diff options
Diffstat (limited to 'mods/mod_hakchi/hakchi/script/reflash')
-rw-r--r-- | mods/mod_hakchi/hakchi/script/reflash | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/mods/mod_hakchi/hakchi/script/reflash b/mods/mod_hakchi/hakchi/script/reflash index a7beaefb..258d263e 100644 --- a/mods/mod_hakchi/hakchi/script/reflash +++ b/mods/mod_hakchi/hakchi/script/reflash @@ -1,6 +1,7 @@ +umount_base + local firmware="$(find -type f -name "*.hsqs" | sort | head -n 1)" if [ -f "$firmware" ]; then - umount_base umount "$mountpoint" cryptsetup close root-crypt @@ -13,15 +14,18 @@ if [ -f "$firmware" ]; then cryptsetup open /dev/nandb root-crypt --readonly --type plain --cipher aes-xts-plain --key-file /key-file mount -o ro,noatime /dev/mapper/root-crypt "$mountpoint" +fi +unset firmware - local tmk="$(pwd)/mkfs.txz" - if [ -f "$tmk"]; then - cd / && tar xJf "$tmk" - mount_bind "$mountpoint/lib" "/lib" -# /sbin/mkfs.ext4 -L data -m 0 /dev/nandc - mkfs.ext2 -L data -m 0 /dev/nandc - umount "/lib" - fi - - mount_base +local tmk="$(pwd)/mkfs.txz" +if [ -f "$tmk"]; then + rm "/lib" + cd / && tar xJf "$tmk" + mount_bind "$mountpoint/lib" "/lib" +# /sbin/mkfs.ext4 -L data -m 0 /dev/nandc + mkfs.ext2 -L data -m 0 /dev/nandc + umount "/lib" fi +unset tmk + +mount_base |