Commit ff1522bb authored by David Engraf's avatar David Engraf Committed by Linus Torvalds

initramfs: cleanup incomplete rootfs

Unpacking an external initrd may fail e.g.  not enough memory.  This
leads to an incomplete rootfs because some files might be extracted
already.  Fixed by cleaning the rootfs so the kernel is not using an
incomplete rootfs.

Link: default avatarDavid Engraf <>
Cc: Dominik Brodowski <>
Cc: Greg Kroah-Hartman <>
Cc: Philippe Ombredanne <>
Cc: Arnd Bergmann <>
Cc: Luc Van Oostenryck <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent b058809b
......@@ -550,7 +550,6 @@ static void __init free_initrd(void)
initrd_end = 0;
#define BUF_SIZE 1024
static void __init clean_rootfs(void)
......@@ -597,7 +596,6 @@ static void __init clean_rootfs(void)
static int __init populate_rootfs(void)
......@@ -640,8 +638,10 @@ static int __init populate_rootfs(void)
printk(KERN_INFO "Unpacking initramfs...\n");
err = unpack_to_rootfs((char *)initrd_start,
initrd_end - initrd_start);
if (err)
if (err) {
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment