Mount inform partition at ramdisk-recovery 90/156390/1 accepted/tizen/unified/20171020.091842 submit/tizen/20171020.023748
authorSunmin Lee <sunm.lee@samsung.com>
Mon, 18 Sep 2017 11:16:07 +0000 (20:16 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 18 Oct 2017 07:42:52 +0000 (16:42 +0900)
In case of using inform partition for reboot parameter,
the kernel requires inform path in ramdisk-recovery, too.
The inform partition should be mounted in recovery mode
to clean up reboot parameter properly at the end of each mode.

Change-Id: Ia955cf71b282d64e7e729a46d61259bf8bbd8cf3
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
packaging/initrd-recovery.spec
src/initrd-recovery/00-initrd-recovery.list.in
src/initrd-recovery/init

index 698db14..be3047e 100644 (file)
@@ -1,7 +1,7 @@
 Name:           initrd-recovery
 Summary:        Tools for system recovery
-Version:        0.1.4
-Release:        5
+Version:        0.1.5
+Release:        0
 Group:          System/Utilities
 License:        Apache-2.0
 ExclusiveArch:  %{arm}
index 76ac2dc..21a03e9 100644 (file)
@@ -12,6 +12,7 @@ WITHLIBS="
 /usr/bin/sleep
 /usr/bin/sync
 /usr/bin/umount
+/usr/sbin/blkid
 "
 
 # LinkFileName:Target
index d696d3f..0bac889 100755 (executable)
@@ -4,6 +4,7 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
 
 FAKE_ROOT=/system
 FAKE_ROOT_RO=/system-ro
+INFORM_PATH=/mnt/inform
 
 STATUS_DIR=${FAKE_ROOT}/opt/data/recovery
 STATUS_FILE=${STATUS_DIR}/RW.STATUS
@@ -14,6 +15,7 @@ MKDIR="/bin/mkdir"
 MOUNT="/bin/mount"
 UMOUNT="/bin/umount"
 REBOOT="/sbin/reboot"
+BLKID="/usr/sbin/blkid"
 
 #------------------------------------------------
 #       mount_partitions
@@ -30,6 +32,17 @@ mount_partitions() {
 }
 
 #------------------------------------------------
+#       mount_inform
+#------------------------------------------------
+mount_inform() {
+    PART_INFORM=$("$BLKID" -L "inform" -o device)
+    if [ "z$PART_INFORM" != "z" ]; then
+        "$MKDIR" -p ${INFORM_PATH}
+        "$MOUNT" -t ext4 ${PART_INFORM} ${INFORM_PATH}
+    fi
+}
+
+#------------------------------------------------
 #       do_reboot
 #------------------------------------------------
 do_reboot() {
@@ -49,6 +62,7 @@ do_reboot() {
 echo "You entered into /sbin/init on initrd"
 
 mount_partitions
+mount_inform
 
 cd /