Compare commits

..

No commits in common. "3874eb4654537167613f198f0836e6216b6caaaf" and "1643b5109385895837b76f73cc56d4d5831cb47b" have entirely different histories.

4 changed files with 212 additions and 622 deletions

View File

@ -1,9 +1,9 @@
diff --git a/raspi-config b/raspi-config diff --git a/raspi-config b/raspi-config
index bf24fa9..bac530a 100755 index a640864..0cbf00f 100755
--- a/raspi-config --- a/raspi-config
+++ b/raspi-config +++ b/raspi-config
@@ -12,8 +12,8 @@ USER=${SUDO_USER:-$(who -m | awk '{ print $1 }')} @@ -11,8 +11,8 @@ CONFIG=/boot/config.txt
INIT="$(ps --no-headers -o comm 1)" USER=${SUDO_USER:-$(who -m | awk '{ print $1 }')}
is_pi () { is_pi () {
- ARCH=$(dpkg --print-architecture) - ARCH=$(dpkg --print-architecture)
@ -13,46 +13,7 @@ index bf24fa9..bac530a 100755
return 0 return 0
else else
return 1 return 1
@@ -22,7 +22,7 @@ is_pi () { @@ -98,7 +98,7 @@ has_analog() {
if is_pi ; then
if [ -e /proc/device-tree/chosen/os_prefix ]; then
- PREFIX="$(cat /proc/device-tree/chosen/os_prefix)"
+ PREFIX="$(cat /proc/device-tree/chosen/os_prefix | tr -d '\0')"
fi
CMDLINE="/boot/${PREFIX}cmdline.txt"
else
@@ -63,6 +63,11 @@ is_pifour() {
return $?
}
+is_pifive() {
+ grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F]4[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo
+ return $?
+}
+
get_pi_type() {
if is_pione; then
echo 1
@@ -72,6 +77,8 @@ get_pi_type() {
echo 3
elif is_pifour; then
echo 4
+ elif is_pifive; then
+ echo 5
elif is_pizero; then
echo 0
else
@@ -85,7 +92,7 @@ is_live() {
}
is_ssh() {
- if pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
+ if pstree -p | grep -E --quiet --extended-regexp ".*sshd.*\($$\)"; then
return 0
else
return 1
@@ -117,15 +124,18 @@ has_analog() {
} }
is_installed() { is_installed() {
@ -61,29 +22,7 @@ index bf24fa9..bac530a 100755
return 1 return 1
else else
return 0 return 0
fi @@ -141,7 +141,7 @@ get_can_expand() {
}
-deb_ver () {
- ver=`cat /etc/debian_version | cut -d . -f 1`
+rpm_ver () {
+ ver=`cat /etc/os-release | grep VERSION_ID | awk -F = '{print $2}' | cut -d . -f 1`
+ if [ "x${ver:0:1}" == "x\"" ]; then
+ ver=${ver:1}
+ fi
echo $ver
}
@@ -152,7 +162,7 @@ configuration of the Raspberry Pi. Although it can be run
at any time, some of the options may have difficulties if
you have heavily customised your installation.
-$(dpkg -s raspi-config 2> /dev/null | grep Version)\
+$(rpm -qi raspi-config 2> /dev/null | grep Version)\
" 20 70 1
return 0
}
@@ -163,7 +173,7 @@ get_can_expand() {
PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")"
@ -92,15 +31,22 @@ index bf24fa9..bac530a 100755
echo 1 echo 1
exit exit
fi fi
@@ -182,14 +192,25 @@ do_expand_rootfs() { @@ -162,19 +162,30 @@ do_expand_rootfs() {
PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" # NOTE: the NOOBS partition layout confuses parted. For now, let's only
# agree to work with a sufficiently simple partition layout
- if [ "$PART_NUM" -ne 2 ]; then
+ if [ "$PART_NUM" -ne 3 ]; then
whiptail --msgbox "Your partition layout is not currently supported by this tool. You are probably using NOOBS, in which case your root filesystem is already expanded anyway." 20 60 2
- return 0
+ return -1
fi
- LAST_PART_NUM=$(parted "$ROOT_DEV" -ms unit s p | tail -n 1 | cut -f 1 -d:) - LAST_PART_NUM=$(parted "$ROOT_DEV" -ms unit s p | tail -n 1 | cut -f 1 -d:)
+ PART_INFO=$(parted "$ROOT_DEV" -ms unit s p) + PART_INFO=$(parted "$ROOT_DEV" -ms unit s p)
+ +
+ LAST_PART_NUM=$(echo "$PART_INFO" | tail -n 1 | cut -f 1 -d:) + LAST_PART_NUM=$(echo "$PART_INFO" | tail -n 1 | cut -f 1 -d:)
if [ "$LAST_PART_NUM" -ne "$PART_NUM" ]; then if [ $LAST_PART_NUM -ne $PART_NUM ]; then
whiptail --msgbox "$ROOT_PART is not the last partition. Don't know how to expand" 20 60 2 whiptail --msgbox "$ROOT_PART is not the last partition. Don't know how to expand" 20 60 2
- return 0 - return 0
+ return -1 + return -1
@ -121,7 +67,7 @@ index bf24fa9..bac530a 100755
[ "$PART_START" ] || return 1 [ "$PART_START" ] || return 1
# Return value will likely be error for fdisk as it fails to reload the # Return value will likely be error for fdisk as it fails to reload the
# partition table because the root fs is mounted # partition table because the root fs is mounted
@@ -205,6 +226,15 @@ $PART_START @@ -190,6 +201,15 @@ $PART_START
p p
w w
EOF EOF
@ -137,7 +83,7 @@ index bf24fa9..bac530a 100755
ASK_TO_REBOOT=1 ASK_TO_REBOOT=1
# now set up an init.d script # now set up an init.d script
@@ -241,6 +271,7 @@ EOF @@ -226,6 +246,7 @@ EOF
if [ "$INTERACTIVE" = True ]; then if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "Root partition has been resized.\nThe filesystem will be enlarged upon the next reboot" 20 60 2 whiptail --msgbox "Root partition has been resized.\nThe filesystem will be enlarged upon the next reboot" 20 60 2
fi fi
@ -145,21 +91,7 @@ index bf24fa9..bac530a 100755
} }
set_config_var() { set_config_var() {
@@ -397,9 +428,12 @@ do_overscan_kms() { @@ -342,8 +363,9 @@ do_blanking() {
echo "xrandr --output HDMI-$DEV --set \"left margin\" $PIX --set \"right margin\" $PIX --set \"top margin\" $PIX --set \"bottom margin\" $PIX" >> /usr/share/ovscsetup.sh
fi
else
- echo "#!/bin/sh\nxrandr --output HDMI-$DEV --set \"left margin\" $PIX --set \"right margin\" $PIX --set \"top margin\" $PIX --set \"bottom margin\" $PIX" > /usr/share/ovscsetup.sh
+ echo -e "#!/bin/sh\nxrandr --output HDMI-$DEV --set \"left margin\" $PIX --set \"right margin\" $PIX --set \"top margin\" $PIX --set \"bottom margin\" $PIX" > /usr/share/ovscsetup.sh
fi
if ! grep -q ovscsetup /usr/share/dispsetup.sh 2> /dev/null ; then
+ if [ ! -f /usr/share/dispsetup.sh ]; then
+ echo -e "#!/bin/sh\nexit 0" > /usr/share/dispsetup.sh
+ fi
sed /usr/share/dispsetup.sh -i -e "s#exit#if [ -e /usr/share/ovscsetup.sh ] ; then\n. /usr/share/ovscsetup.sh\nfi\nexit#"
fi
if [ "$INTERACTIVE" = True ]; then
@@ -424,8 +458,9 @@ do_blanking() {
CURRENT=1 CURRENT=1
fi fi
if [ "$INTERACTIVE" = True ]; then if [ "$INTERACTIVE" = True ]; then
@ -171,136 +103,34 @@ index bf24fa9..bac530a 100755
fi fi
whiptail --yesno "Would you like to enable screen blanking?" $DEFAULT 20 60 2 whiptail --yesno "Would you like to enable screen blanking?" $DEFAULT 20 60 2
RET=$? RET=$?
@@ -577,69 +612,74 @@ do_change_timezone() { @@ -617,16 +639,16 @@ do_memory_split() { # Memory Split
if [ -e /boot/start_cd.elf ]; then
get_wifi_country() { # New-style memory split setting
CODE=${1:-0} ## get current memory split from /boot/config.txt
- if [ -e /etc/default/crda ]; then - arm=$(vcgencmd get_mem arm | cut -d '=' -f 2 | cut -d 'M' -f 1)
- . /etc/default/crda - gpu=$(vcgencmd get_mem gpu | cut -d '=' -f 2 | cut -d 'M' -f 1)
- elif systemctl -q is-active dhcpcd; then - tot=$(($arm+$gpu))
- REGDOMAIN="$(wpa_cli get country | tail -n 1)" - 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 - else
- REGDOMAIN="$(iw reg get | sed -n "0,/country/s/^country \(.\+\):.*$/\1/p")" - CUR_GPU_MEM=$(get_config_var gpu_mem_256 $CONFIG)
+ IFACE="$(list_wlan_interfaces | head -n 1)"
+ if [ -z "$IFACE" ]; then
+ if [ "$INTERACTIVE" = True ]; then
+ whiptail --msgbox "No wireless interface found" 20 60
+ fi
+ return 1
fi
- if [ -z "$REGDOMAIN" ] \
- || ! grep -q "^${REGDOMAIN}[[:space:]]" /usr/share/zoneinfo/iso3166.tab; then
+ if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then
+ if [ "$INTERACTIVE" = True ]; then
+ whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60
+ fi
+ return 1
+ fi
+ wpa_cli -i "$IFACE" save_config > /dev/null 2>&1
+ COUNTRY="$(wpa_cli -i "$IFACE" get country)"
+ if [ "$COUNTRY" = "FAIL" ]; then
return 1
fi
- if [ "$CODE" = 0 ]; then
- echo "$REGDOMAIN"
+ if [ $CODE = 0 ]; then
+ echo "$COUNTRY"
fi
return 0
}
do_wifi_country() {
- if [ "$INTERACTIVE" = True ]; then
- value=$(sed '/^#/d' /usr/share/zoneinfo/iso3166.tab | tr '\t\n' '/')
- oIFS="$IFS"
- IFS="/"
- #shellcheck disable=2086
- REGDOMAIN=$(whiptail --menu "Select the country in which the Pi is to be used" 20 60 10 ${value} 3>&1 1>&2 2>&3)
- IFS="$oIFS"
- else
- REGDOMAIN=$1
- fi - fi
- if ! grep -q "^${REGDOMAIN}[[:space:]]" /usr/share/zoneinfo/iso3166.tab; then + # arm=$(vcgencmd get_mem arm | cut -d '=' -f 2 | cut -d 'M' -f 1)
+ IFACE="$(list_wlan_interfaces | head -n 1)" + # gpu=$(vcgencmd get_mem gpu | cut -d '=' -f 2 | cut -d 'M' -f 1)
+ if [ -z "$IFACE" ]; then + # tot=$(($arm+$gpu))
if [ "$INTERACTIVE" = True ]; then + # if [ $tot -gt 512 ]; then
- whiptail --msgbox "$REGDOMAIN is not a valid ISO/IEC 3166-1 alpha2 code" 20 60 + # CUR_GPU_MEM=$(get_config_var gpu_mem_1024 $CONFIG)
+ whiptail --msgbox "No wireless interface found" 20 60 + # 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 fi
return 1 @@ -765,7 +787,7 @@ clear_overclock () {
fi
- if [ -e /etc/default/crda ]; then
- sed -i "s/^REGDOMAIN=.*$/REGDOMAIN=$REGDOMAIN/" /etc/default/crda
- if ! ischroot; then
- iw reg set "$REGDOMAIN"
- fi
- fi
- IFACE="$(list_wlan_interfaces | head -n 1)"
- if [ "$INIT" = "systemd" ] && [ -n "$IFACE" ] && systemctl -q is-active dhcpcd; then
- wpa_cli -i "$IFACE" set country "$REGDOMAIN" > /dev/null 2>&1
- wpa_cli -i "$IFACE" save_config > /dev/null 2>&1
+ if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then
+ if [ "$INTERACTIVE" = True ]; then
+ whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60
+ fi
+ return 1
fi
- if [ "$INIT" = "systemd" ] && ! ischroot && systemctl -q is-active NetworkManager; then
- nmcli radio wifi on
- elif hash rfkill 2> /dev/null; then
- rfkill unblock wifi
+ oIFS="$IFS"
+ if [ "$INTERACTIVE" = True ]; then
+ value=$(cat /usr/share/zoneinfo/iso3166.tab | tail -n +26 | tr '\t' '/' | tr '\n' '/')
+ IFS="/"
+ COUNTRY=$(whiptail --menu "Select the country in which the Pi is to be used" 20 60 10 ${value} 3>&1 1>&2 2>&3)
+ else
+ COUNTRY=$1
+ true
fi
- if is_pi; then
- for filename in /var/lib/systemd/rfkill/*:wlan ; do
- if ! [ -e "$filename" ]; then
- continue
+ if [ $? -eq 0 ];then
+ wpa_cli -i "$IFACE" set country "$COUNTRY"
+ wpa_cli -i "$IFACE" save_config > /dev/null 2>&1
+ if iw reg set "$COUNTRY" 2> /dev/null; then
+ ASK_TO_REBOOT=1
+ fi
+ if hash rfkill 2> /dev/null; then
+ rfkill unblock wifi
+ if is_pi ; then
+ for filename in /var/lib/systemd/rfkill/*:wlan ; do
+ echo 0 > $filename
+ done
fi
- echo 0 > "$filename"
- done
- fi
- if [ "$INTERACTIVE" = True ]; then
- whiptail --msgbox "Wireless LAN country set to $REGDOMAIN" 20 60 1
+ fi
+ if [ "$INTERACTIVE" = True ]; then
+ whiptail --msgbox "Wireless LAN country set to $COUNTRY" 20 60 1
+ fi
fi
+ IFS=$oIFS
}
get_hostname() {
@@ -664,7 +704,7 @@ No other symbols, punctuation characters, or blank spaces are permitted.\
true
fi
if [ "$?" -eq 0 ]; then
- if [ "$INIT" = "systemd" ] && systemctl -q is-active dbus && ! ischroot; then
+ if [ "$INIT" = "systemd" ] && systemctl -q is-active dbus; then
hostnamectl set-hostname "$NEW_HOSTNAME" 2> /dev/null
else
echo "$NEW_HOSTNAME" > /etc/hostname
@@ -826,7 +866,7 @@ clear_overclock () {
} }
get_ssh() { get_ssh() {
@ -309,7 +139,7 @@ index bf24fa9..bac530a 100755
echo 1 echo 1
else else
echo 0 echo 0
@@ -852,12 +892,12 @@ do_ssh() { @@ -791,12 +813,12 @@ do_ssh() {
fi fi
if [ $RET -eq 0 ]; then if [ $RET -eq 0 ]; then
ssh-keygen -A && ssh-keygen -A &&
@ -326,37 +156,50 @@ index bf24fa9..bac530a 100755
STATUS=disabled STATUS=disabled
else else
return $RET return $RET
@@ -868,7 +908,7 @@ do_ssh() { @@ -807,7 +829,7 @@ do_ssh() {
} }
get_vnc() { get_vnc() {
- if systemctl status vncserver-x11-serviced.service | grep -q -w active; then - if systemctl status vncserver-x11-serviced.service | grep -q -w active; then
+ if systemctl status vncserver@:1.service | grep -q -w active; then + if systemctl status vncserver@1.service | grep -q -w active; then
echo 0 echo 0
else else
echo 1 echo 1
@@ -880,33 +920,39 @@ do_vnc() { @@ -826,24 +848,54 @@ do_vnc() {
if [ $(get_vnc) -eq 0 ]; then
DEFAULT=
fi
- APT_GET_FLAGS=""
if [ "$INTERACTIVE" = True ]; then
whiptail --yesno "Would you like the VNC Server to be enabled?" $DEFAULT 20 60 2
RET=$?
else
RET=$1 RET=$1
- APT_GET_FLAGS="-y"
fi fi
if [ $RET -eq 0 ]; then if [ $RET -eq 0 ]; then
- if is_installed realvnc-vnc-server || apt-get install "$APT_GET_FLAGS" realvnc-vnc-server; then - if is_installed realvnc-vnc-server || apt-get install realvnc-vnc-server; then
- systemctl enable vncserver-x11-serviced.service && - systemctl enable vncserver-x11-serviced.service &&
- systemctl start vncserver-x11-serviced.service && - systemctl start vncserver-x11-serviced.service &&
+ if is_installed tigervnc-server || dnf install -y tigervnc-server; then + if is_installed tigervnc-server || dnf install -y tigervnc-server; then
+ cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service + if [ ! -f /etc/systemd/system/vncserver@.service ]; then
+ sed -i '/:1='"$SUDO_USER"'/d' /etc/tigervnc/vncserver.users + cat > /etc/systemd/system/vncserver\@.service << EOF
+ sed -i '$a\:1='"$SUDO_USER"'' /etc/tigervnc/vncserver.users +[Unit]
+ systemctl enable vncserver@:1.service && +Description=Remote desktop service (VNC)
+ systemctl start vncserver@:1.service && +After=syslog.target network.target
+
+[Service]
+Type=forking
+WorkingDirectory=/home/pi
+User=pi
+Group=pi
+
+PIDFile=/home/pi/.vnc/%H:%i.pid
+
+ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :%i > /dev/null 2>&1 || :'
+ExecStart=/usr/bin/vncserver :%i
+ExecStop=/usr/bin/vncserver -kill :%i
+
+Restart=on-success
+RestartSec=15
+
+[Install]
+WantedBy=multi-user.target
+EOF
+ fi
+ systemctl enable vncserver@1 &&
+ systemctl start vncserver@1 &&
STATUS=enabled STATUS=enabled
else else
return 1 return 1
@ -366,8 +209,8 @@ index bf24fa9..bac530a 100755
- systemctl disable vncserver-x11-serviced.service - systemctl disable vncserver-x11-serviced.service
- systemctl stop vncserver-x11-serviced.service - systemctl stop vncserver-x11-serviced.service
+ if is_installed tigervnc-server; then + if is_installed tigervnc-server; then
+ systemctl disable vncserver@:1.service + systemctl disable vncserver@1
+ systemctl stop vncserver@:1.service + systemctl stop vncserver@1
fi fi
STATUS=disabled STATUS=disabled
else else
@ -384,34 +227,85 @@ index bf24fa9..bac530a 100755
fi fi
} }
@@ -1095,8 +1141,7 @@ disable_raspi_config_at_boot() { @@ -857,8 +909,10 @@ get_spi() {
}
get_boot_cli() { do_spi() {
- if [ "$(basename $(readlink -f /etc/systemd/system/default.target))" = graphical.target ] \ DEFAULT=--defaultno
- && systemctl is-enabled lightdm > /dev/null 2>&1; then + CURRENT=0
+ if [ "$(systemctl get-default)" = graphical.target ] && systemctl is-enabled lightdm > /dev/null 2>&1; then if [ $(get_spi) -eq 0 ]; then
echo 1 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 else
echo 0 RET=$1
@@ -1409,6 +1454,9 @@ do_boot_behaviour() { 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() {
B2*) B2*)
systemctl --quiet set-default multi-user.target systemctl set-default multi-user.target
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
+ if [ ! -d /etc/systemd/system/getty@tty1.service.d ]; then + if [ ! -d /etc/systemd/system/getty@tty1.service.d ]; then
+ mkdir /etc/systemd/system/getty@tty1.service.d + mkdir /etc/systemd/system/getty@tty1.service.d
+ fi + fi
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF
[Service] [Service]
ExecStart= ExecStart=
@@ -1416,19 +1464,22 @@ ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM @@ -1320,21 +1385,24 @@ ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM
EOF EOF
;; ;;
B3*) B3*)
- if [ -e /etc/init.d/lightdm ]; then - if [ -e /etc/init.d/lightdm ]; then
+ if [ -e /etc/lightdm ]; then + if [ -e /etc/lightdm ]; then
systemctl --quiet set-default graphical.target systemctl set-default graphical.target
rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/" sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/"
disable_raspi_config_at_boot disable_raspi_config_at_boot
else else
@ -423,14 +317,15 @@ index bf24fa9..bac530a 100755
B4*) B4*)
- if [ -e /etc/init.d/lightdm ]; then - if [ -e /etc/init.d/lightdm ]; then
+ if [ -e /etc/lightdm ]; then + if [ -e /etc/lightdm ]; then
systemctl --quiet set-default graphical.target systemctl set-default graphical.target
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
+ if [ ! -d /etc/systemd/system/getty@tty1.service.d ]; then + if [ ! -d /etc/systemd/system/getty@tty1.service.d ]; then
+ mkdir /etc/systemd/system/getty@tty1.service.d + mkdir /etc/systemd/system/getty@tty1.service.d
+ fi + fi
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF
[Service] [Service]
ExecStart= ExecStart=
@@ -1437,7 +1488,7 @@ EOF @@ -1343,7 +1411,7 @@ EOF
sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$USER/" sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$USER/"
disable_raspi_config_at_boot disable_raspi_config_at_boot
else else
@ -439,212 +334,7 @@ index bf24fa9..bac530a 100755
return 1 return 1
fi fi
;; ;;
@@ -1456,54 +1507,69 @@ EOF @@ -1733,19 +1801,19 @@ do_onewire() {
do_boot_order() {
if [ "$INTERACTIVE" = True ]; then
BOOTOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Boot Device Order" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \
- "B1 SD Card Boot" "Boot from SD Card if available, otherwise boot from USB" \
- "B2 USB Boot" "Boot from USB if available, otherwise boot from SD Card" \
- "B3 Network Boot" "Boot from network if SD card boot fails" \
+ "B1 SD Card Boot " "Boot from SD Card before trying NVMe and then USB (RECOMMENDED)" \
+ "B2 NVMe/USB Boot" "Boot from NVMe before trying USB and then SD Card" \
+ "B3 Network Boot " "Boot from Network unless override by SD Card" \
3>&1 1>&2 2>&3)
else
BOOTOPT=$1
true
fi
if [ $? -eq 0 ]; then
- CURDATE=$(date -d "`vcgencmd bootloader_version | head -n 1`" +%Y%m%d)
+ CURDATE=$(date -d "$(vcgencmd bootloader_version | head -n 1)" +%Y%m%d)
FILNAME="none"
- if grep -q "stable" /etc/default/rpi-eeprom-update ; then
- EEPATH="/lib/firmware/raspberrypi/bootloader/stable/pieeprom*.bin"
+ EEBASE=$(rpi-eeprom-update | grep RELEASE | sed 's/.*(//g' | sed 's/[^\/]*)//g')
+ if grep FIRMWARE_RELEASE_STATUS /etc/default/rpi-eeprom-update | grep -Eq "stable|latest"; then
+ EEPATH="${EEBASE}/latest/pieeprom*.bin"
else
- EEPATH="/lib/firmware/raspberrypi/bootloader/critical/pieeprom*.bin"
+ EEPATH="${EEBASE}/default/pieeprom*.bin"
fi
- for filename in $EEPATH ; do
- FILDATE=$(date -d "`echo $filename | cut -d - -f 2- | cut -d . -f 1`" +%Y%m%d)
+ for filename in $(find $EEPATH -name "pieeprom*.bin" 2>/dev/null | sort); do
+ FILDATE=$(date -d "$(echo $filename | sed 's/.*\///g' | cut -d - -f 2- | cut -d . -f 1)" +%Y%m%d)
if [ $FILDATE -eq $CURDATE ]; then
FILNAME=$filename
+ break
+ elif [ "$FILDATE" ">" "$CURDATE" ]; then
+ # If there is no exact match then try an upgrade
+ FILNAME=$filename
fi
done
if [ "$FILNAME" = "none" ]; then
if [ "$INTERACTIVE" = True ]; then
- whiptail --msgbox "No EEPROM bin file found for version `date -d $CURDATE +%Y-%m-%d` - aborting" 20 60 2
+ whiptail --msgbox "Current EEPROM version $(date -d $CURDATE +%Y-%m-%d) or newer not found - aborting.\n\nTry updating the rpi-eeprom APT package." 20 70 2
fi
return 1
fi
EECFG=$(mktemp)
- vcgencmd bootloader_config > $EECFG
+ rpi-eeprom-config > $EECFG
sed $EECFG -i -e "/SD_BOOT_MAX_RETRIES/d"
sed $EECFG -i -e "/NET_BOOT_MAX_RETRIES/d"
case "$BOOTOPT" in
B1*)
+ if is_pifive; then
+ ORD=0xf461
+ else
+ ORD=0xf41
+ fi
if ! grep -q "BOOT_ORDER" $EECFG ; then
- sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf41"
+ sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=${ORD}"
else
- sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf41/"
+ sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=${ORD}/"
fi
STATUS="SD Card"
;;
B2*)
+ if is_pifive; then
+ ORD=0xf146
+ else
+ ORD=0xf14
+ fi
if ! grep -q "BOOT_ORDER" $EECFG ; then
- sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf14"
+ sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=${ORD}"
else
- sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf14/"
+ sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=${ORD}/"
fi
- STATUS="USB"
+ STATUS="NVMe/USB"
;;
B3*)
if ! grep -q "BOOT_ORDER" $EECFG ; then
@@ -1518,9 +1584,7 @@ do_boot_order() {
return 1
;;
esac
- EEBIN=$(mktemp)
- rpi-eeprom-config --config $EECFG --out $EEBIN $FILNAME
- rpi-eeprom-update -d -f $EEBIN
+ rpi-eeprom-config --apply $EECFG $FILNAME
ASK_TO_REBOOT=1
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "$STATUS is default boot device" 20 60 1
@@ -1531,9 +1595,9 @@ do_boot_order() {
do_boot_rom() {
if [ "$INTERACTIVE" = True ]; then
- BOOTOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Boot ROM Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \
- "E1 Latest" "Use the latest version boot ROM software" \
- "E2 Default" "Use the factory default boot ROM software" \
+ BOOTOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Bootloader Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \
+ "E1 Latest" "Use the latest bootloader image" \
+ "E2 Default" "Use the factory default bootloader image" \
3>&1 1>&2 2>&3)
else
BOOTOPT=$1
@@ -1542,46 +1606,47 @@ do_boot_rom() {
if [ $? -eq 0 ]; then
case "$BOOTOPT" in
E1*)
- sed /etc/default/rpi-eeprom-update -i -e "s/^FIRMWARE_RELEASE_STATUS.*/FIRMWARE_RELEASE_STATUS=\"stable\"/"
+ sed /etc/default/rpi-eeprom-update -i -e "s/^FIRMWARE_RELEASE_STATUS.*/FIRMWARE_RELEASE_STATUS=\"latest\"/"
EETYPE="Latest version"
;;
E2*)
- sed /etc/default/rpi-eeprom-update -i -e "s/^FIRMWARE_RELEASE_STATUS.*/FIRMWARE_RELEASE_STATUS=\"critical\"/"
+ sed /etc/default/rpi-eeprom-update -i -e "s/^FIRMWARE_RELEASE_STATUS.*/FIRMWARE_RELEASE_STATUS=\"default\"/"
EETYPE="Factory default"
;;
*)
- whiptail --msgbox "Programmer error, unrecognised boot ROM option" 20 60 2
+ whiptail --msgbox "Programmer error, unrecognised bootloader option" 20 60 2
return 1
;;
esac
if [ "$INTERACTIVE" = True ]; then
- whiptail --yesno "$EETYPE boot ROM selected - will be loaded at next reboot.\n\nReset boot ROM to defaults?" 20 60 2
+ whiptail --yesno "$EETYPE bootloader selected - will be loaded at next reboot.\n\nReset bootloader to default configuration?" 20 60 2
DEFAULTS=$?
else
DEFAULTS=$2
fi
if [ "$DEFAULTS" -eq 0 ]; then # yes
- if grep -q "stable" /etc/default/rpi-eeprom-update ; then
- EEPATH="/lib/firmware/raspberrypi/bootloader/stable/"
+ EEBASE=$(rpi-eeprom-update | grep RELEASE | sed 's/.*(//g' | sed 's/[^\/]*)//g')
+ if grep FIRMWARE_RELEASE_STATUS /etc/default/rpi-eeprom-update | grep -Eq "stable|latest"; then
+ EEPATH="${EEBASE}/latest/"
else
- EEPATH="/lib/firmware/raspberrypi/bootloader/critical/"
+ EEPATH="${EEBASE}/default/"
fi
MATCH=".*/pieeprom-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].bin"
- FILNAME="$(find "${EEPATH}" -maxdepth 1 -type f -size 524288c -regex "${MATCH}" | sort -r | head -n1)"
+ FILNAME="$(find "${EEPATH}" -maxdepth 1 -type f -regex "${MATCH}" | sort -r | head -n1)"
if [ -z "$FILNAME" ]; then
if [ "$INTERACTIVE" = True ]; then
- whiptail --msgbox "No EEPROM bin file found - cannot reset to defaults" 20 60 2
+ whiptail --msgbox "No EEPROM bin file found - cannot reset to defaults,\n\nTry updating APT rpi-eeprom package and selecting the latest release." 20 60 2
fi
else
rpi-eeprom-update -d -f $FILNAME
if [ "$INTERACTIVE" = True ]; then
- whiptail --msgbox "Boot ROM reset to defaults" 20 60 2
+ whiptail --msgbox "Bootloader reset to default configuration" 20 60 2
fi
fi
else
rpi-eeprom-update
if [ "$INTERACTIVE" = True ]; then
- whiptail --msgbox "Boot ROM not reset to defaults" 20 60 2
+ whiptail --msgbox "Bootloader not reset to defaults" 20 60 2
fi
fi
ASK_TO_REBOOT=1
@@ -1738,7 +1803,7 @@ EOF
}
get_camera() {
- if [ $(deb_ver) -le 10 ]; then
+ if [ $(rpm_ver) -le 21 ]; then
CAM=$(get_config_var start_x $CONFIG)
if [ $CAM -eq 1 ]; then
echo 0
@@ -1760,7 +1825,7 @@ get_camera() {
}
do_camera() {
- if [ $(deb_ver) -le 10 ] && [ ! -e /boot/start_x.elf ]; then
+ if [ $(rpm_ver) -le 21 ] && [ ! -e /boot/start_x.elf ]; then
whiptail --msgbox "Your firmware appears to be out of date (no start_x.elf). Please update" 20 60 2
return 1
fi
@@ -1783,7 +1848,7 @@ do_camera() {
ASK_TO_REBOOT=1
fi
if [ $RET -eq 0 ]; then
- if [ $(deb_ver) -le 10 ] ; then
+ if [ $(rpm_ver) -le 21 ] ; then
set_config_var start_x 1 $CONFIG
CUR_GPU_MEM=$(get_config_var gpu_mem $CONFIG)
if [ -z "$CUR_GPU_MEM" ] || [ "$CUR_GPU_MEM" -lt 128 ]; then
@@ -1794,7 +1859,7 @@ do_camera() {
fi
STATUS=enabled
elif [ $RET -eq 1 ]; then
- if [ $(deb_ver) -le 10 ] ; then
+ if [ $(rpm_ver) -le 21 ] ; then
set_config_var start_x 0 $CONFIG
sed $CONFIG -i -e "s/^start_file/#start_file/"
else
@@ -1912,19 +1977,19 @@ do_legacy() {
} }
do_gldriver() { do_gldriver() {
@ -674,18 +364,10 @@ index bf24fa9..bac530a 100755
+# whiptail --msgbox "Required packages not found, please install: ${missing_packages}" 20 60 2 +# whiptail --msgbox "Required packages not found, please install: ${missing_packages}" 20 60 2
+# return 1 +# return 1
+# fi +# fi
if is_pifour ; then
GLOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "GL Driver" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ 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" \ "G1 Legacy" "Original non-GL desktop driver" \
"G2 GL (Full KMS)" "OpenGL desktop driver with full KMS" \ @@ -1895,8 +1963,8 @@ do_net_names () {
@@ -2153,6 +2218,7 @@ do_net_names () {
rm -f /etc/systemd/network/73-usb-net-by-mac.link
STATUS=enabled
elif [ $RET -eq 1 ]; then
+ mkdir -p /etc/systemd/network
ln -sf /dev/null /etc/systemd/network/99-default.link
ln -sf /dev/null /etc/systemd/network/73-usb-net-by-mac.link
STATUS=disabled
@@ -2165,8 +2231,8 @@ do_net_names () {
} }
do_update() { do_update() {
@ -696,34 +378,13 @@ index bf24fa9..bac530a 100755
printf "Sleeping 5 seconds before reloading raspi-config\n" && printf "Sleeping 5 seconds before reloading raspi-config\n" &&
sleep 5 && sleep 5 &&
exec raspi-config exec raspi-config
@@ -2211,7 +2277,7 @@ do_audio() { @@ -2070,6 +2138,63 @@ list_wlan_interfaces() {
if [ "$INTERACTIVE" = True ]; then done
n=0 }
array=""
- while [ $n -le 9 ]]
+ while [ $n -le 9 ]
do
CARD=$(LC_ALL=C aplay -l | grep "card $n" | cut -d [ -f 2 | cut -d ] -f 1)
if [ -z "$CARD" ] ; then
@@ -2377,12 +2443,69 @@ EOF
list_wlan_interfaces() {
for dir in /sys/class/net/*/wireless; do
if [ -d "$dir" ]; then
- IFACE="$(basename "$(dirname "$dir")")"
- if wpa_cli -i "$IFACE" status > /dev/null 2>&1; then
- echo "$IFACE"
- fi
+ basename "$(dirname "$dir")"
+ # IFACE="$(basename "$(dirname "$dir")")"
+ # if wpa_cli -i "$IFACE" status > /dev/null 2>&1; then
+ # echo "$IFACE"
+ # fi
+ fi
+ done
+}
+
+do_wifi_ssid_passphrase_nmcli() { +do_wifi_ssid_passphrase_nmcli() {
+ IFACE="$(list_wlan_interfaces | head -n 1)" + IFACE_LIST="$(list_wlan_interfaces)"
+ IFACE="$(echo "$IFACE_LIST" | head -n 1)"
+ +
+ if [ -z "$IFACE" ]; then + if [ -z "$IFACE" ]; then
+ if [ "$INTERACTIVE" = True ]; then + if [ "$INTERACTIVE" = True ]; then
@ -749,8 +410,8 @@ index bf24fa9..bac530a 100755
+ return 0 + return 0
+ else + else
+ break + break
fi + fi
done + done
+ +
+ # Escape special characters for embedding in regex below + # Escape special characters for embedding in regex below
+ local ssid="$(echo "$SSID" \ + local ssid="$(echo "$SSID" \
@ -776,10 +437,12 @@ index bf24fa9..bac530a 100755
+ whiptail --msgbox "Connect to $SSID failed, try nmtui." 20 60 + whiptail --msgbox "Connect to $SSID failed, try nmtui." 20 60
+ fi + fi
+ return $RET + return $RET
} +}
+
do_wifi_ssid_passphrase() { do_wifi_ssid_passphrase() {
@@ -2883,8 +3006,8 @@ do_proxy() { RET=0
IFACE_LIST="$(list_wlan_interfaces)"
@@ -2542,8 +2667,8 @@ do_proxy() {
sed -i "/^export ${SCHEME}_/Id" /etc/profile.d/proxy.sh sed -i "/^export ${SCHEME}_/Id" /etc/profile.d/proxy.sh
fi fi
if [ "${SCHEME#*http}" != "$SCHEME" ]; then if [ "${SCHEME#*http}" != "$SCHEME" ]; then
@ -790,7 +453,7 @@ index bf24fa9..bac530a 100755
fi fi
fi fi
if [ -z "$ADDRESS" ]; then if [ -z "$ADDRESS" ]; then
@@ -2898,7 +3021,7 @@ do_proxy() { @@ -2557,7 +2682,7 @@ do_proxy() {
echo "export ${SCHEME}_proxy=\"$ADDRESS\"" >> /etc/profile.d/proxy.sh echo "export ${SCHEME}_proxy=\"$ADDRESS\"" >> /etc/profile.d/proxy.sh
fi fi
if [ "${SCHEME#*http}" != "$SCHEME" ]; then if [ "${SCHEME#*http}" != "$SCHEME" ]; then
@ -799,7 +462,7 @@ index bf24fa9..bac530a 100755
fi fi
done done
if [ "$INTERACTIVE" = True ]; then if [ "$INTERACTIVE" = True ]; then
@@ -2929,7 +3052,9 @@ do @@ -2588,7 +2713,9 @@ do
--expand-rootfs) --expand-rootfs)
INTERACTIVE=False INTERACTIVE=False
do_expand_rootfs do_expand_rootfs
@ -810,7 +473,7 @@ index bf24fa9..bac530a 100755
exit 0 exit 0
;; ;;
--apply-os-config) --apply-os-config)
@@ -2975,8 +3100,8 @@ do_system_menu() { @@ -2634,8 +2761,8 @@ do_system_menu() {
"S3 Password" "Change password for the '$USER' user" \ "S3 Password" "Change password for the '$USER' user" \
"S4 Hostname" "Set name for this computer on a network" \ "S4 Hostname" "Set name for this computer on a network" \
"S5 Boot / Auto Login" "Select boot into desktop or to command line" \ "S5 Boot / Auto Login" "Select boot into desktop or to command line" \
@ -821,27 +484,7 @@ index bf24fa9..bac530a 100755
"S8 Power LED" "Set behaviour of power LED" \ "S8 Power LED" "Set behaviour of power LED" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
elif is_live ; then elif is_live ; then
@@ -2985,7 +3110,7 @@ do_system_menu() { @@ -2661,7 +2788,7 @@ 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" \
- "S6 Network at Boot" "Select wait for network connection on boot" \
+ `# "S6 Network at Boot" "Select wait for network connection on boot"` \
3>&1 1>&2 2>&3)
else
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
@@ -2993,8 +3118,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" \
- "S6 Network at Boot" "Select wait for network connection on boot" \
- "S7 Splash Screen" "Choose graphical splash screen or text boot" \
+ `# "S6 Network at Boot" "Select wait for network connection on boot"` \
+ `# "S7 Splash Screen" "Choose graphical splash screen or text boot"` \
3>&1 1>&2 2>&3)
fi
RET=$?
@@ -3002,7 +3127,7 @@ do_system_menu() {
return 0 return 0
elif [ $RET -eq 0 ]; then elif [ $RET -eq 0 ]; then
case "$FUN" in case "$FUN" in
@ -850,16 +493,25 @@ index bf24fa9..bac530a 100755
S2\ *) do_audio ;; S2\ *) do_audio ;;
S3\ *) do_change_pass ;; S3\ *) do_change_pass ;;
S4\ *) do_hostname ;; S4\ *) do_hostname ;;
@@ -3071,7 +3196,7 @@ do_interface_menu() { @@ -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() {
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 \ 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 \
"I1 Legacy Camera" "Enable/disable legacy camera support" \ "P1 Camera" "Enable/disable connection to the Raspberry Pi Camera" \
"I2 SSH" "Enable/disable remote command line access using SSH" \ "P2 SSH" "Enable/disable remote command line access using SSH" \
- "I3 VNC" "Enable/disable graphical remote access using RealVNC" \ - "P3 VNC" "Enable/disable graphical remote access using RealVNC" \
+ "I3 VNC" "Enable/disable graphical remote access using TigerVNC" \ + "P3 VNC" "Enable/disable graphical remote access using TigerVNC" \
"I4 SPI" "Enable/disable automatic loading of SPI kernel module" \ "P4 SPI" "Enable/disable automatic loading of SPI kernel module" \
"I5 I2C" "Enable/disable automatic loading of I2C kernel module" \ "P5 I2C" "Enable/disable automatic loading of I2C kernel module" \
"I6 Serial Port" "Enable/disable shell messages on the serial connection" \ "P6 Serial Port" "Enable/disable shell messages on the serial connection" \
@@ -3105,7 +3230,7 @@ do_performance_menu() { @@ -2741,7 +2868,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 \ 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" \ "P1 Overclock" "Configure CPU overclocking" \
"P2 GPU Memory" "Change the amount of memory made available to the GPU" \ "P2 GPU Memory" "Change the amount of memory made available to the GPU" \
@ -868,24 +520,23 @@ index bf24fa9..bac530a 100755
"P4 Fan" "Set behaviour of GPIO fan" \ "P4 Fan" "Set behaviour of GPIO fan" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
RET=$? RET=$?
@@ -3147,41 +3272,41 @@ do_advanced_menu() { @@ -2783,19 +2910,19 @@ do_advanced_menu() {
if is_pifour ; then 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 \ 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" \ "A1 Expand Filesystem" "Ensures that all of the SD card is available" \
- "A2 GL Driver" "Enable/disable experimental desktop GL driver" \
- "A3 Compositor" "Enable/disable xcompmgr composition manager" \ - "A3 Compositor" "Enable/disable xcompmgr composition manager" \
+ `# "A2 GL Driver" "Enable/disable experimental desktop GL driver"` \
+ `# "A3 Compositor" "Enable/disable xcompmgr composition manager"` \ + `# "A3 Compositor" "Enable/disable xcompmgr composition manager"` \
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \ "A4 Network Interface Names" "Enable/disable predictable network i/f names" \
"A5 Network Proxy Settings" "Configure network proxy settings" \ "A5 Network Proxy Settings" "Configure network proxy settings" \
"A6 Boot Order" "Choose network or USB device boot" \ - "A6 Boot Order" "Choose network or USB device boot" \
- "A7 Bootloader Version" "Select latest or default boot ROM software" \ - "A7 Bootloader Version" "Select latest or default boot ROM software" \
- "A9 Wayland" "Enable experimental Wayland backend" \ + `# "A6 Boot Order" "Choose network or USB device boot"` \
- "AA Network Config" "Set network configuration tool" \ + `# "A7 Bootloader Version" "Select latest or default boot ROM software"` \
+ "A7 Bootloader Version" "Select latest or factory default bootloader software" \ "A8 HDMI / Composite" "Raspberry Pi 4 video output options" \
+ `# "A9 Wayland" "Enable experimental Wayland backend"` \
+ `# "AA Network Config" "Set network configuration tool"` \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
elif is_pi ; then elif is_pi ; then
if is_kms; 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 \ 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" \ "A1 Expand Filesystem" "Ensures that all of the SD card is available" \
- "A2 GL Driver" "Enable/disable experimental desktop GL driver" \ - "A2 GL Driver" "Enable/disable experimental desktop GL driver" \
@ -894,45 +545,17 @@ index bf24fa9..bac530a 100755
+ `# "A3 Compositor" "Enable/disable xcompmgr composition manager"` \ + `# "A3 Compositor" "Enable/disable xcompmgr composition manager"` \
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \ "A4 Network Interface Names" "Enable/disable predictable network i/f names" \
"A5 Network Proxy Settings" "Configure network proxy settings" \ "A5 Network Proxy Settings" "Configure network proxy settings" \
- "A8 Glamor" "Enable/disable glamor graphics acceleration" \
- "A9 Wayland" "Enable experimental Wayland backend" \
- "AA Network Config" "Set network configuration tool" \
+ `# "A8 Glamor" "Enable/disable glamor graphics acceleration"` \
+ `# "A9 Wayland" "Enable experimental Wayland backend"` \
+ `# "AA Network Config" "Set network configuration tool"` \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
else @@ -2819,7 +2946,7 @@ do_advanced_menu() {
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 \ A7\ *) do_boot_rom ;;
"A1 Expand Filesystem" "Ensures that all of the SD card is available" \ A8\ *) do_pi4video ;;
- "A2 GL Driver" "Enable/disable experimental desktop GL driver" \
+ `# "A2 GL Driver" "Enable/disable experimental desktop GL driver"` \
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \
"A5 Network Proxy Settings" "Configure network proxy settings" \
- "A8 Glamor" "Enable/disable glamor graphics acceleration" \
- "AA Network Config" "Set network configuration tool" \
+ `# "A8 Glamor" "Enable/disable glamor graphics acceleration"` \
+ `# "AA Network Config" "Set network configuration tool"` \
3>&1 1>&2 2>&3)
fi
else
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 \
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \
"A5 Network Proxy Settings" "Configure network proxy settings" \
- "AA Network Config" "Set network configuration tool" \
+ `# "AA Network Config" "Set network configuration tool"` \
3>&1 1>&2 2>&3)
fi
RET=$?
@@ -3200,7 +3325,7 @@ do_advanced_menu() {
A9\ *) do_wayland ;;
AA\ *) do_netconf ;;
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
- esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 - esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
+ esac || [ $? -eq 2 ] || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + esac || [ $? -eq 2 ] || whiptail --msgbox "There was an error running option $FUN" 20 60 1
fi fi
} }
@@ -3237,17 +3362,17 @@ if [ "$INTERACTIVE" = True ]; then @@ -2856,17 +2983,17 @@ if [ "$INTERACTIVE" = True ]; then
calc_wt_size calc_wt_size
while [ "$USER" = "root" ] || [ -z "$USER" ]; do 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 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
@ -953,12 +576,3 @@ index bf24fa9..bac530a 100755
"6 Advanced Options" "Configure advanced settings" \ "6 Advanced Options" "Configure advanced settings" \
"8 Update" "Update this tool to the latest version" \ "8 Update" "Update this tool to the latest version" \
"9 About raspi-config" "Information about this configuration tool" \ "9 About raspi-config" "Information about this configuration tool" \
@@ -3257,7 +3382,7 @@ if [ "$INTERACTIVE" = True ]; then
"1 System Options" "Configure system settings" \
"2 Display Options" "Configure display settings" \
"3 Interface Options" "Configure connections to peripherals" \
- "5 Localisation Options" "Configure language and regional settings" \
+ `# "5 Localisation Options" "Configure language and regional settings"` \
"6 Advanced Options" "Configure advanced settings" \
"8 Update" "Update this tool to the latest version" \
"9 About raspi-config" "Information about this configuration tool" \

View File

@ -4,12 +4,12 @@
%global _share_path /usr/share/raspi-config %global _share_path /usr/share/raspi-config
%global _service_path /etc/init.d %global _service_path /etc/init.d
%global _proxy_path /etc/sudoers.d %global _proxy_path /etc/sudoers.d
%global _etc_path /etc/default %global _systemd_path /etc/systemd/system
%global commitid 408bde537671de6df2d9b91564e67132f98ffa71 %global commitid 8607dbc7281cef142b2e0c12839176f189d48a1b
%global debug_package %{nil} %global debug_package %{nil}
Name: raspi-config Name: raspi-config
Version: 20230320 Version: 20210625
Release: 2 Release: 2
Summary: Raspberry Pi configuration tool Summary: Raspberry Pi configuration tool
License: MIT License: MIT
@ -41,16 +41,16 @@ mkdir -p %{buildroot}%{_doc_path}
mkdir -p %{buildroot}%{_share_path} mkdir -p %{buildroot}%{_share_path}
mkdir -p %{buildroot}%{_service_path} mkdir -p %{buildroot}%{_service_path}
mkdir -p %{buildroot}%{_proxy_path} mkdir -p %{buildroot}%{_proxy_path}
mkdir -p %{buildroot}%{_etc_path} mkdir -p %{buildroot}%{_systemd_path}
cd %{name}-%{commitid} cd %{name}-%{commitid}
install -p -m 644 etc/default/cpu_governor %{buildroot}%{_etc_path}/ install -p -m 755 usr/lib/raspi-config/* %{buildroot}%{_lib_path}/
install -p -m 755 usr/lib/raspi-config/cmstart.sh %{buildroot}%{_lib_path}/
install -p -m 755 raspi-config %{buildroot}%{_bin_path}/ install -p -m 755 raspi-config %{buildroot}%{_bin_path}/
install -p -m 755 debian/raspi-config.init %{buildroot}%{_service_path}/raspi-config install -p -m 755 debian/raspi-config.init %{buildroot}%{_service_path}/raspi-config
install -p -m 644 debian/changelog %{buildroot}%{_doc_path}/ install -p -m 644 debian/changelog %{buildroot}%{_doc_path}/
install -p -m 644 usr/share/raspi-config/10-blanking.conf %{buildroot}%{_share_path}/ install -p -m 644 usr/share/raspi-config/10-blanking.conf %{buildroot}%{_share_path}/
install -p -m 440 etc/sudoers.d/010_proxy %{buildroot}%{_proxy_path}/ install -p -m 440 etc/sudoers.d/010_proxy %{buildroot}%{_proxy_path}/
install -p -m 644 autologin@.service %{buildroot}%{_systemd_path}/
cd - cd -
@ -61,33 +61,9 @@ cd -
%{_bin_path}/* %{_bin_path}/*
%{_service_path}/* %{_service_path}/*
%{_proxy_path}/* %{_proxy_path}/*
%{_etc_path}/* %{_systemd_path}/*
%changelog %changelog
* Thu Apr 25 2024 Yafen Fang <yafen@iscas.ac.cn> - 20230320-2
- update script: raspi-config after upgrading to raspberrypi-eeprom-2024.04.20-1.
* Mon Mar 20 2023 Yafen Fang <yafen@iscas.ac.cn> - 20230320-1
- update to upstream's last commit (408bde537671de6df2d9b91564e67132f98ffa71): do_wifi_ssid_passphrase: set scan_ssid on hidden network in dhcpcd case
- adjust for openEuler
- disable A9 Wayland and AA Network Config
- remove legacy autologin cruft
* Wed Mar 23 2022 Yafen Fang <yafen@iscas.ac.cn> - 20220323-1
- update to upstream's last commit (d3fe4e7058dfaa616aa8a4bb053c31c8d59c0135): Fix incorrect detection of read-only boot partition
- adjust for openEuler
- fix bug for P3 VNC and A4 Network Interface Names
- remove unused init_resize.sh
* 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 * Fri Jun 25 2021 Yafen Fang<yafen@iscas.ac.cn> - 20210625-2
- adjust for openEuler - adjust for openEuler