aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerge Schneider <[email protected]>2018-12-11 15:12:40 +0000
committerSerge Schneider <[email protected]>2018-12-11 15:12:40 +0000
commitd1b747747c81d34c6779c2ac9bb86fcbfac79c6c (patch)
tree2adc12cf95dc48bbbbc3840716790a7f55561a03
parent980bdb961bb72bd130f68fb2141a6cc095d1251d (diff)
Add PINN restore support
-rw-r--r--export-noobs/00-release/files/partition_setup.sh29
1 files changed, 16 insertions, 13 deletions
diff --git a/export-noobs/00-release/files/partition_setup.sh b/export-noobs/00-release/files/partition_setup.sh
index f4bc961..e41a9d3 100644
--- a/export-noobs/00-release/files/partition_setup.sh
+++ b/export-noobs/00-release/files/partition_setup.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+#supports_backup in PINN
set -ex
@@ -13,23 +14,25 @@ mount "$part1" /tmp/1
mount "$part2" /tmp/2
sed /tmp/1/cmdline.txt -i -e "s|root=[^ ]*|root=${part2}|"
-sed /tmp/2/etc/fstab -i -e "s|^.* / |${part2} / |"
-sed /tmp/2/etc/fstab -i -e "s|^.* /boot |${part1} /boot |"
+sed /tmp/2/etc/fstab -i -e "s|^[^#].* / |${part2} / |"
+sed /tmp/2/etc/fstab -i -e "s|^[^#].* /boot |${part1} /boot |"
-if [ -f /mnt/ssh ]; then
- cp /mnt/ssh /tmp/1/
-fi
+if [ -z $restore ]; then
+ if [ -f /mnt/ssh ]; then
+ cp /mnt/ssh /tmp/1/
+ fi
-if [ -f /mnt/ssh.txt ]; then
- cp /mnt/ssh.txt /tmp/1/
-fi
+ if [ -f /mnt/ssh.txt ]; then
+ cp /mnt/ssh.txt /tmp/1/
+ fi
-if [ -f /settings/wpa_supplicant.conf ]; then
- cp /settings/wpa_supplicant.conf /tmp/1/
-fi
+ if [ -f /settings/wpa_supplicant.conf ]; then
+ cp /settings/wpa_supplicant.conf /tmp/1/
+ fi
-if ! grep -q resize /proc/cmdline; then
- sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||;s| quiet||2g' /tmp/1/cmdline.txt
+ if ! grep -q resize /proc/cmdline; then
+ sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||;s| quiet||2g' /tmp/1/cmdline.txt
+ fi
fi
umount /tmp/1