summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2014-12-09 15:50:05 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-19 18:07:59 +0000
commit31952101f38275e0c4a8e7d6a7c5ebad452a1b5b (patch)
treec3a85eef12741184979904597c43c8fd9a9fc60d /meta
parent25a3ab182265c11a023ca3cb118c84ca12c8706b (diff)
downloadpoky-31952101f38275e0c4a8e7d6a7c5ebad452a1b5b.tar.gz
image_types.bbclass: Populate cpio /init as symlink
For cpio/ramfs the kernel will first attempt to execute /init and will emit the following error as the file is empty: Failed to execute /init (error -13) If /sbin/init exists symlink to it so the kernel can immediately start the correct init executable instead of an empty file. (From OE-Core rev: 3505558e067fdde4ab7aaaf3c50886f292d7c166) Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image_types.bbclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 9aee7458bc..1b8ceeebed 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -70,7 +70,11 @@ IMAGE_CMD_cpio () {
70 (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) 70 (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
71 if [ ! -e ${IMAGE_ROOTFS}/init ]; then 71 if [ ! -e ${IMAGE_ROOTFS}/init ]; then
72 mkdir -p ${WORKDIR}/cpio_append 72 mkdir -p ${WORKDIR}/cpio_append
73 touch ${WORKDIR}/cpio_append/init 73 if [ -e ${IMAGE_ROOTFS}/sbin/init -o -L ${IMAGE_ROOTFS}/sbin/init ]; then
74 ln -sf /sbin/init ${WORKDIR}/cpio_append/init
75 else
76 touch ${WORKDIR}/cpio_append/init
77 fi
74 (cd ${WORKDIR}/cpio_append && echo ./init | cpio -oA -H newc -F ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) 78 (cd ${WORKDIR}/cpio_append && echo ./init | cpio -oA -H newc -F ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
75 fi 79 fi
76} 80}