X-Original-To: alpine-devel@lists.alpinelinux.org Received: from hydrogenium.shiz.me (hydrogenium.shiz.me [62.210.12.63]) by lists.alpinelinux.org (Postfix) with ESMTP id DB17B5C441E for ; Thu, 17 Nov 2016 01:53:05 +0000 (GMT) Received: from localhost (::ffff:80.112.172.223 [IPv6:::ffff:80.112.172.223]) by hydrogenium.shiz.me (OpenSMTPD) with ESMTPSA id 21e3cc39 TLS protoversion=TLSv1.2 ciphersuite=ECDHE-RSA-AES256-GCM-SHA384 verify=NO for ; Thu, 17 Nov 2016 01:52:44 +0000 (UTC) From: Shiz To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH 1/3] mkinitfs: add option to avoid including kernel-specific files Date: Thu, 17 Nov 2016 02:52:50 +0100 Message-Id: <20161117015252.27549-1-hi@shiz.me> X-Mailer: git-send-email 2.10.0 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: This allows one to make a generic initramfs that doesn't require a running kernel identical to the one used for booting, if said kernel already includes everything it needs to function (such as compiling everything in instead of using kernel modules). --- mkinitfs.in | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mkinitfs.in b/mkinitfs.in index d69ccc5..a860cbc 100755 --- a/mkinitfs.in +++ b/mkinitfs.in @@ -102,6 +102,7 @@ find_kmods() { } initfs_kmods() { + [ -z "$nokernel" ] || return local glob= file= files= dirs= rm -rf "$tmpdir"/lib/modules # make sure we have modules.dep @@ -123,6 +124,7 @@ initfs_kmods() { } initfs_firmware() { + [ -z "$nokernel" ] || return rm -rf "$tmpdir"/lib/firmware mkdir -p "$tmpdir"/lib/firmware find "$tmpdir"/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort -u | while read FW; do @@ -149,7 +151,7 @@ initfs_cpio() { usage() { cat <