From 6540ecdb3713dd4422e558ac83e621008f21f42c Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 9 Dec 2014 15:50:05 +1000 Subject: 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) (From OE-Core rev: 40bf6d0d71bd534fadcbc07b6fbba856e50bc534) Signed-off-by: Nathan Rossi Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster Signed-off-by: Richard Purdie --- meta/classes/image_types.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'meta') diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 6c3a89eefc..8e33214955 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass @@ -70,7 +70,11 @@ IMAGE_CMD_cpio () { (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) if [ ! -e ${IMAGE_ROOTFS}/init ]; then mkdir -p ${WORKDIR}/cpio_append - touch ${WORKDIR}/cpio_append/init + if [ -e ${IMAGE_ROOTFS}/sbin/init -o -L ${IMAGE_ROOTFS}/sbin/init ]; then + ln -sf /sbin/init ${WORKDIR}/cpio_append/init + else + touch ${WORKDIR}/cpio_append/init + fi (cd ${WORKDIR}/cpio_append && echo ./init | cpio -oA -H newc -F ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) fi } -- cgit v1.2.3-54-g00ecf