6
6
INTERACTIVE=True
7
7
ASK_TO_REBOOT=0
8
8
BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf
9
- CONFIG=/boot/config.txt
9
+
10
+ if [ -e /boot/firmware/config.txt ] ; then
11
+ FIRMWARE=/firmware
12
+ else
13
+ FIRMWARE=
14
+ fi
15
+ CONFIG=/boot${FIRMWARE} /config.txt
10
16
11
17
USER=${SUDO_USER:- $(who -m | awk ' { print $1 }' )}
12
18
INIT=" $( ps --no-headers -o comm 1) "
@@ -24,7 +30,7 @@ if is_pi ; then
24
30
if [ -e /proc/device-tree/chosen/os_prefix ]; then
25
31
PREFIX=" $( cat /proc/device-tree/chosen/os_prefix) "
26
32
fi
27
- CMDLINE=" /boot/${PREFIX} cmdline.txt"
33
+ CMDLINE=" /boot${FIRMWARE} /${PREFIX} cmdline.txt"
28
34
else
29
35
CMDLINE=/proc/cmdline
30
36
fi
@@ -148,17 +154,17 @@ can_configure() {
148
154
if ! is_pi; then
149
155
return 0
150
156
fi
151
- if [ ! -e /boot/start_x.elf ]; then
157
+ if [ ! -e /boot${FIRMWARE} /start_x.elf ]; then
152
158
return 1
153
159
fi
154
160
if [ -e $CONFIG ] && grep -q " ^device_tree=$" $CONFIG ; then
155
161
return 1
156
162
fi
157
- if ! mountpoint -q /boot; then
163
+ if ! mountpoint -q /boot${FIRMWARE} ; then
158
164
return 1
159
165
fi
160
- if [ ! -e /boot/config.txt ]; then
161
- touch /boot/config.txt
166
+ if [ ! -e $CONFIG ]; then
167
+ touch $CONFIG
162
168
fi
163
169
return 0
164
170
}
@@ -821,7 +827,7 @@ No other symbols, punctuation characters, or blank spaces are permitted.\
821
827
}
822
828
823
829
do_memory_split () { # Memory Split
824
- if [ -e /boot/start_cd.elf ]; then
830
+ if [ -e /boot${FIRMWARE} /start_cd.elf ]; then
825
831
# New-style memory split setting
826
832
# # get current memory split from /boot/config.txt
827
833
arm=$( vcgencmd get_mem arm | cut -d ' =' -f 2 | cut -d ' M' -f 1)
@@ -877,7 +883,7 @@ get_current_memory_split() {
877
883
AVAILABLE_SPLITS=" 128 192 224 240"
878
884
MEMSPLIT_DESCRIPTION=" "
879
885
for SPLIT in $AVAILABLE_SPLITS ; do
880
- if [ -e /boot/arm${SPLIT} _start.elf ] && cmp /boot/arm${SPLIT} _start.elf /boot/start.elf > /dev/null 2>&1 ; then
886
+ if [ -e /boot${FIRMWARE} /arm${SPLIT} _start.elf ] && cmp /boot${FIRMWARE} /arm${SPLIT} _start.elf /boot${FIRMWARE} /start.elf > /dev/null 2>&1 ; then
881
887
CURRENT_MEMSPLIT=$SPLIT
882
888
MEMSPLIT_DESCRIPTION=" Current: ${CURRENT_MEMSPLIT} MiB for ARM, $(( 256 - CURRENT_MEMSPLIT)) MiB for VideoCore"
883
889
break
@@ -886,7 +892,7 @@ get_current_memory_split() {
886
892
}
887
893
888
894
set_memory_split () {
889
- cp -a /boot/arm${1} _start.elf /boot/start.elf
895
+ cp -a /boot${FIRMWARE} /arm${1} _start.elf /boot${FIRMWARE} /start.elf
890
896
sync
891
897
}
892
898
@@ -1999,7 +2005,7 @@ get_camera() {
1999
2005
}
2000
2006
2001
2007
do_camera () {
2002
- if [ $( deb_ver) -le 10 ] && [ ! -e /boot/start_x.elf ]; then
2008
+ if [ $( deb_ver) -le 10 ] && [ ! -e /boot${FIRMWARE} /start_x.elf ]; then
2003
2009
whiptail --msgbox " Your firmware appears to be out of date (no start_x.elf). Please update" 20 60 2
2004
2010
return 1
2005
2011
fi
@@ -2151,7 +2157,7 @@ do_legacy() {
2151
2157
}
2152
2158
2153
2159
do_gldriver () {
2154
- if [ ! -e /boot/overlays/vc4-kms-v3d.dtbo ]; then
2160
+ if [ ! -e /boot${FIRMWARE} /overlays/vc4-kms-v3d.dtbo ]; then
2155
2161
whiptail --msgbox " Driver and kernel not present on your system. Please update" 20 60 2
2156
2162
return 1
2157
2163
fi
@@ -2888,12 +2894,12 @@ get_overlay_conf() {
2888
2894
}
2889
2895
2890
2896
get_bootro_now () {
2891
- findmnt /boot | grep -q " ro,"
2897
+ findmnt /boot${FIRMWARE} | grep -q " ro,"
2892
2898
echo $?
2893
2899
}
2894
2900
2895
2901
get_bootro_conf () {
2896
- grep /boot /etc/fstab | grep -q " defaults.*,ro[ ,]"
2902
+ grep /boot${FIRMWARE} /etc/fstab | grep -q " defaults.*,ro[ ,]"
2897
2903
echo $?
2898
2904
}
2899
2905
@@ -2907,7 +2913,7 @@ enable_overlayfs() {
2907
2913
2908
2914
# mount the boot partition as writable if it isn't already
2909
2915
if [ $( get_bootro_now) -eq 0 ] ; then
2910
- if ! mount -o remount,rw /boot 2> /dev/null ; then
2916
+ if ! mount -o remount,rw /boot${FIRMWARE} 2> /dev/null ; then
2911
2917
echo " Unable to mount boot partition as writable - cannot enable"
2912
2918
return 1
2913
2919
fi
@@ -2985,16 +2991,16 @@ EOF
2985
2991
# there is now a modified initramfs ready for use...
2986
2992
2987
2993
# modify config.txt
2988
- sed -i /boot/config.txt -e " /initramfs.*/d"
2989
- echo initramfs " $INITRD " >> /boot/config.txt
2994
+ sed -i $CONFIG -e " /initramfs.*/d"
2995
+ echo initramfs " $INITRD " >> $CONFIG
2990
2996
2991
2997
# modify command line
2992
2998
if ! grep -q " boot=overlay" $CMDLINE ; then
2993
2999
sed -i $CMDLINE -e " s/^/boot=overlay /"
2994
3000
fi
2995
3001
2996
3002
if [ " $BOOTRO " = " yes" ] ; then
2997
- if ! mount -o remount,ro /boot 2> /dev/null ; then
3003
+ if ! mount -o remount,ro /boot${FIRMWARE} 2> /dev/null ; then
2998
3004
echo " Unable to remount boot partition as read-only"
2999
3005
fi
3000
3006
fi
@@ -3004,7 +3010,7 @@ disable_overlayfs() {
3004
3010
KERN=$( uname -r)
3005
3011
# mount the boot partition as writable if it isn't already
3006
3012
if [ $( get_bootro_now) -eq 0 ] ; then
3007
- if ! mount -o remount,rw /boot 2> /dev/null ; then
3013
+ if ! mount -o remount,rw /boot${FIRMWARE} 2> /dev/null ; then
3008
3014
echo " Unable to mount boot partition as writable - cannot disable"
3009
3015
return 1
3010
3016
fi
@@ -3014,14 +3020,14 @@ disable_overlayfs() {
3014
3020
fi
3015
3021
3016
3022
# modify config.txt
3017
- sed -i /boot/config.txt -e " /initramfs.*/d"
3023
+ sed -i $CONFIG -e " /initramfs.*/d"
3018
3024
update-initramfs -d -k " ${KERN} -overlay"
3019
3025
3020
3026
# modify command line
3021
3027
sed -i $CMDLINE -e " s/\(.*\)boot=overlay \(.*\)/\1\2/"
3022
3028
3023
3029
if [ " $BOOTRO " = " yes" ] ; then
3024
- if ! mount -o remount,ro /boot 2> /dev/null ; then
3030
+ if ! mount -o remount,ro /boot${FIRMWARE} 2> /dev/null ; then
3025
3031
echo " Unable to remount boot partition as read-only"
3026
3032
fi
3027
3033
fi
@@ -3032,15 +3038,15 @@ enable_bootro() {
3032
3038
echo " Overlay in use; cannot update fstab"
3033
3039
return 1
3034
3040
fi
3035
- sed -i /etc/fstab -e " s/ \(.*\ /boot.*\)defaults\(.*\)/ \1defaults,ro\2/ "
3041
+ sed -i /etc/fstab -e " s# \(.*/boot$FIRMWARE .*\)defaults\(.*\)# \1defaults,ro\2# "
3036
3042
}
3037
3043
3038
3044
disable_bootro () {
3039
3045
if [ $( get_overlay_now) -eq 0 ] ; then
3040
3046
echo " Overlay in use; cannot update fstab"
3041
3047
return 1
3042
3048
fi
3043
- sed -i /etc/fstab -e " s/ \(.*\ /boot.*\)defaults,ro\(.*\)/ \1defaults\2/ "
3049
+ sed -i /etc/fstab -e " s# \(.*/boot$FIRMWARE .*\)defaults,ro\(.*\)# \1defaults\2# "
3044
3050
}
3045
3051
3046
3052
do_overlayfs () {
@@ -3312,7 +3318,6 @@ do_display_menu() {
3312
3318
if is_pi ; then
3313
3319
if is_wayfire; then
3314
3320
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 \
3315
- " D2 Underscan" " Remove black border around screen" \
3316
3321
" D4 Screen Blanking" " Enable/disable screen blanking" \
3317
3322
" D5 VNC Resolution" " Set resolution for headless use" \
3318
3323
" D6 Composite" " Set options for composite output" \
0 commit comments