Skip to content

Commit

Permalink
v9.7
Browse files Browse the repository at this point in the history
- DietPi-Patches | Avoid shell warning for command substitution reading /proc node
  • Loading branch information
MichaIng committed Aug 22, 2024
1 parent 9373e2d commit bdc4ee0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,9 @@ Patch_9_7()
# NanoPi R5S/R6S migration from legacy image with 8 partitions to Armbian-based kernel and bootloader
elif [[ $G_HW_MODEL == 76 ]] && dpkg-query -s 'firmware-nanopi5' &> /dev/null
then
case $(</proc/device-tree/model) in
local rmodel
read -r rmodel < /proc/device-tree/model
case $rmodel in
*R5S*) HW_VARIANT=1 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi; local model='nanopi-r5s';;
*R5C*) HW_VARIANT=2 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi; local model='nanopi-r5c';;
*) G_DIETPI-NOTIFY 1 'No known SBC model detected'; exit 1;;
Expand Down Expand Up @@ -1852,7 +1854,7 @@ Patch_9_7()
G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread -N1 "$rootdrive" <<< ',+' # Needed, since above command and '286720,+' somehow create the partition 2015 sectors smaller, resulting in too large filesystem size. Only a subsequent ',+' expands it to the true end of the drive.
# LAN interface migration
G_DIETPI-NOTIFY 2 'Migrating LAN interface configs'
case $(</proc/device-tree/model) in
case $rmodel in
*R5S*) local eth0='ethto2' eth1='ethto0' eth2='ethto1';;
*R5C*) local eth0='ethto1' eth1='ethto0' eth2='';;
*) :;;
Expand All @@ -1868,7 +1870,9 @@ Patch_9_7()

elif [[ $G_HW_MODEL == 79 ]] && dpkg-query -s 'firmware-nanopi6' &> /dev/null
then
case $(</proc/device-tree/model) in
local rmodel
read -r rmodel < /proc/device-tree/model
case $rmodel in
*R6S*) HW_VARIANT=1 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi; local model='nanopi-r6s';;
*R6C*) HW_VARIANT=2 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi; local model='nanopi-r6c';;
*T6*) HW_VARIANT=3 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi; local model='nanopct6';;
Expand Down Expand Up @@ -1934,7 +1938,7 @@ Patch_9_7()
G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread -N1 "$rootdrive" <<< ',+' # Needed, since above command and '286720,+' somehow create the partition 2015 sectors smaller, resulting in too large filesystem size. Only a subsequent ',+' expands it to the true end of the drive.
# LAN interface migration
G_DIETPI-NOTIFY 2 'Migrating LAN interface configs'
case $(</proc/device-tree/model) in
case $rmodel in
*R6S*) local eth1='ethto2' eth2='ethto1';;
*) local eth0='skip';;
esac
Expand Down

0 comments on commit bdc4ee0

Please sign in to comment.