summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-live.sh23
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb14
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"
7MOUNT="/bin/mount" 7MOUNT="/bin/mount"
8UMOUNT="/bin/umount" 8UMOUNT="/bin/umount"
9ISOLINUX="" 9ISOLINUX=""
10UNIONFS="no"
10 11
11early_setup() { 12early_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"
2LICENSE = "MIT" 2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4RDEPENDS = "udev" 4RDEPENDS = "udev"
5DEPENDS = "virtual/kernel"
5SRC_URI = "file://init-live.sh" 6SRC_URI = "file://init-live.sh"
6 7
7PR = "r7" 8PR = "r9"
8 9
10do_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
9do_install() { 16do_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
13inherit allarch
14
15FILES_${PN} += " /init " 20FILES_${PN} += " /init "
21
22# Due to kernel depdendency
23PACKAGE_ARCH = "${MACHINE_ARCH}"