diff options
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-live.sh | 23 | ||||
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb | 14 |
2 files changed, 30 insertions, 7 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh index eb5ab5b7a5..737dae4cbc 100644 --- a/meta/recipes-core/initrdscripts/files/init-live.sh +++ b/meta/recipes-core/initrdscripts/files/init-live.sh | |||
@@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img" | |||
7 | MOUNT="/bin/mount" | 7 | MOUNT="/bin/mount" |
8 | UMOUNT="/bin/umount" | 8 | UMOUNT="/bin/umount" |
9 | ISOLINUX="" | 9 | ISOLINUX="" |
10 | UNIONFS="no" | ||
10 | 11 | ||
11 | early_setup() { | 12 | early_setup() { |
12 | mkdir /proc | 13 | mkdir /proc |
@@ -89,17 +90,31 @@ case $label in | |||
89 | mkdir $ROOT_MOUNT | 90 | mkdir $ROOT_MOUNT |
90 | mknod /dev/loop0 b 7 0 2>/dev/null | 91 | mknod /dev/loop0 b 7 0 2>/dev/null |
91 | 92 | ||
92 | if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then | 93 | |
93 | fatal "Couldnt mount rootfs image" | 94 | if [ "$UNIONFS" = "yes" ]; then |
95 | mkdir /rootfs-tmp | ||
96 | |||
97 | if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then | ||
98 | fatal "Could not mount rootfs image" | ||
99 | else | ||
100 | mkdir /cow | ||
101 | mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow | ||
102 | mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT | ||
103 | boot_live_root | ||
104 | fi | ||
94 | else | 105 | else |
95 | boot_live_root | 106 | if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then |
107 | fatal "Could not mount rootfs image" | ||
108 | else | ||
109 | boot_live_root | ||
110 | fi | ||
96 | fi | 111 | fi |
97 | ;; | 112 | ;; |
98 | install) | 113 | install) |
99 | if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then | 114 | if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then |
100 | ./install.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode | 115 | ./install.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode |
101 | else | 116 | else |
102 | fatal "Couldnt find install script" | 117 | fatal "Could not find install script" |
103 | fi | 118 | fi |
104 | 119 | ||
105 | # If we're getting here, we failed... | 120 | # If we're getting here, we failed... |
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 e85a0e1189..8f7511eadd 100644 --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb | |||
@@ -2,14 +2,22 @@ DESCRIPTION = "A live image init script" | |||
2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
4 | RDEPENDS = "udev" | 4 | RDEPENDS = "udev" |
5 | DEPENDS = "virtual/kernel" | ||
5 | SRC_URI = "file://init-live.sh" | 6 | SRC_URI = "file://init-live.sh" |
6 | 7 | ||
7 | PR = "r7" | 8 | PR = "r9" |
8 | 9 | ||
10 | do_compile() { | ||
11 | if grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then | ||
12 | sed -i 's/UNIONFS="no"/UNIONFS="yes"/g' ${WORKDIR}/init-live.sh | ||
13 | fi | ||
14 | } | ||
15 | |||
9 | do_install() { | 16 | do_install() { |
10 | install -m 0755 ${WORKDIR}/init-live.sh ${D}/init | 17 | install -m 0755 ${WORKDIR}/init-live.sh ${D}/init |
11 | } | 18 | } |
12 | 19 | ||
13 | inherit allarch | ||
14 | |||
15 | FILES_${PN} += " /init " | 20 | FILES_${PN} += " /init " |
21 | |||
22 | # Due to kernel depdendency | ||
23 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||