]> code.ossystems Code Review - openembedded-core.git/commitdiff
core-image-tiny-initramfs: Fix error message shown after a successful initrd boot
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>
Tue, 20 Dec 2016 23:08:40 +0000 (23:08 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 31 Jan 2017 14:40:19 +0000 (14:40 +0000)
When booting core-image-tiny-initramfs, since we want to live on initrd,
on purpose, we never find a rootfs image to switch root to,
this causes init to show an error as it would with other images,
this patch replaces the message shown to the user, avoiding confusion
when it was indeed a successful boot.

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
meta/recipes-core/images/core-image-tiny-initramfs.bb

index 846d58930e363e66fb6eb82031d5c5102d0bcf83..184727ddf7a533bdea59731f86626f5dc60c44c4 100644 (file)
@@ -28,3 +28,15 @@ BAD_RECOMMENDATIONS += "busybox-syslog"
 
 # Use the same restriction as initramfs-live-install
 COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
+python tinyinitrd () {
+  # Modify our init file so the user knows we drop to shell prompt on purpose
+  newinit = None
+  with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
+    newinit = init.read()
+    newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
+  with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
+    init.write(newinit)
+}
+
+IMAGE_PREPROCESS_COMMAND += "tinyinitrd;"