From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5ACA713835A for ; Sun, 2 Aug 2020 22:42:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72616E0972; Sun, 2 Aug 2020 22:42:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 58DA6E0972 for ; Sun, 2 Aug 2020 22:42:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4BBB334F33B for ; Sun, 2 Aug 2020 22:42:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B86A42FE for ; Sun, 2 Aug 2020 22:42:23 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1596408014.9fdb3acb257e7103a89e8f47fe8cb23e614efe84.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_determineargs.sh gen_initramfs.sh genkernel.conf X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 9fdb3acb257e7103a89e8f47fe8cb23e614efe84 X-VCS-Branch: master Date: Sun, 2 Aug 2020 22:42:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 68299748-ea9f-4301-a25a-7eb61054313f X-Archives-Hash: 2e786a2ae38314f094100c2ae49a6fde commit: 9fdb3acb257e7103a89e8f47fe8cb23e614efe84 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Aug 2 10:44:56 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Aug 2 22:40:14 2020 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9fdb3acb Make use of expand_file() for --linuxrc option Bug: https://bugs.gentoo.org/483146 Signed-off-by: Thomas Deutschmann gentoo.org> gen_determineargs.sh | 13 +++++++++++++ gen_initramfs.sh | 13 +++++-------- genkernel.conf | 3 +++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 0a404ee..3a7882d 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -353,6 +353,7 @@ determine_real_args() { set_config_with_override BOOL RAMDISKMODULES CMD_RAMDISKMODULES "yes" set_config_with_override BOOL ALLRAMDISKMODULES CMD_ALLRAMDISKMODULES "no" set_config_with_override STRING INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY + set_config_with_override STRING LINUXRC CMD_LINUXRC set_config_with_override BOOL MOUNTBOOT CMD_MOUNTBOOT "yes" set_config_with_override BOOL BUILD_STATIC CMD_STATIC "no" set_config_with_override BOOL SAVE_CONFIG CMD_SAVE_CONFIG "yes" @@ -1145,6 +1146,18 @@ determine_real_args() { fi fi + if [ -n "${LINUXRC}" ] + then + LINUXRC=$(expand_file "${CMD_LINUXRC}" 2>/dev/null) + if [ -z "${LINUXRC}" ] + then + gen_die "--linuxrc value '${CMD_LINUXRC}' failed to expand!" + elif [ ! -e "${LINUXRC}" ] + then + gen_die "--linuxrc file '${LINUXRC}' does not exist!" + fi + fi + need_tar=yes fi diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 24ddcb5..3cd535c 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -1795,18 +1795,14 @@ append_auxilary() { done local mylinuxrc= - if [ -f "${CMD_LINUXRC}" ] + if [ -n "${LINUXRC}" ] then - mylinuxrc="${CMD_LINUXRC}" + mylinuxrc="${LINUXRC}" print_info 2 "$(get_indent 2)>> Copying user specified linuxrc '${mylinuxrc}' to '/init' ..." - cp -aL "${mylinuxrc}" "${TDIR}"/init 2>/dev/null \ - || gen_die "Failed to copy '${mylinuxrc}' to '${TDIR}/init'!" elif isTrue "${NETBOOT}" then mylinuxrc="${GK_SHARE}/netboot/linuxrc.x" print_info 2 "$(get_indent 2)>> Copying netboot specific linuxrc '${mylinuxrc}' to '/init' ..." - cp -aL "${mylinuxrc}" "${TDIR}"/init 2>/dev/null \ - || gen_die "Failed to copy '${mylinuxrc}' to '${TDIR}/init'!" else if [ -f "${GK_SHARE}/arch/${ARCH}/linuxrc" ] then @@ -1816,10 +1812,11 @@ append_auxilary() { fi print_info 2 "$(get_indent 2)>> Copying '${mylinuxrc}' to '/init' ..." - cp -aL "${mylinuxrc}" "${TDIR}"/init 2>/dev/null \ - || gen_die "Failed to copy '${mylinuxrc}' to '${TDIR}/init'!" fi + cp -aL "${mylinuxrc}" "${TDIR}"/init 2>/dev/null \ + || gen_die "Failed to copy '${mylinuxrc}' to '${TDIR}/init'!" + # Make sure it's executable chmod 0755 "${TDIR}"/init || gen_die "Failed to chmod of '${TDIR}/init' to 0755!" diff --git a/genkernel.conf b/genkernel.conf index 93cf8e7..654f185 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -363,6 +363,9 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux" #MODULES_group1="some-module" #MODULES_group2="" # Load no modules for this group +# Override the default used linuxrc script. +#LINUXRC="/path/to/custom/linuxrc" + # Archive file created using tar containing modules after # the callbacks have run #MODULESPACKAGE="/path/to/file.tar.xz"