Add PINN restore support
This commit is contained in:
parent
980bdb961b
commit
d1b747747c
1 changed files with 16 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
#supports_backup in PINN
|
||||
|
||||
set -ex
|
||||
|
||||
|
@ -13,9 +14,10 @@ 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 [ -z $restore ]; then
|
||||
if [ -f /mnt/ssh ]; then
|
||||
cp /mnt/ssh /tmp/1/
|
||||
fi
|
||||
|
@ -31,6 +33,7 @@ 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
|
||||
fi
|
||||
fi
|
||||
|
||||
umount /tmp/1
|
||||
umount /tmp/2
|
||||
|
|
Loading…
Reference in a new issue