!4 基于 raspberrypi-userland/raspberrypi-eeprom 补充部分功能
Merge pull request !4 from woqidaideshi/openEuler-22.03-LTS-Next
This commit is contained in:
commit
26ce0804e1
138
openEuler.patch
138
openEuler.patch
@ -1,5 +1,5 @@
|
||||
diff --git a/raspi-config b/raspi-config
|
||||
index a640864..0cbf00f 100755
|
||||
index a640864..ae97af5 100755
|
||||
--- a/raspi-config
|
||||
+++ b/raspi-config
|
||||
@@ -11,8 +11,8 @@ CONFIG=/boot/config.txt
|
||||
@ -103,33 +103,6 @@ index a640864..0cbf00f 100755
|
||||
fi
|
||||
whiptail --yesno "Would you like to enable screen blanking?" $DEFAULT 20 60 2
|
||||
RET=$?
|
||||
@@ -617,16 +639,16 @@ do_memory_split() { # Memory Split
|
||||
if [ -e /boot/start_cd.elf ]; then
|
||||
# New-style memory split setting
|
||||
## get current memory split from /boot/config.txt
|
||||
- arm=$(vcgencmd get_mem arm | cut -d '=' -f 2 | cut -d 'M' -f 1)
|
||||
- gpu=$(vcgencmd get_mem gpu | cut -d '=' -f 2 | cut -d 'M' -f 1)
|
||||
- tot=$(($arm+$gpu))
|
||||
- if [ $tot -gt 512 ]; then
|
||||
- CUR_GPU_MEM=$(get_config_var gpu_mem_1024 $CONFIG)
|
||||
- elif [ $tot -gt 256 ]; then
|
||||
- CUR_GPU_MEM=$(get_config_var gpu_mem_512 $CONFIG)
|
||||
- else
|
||||
- CUR_GPU_MEM=$(get_config_var gpu_mem_256 $CONFIG)
|
||||
- fi
|
||||
+ # arm=$(vcgencmd get_mem arm | cut -d '=' -f 2 | cut -d 'M' -f 1)
|
||||
+ # gpu=$(vcgencmd get_mem gpu | cut -d '=' -f 2 | cut -d 'M' -f 1)
|
||||
+ # tot=$(($arm+$gpu))
|
||||
+ # if [ $tot -gt 512 ]; then
|
||||
+ # CUR_GPU_MEM=$(get_config_var gpu_mem_1024 $CONFIG)
|
||||
+ # elif [ $tot -gt 256 ]; then
|
||||
+ # CUR_GPU_MEM=$(get_config_var gpu_mem_512 $CONFIG)
|
||||
+ # else
|
||||
+ # CUR_GPU_MEM=$(get_config_var gpu_mem_256 $CONFIG)
|
||||
+ # fi
|
||||
if [ -z "$CUR_GPU_MEM" ] || [ $CUR_GPU_MEM = "0" ]; then
|
||||
CUR_GPU_MEM=$(get_config_var gpu_mem $CONFIG)
|
||||
fi
|
||||
@@ -765,7 +787,7 @@ clear_overclock () {
|
||||
}
|
||||
|
||||
@ -227,67 +200,7 @@ index a640864..0cbf00f 100755
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -857,8 +909,10 @@ get_spi() {
|
||||
|
||||
do_spi() {
|
||||
DEFAULT=--defaultno
|
||||
+ CURRENT=0
|
||||
if [ $(get_spi) -eq 0 ]; then
|
||||
DEFAULT=
|
||||
+ CURRENT=1
|
||||
fi
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
whiptail --yesno "Would you like the SPI interface to be enabled?" $DEFAULT 20 60 2
|
||||
@@ -866,6 +920,9 @@ do_spi() {
|
||||
else
|
||||
RET=$1
|
||||
fi
|
||||
+ if [ $RET -eq $CURRENT ]; then
|
||||
+ ASK_TO_REBOOT=1
|
||||
+ fi
|
||||
if [ $RET -eq 0 ]; then
|
||||
SETTING=on
|
||||
STATUS=enabled
|
||||
@@ -881,7 +938,7 @@ do_spi() {
|
||||
touch $BLACKLIST
|
||||
fi
|
||||
sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*spi[-_]bcm2708\)/#\1/"
|
||||
- dtparam spi=$SETTING
|
||||
+ #dtparam spi=$SETTING
|
||||
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
whiptail --msgbox "The SPI interface is $STATUS" 20 60 1
|
||||
@@ -898,8 +955,10 @@ get_i2c() {
|
||||
|
||||
do_i2c() {
|
||||
DEFAULT=--defaultno
|
||||
+ CURRENT=0
|
||||
if [ $(get_i2c) -eq 0 ]; then
|
||||
DEFAULT=
|
||||
+ CURRENT=1
|
||||
fi
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
whiptail --yesno "Would you like the ARM I2C interface to be enabled?" $DEFAULT 20 60 2
|
||||
@@ -907,6 +966,9 @@ do_i2c() {
|
||||
else
|
||||
RET=$1
|
||||
fi
|
||||
+ if [ $RET -eq $CURRENT ]; then
|
||||
+ ASK_TO_REBOOT=1
|
||||
+ fi
|
||||
if [ $RET -eq 0 ]; then
|
||||
SETTING=on
|
||||
STATUS=enabled
|
||||
@@ -926,7 +988,7 @@ do_i2c() {
|
||||
if ! grep -q "^i2c[-_]dev" /etc/modules; then
|
||||
printf "i2c-dev\n" >> /etc/modules
|
||||
fi
|
||||
- dtparam i2c_arm=$SETTING
|
||||
+ #dtparam i2c_arm=$SETTING
|
||||
modprobe i2c-dev
|
||||
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
@@ -1313,6 +1375,9 @@ do_boot_behaviour() {
|
||||
@@ -1313,6 +1365,9 @@ do_boot_behaviour() {
|
||||
B2*)
|
||||
systemctl set-default multi-user.target
|
||||
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||
@ -297,7 +210,7 @@ index a640864..0cbf00f 100755
|
||||
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
@@ -1320,21 +1385,24 @@ ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM
|
||||
@@ -1320,21 +1375,24 @@ ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM
|
||||
EOF
|
||||
;;
|
||||
B3*)
|
||||
@ -325,7 +238,7 @@ index a640864..0cbf00f 100755
|
||||
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
@@ -1343,7 +1411,7 @@ EOF
|
||||
@@ -1343,7 +1401,7 @@ EOF
|
||||
sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$USER/"
|
||||
disable_raspi_config_at_boot
|
||||
else
|
||||
@ -334,7 +247,7 @@ index a640864..0cbf00f 100755
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
@@ -1733,19 +1801,19 @@ do_onewire() {
|
||||
@@ -1733,19 +1791,19 @@ do_onewire() {
|
||||
}
|
||||
|
||||
do_gldriver() {
|
||||
@ -367,7 +280,7 @@ index a640864..0cbf00f 100755
|
||||
if is_pifour ; then
|
||||
GLOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "GL Driver" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \
|
||||
"G1 Legacy" "Original non-GL desktop driver" \
|
||||
@@ -1895,8 +1963,8 @@ do_net_names () {
|
||||
@@ -1895,8 +1953,8 @@ do_net_names () {
|
||||
}
|
||||
|
||||
do_update() {
|
||||
@ -378,7 +291,7 @@ index a640864..0cbf00f 100755
|
||||
printf "Sleeping 5 seconds before reloading raspi-config\n" &&
|
||||
sleep 5 &&
|
||||
exec raspi-config
|
||||
@@ -2070,6 +2138,63 @@ list_wlan_interfaces() {
|
||||
@@ -2070,6 +2128,63 @@ list_wlan_interfaces() {
|
||||
done
|
||||
}
|
||||
|
||||
@ -442,7 +355,7 @@ index a640864..0cbf00f 100755
|
||||
do_wifi_ssid_passphrase() {
|
||||
RET=0
|
||||
IFACE_LIST="$(list_wlan_interfaces)"
|
||||
@@ -2542,8 +2667,8 @@ do_proxy() {
|
||||
@@ -2542,8 +2657,8 @@ do_proxy() {
|
||||
sed -i "/^export ${SCHEME}_/Id" /etc/profile.d/proxy.sh
|
||||
fi
|
||||
if [ "${SCHEME#*http}" != "$SCHEME" ]; then
|
||||
@ -453,7 +366,7 @@ index a640864..0cbf00f 100755
|
||||
fi
|
||||
fi
|
||||
if [ -z "$ADDRESS" ]; then
|
||||
@@ -2557,7 +2682,7 @@ do_proxy() {
|
||||
@@ -2557,7 +2672,7 @@ do_proxy() {
|
||||
echo "export ${SCHEME}_proxy=\"$ADDRESS\"" >> /etc/profile.d/proxy.sh
|
||||
fi
|
||||
if [ "${SCHEME#*http}" != "$SCHEME" ]; then
|
||||
@ -462,7 +375,7 @@ index a640864..0cbf00f 100755
|
||||
fi
|
||||
done
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
@@ -2588,7 +2713,9 @@ do
|
||||
@@ -2588,7 +2703,9 @@ do
|
||||
--expand-rootfs)
|
||||
INTERACTIVE=False
|
||||
do_expand_rootfs
|
||||
@ -473,7 +386,7 @@ index a640864..0cbf00f 100755
|
||||
exit 0
|
||||
;;
|
||||
--apply-os-config)
|
||||
@@ -2634,8 +2761,8 @@ do_system_menu() {
|
||||
@@ -2634,8 +2751,8 @@ do_system_menu() {
|
||||
"S3 Password" "Change password for the '$USER' user" \
|
||||
"S4 Hostname" "Set name for this computer on a network" \
|
||||
"S5 Boot / Auto Login" "Select boot into desktop or to command line" \
|
||||
@ -484,7 +397,7 @@ index a640864..0cbf00f 100755
|
||||
"S8 Power LED" "Set behaviour of power LED" \
|
||||
3>&1 1>&2 2>&3)
|
||||
elif is_live ; then
|
||||
@@ -2661,7 +2788,7 @@ do_system_menu() {
|
||||
@@ -2661,7 +2778,7 @@ do_system_menu() {
|
||||
return 0
|
||||
elif [ $RET -eq 0 ]; then
|
||||
case "$FUN" in
|
||||
@ -493,16 +406,7 @@ index a640864..0cbf00f 100755
|
||||
S2\ *) do_audio ;;
|
||||
S3\ *) do_change_pass ;;
|
||||
S4\ *) do_hostname ;;
|
||||
@@ -2677,7 +2804,7 @@ do_system_menu() {
|
||||
do_display_menu() {
|
||||
if is_pi ; then
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Display Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
- "D1 Resolution" "Set a specific screen resolution" \
|
||||
+ `# "D1 Resolution" "Set a specific screen resolution"` \
|
||||
"D2 Underscan" "Remove black border around screen" \
|
||||
"D3 Pixel Doubling" "Enable/disable 2x2 pixel mapping" \
|
||||
"D4 Screen Blanking" "Enable/disable screen blanking" \
|
||||
@@ -2707,7 +2834,7 @@ do_interface_menu() {
|
||||
@@ -2707,7 +2824,7 @@ do_interface_menu() {
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
"P1 Camera" "Enable/disable connection to the Raspberry Pi Camera" \
|
||||
"P2 SSH" "Enable/disable remote command line access using SSH" \
|
||||
@ -511,7 +415,7 @@ index a640864..0cbf00f 100755
|
||||
"P4 SPI" "Enable/disable automatic loading of SPI kernel module" \
|
||||
"P5 I2C" "Enable/disable automatic loading of I2C kernel module" \
|
||||
"P6 Serial Port" "Enable/disable shell messages on the serial connection" \
|
||||
@@ -2741,7 +2868,7 @@ do_performance_menu() {
|
||||
@@ -2741,7 +2858,7 @@ do_performance_menu() {
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Performance Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
"P1 Overclock" "Configure CPU overclocking" \
|
||||
"P2 GPU Memory" "Change the amount of memory made available to the GPU" \
|
||||
@ -520,7 +424,7 @@ index a640864..0cbf00f 100755
|
||||
"P4 Fan" "Set behaviour of GPIO fan" \
|
||||
3>&1 1>&2 2>&3)
|
||||
RET=$?
|
||||
@@ -2783,19 +2910,19 @@ do_advanced_menu() {
|
||||
@@ -2783,8 +2900,8 @@ do_advanced_menu() {
|
||||
if is_pifour ; then
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
"A1 Expand Filesystem" "Ensures that all of the SD card is available" \
|
||||
@ -530,12 +434,8 @@ index a640864..0cbf00f 100755
|
||||
+ `# "A3 Compositor" "Enable/disable xcompmgr composition manager"` \
|
||||
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \
|
||||
"A5 Network Proxy Settings" "Configure network proxy settings" \
|
||||
- "A6 Boot Order" "Choose network or USB device boot" \
|
||||
- "A7 Bootloader Version" "Select latest or default boot ROM software" \
|
||||
+ `# "A6 Boot Order" "Choose network or USB device boot"` \
|
||||
+ `# "A7 Bootloader Version" "Select latest or default boot ROM software"` \
|
||||
"A8 HDMI / Composite" "Raspberry Pi 4 video output options" \
|
||||
3>&1 1>&2 2>&3)
|
||||
"A6 Boot Order" "Choose network or USB device boot" \
|
||||
@@ -2794,8 +2911,8 @@ do_advanced_menu() {
|
||||
elif is_pi ; then
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
"A1 Expand Filesystem" "Ensures that all of the SD card is available" \
|
||||
@ -546,7 +446,7 @@ index a640864..0cbf00f 100755
|
||||
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \
|
||||
"A5 Network Proxy Settings" "Configure network proxy settings" \
|
||||
3>&1 1>&2 2>&3)
|
||||
@@ -2819,7 +2946,7 @@ do_advanced_menu() {
|
||||
@@ -2819,7 +2936,7 @@ do_advanced_menu() {
|
||||
A7\ *) do_boot_rom ;;
|
||||
A8\ *) do_pi4video ;;
|
||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||
@ -555,7 +455,7 @@ index a640864..0cbf00f 100755
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -2856,17 +2983,17 @@ if [ "$INTERACTIVE" = True ]; then
|
||||
@@ -2856,17 +2973,17 @@ if [ "$INTERACTIVE" = True ]; then
|
||||
calc_wt_size
|
||||
while [ "$USER" = "root" ] || [ -z "$USER" ]; do
|
||||
if ! USER=$(whiptail --inputbox "raspi-config could not determine the default user.\\n\\nWhat user should these settings apply to?" 20 60 pi 3>&1 1>&2 2>&3); then
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
Name: raspi-config
|
||||
Version: 20210625
|
||||
Release: 2
|
||||
Release: 4
|
||||
Summary: Raspberry Pi configuration tool
|
||||
License: MIT
|
||||
URL: https://github.com/RPi-Distro/raspi-config
|
||||
@ -64,6 +64,15 @@ cd -
|
||||
%{_systemd_path}/*
|
||||
|
||||
%changelog
|
||||
* Wed Sep 29 2021 Yafen Fang <yafen@iscas.ac.cn> - 20210625-4
|
||||
- enable select boot order
|
||||
- enable select bootloader version
|
||||
|
||||
* Sat Sep 18 2021 Yafen Fang<yafen@iscas.ac.cn> - 20210625-3
|
||||
- enable screen resolution
|
||||
- enable dtparam in func do_spi and do_i2c
|
||||
- enable vcgencmd in func do_memory_split
|
||||
|
||||
* Fri Jun 25 2021 Yafen Fang<yafen@iscas.ac.cn> - 20210625-2
|
||||
- adjust for openEuler
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user