summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunmin Lee <sunm.lee@samsung.com>2017-09-18 20:16:07 +0900
committerSunmin Lee <sunm.lee@samsung.com>2017-10-18 16:42:52 +0900
commit3ebb7aeaac1b7a92c8c40574c0ced7ba2b966fe7 (patch)
treec136cffdfe1cb81a11706fc7ab4ae8744c0397e2
parent9c684f2a025023d761d433694b9d48c3ecf627af (diff)
downloadinitrd-recovery-3ebb7aeaac1b7a92c8c40574c0ced7ba2b966fe7.tar.gz
initrd-recovery-3ebb7aeaac1b7a92c8c40574c0ced7ba2b966fe7.tar.bz2
initrd-recovery-3ebb7aeaac1b7a92c8c40574c0ced7ba2b966fe7.zip
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>
-rw-r--r--packaging/initrd-recovery.spec4
-rw-r--r--src/initrd-recovery/00-initrd-recovery.list.in1
-rwxr-xr-xsrc/initrd-recovery/init14
3 files changed, 17 insertions, 2 deletions
diff --git a/packaging/initrd-recovery.spec b/packaging/initrd-recovery.spec
index 698db14..be3047e 100644
--- a/packaging/initrd-recovery.spec
+++ b/packaging/initrd-recovery.spec
@@ -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}
diff --git a/src/initrd-recovery/00-initrd-recovery.list.in b/src/initrd-recovery/00-initrd-recovery.list.in
index 76ac2dc..21a03e9 100644
--- a/src/initrd-recovery/00-initrd-recovery.list.in
+++ b/src/initrd-recovery/00-initrd-recovery.list.in
@@ -12,6 +12,7 @@ WITHLIBS="
/usr/bin/sleep
/usr/bin/sync
/usr/bin/umount
+/usr/sbin/blkid
"
# LinkFileName:Target
diff --git a/src/initrd-recovery/init b/src/initrd-recovery/init
index d696d3f..0bac889 100755
--- a/src/initrd-recovery/init
+++ b/src/initrd-recovery/init
@@ -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 /