Skip to content

Commit

Permalink
Add prompt for wiping roms partition
Browse files Browse the repository at this point in the history
  • Loading branch information
mac2612 committed Mar 29, 2021
1 parent 8497dd2 commit 6914684
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions remote_flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ nand_flash_rfs () {
sleep 1
${SSH} "/usr/sbin/ubimkvol /dev/ubi0 -N RFS -m"
sleep 1
# TODO: This should be part of the surgeon fsoverlay
${SSH} "mkdir /mnt/root"
${SSH} "mount -t ubifs /dev/ubi0_0 /mnt/root"
# Note: We used to use a ubifs image here, but now use a .tar.gz.
# This removes the need to care about PEB/LEB sizes at build time,
Expand All @@ -83,6 +81,17 @@ nand_flash_rfs () {
echo "Done flashing the root filesystem!"
}

nand_maybe_wipe_roms () {
read -p "Do you want to format the roms partition? (You should do this on the first flash of retroleap) (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
${SSH} /usr/sbin/ubiformat /dev/mtd3
${SSH} /usr/sbin/ubiattach -p /dev/mtd3
${SSH} /usr/sbin/ubimkvol /dev/ubi0 -m -N roms
fi
}

flash_nand () {
prefix=$1
if [ $prefix == "lf1000_" ]; then
Expand All @@ -99,6 +108,7 @@ flash_nand () {
nand_part_detect
nand_flash_kernel $kernel
nand_flash_rfs ${prefix}rootfs.tar.gz
nand_maybe_wipe_roms
echo "Done! Rebooting the host."
${SSH} '/sbin/reboot'
}
Expand Down

0 comments on commit 6914684

Please sign in to comment.