diff options
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-live.sh | 10 | ||||
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh index 28219641a4..d852c5737f 100644 --- a/meta/recipes-core/initrdscripts/files/init-live.sh +++ b/meta/recipes-core/initrdscripts/files/init-live.sh | |||
@@ -8,6 +8,8 @@ MOUNT="/bin/mount" | |||
8 | UMOUNT="/bin/umount" | 8 | UMOUNT="/bin/umount" |
9 | ISOLINUX="" | 9 | ISOLINUX="" |
10 | 10 | ||
11 | ROOT_DISK="" | ||
12 | |||
11 | # Copied from initramfs-framework. The core of this script probably should be | 13 | # Copied from initramfs-framework. The core of this script probably should be |
12 | # turned into initramfs-framework modules to reduce duplication. | 14 | # turned into initramfs-framework modules to reduce duplication. |
13 | udev_daemon() { | 15 | udev_daemon() { |
@@ -80,6 +82,10 @@ boot_live_root() { | |||
80 | udevadm settle --timeout=3 --quiet | 82 | udevadm settle --timeout=3 --quiet |
81 | killall "${_UDEV_DAEMON##*/}" 2>/dev/null | 83 | killall "${_UDEV_DAEMON##*/}" 2>/dev/null |
82 | 84 | ||
85 | # Allow for identification of the real root even after boot | ||
86 | mkdir -p ${ROOT_MOUNT}/media/realroot | ||
87 | mount -n --move "/run/media/${ROOT_DISK}" ${ROOT_MOUNT}/media/realroot | ||
88 | |||
83 | # Move the mount points of some filesystems over to | 89 | # Move the mount points of some filesystems over to |
84 | # the corresponding directories under the real root filesystem. | 90 | # the corresponding directories under the real root filesystem. |
85 | for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do | 91 | for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do |
@@ -116,10 +122,12 @@ do | |||
116 | for i in `ls /run/media 2>/dev/null`; do | 122 | for i in `ls /run/media 2>/dev/null`; do |
117 | if [ -f /run/media/$i/$ROOT_IMAGE ] ; then | 123 | if [ -f /run/media/$i/$ROOT_IMAGE ] ; then |
118 | found="yes" | 124 | found="yes" |
125 | ROOT_DISK="$i" | ||
119 | break | 126 | break |
120 | elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then | 127 | elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then |
121 | found="yes" | 128 | found="yes" |
122 | ISOLINUX="isolinux" | 129 | ISOLINUX="isolinux" |
130 | ROOT_DISK="$i" | ||
123 | break | 131 | break |
124 | fi | 132 | fi |
125 | done | 133 | done |
@@ -150,7 +158,7 @@ mount_and_boot() { | |||
150 | mkdir $ROOT_MOUNT | 158 | mkdir $ROOT_MOUNT |
151 | mknod /dev/loop0 b 7 0 2>/dev/null | 159 | mknod /dev/loop0 b 7 0 2>/dev/null |
152 | 160 | ||
153 | if ! mount -o rw,loop,noatime,nodiratime /run/media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then | 161 | if ! mount -o rw,loop,noatime,nodiratime /run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then |
154 | fatal "Could not mount rootfs image" | 162 | fatal "Could not mount rootfs image" |
155 | fi | 163 | fi |
156 | 164 | ||
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb index 2d378e2101..ac54902415 100644 --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb | |||
@@ -5,7 +5,7 @@ DEPENDS = "virtual/kernel" | |||
5 | RDEPENDS_${PN} = "udev udev-extraconf" | 5 | RDEPENDS_${PN} = "udev udev-extraconf" |
6 | SRC_URI = "file://init-live.sh" | 6 | SRC_URI = "file://init-live.sh" |
7 | 7 | ||
8 | PR = "r11" | 8 | PR = "r12" |
9 | 9 | ||
10 | do_install() { | 10 | do_install() { |
11 | install -m 0755 ${WORKDIR}/init-live.sh ${D}/init | 11 | install -m 0755 ${WORKDIR}/init-live.sh ${D}/init |
@@ -13,5 +13,5 @@ do_install() { | |||
13 | 13 | ||
14 | FILES_${PN} += " /init " | 14 | FILES_${PN} += " /init " |
15 | 15 | ||
16 | # Due to kernel depdendency | 16 | # Due to kernel dependency |
17 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" |