From 1343b04eb47287889649b502d7acd04afb9242c1 Mon Sep 17 00:00:00 2001 From: soumenganguly Date: Tue, 21 Apr 2015 10:49:21 +0530 Subject: modified recovery script according to the GUI --- reinstall-recovery/recovery.sh | 88 +++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/reinstall-recovery/recovery.sh b/reinstall-recovery/recovery.sh index 618d753..5ff7265 100644 --- a/reinstall-recovery/recovery.sh +++ b/reinstall-recovery/recovery.sh @@ -79,51 +79,61 @@ fi installation() { - - echo "" - echo "" - echo -e "\t\tThe installation is underway, do not exit..." - # exit 0 - mkdir $ubuntu_dir + #Detect the no. of partitions on the SD Card. + #If it contains a single partition, then continue, otherwise copy the contents of ext4 to nand_previous. + echo "" + echo "" + echo -e "\t\tThe installation is underway, do not exit..." + # exit 0 + mkdir $ubuntu_dir # This part is taken care of in lib/debian-installer/menu file. # mkdir /sd_card # mount /dev/mmcblk0p1 /sd_card - if [ $(echo $?) -eq 0 ]; then - flash_erase $rootfs_part 0 0 > /dev/null - else - echo -e"\t\tSD card not mounted" - sleep 3 - exit 0 - fi - ubiattach /dev/ubi_ctrl -m $rootfs_mtd_num > /dev/null - ubimkvol /dev/ubi0 -N ubuntu-rootfs -m > /dev/null - if [ $(echo $?) -eq 0 ]; then - mount -t ubifs ubi0_0 $ubuntu_dir - else - echo -e "\t\tubimkvol failed" - sleep 3 - exit 0 - fi - #Insert progress bar here. - sh /mnt/bar /sd_card/fossee-os.tar.gz | tar xzpf - -C /nand_previous - sync - - umount $ubuntu_dir + if [ $(echo $?) -eq 0 ]; then + flash_erase $rootfs_part 0 0 > /dev/null + else + echo -e"\t\tSD card not mounted" + sleep 3 + exit 0 + fi + ubiattach /dev/ubi_ctrl -m $rootfs_mtd_num > /dev/null + ubimkvol /dev/ubi0 -N ubuntu-rootfs -m > /dev/null + if [ $(echo $?) -eq 0 ]; then + mount -t ubifs ubi0_0 $ubuntu_dir + else + echo -e "\t\tubimkvol failed" + sleep 3 + exit 0 + fi + #Insert progress bar here. + #Check the no. of partitions on the SD card. 1?regular-backup!incremental-backup. + + part_no_two=$(ls /dev/mmcblk0* | echo $a | cut -d' ' -f3) #Check for the second partition on the SD card. + if [ $part_no_2 = '' ]; then + sh /mnt/bar /sd_card/fossee-os.tar.gz | tar xzpf - -C /nand_previous + sync + else + mount /dev/mmcblk0p2 /tmp + sh /mnt/bar cp -a /tmp /nand_previous + umount /dev/mmcblk0p2 + + umount $ubuntu_dir # /bin/sh - echo "" - echo -e "\t\tInstallation complete." - sleep 2 - echo "" - umount /dev/mmcblk0p1 - printf "\t\tPress ENTER to restart.[ Please remove the SD card first ]" - read read_restart - if $read_restart; then - reboot - else - echo "It shouldn't come here" - fi + echo "" + echo -e "\t\tInstallation complete." + sleep 2 + echo "" + umount /dev/mmcblk0p1 + printf "\t\tPress ENTER to restart.[ Please remove the SD card first ]" + read read_restart + if $read_restart; then + reboot + else + echo "It shouldn't come here" + fi + } #This functions presents the user with advanecd options where he/she can backup their data from previous installation or repair the current installation through shell prompt. -- cgit From cd4bb39601c3803de352b0b958a4967e90289490 Mon Sep 17 00:00:00 2001 From: soumenganguly Date: Wed, 22 Apr 2015 10:19:09 +0530 Subject: Modified contents of recovery.sh to incorporate changes for GUI tool. --- reinstall-recovery/recovery.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reinstall-recovery/recovery.sh b/reinstall-recovery/recovery.sh index 5ff7265..ee8c115 100644 --- a/reinstall-recovery/recovery.sh +++ b/reinstall-recovery/recovery.sh @@ -110,13 +110,13 @@ installation() #Insert progress bar here. #Check the no. of partitions on the SD card. 1?regular-backup!incremental-backup. - part_no_two=$(ls /dev/mmcblk0* | echo $a | cut -d' ' -f3) #Check for the second partition on the SD card. - if [ $part_no_2 = '' ]; then + part_no_two=$(ls /dev/mmcblk0* | echo $part_no_two | cut -d' ' -f3) #Check for the second partition on the SD card. + if [ $part_no_two ='' ]; then sh /mnt/bar /sd_card/fossee-os.tar.gz | tar xzpf - -C /nand_previous sync else mount /dev/mmcblk0p2 /tmp - sh /mnt/bar cp -a /tmp /nand_previous + cp -a /tmp /nand_previous umount /dev/mmcblk0p2 umount $ubuntu_dir -- cgit From 003c1a570d419abf95e391b034987402c9bf658b Mon Sep 17 00:00:00 2001 From: soumenganguly Date: Wed, 22 Apr 2015 12:53:05 +0530 Subject: Fixed recovery.sh --- reinstall-recovery/recovery.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/reinstall-recovery/recovery.sh b/reinstall-recovery/recovery.sh index ee8c115..6064867 100644 --- a/reinstall-recovery/recovery.sh +++ b/reinstall-recovery/recovery.sh @@ -118,6 +118,7 @@ installation() mount /dev/mmcblk0p2 /tmp cp -a /tmp /nand_previous umount /dev/mmcblk0p2 + fi umount $ubuntu_dir # /bin/sh -- cgit From fe25fd5676edee05fc9d8b490e79b35e0590dfd7 Mon Sep 17 00:00:00 2001 From: soumenganguly Date: Wed, 22 Apr 2015 13:20:55 +0530 Subject: Fixed recovery.sh version0.1 --- reinstall-recovery/recovery.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reinstall-recovery/recovery.sh b/reinstall-recovery/recovery.sh index 6064867..656b454 100644 --- a/reinstall-recovery/recovery.sh +++ b/reinstall-recovery/recovery.sh @@ -110,7 +110,8 @@ installation() #Insert progress bar here. #Check the no. of partitions on the SD card. 1?regular-backup!incremental-backup. - part_no_two=$(ls /dev/mmcblk0* | echo $part_no_two | cut -d' ' -f3) #Check for the second partition on the SD card. + part_no_two=$(ls /dev/mmcblk0*) + part_no_two=$(echo $part_no_two | cut -d' ' -f3) #Check for the second partition on the SD card. if [ $part_no_two ='' ]; then sh /mnt/bar /sd_card/fossee-os.tar.gz | tar xzpf - -C /nand_previous sync -- cgit From dd3461f816b985c5a11caa897604f4acb2539419 Mon Sep 17 00:00:00 2001 From: soumenganguly Date: Thu, 23 Apr 2015 11:33:30 +0530 Subject: Added minor changes to recovery.sh --- reinstall-recovery/recovery.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reinstall-recovery/recovery.sh b/reinstall-recovery/recovery.sh index 656b454..3934a42 100644 --- a/reinstall-recovery/recovery.sh +++ b/reinstall-recovery/recovery.sh @@ -112,7 +112,7 @@ installation() part_no_two=$(ls /dev/mmcblk0*) part_no_two=$(echo $part_no_two | cut -d' ' -f3) #Check for the second partition on the SD card. - if [ $part_no_two ='' ]; then + if [ "$part_no_two" == '' ]; then sh /mnt/bar /sd_card/fossee-os.tar.gz | tar xzpf - -C /nand_previous sync else -- cgit