diff options
Diffstat (limited to 'meta/recipes-core/initrdscripts/files')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-live.sh | 10 |
1 files changed, 9 insertions, 1 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 | ||