From 455261dc71f1db53e458196bf6e00ff766b1b7b1 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Thu, 11 Jul 2024 16:41:45 +0200 Subject: [PATCH] initramfs: break loop when decompression finishes This fixes booting with initramfs (cpio.gz based) with additional garbage added after the main initramfs image. The below message is displayed during booting. [ 0.546162] rootfs image is not initramfs (invalid magic at start of compressed archive); looks like an initrd Change-Id: Iddf10f6696c7d15ec68d29bc69614523c9fd9b65 Signed-off-by: Marek Szyprowski --- init/initramfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init/initramfs.c b/init/initramfs.c index 8d0fd94..828f7f4 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -520,6 +520,7 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) &my_inptr, error); if (res) error("decompressor failed"); + break; } else if (compress_name) { if (!message) { snprintf(msg_buf, sizeof msg_buf, -- 2.7.4