public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-03-28 23:43 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-03-28 23:43 UTC (permalink / raw
  To: gentoo-commits

commit:     0994a48e690b48bd4f9da0e35c585dd2b78214be
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 28 23:19:56 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Mar 28 23:19:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0994a48e

documentation: mark --[no-]compress-initrd as deprecated

Let's move user to --[no-]compress-initramfs for more consistency.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt |  5 ++++-
 gen_cmdline.sh      | 12 +++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 54ea00a..d77b6ef 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -425,9 +425,12 @@ OUTPUT SETTINGS
     Wrap initramfs using mkimage for u-boot boots. Please note that only
     certain compression types are supported by mkimage (see manpage).
 
-*--*[*no-*]*compress-initramfs*, *--*[*no-*]*compress-initrd*::
+*--*[*no-*]*compress-initramfs*::
     Compresses or does not compress the generated initramfs.
 
+*--*[*no-*]*compress-initrd*::
+    Deprecated alias for *--*[*no-*]*compress-initramfs*.
+
 *--compress-initramfs-type*=<arg>::
     Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop).
     "Best" causes selection of the best available algorithm that is selected

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 86150fa..5b7aafa 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -196,8 +196,8 @@ longusage() {
   echo "				Compress initramfs"
   echo "	--no-compress-initramfs"
   echo "				Do not compress initramfs"
-  echo "	--compress-initrd	Compress initrd"
-  echo "	--no-compress-initrd	Do not compress initrd"
+  echo "	--compress-initrd	Deprecated alias for --compress-initramfs"
+  echo "	--no-compress-initrd	Deprecated alias for --no-compress-initramfs"
   echo "	--compress-initramfs-type=<arg>"
   echo "				Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)"
   echo "	--strip=(all|kernel|modules|none)"
@@ -717,10 +717,16 @@ parse_cmdline() {
 			CMD_WRAP_INITRD=`parse_optbool "$*"`
 			print_info 2 "CMD_WRAP_INITRD=${CMD_WRAP_INITRD}"
 			;;
-		--compress-initramfs|--no-compress-initramfs|--compress-initrd|--no-compress-initrd)
+		--compress-initramfs|--no-compress-initramfs)
 			CMD_COMPRESS_INITRD=`parse_optbool "$*"`
 			print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}"
 			;;
+		--compress-initrd|--no-compress-initrd)
+			CMD_COMPRESS_INITRD=`parse_optbool "$*"`
+			print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}"
+			echo
+			print_warning 1 "Please use --[no-]compress-initramfs, as --[no-]compress-initrd is deprecated."
+			;;
 		--compress-initramfs-type=*|--compress-initrd-type=*)
 			CMD_COMPRESS_INITRD_TYPE="${*#*=}"
 			print_info 2 "CMD_COMPRESS_INITRD_TYPE: ${CMD_COMPRESS_INITRD_TYPE}"


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2023-08-08  5:33 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2023-08-08  5:33 UTC (permalink / raw
  To: gentoo-commits

commit:     d5f8f9c175332873a139e5d89197acca314aaf8c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  8 05:33:15 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug  8 05:33:15 2023 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d5f8f9c1

Fix build->built

Signed-off-by: Sam James <sam <AT> gentoo.org>

 doc/genkernel.8.txt | 2 +-
 gen_configkernel.sh | 2 +-
 genkernel           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 3a1ae58..6f9a64f 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -198,7 +198,7 @@ specified.
 *--*[*no-*]*module-rebuild*::
     Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild"
     to build out-of-tree modules when possible, i.e. when non-static
-    kernel and modules will be build, installed, *--kernel-modules-prefix* is not set.
+    kernel and modules will be built, installed, *--kernel-modules-prefix* is not set.
 
 NOTE: Command can be customized using '--module-rebuild-cmd' command-line
 argument or 'MODULEREBUILD_CMD' in '/etc/genkernel.conf'.

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 44a06b3..ebb3a44 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -167,7 +167,7 @@ set_initramfs_compression_method() {
 		local cfg_DECOMPRESS_SUPPORT=$(kconfig_get_opt "${kernel_config}" "CONFIG_RD_${COMPRESS_INITRD_TYPE}")
 		if [[ "${cfg_DECOMPRESS_SUPPORT}" != "y" ]]
 		then
-			gen_die "The kernel config '${kernel_config}' this initramfs will be build for cannot decompress set --compress-initrd-type '${COMPRESS_INITRD_TYPE}'!"
+			gen_die "The kernel config '${kernel_config}' this initramfs will be built for cannot decompress set --compress-initrd-type '${COMPRESS_INITRD_TYPE}'!"
 		fi
 
 		# If we are not building kernel, there is no point in

diff --git a/genkernel b/genkernel
index 0e3fc55..b32d0a3 100755
--- a/genkernel
+++ b/genkernel
@@ -207,7 +207,7 @@ fi
 if isTrue "${KERNCACHE_IS_VALID}" && ! isTrue "${CMD_INSTALL}" && ! isTrue "${BUILD_RAMDISK}"
 then
 	error_msg="Nothing to do: Selected action does not include building initramfs."
-	error_msg+=" Because kerncache is valid, no kernel will be build."
+	error_msg+=" Because kerncache is valid, no kernel will be built."
 	error_msg+=" However, due to set --no-install option, we will not even install kernel binary from kerncache."
 	gen_die "${error_msg}"
 fi


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2023-07-05 17:41 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2023-07-05 17:41 UTC (permalink / raw
  To: gentoo-commits

commit:     57a4a1e250dfcc37f0169d3dd9d4a6a7d9308e67
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  5 17:40:44 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul  5 17:40:44 2023 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=57a4a1e2

Don't require obsolete /var/lib/module-rebuild/moduledb to exist

See 71110f715fc46f148280b52b297121786504a325 and d9687a4df038382187300d6f44230661ff5bc377
in gentoo.git.

Bug: https://bugs.gentoo.org/909722
Signed-off-by: Sam James <sam <AT> gentoo.org>

 doc/genkernel.8.txt | 4 +---
 gen_compile.sh      | 7 -------
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index a5c0b92..3a1ae58 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -198,9 +198,7 @@ specified.
 *--*[*no-*]*module-rebuild*::
     Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild"
     to build out-of-tree modules when possible, i.e. when non-static
-    kernel and modules will be build, installed,
-    *--kernel-modules-prefix* is not set, '/var/lib/module-rebuild/moduledb' exists
-    and is not empty.
+    kernel and modules will be build, installed, *--kernel-modules-prefix* is not set.
 
 NOTE: Command can be customized using '--module-rebuild-cmd' command-line
 argument or 'MODULEREBUILD_CMD' in '/etc/genkernel.conf'.

diff --git a/gen_compile.sh b/gen_compile.sh
index 9af128b..6db69ec 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -27,13 +27,6 @@ compile_external_modules() {
 		return
 	fi
 
-	local modulesdb_file="/var/lib/module-rebuild/moduledb"
-	if [ ! -s "${modulesdb_file}" ]
-	then
-		print_info 2 "$(get_indent 1)>> '${modulesdb_file}' does not exist or is empty; Skipping '${MODULEREBUILD_CMD}' ..."
-		return
-	fi
-
 	local -x KV_OUT_DIR="${KERNEL_OUTPUTDIR}"
 
 	print_info 1 "$(get_indent 1)>> Compiling out-of-tree module(s) ..."


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2021-07-06 21:27 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2021-07-06 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     a30b7139cfad7261c84345b136c671744e64ec29
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  6 20:22:12 2021 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Jul  6 20:59:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=a30b7139

gen_cmdline.sh: parse_cmdline(): Allow to override AS, AR, NM & Co via CLI

Bug: https://bugs.gentoo.org/786405
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt | 44 +++++++++++++++++++++++++++++++-
 gen_cmdline.sh      | 72 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 genkernel.conf      | 38 +++++++++++++++++++---------
 3 files changed, 135 insertions(+), 19 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index aa18496..262027b 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -246,15 +246,36 @@ LOW-LEVEL COMPILATION OPTIONS
 *--kernel-as*=<assembler>::
     Assembler to use for the kernel compilation.
 
+*--kernel-ar*=<archiver>::
+    Archiver to use for the kernel compilation.
+
 *--kernel-cc*=<compiler>::
     Compiler to use for the kernel compilation (e.g. distcc).
 
 *--kernel-ld*=<linker>::
     Linker to use for the kernel compilation.
 
-*--kernel-make*=<makeprg>::
+*--kernel-nm*=<nm>::
+    NM utility to use for the kernel compilation.
+
+*--kernel-make*=<makeprog>::
     GNU Make to use for the kernel compilation.
 
+*--kernel-objcopy*=<objcopyprog>::
+    Objcopy utility to use for the kernel compilation.
+
+*--kernel-objdump*=<objdumpprog>::
+    Objdump utility to use for the kernel compilation.
+
+*--kernel-ranlib*=<ranlibprog>::
+    Ranlib utility to use for the kernel compilation.
+
+*--kernel-readelf*=<readelfprog>::
+    Readelf utility to use for the kernel compilation.
+
+*--kernel-strip*=<stripprog>::
+    Strip utility to use for the kernel compilation.
+
 *--kernel-target*=<t>::
     Override default make target (bzImage), note that values
     like *--kernel-target=* are also valid (useful for Xen
@@ -272,6 +293,9 @@ LOW-LEVEL COMPILATION OPTIONS
 *--utils-as*=<assembler>::
     Assembler to use for utilities.
 
+*--utils-ar*=<archiver>::
+    Archiver to use for utilities.
+
 *--utils-cflags*=<cflags>::
     C compiler flags used to compile utilities.
 
@@ -287,6 +311,24 @@ LOW-LEVEL COMPILATION OPTIONS
 *--utils-make*=<makeprog>::
     GNU Make to use for utilities.
 
+*--utils-nm*=<nm>::
+    NM utility to use for utilities.
+
+*--utils-objcopy*=<objcopyprog>::
+    Objcopy utility to use for utilities.
+
+*--utils-objdump*=<objdumpprog>::
+    Objdump utility to use for utilities.
+
+*--utils-ranlib*=<ranlibprog>::
+    Ranlib utility to use for utilities.
+
+*--utils-readelf*=<readelfprof>::
+    Readelf utility to use for utilities.
+
+*--utils-strip*=<striprog>::
+    Strip utility to use for utilities.
+
 *--makeopts*=<makeopts>::
     GNU Make options such as -j2, etc.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 33bf1c5..b35750d 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -87,18 +87,22 @@ longusage() {
   echo "	--cross-compile=<target-triplet>"
   echo "				Target triple (i.e. aarch64-linux-gnu) to build for"
   echo "	--kernel-as=<assembler>	Assembler to use for kernel"
+  echo "	--kernel-ar=<archiver>	Archiver to use for kernel"
   echo "	--kernel-cc=<compiler>	Compiler to use for kernel (e.g. distcc)"
   echo "	--kernel-ld=<linker>	Linker to use for kernel"
+  echo "	--kernel-nm=<nm>	NM utility to use for kernel"
   echo "	--kernel-make=<makeprg> GNU Make to use for kernel"
   echo "	--kernel-target=<t>	Override default make target (bzImage)"
   echo "	--kernel-binary=<path>	Override default kernel binary path (arch/foo/boot/bar)"
   echo "	--kernel-outputdir=<path>"
   echo "				Save output files outside the source tree"
   echo "	--utils-as=<assembler>	Assembler to use for utils"
+  echo "	--utils-ar=<archiver>	Archiver to use for utils"
   echo "	--utils-cc=<compiler>	C Compiler to use for utilities"
   echo "	--utils-cxx=<compiler>	C++ Compiler to use for utilities"
   echo "	--utils-cflags=<cflags> C compiler flags used to compile utilities"
   echo "	--utils-ld=<linker>	Linker to use for utils"
+  echo "	--utils-nm=<nm>		NM utility to use for utils"
   echo "	--utils-make=<makeprog>	GNU Make to use for utils"
   echo "	--makeopts=<makeopts>	Make options such as -j2, etc ..."
   echo "	--mountboot		Mount BOOTDIR automatically if mountable"
@@ -288,6 +292,14 @@ parse_cmdline() {
 			CMD_CROSS_COMPILE="${*#*=}"
 			print_info 3 "CMD_CROSS_COMPILE: ${CMD_CROSS_COMPILE}"
 			;;
+		--kernel-as=*)
+			CMD_KERNEL_AS="${*#*=}"
+			print_info 3 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
+			;;
+		--kernel-ar=*)
+			CMD_KERNEL_AR="${*#*=}"
+			print_info 3 "CMD_KERNEL_AR: ${CMD_KERNEL_AR}"
+			;;
 		--kernel-cc=*)
 			CMD_KERNEL_CC="${*#*=}"
 			print_info 3 "CMD_KERNEL_CC: ${CMD_KERNEL_CC}"
@@ -296,14 +308,34 @@ parse_cmdline() {
 			CMD_KERNEL_LD="${*#*=}"
 			print_info 3 "CMD_KERNEL_LD: ${CMD_KERNEL_LD}"
 			;;
-		--kernel-as=*)
-			CMD_KERNEL_AS="${*#*=}"
-			print_info 3 "CMD_KERNEL_AS: ${CMD_KERNEL_AS}"
+		--kernel-nm=*)
+			CMD_KERNEL_NM="${*#*=}"
+			print_info 3 "CMD_KERNEL_NM: ${CMD_KERNEL_NM}"
 			;;
 		--kernel-make=*)
 			CMD_KERNEL_MAKE="${*#*=}"
 			print_info 3 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
 			;;
+		--kernel-objcopy=*)
+			CMD_KERNEL_OBJCOPY="${*#*=}"
+			print_info 3 "CMD_KERNEL_OBJCOPY: ${CMD_KERNEL_OBJCOPY}"
+			;;
+		--kernel-objdump=*)
+			CMD_KERNEL_OBJDUMP="${*#*=}"
+			print_info 3 "CMD_KERNEL_OBJDUMP: ${CMD_KERNEL_OBJDUMP}"
+			;;
+		--kernel-ranlib=*)
+			CMD_KERNEL_RANLIB="${*#*=}"
+			print_info 3 "CMD_KERNEL_RANLIB: ${CMD_KERNEL_RANLIB}"
+			;;
+		--kernel-readelf=*)
+			CMD_KERNEL_READELF="${*#*=}"
+			print_info 3 "CMD_KERNEL_READELF: ${CMD_KERNEL_READELF}"
+			;;
+		--kernel-strip=*)
+			CMD_KERNEL_STRIP="${*#*=}"
+			print_info 3 "CMD_KERNEL_STRIP: ${CMD_KERNEL_STRIP}"
+			;;
 		--kernel-target=*)
 			KERNEL_MAKE_DIRECTIVE_OVERRIDE="${*#*=}"
 			print_info 3 "KERNEL_MAKE_DIRECTIVE_OVERRIDE: ${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
@@ -316,6 +348,14 @@ parse_cmdline() {
 			CMD_KERNEL_OUTPUTDIR="${*#*=}"
 			print_info 3 "CMD_KERNEL_OUTPUTDIR: ${CMD_KERNEL_OUTPUTDIR}"
 			;;
+		--utils-as=*)
+			CMD_UTILS_AS="${*#*=}"
+			print_info 3 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
+			;;
+		--utils-ar=*)
+			CMD_UTILS_AR="${*#*=}"
+			print_info 3 "CMD_UTILS_AR: ${CMD_UTILS_AR}"
+			;;
 		--utils-cc=*)
 			CMD_UTILS_CC="${*#*=}"
 			print_info 3 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
@@ -332,14 +372,34 @@ parse_cmdline() {
 			CMD_UTILS_LD="${*#*=}"
 			print_info 3 "CMD_UTILS_LD: ${CMD_UTILS_LD}"
 			;;
-		--utils-as=*)
-			CMD_UTILS_AS="${*#*=}"
-			print_info 3 "CMD_UTILS_AS: ${CMD_UTILS_AS}"
+		--utils-nm=*)
+			CMD_UTILS_NM="${*#*=}"
+			print_info 3 "CMD_UTILS_NM: ${CMD_UTILS_NM}"
 			;;
 		--utils-make=*)
 			CMD_UTILS_MAKE="${*#*=}"
 			print_info 3 "CMD_UTILS_MAKE: ${CMD_UTILS_MAKE}"
 			;;
+		--utils-objcopy=*)
+			CMD_UTILS_OBJCOPY="${*#*=}"
+			print_info 3 "CMD_UTILS_OBJCOPY: ${CMD_UTILS_OBJCOPY}"
+			;;
+		--utils-objdump=*)
+			CMD_UTILS_OBJDUMP="${*#*=}"
+			print_info 3 "CMD_UTILS_OBJDUMP: ${CMD_UTILS_OBJDUMP}"
+			;;
+		--utils-ranlib=*)
+			CMD_UTILS_RANLIB="${*#*=}"
+			print_info 3 "CMD_UTILS_RANLIB: ${CMD_UTILS_RANLIB}"
+			;;
+		--utils-readelf=*)
+			CMD_UTILS_READELF="${*#*=}"
+			print_info 3 "CMD_UTILS_READELF: ${CMD_UTILS_READELF}"
+			;;
+		--utils-strip=*)
+			CMD_UTILS_STRIP="${*#*=}"
+			print_info 3 "CMD_UTILS_STRIP: ${CMD_UTILS_STRIP}"
+			;;
 		--makeopts=*)
 			CMD_MAKEOPTS="${*#*=}"
 			print_info 3 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"

diff --git a/genkernel.conf b/genkernel.conf
index 6c350a6..7d10496 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -193,23 +193,34 @@ NOCOLOR="false"
 
 # =========Low Level Compile Settings=========
 #
-# GNU Make to use for kernel.  See also the --kernel-make command line option.
-#KERNEL_MAKE="make"
+# Assembler to use for the kernel.  See also the --kernel-as command line
+# option.
+#KERNEL_AS="as"
+
+# Archiver to use for the kernel.  See also the --kernel-ar command line
+# option.
+#KERNEL_AR="ar"
 
 # Compiler to use for the kernel (e.g. distcc).  See also the --kernel-cc
 # command line option.
 #KERNEL_CC="gcc"
 
-# Assembler to use for the kernel.  See also the --kernel-as command line
-# option.
-#KERNEL_AS="as"
-
 # Linker to use for the kernel.  See also the --kernel-ld command line option.
 #KERNEL_LD="ld"
 
-# GNU Make to use for the utilities.  See also the --utils-make command line
+# NM utility to use for the kernel.  See also the --kernel-nm command line option.
+#KERNEL_NM="nm"
+
+# GNU Make to use for kernel.  See also the --kernel-make command line option.
+#KERNEL_MAKE="make"
+
+# Assembler to use for the utilities.  See also the --utils-as command line
 # option.
-#UTILS_MAKE="make"
+#UTILS_AS="as"
+
+# Archiver to use for the utilities.  See also the --utils-ar command line
+# option.
+#UTILS_AR="ar"
 
 # C Compiler to use for the utilities (e.g. distcc).  See also the --utils-cc
 # command line option.
@@ -219,14 +230,17 @@ NOCOLOR="false"
 # command line option.
 #UTILS_CXX="g++"
 
-# Assembler to use for the utilities.  See also the --utils-as command line
-# option.
-#UTILS_AS="as"
-
 # Linker to use for the utilities.  See also the --utils-ld command line
 # option.
 #UTILS_LD="ld"
 
+# NM utility to use for the utilities.  See also the --utils-nm command line option.
+#UTILS_NM="nm"
+
+# GNU Make to use for the utilities.  See also the --utils-make command line
+# option.
+#UTILS_MAKE="make"
+
 # Target triple (i.e. aarch64-linux-gnu) to build for. If you do not
 # cross-compile, leave blank for auto detection.
 #CROSS_COMPILE=""


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2020-08-02 22:42 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2020-08-02 22:42 UTC (permalink / raw
  To: gentoo-commits

commit:     6882485e665f8b6eb388696dfc0fd983faa9d922
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  2 10:40:47 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Aug  2 22:40:14 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6882485e

Rename INSTALL_MOD_PATH option to KERNEL_MODULES_PREFIX

Before this change we had different names in config file
and command-line for the same thing.

With this change we have one option named KERNEL_MODULES_PREFIX and its
corresponding --kernel-modules-prefix command-line argument.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt  |  6 +++---
 gen_cmdline.sh       |  9 +++++----
 gen_compile.sh       | 16 ++++++++--------
 gen_determineargs.sh |  2 +-
 gen_initramfs.sh     |  4 ++--
 gen_moddeps.sh       |  6 +++---
 gen_package.sh       | 13 ++++++-------
 genkernel            | 15 ++++++++-------
 genkernel.conf       |  3 +--
 9 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 50f1471..8c527b0 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -198,8 +198,8 @@ specified.
 *--*[*no-*]*module-rebuild*::
     Runs, or does not run "emerge --ignore-default-opts --buildpkg=n --usepkg=n --quiet-build=y @module-rebuild"
     to build out-of-tree modules when possible, i.e. when non-static
-    kernel and modules will be build, installed, no custom
-    'INSTALL_MOD_PATH' is set, '/var/lib/module-rebuild/moduledb' exists
+    kernel and modules will be build, installed,
+    *--kernel-modules-prefix* is not set, '/var/lib/module-rebuild/moduledb' exists
     and is not empty.
 
 NOTE: Command can be customized using '--module-rebuild-cmd' command-line
@@ -231,7 +231,7 @@ KERNEL LOCATIONS
     Use the special value 'default' to force usage of default kernel
     config.
 
-*--module-prefix*=<dir>::
+*--kernel-modules-prefix*=<dir>::
     Prefix to kernel module destination, modules will be installed in
     '<prefix>/lib/modules'.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index f502350..5cc0d87 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -80,7 +80,8 @@ longusage() {
   echo "	--kernel-localversion=<...>"
   echo "				Set kernel CONFIG_LOCALVERSION, use special value"
   echo "				'UNSET' to unset any set LOCALVERSION"
-  echo "	--module-prefix=<dir>	Prefix to kernel module destination, modules"
+  echo "	--kernel-modules-prefix=<dir>"
+  echo "				Prefix to kernel module destination, modules"
   echo "				will be installed in <prefix>/lib/modules"
   echo "  Low-Level Compile settings"
   echo "	--cross-compile=<target-triplet>"
@@ -680,9 +681,9 @@ parse_cmdline() {
 			CMD_KERNEL_LOCALVERSION="${*#*=}"
 			print_info 3 "CMD_KERNEL_LOCALVERSION: ${CMD_KERNEL_LOCALVERSION}"
 			;;
-		--module-prefix=*)
-			CMD_INSTALL_MOD_PATH="${*#*=}"
-			print_info 3 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"
+		--kernel-modules-prefix=*)
+			CMD_KERNEL_MODULES_PREFIX="${*#*=}"
+			print_info 3 "CMD_KERNEL_MODULES_PREFIX: ${CMD_KERNEL_MODULES_PREFIX}"
 			;;
 		--cachedir=*)
 			CACHE_DIR="${*#*=}"

diff --git a/gen_compile.sh b/gen_compile.sh
index 0fa6912..d755150 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -20,10 +20,10 @@ compile_external_modules() {
 		return
 	fi
 
-	if [ -n "${INSTALL_MOD_PATH}" ]
+	if [ -n "${KERNEL_MODULES_PREFIX}" ]
 	then
 		# emerge would install to a different location
-		print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping '${MODULEREBUILD_CMD}' ..."
+		print_warning 1 "$(get_indent 1)>> KERNEL_MODULES_PREFIX set; Skipping '${MODULEREBUILD_CMD}' ..."
 		return
 	fi
 
@@ -182,7 +182,7 @@ compile_modules() {
 
 	compile_generic modules kernel
 
-	[ -n "${INSTALL_MOD_PATH}" ] && local -x INSTALL_MOD_PATH="${INSTALL_MOD_PATH}"
+	[ -n "${KERNEL_MODULES_PREFIX}" ] && local -x INSTALL_MOD_PATH="${KERNEL_MODULES_PREFIX%/}"
 	if [ "${CMD_STRIP_TYPE}" == "all" -o "${CMD_STRIP_TYPE}" == "modules" ]
 	then
 		print_info 1 "$(get_indent 1)>> Installing ${KV} modules (and stripping) ..."
@@ -195,10 +195,10 @@ compile_modules() {
 	compile_generic "modules_install" kernel
 
 	print_info 1 "$(get_indent 1)>> Generating module dependency data ..."
-	if [ -n "${INSTALL_MOD_PATH}" ]
+	if [ -n "${KERNEL_MODULES_PREFIX}" ]
 	then
-		depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map -b "${INSTALL_MOD_PATH}" ${KV} \
-			|| gen_die "depmod (INSTALL_MOD_PATH=${INSTALL_MOD_PATH}) failed!"
+		depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map -b "${KERNEL_MODULES_PREFIX%/}" ${KV} \
+			|| gen_die "depmod (INSTALL_MOD_PATH=${KERNEL_MODULES_PREFIX%/}) failed!"
 	else
 		depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map ${KV} \
 			|| gen_die "depmod failed!"
@@ -250,8 +250,8 @@ compile_kernel() {
 			print_info 1 "$(get_indent 1)>> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y) ..."
 		else
 			print_info 1 "$(get_indent 1)>> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y ..."
-			[ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
-			[ "${INSTALL_FW_PATH}" != '' ] && export INSTALL_FW_PATH
+			[ -n "${KERNEL_MODULES_PREFIX}" ] && local -x INSTALL_MOD_PATH="${KERNEL_MODULES_PREFIX%/}"
+			[ -n "${INSTALL_FW_PATH}" ] && export INSTALL_FW_PATH
 			MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel
 		fi
 	elif [ ${KV_NUMERIC} -lt 4014 ]

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index d9056e4..0a404ee 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -300,6 +300,7 @@ determine_real_args() {
 	set_config_with_override STRING TMPDIR                                CMD_TMPDIR                                "/var/tmp/genkernel"
 	set_config_with_override STRING LOGFILE                               CMD_LOGFILE                               "/var/log/genkernel.conf"
 	set_config_with_override STRING KERNEL_DIR                            CMD_KERNEL_DIR                            "${DEFAULT_KERNEL_SOURCE}"
+	set_config_with_override STRING KERNEL_MODULES_PREFIX                 CMD_KERNEL_MODULES_PREFIX
 	set_config_with_override BOOL   KERNEL_SOURCES                        CMD_KERNEL_SOURCES                        "yes"
 	set_config_with_override STRING INITRAMFS_FILENAME                    CMD_INITRAMFS_FILENAME                    "${DEFAULT_INITRAMFS_FILENAME}"
 	set_config_with_override STRING INITRAMFS_SYMLINK_NAME                CMD_INITRAMFS_SYMLINK_NAME                "${DEFAULT_INITRAMFS_SYMLINK_NAME}"
@@ -356,7 +357,6 @@ determine_real_args() {
 	set_config_with_override BOOL   BUILD_STATIC                          CMD_STATIC                                "no"
 	set_config_with_override BOOL   SAVE_CONFIG                           CMD_SAVE_CONFIG                           "yes"
 	set_config_with_override BOOL   SYMLINK                               CMD_SYMLINK                               "no"
-	set_config_with_override STRING INSTALL_MOD_PATH                      CMD_INSTALL_MOD_PATH
 	set_config_with_override BOOL   OLDCONFIG                             CMD_OLDCONFIG                             "yes"
 	set_config_with_override BOOL   SANDBOX                               CMD_SANDBOX                               "yes"
 	set_config_with_override BOOL   SSH                                   CMD_SSH                                   "no"

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index d1a0e33..24ddcb5 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1680,9 +1680,9 @@ append_modules() {
 
 	print_info 2 "$(get_indent 2)modules: >> Copying modules to initramfs ..."
 
-	if [ -n "${INSTALL_MOD_PATH}" ]
+	if [ -n "${KERNEL_MODULES_PREFIX}" ]
 	then
-		modules_srcdir="${INSTALL_MOD_PATH%/}${modules_srcdir}"
+		modules_srcdir="${KERNEL_MODULES_PREFIX%/}${modules_srcdir}"
 	fi
 
 	if [ ! -d "${modules_srcdir}" ]

diff --git a/gen_moddeps.sh b/gen_moddeps.sh
index 5e6c980..fd7800f 100755
--- a/gen_moddeps.sh
+++ b/gen_moddeps.sh
@@ -4,7 +4,7 @@
 gen_dep_list() {
 	if isTrue "${ALLRAMDISKMODULES}"
 	then
-		strip_mod_paths $(find "${INSTALL_MOD_PATH}/lib/modules/${KV}" -name "*$(modules_kext)") | sort
+		strip_mod_paths $(find "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}" -name "*$(modules_kext)") | sort
 	else
 		rm -f "${TEMP}/moddeps" >/dev/null
 
@@ -48,9 +48,9 @@ gen_deps() {
 
 modules_dep_list() {
 	KEXT=$(modules_kext)
-	if [ -f ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep ]
+	if [ -f "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}/modules.dep" ]
 	then
-		cat ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep | grep ${1}${KEXT}\: | cut -d\:  -f2
+		cat "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}/modules.dep" | grep ${1}${KEXT}\: | cut -d\:  -f2
 	fi
 }
 

diff --git a/gen_package.sh b/gen_package.sh
index 5182d51..c49141f 100755
--- a/gen_package.sh
+++ b/gen_package.sh
@@ -89,14 +89,14 @@ gen_minkernpackage() {
 }
 
 gen_modulespackage() {
-	if [ -d "${INSTALL_MOD_PATH}/lib/modules/${KV}" ]
+	if [ -d "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}" ]
 	then
 		print_info 1 "modulespkg: >> Creating modules package in '${MODULESPACKAGE}' ..."
 		rm -rf "${TEMP}/modulespackage" >/dev/null 2>&1
 		mkdir "${TEMP}/modulespackage" || gen_die "Failed to create '${TEMP}/modulespackage'!"
 
 		mkdir -p "${TEMP}/modulespackage/lib/modules" || gen_die "Failed to create '${TEMP}/modulespackage/lib/modules'!"
-		cp -arP "${INSTALL_MOD_PATH}/lib/modules/${KV}" "${TEMP}/modulespackage/lib/modules"
+		cp -arP "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}" "${TEMP}/modulespackage/lib/modules"
 
 		cd "${TEMP}/modulespackage" || gen_die "Failed to chdir to '${TEMP}/modulespackage'!"
 
@@ -106,7 +106,7 @@ gen_modulespackage() {
 		print_info 3 "COMMAND: ${tar_cmd[*]}" 1 0 1
 		eval "${tar_cmd[@]}" || gen_die "Failed to create compressed modules package '${MODULESPACKAGE}'!"
 	else
-		print_info 1 "modulespkg: >> '${INSTALL_MOD_PATH}/lib/modules/${KV}' was not found; Skipping creation of modules package in '${MODULESPACKAGE}' ..."
+		print_info 1 "modulespkg: >> '${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}' was not found; Skipping creation of modules package in '${MODULESPACKAGE}' ..."
 	fi
 }
 
@@ -165,9 +165,9 @@ gen_kerncache() {
 	mkdir -p "${TEMP}/kerncache/lib/modules/" \
 		|| gen_die "Failed to create '${TEMP}/kerncache/lib/modules'"
 
-	if [ -d "${INSTALL_MOD_PATH}/lib/modules/${KV}" ]
+	if [ -d "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}" ]
 	then
-		cp -arP "${INSTALL_MOD_PATH}/lib/modules/${KV}" "${TEMP}/kerncache/lib/modules"
+		cp -arP "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}" "${TEMP}/kerncache/lib/modules"
 	fi
 
 	cd "${TEMP}/kerncache" || gen_die "Failed to chdir to '${TEMP}/kerncache'!"
@@ -204,8 +204,7 @@ gen_kerncache_extract_kernel() {
 }
 
 gen_kerncache_extract_modules() {
-	local modules_dir=/lib
-	[ -n "${INSTALL_MOD_PATH}" ] && modules_dir="${INSTALL_MOD_PATH}/lib"
+	local modules_dir="${KERNEL_MODULES_PREFIX%/}/lib"
 
 	if [ ! -d "${modules_dir}" ]
 	then

diff --git a/genkernel b/genkernel
index efa4360..a155a9c 100755
--- a/genkernel
+++ b/genkernel
@@ -38,6 +38,7 @@ if [ ${#GK_SETTINGS[@]} -gt 0 ]
 then
 	GK_SETTINGS+=( CALLBACK )
 	GK_SETTINGS+=( EXTRAVERSION )
+	GK_SETTINGS+=( INSTALL_MOD_PATH )
 	GK_SETTINGS+=( MOD_INSTALL )
 
 	for GK_SETTING in "${GK_SETTINGS[@]}"
@@ -295,18 +296,18 @@ then
 
 	if ! isTrue "${BUILD_STATIC}"
 	then
-		if ! isTrue "${CMD_INSTALL}" && [ -z "${INSTALL_MOD_PATH}" ]
+		if ! isTrue "${CMD_INSTALL}" && [ -z "${KERNEL_MODULE_PREFIX}" ]
 		then
-			# We have to set $INSTALL_MOD_PATH to avoid installing files
+			# We have to set $KERNEL_MODULE_PREFIX to avoid installing files
 			# to /lib/modules because --no-install was set
-			INSTALL_MOD_PATH="$(mktemp -d -p "${TEMP}" kerncache-modules_XXXXXXX 2>/dev/null)"
-			if [ -z "${INSTALL_MOD_PATH}" ]
+			KERNEL_MODULE_PREFIX="$(mktemp -d -p "${TEMP}" kerncache-modules_XXXXXXX 2>/dev/null)"
+			if [ -z "${KERNEL_MODULE_PREFIX}" ]
 			then
-				gen_die "Internal error: Variable 'INSTALL_MOD_PATH' is empty; mktemp() for kerncache modules failed!"
+				gen_die "Internal error: Variable 'KERNEL_MODULE_PREFIX' is empty; mktemp() for kerncache modules failed!"
 			else
 				print_info 5 '' 1 0
-				print_info 5 "INSTALL_MOD_PATH set to '${INSTALL_MOD_PATH}' because --kerncache is used but --no-install was set ..."
-				mkdir "${INSTALL_MOD_PATH}/lib" || gen_die "Failed to create '${INSTALL_MOD_PATH}/lib'!"
+				print_info 5 "KERNEL_MODULE_PREFIX set to '${KERNEL_MODULE_PREFIX}' because --kerncache is used but --no-install was set ..."
+				mkdir "${KERNEL_MODULE_PREFIX}/lib" || gen_die "Failed to create '${KERNEL_MODULE_PREFIX}/lib'!"
 			fi
 		fi
 

diff --git a/genkernel.conf b/genkernel.conf
index 43415ef..93cf8e7 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -322,8 +322,7 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux"
 
 # Prefix to kernel module destination, modules
 # will be installed in <prefix>/lib/modules
-# (.conf equivalent of --module-prefix=<dir>)
-#INSTALL_MOD_PATH=""
+#KERNEL_MODULES_PREFIX=""
 
 
 # =========MISC INITRAMFS CONFIGURATION============


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-07-21 18:38 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-07-21 18:38 UTC (permalink / raw
  To: gentoo-commits

commit:     47462f4dc4a9164cd546d6e2be953f38a450996d
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 21 18:28:51 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 18:31:50 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=47462f4d

Rename --tempdir option to --tmpdir to match used variable name

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt | 2 +-
 gen_cmdline.sh      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index e741a72..72029d6 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -398,7 +398,7 @@ INTERNALS
 *--*[*no-*]*clear-cachedir*::
     Clears or skips clearing all files in cache location on genkernel start.
 
-*--tempdir*=<dir>::
+*--tmpdir*=<dir>::
     Sets genkernel's temporary working directory to <dir>.
 
 *--*[*no-*]*postclear*::

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 247a674..a05e277 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -172,7 +172,7 @@ longusage() {
   echo "				if you want to force rebuild of included tools"
   echo "				like BusyBox, DMRAID, GnuPG, LVM, MDADM ..."
   echo "	--no-clear-cachedir	Do not clean up on genkernel start"
-  echo "	--tempdir=<dir>		Location of genkernel's temporary directory"
+  echo "	--tmpdir=<dir>		Location of genkernel's temporary directory"
   echo "	--postclear		Clear all tmp files and caches after genkernel has run"
   echo "	--no-postclear		Do not clean up after genkernel has run"
   echo "  Output Settings"
@@ -593,7 +593,7 @@ parse_cmdline() {
 			CMD_STATIC=$(parse_optbool "$*")
 			print_info 3 "CMD_STATIC: ${CMD_STATIC}"
 			;;
-		--tempdir=*)
+		--tmpdir=*)
 			CMD_TMPDIR="${*#*=}"
 			print_info 3 "CMD_TMPDIR: ${CMD_TMPDIR}"
 			;;


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-07-21 16:26 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-07-21 16:26 UTC (permalink / raw
  To: gentoo-commits

commit:     b0ca48130c96f34e61a8bb2ea4c169f5efd89c94
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 20 22:11:31 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 16:09:35 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b0ca4813

Add --no-sandbox option

This option is useful when you are calling genkernel within a sandboxed
environment, i.e. when using genkernel within an ebuild.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt  |   3 +
 gen_cmdline.sh       |   6 ++
 gen_determineargs.sh |  11 +++
 gen_funcs.sh         | 192 +++++++++++++++++++++++++++------------------------
 genkernel            |  16 +++++
 genkernel.conf       |   3 +
 6 files changed, 141 insertions(+), 90 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 3b96d8e..e04e800 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -327,6 +327,9 @@ INITIALIZATION
 *--*[*no-*]*iscsi*::
     Includes or excludes iSCSI support.
 
+*--*[*no-*]*sandbox*::
+    Enables or disables sandbox-ing when building initramfs.
+
 *--*[*no-*]*ssh*::
     Includes or excludes SSH (dropbear) support for remote LUKS keys.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index b17e35c..a8700cd 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -133,6 +133,8 @@ longusage() {
   echo "	--no-multipath		Exclude Multipath support"
   echo "	--iscsi			Include iSCSI support"
   echo "	--no-iscsi		Exclude iSCSI support"
+  echo "	--sandbox		Enable sandbox-ing when building initramfs"
+  echo "	--no-sandbox		Disable sandbox-ing when building initramfs"
   echo "	--ssh			Include SSH (dropbear) support"
   echo "	--no-ssh		Exclude SSH (dropbear) support"
   echo "	--ssh-authorized-keys-file=<file>"
@@ -440,6 +442,10 @@ parse_cmdline() {
 			CMD_HYPERV=$(parse_optbool "$*")
 			print_info 3 "CMD_HYPERV: ${CMD_HYPERV}"
 			;;
+		--sandbox|--no-sandbox)
+			CMD_SANDBOX=$(parse_optbool "$*")
+			print_info 3 "CMD_SANDBOX: ${CMD_SANDBOX}"
+			;;
 		--ssh|--no-ssh)
 			CMD_SSH=$(parse_optbool "$*")
 			print_info 3 "CMD_SSH: ${CMD_SSH}"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 52de7a3..e2eafbb 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -145,6 +145,7 @@ determine_real_args() {
 	set_config_with_override BOOL   SYMLINK                  CMD_SYMLINK                  "no"
 	set_config_with_override STRING INSTALL_MOD_PATH         CMD_INSTALL_MOD_PATH
 	set_config_with_override BOOL   OLDCONFIG                CMD_OLDCONFIG                "yes"
+	set_config_with_override BOOL   SANDBOX                  CMD_SANDBOX                  "yes"
 	set_config_with_override BOOL   SSH                      CMD_SSH                      "no"
 	set_config_with_override STRING SSH_AUTHORIZED_KEYS_FILE CMD_SSH_AUTHORIZED_KEYS_FILE "/etc/dropbear/authorized_keys"
 	set_config_with_override STRING SSH_HOST_KEYS            CMD_SSH_HOST_KEYS            "create"
@@ -527,6 +528,16 @@ determine_real_args() {
 		then
 			gen_die "'lddtree -l ${lddtree_testfile}' failed -- cannot generate initramfs without working lddtree!"
 		fi
+
+		SANDBOX_COMMAND=
+		if isTrue "${SANDBOX}"
+		then
+			SANDBOX_COMMAND="$(which sandbox)"
+			if [ -z "${SANDBOX_COMMAND}" ]
+			then
+				gen_die "Sandbox not found. Is sys-apps/sandbox installed?"
+			fi
+		fi
 	fi
 
 	MICROCODE=${MICROCODE,,}

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 9aa4e24..33b05b7 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -543,38 +543,41 @@ dropbear_create_key() {
 	[[ ${#} -ne 2 ]] \
 		&& gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly two arguments (${#} given)!"
 
-	if ! hash sandbox &>/dev/null
-	then
-		gen_die "Sandbox not found. Please install sys-apps/sandbox!"
-	fi
-
 	local key_file=${1}
 	local command=${2}
 	local key_type=$(dropbear_get_key_type_from_filename "${key_file}")
 
 	local -a envvars=(
-		GK_SHARE="${GK_SHARE}"
-		LOGLEVEL="${LOGLEVEL}"
-		LOGFILE="${LOGFILE}"
-		NOCOLOR="${NOCOLOR}"
-		TEMP="${TEMP}"
-		SANDBOX_WRITE="${LOGFILE}:${TEMP}"
+		"GK_SHARE='${GK_SHARE}'"
+		"LOGLEVEL='${LOGLEVEL}'"
+		"LOGFILE='${LOGFILE}'"
+		"NOCOLOR='${NOCOLOR}'"
+		"TEMP='${TEMP}'"
 	)
 
 	envvars+=(
-		DROPBEAR_COMMAND="${command}"
-		DROPBEAR_KEY_FILE="${key_file}"
-		DROPBEAR_KEY_TYPE="${key_type}"
+		"DROPBEAR_COMMAND='${command}'"
+		"DROPBEAR_KEY_FILE='${key_file}'"
+		"DROPBEAR_KEY_TYPE='${key_type}'"
 	)
 
+	if isTrue "${SANDBOX}"
+	then
+		envvars+=( "SANDBOX_WRITE='${LOGFILE}:${TEMP}'" )
+	fi
+
 	# set up worker signal handler
 	local error_msg_detail="Failed to create dropbear key '${key_file}'!"
 	local error_msg="gen_worker.sh aborted: ${error_msg_detail}"
 	trap "gen_die \"${error_msg}\"" SIGABRT SIGHUP SIGQUIT SIGINT SIGTERM
 
-	env -i \
-		"${envvars[@]}" \
-		sandbox "${GK_SHARE}"/gen_worker.sh dropbear 2>&1
+	local dropbear_command=( "env -i" )
+	dropbear_command+=( "${envvars[*]}" )
+	dropbear_command+=( "${SANDBOX_COMMAND}" )
+	dropbear_command+=( "${GK_SHARE}/gen_worker.sh" )
+	dropbear_command+=( "dropbear" )
+	dropbear_command+=( "2>&1" )
+	eval "${dropbear_command[@]}"
 
 	local RET=$?
 
@@ -613,11 +616,6 @@ dropbear_generate_key_info_file() {
 	[[ ${#} -ne 3 ]] \
 		&& gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly three arguments (${#} given)!"
 
-	if ! hash sandbox &>/dev/null
-	then
-		gen_die "Sandbox not found. Please install sys-apps/sandbox!"
-	fi
-
 	local command=${1}
 	local key_info_file=${2}
 	local initramfs_dropbear_dir=${3}
@@ -625,29 +623,37 @@ dropbear_generate_key_info_file() {
 	local key_type=$(dropbear_get_key_type_from_filename "${key_file}")
 
 	local -a envvars=(
-		GK_SHARE="${GK_SHARE}"
-		LOGLEVEL="${LOGLEVEL}"
-		LOGFILE="${LOGFILE}"
-		NOCOLOR="${NOCOLOR}"
-		TEMP="${TEMP}"
-		SANDBOX_WRITE="${LOGFILE}:${TEMP}"
+		"GK_SHARE='${GK_SHARE}'"
+		"LOGLEVEL='${LOGLEVEL}'"
+		"LOGFILE='${LOGFILE}'"
+		"NOCOLOR='${NOCOLOR}'"
+		"TEMP='${TEMP}'"
 	)
 
 	envvars+=(
-		DROPBEAR_COMMAND="${command}"
-		DROPBEAR_KEY_FILE="${key_file}"
-		DROPBEAR_KEY_TYPE="${key_type}"
-		DROPBEAR_KEY_INFO_FILE="${key_info_file}"
+		"DROPBEAR_COMMAND='${command}'"
+		"DROPBEAR_KEY_FILE='${key_file}'"
+		"DROPBEAR_KEY_TYPE='${key_type}'"
+		"DROPBEAR_KEY_INFO_FILE='${key_info_file}'"
 	)
 
+	if isTrue "${SANDBOX}"
+	then
+		envvars+=( SANDBOX_WRITE="${LOGFILE}:${TEMP}" )
+	fi
+
 	# set up worker signal handler
 	local error_msg_detail="Failed to extract dropbear key information from '${key_file}'!"
 	local error_msg="gen_worker.sh aborted: ${error_msg_detail}"
 	trap "gen_die \"${error_msg}\"" SIGABRT SIGHUP SIGQUIT SIGINT SIGTERM
 
-	env -i \
-		"${envvars[@]}" \
-		sandbox "${GK_SHARE}"/gen_worker.sh dropbear 2>&1
+	local dropbear_command=( "env -i" )
+	dropbear_command+=( "${envvars[*]}" )
+	dropbear_command+=( "${SANDBOX_COMMAND}" )
+	dropbear_command+=( "${GK_SHARE}/gen_worker.sh" )
+	dropbear_command+=( "dropbear" )
+	dropbear_command+=( "2>&1" )
+	eval "${dropbear_command[@]}"
 
 	local RET=$?
 
@@ -1100,11 +1106,6 @@ gkbuild() {
 	[[ ${#} -gt 7 ]] \
 		&& gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes at most six arguments (${#} given)!"
 
-	if ! hash sandbox &>/dev/null
-	then
-		gen_die "Sandbox not found. Please install sys-apps/sandbox!"
-	fi
-
 	local PKG=${1}
 	local VERSION=${2}
 	local SRCDIR=${3}
@@ -1136,41 +1137,40 @@ gkbuild() {
 	fi
 
 	local -a envvars=(
-		GK_SHARE="${GK_SHARE}"
-		LOGLEVEL="${LOGLEVEL}"
-		LOGFILE="${LOGFILE}"
-		NOCOLOR="${NOCOLOR}"
-		SANDBOX_WRITE="${LOGFILE}:${TEMP}"
-		TEMP="${TEMP}"
-		TMPDIR="${TEMP}"
+		"GK_SHARE='${GK_SHARE}'"
+		"LOGLEVEL='${LOGLEVEL}'"
+		"LOGFILE='${LOGFILE}'"
+		"NOCOLOR='${NOCOLOR}'"
+		"TEMP='${TEMP}'"
+		"TMPDIR='${TEMP}'"
 	)
 
 	envvars+=(
-		GKPKG_PN="${PKG}"
-		GKPKG_PV="${VERSION}"
-		GKPKG_SRCDIR="${SRCDIR}"
-		GKPKG_SRCTAR="${SRCTAR}"
-		GKPKG_BINPKG="${BINPKG}"
-		GKPKG_DEPS="${DEPS}"
+		"GKPKG_PN='${PKG}'"
+		"GKPKG_PV='${VERSION}'"
+		"GKPKG_SRCDIR='${SRCDIR}'"
+		"GKPKG_SRCTAR='${SRCTAR}'"
+		"GKPKG_BINPKG='${BINPKG}'"
+		"GKPKG_DEPS='${DEPS}'"
 	)
 
 	envvars+=(
-		CFLAGS="${CMD_UTILS_CFLAGS}"
-		CXXFLAGS="${CMD_UTILS_CFLAGS}"
-		CBUILD="${CBUILD}"
-		CHOST="${CHOST}"
-		AR="$(tc-getAR)"
-		AS="$(tc-getAS)"
-		CC="$(tc-getCC)"
-		CPP="$(tc-getCPP)"
-		CXX="$(tc-getCXX)"
-		LD="$(tc-getLD)"
-		NM="$(tc-getNM)"
-		MAKE="${CMD_UTILS_MAKE}"
-		OBJCOPY="$(tc-getOBJCOPY)"
-		OBJDUMP="$(tc-getOBJDUMP)"
-		RANLIB="$(tc-getRANLIB)"
-		STRIP="$(tc-getSTRIP)"
+		"CFLAGS='${CMD_UTILS_CFLAGS}'"
+		"CXXFLAGS='${CMD_UTILS_CFLAGS}'"
+		"CBUILD='${CBUILD}'"
+		"CHOST='${CHOST}'"
+		"AR='$(tc-getAR)'"
+		"AS='$(tc-getAS)'"
+		"CC='$(tc-getCC)'"
+		"CPP='$(tc-getCPP)'"
+		"CXX='$(tc-getCXX)'"
+		"LD='$(tc-getLD)'"
+		"NM='$(tc-getNM)'"
+		"MAKE='${CMD_UTILS_MAKE}'"
+		"OBJCOPY='$(tc-getOBJCOPY)'"
+		"OBJDUMP='$(tc-getOBJDUMP)'"
+		"RANLIB='$(tc-getRANLIB)'"
+		"STRIP='$(tc-getSTRIP)'"
 	)
 
 	if [ ${NICE} -ne 0 ]
@@ -1179,17 +1179,26 @@ gkbuild() {
 	else
 		NICEOPTS=""
 	fi
-	envvars+=( NICEOPTS="${NICEOPTS}" )
+	envvars+=( "NICEOPTS='${NICEOPTS}'" )
 
-	envvars+=( MAKEOPTS="${MAKEOPTS}" )
+	envvars+=( "MAKEOPTS='${MAKEOPTS}'" )
+
+	if isTrue "${SANDBOX}"
+	then
+		envvars+=( "SANDBOX_WRITE='${LOGFILE}:${TEMP}'" )
+	fi
 
 	# set up gkbuild signal handler
 	local error_msg="gen_worker.sh aborted: Failed to compile ${PKG}-${VERSION}!"
 	trap "gen_die \"${error_msg}\"" SIGABRT SIGHUP SIGQUIT SIGINT SIGTERM
 
-	env -i \
-		"${envvars[@]}" \
-		sandbox "${GK_SHARE}"/gen_worker.sh build 2>&1
+	local build_command=( "env -i" )
+	build_command+=( "${envvars[*]}" )
+	build_command+=( "${SANDBOX_COMMAND}" )
+	build_command+=( "${GK_SHARE}/gen_worker.sh" )
+	build_command+=( "build" )
+	build_command+=( "2>&1" )
+	eval "${build_command[@]}"
 
 	local RET=$?
 
@@ -1211,36 +1220,39 @@ unpack() {
 	[[ ${#} -ne 2 ]] \
 		&& gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly two arguments (${#} given)!"
 
-	if ! hash sandbox &>/dev/null
-	then
-		gen_die "Sandbox not found. Please install sys-apps/sandbox!"
-	fi
-
 	local unpack_file=${1}
 	local unpack_dir=${2}
 
 	local -a envvars=(
-		GK_SHARE="${GK_SHARE}"
-		LOGLEVEL="${LOGLEVEL}"
-		LOGFILE="${LOGFILE}"
-		NOCOLOR="${NOCOLOR}"
-		TEMP="${TEMP}"
-		SANDBOX_WRITE="${LOGFILE}:${TEMP}"
+		"GK_SHARE='${GK_SHARE}'"
+		"LOGLEVEL='${LOGLEVEL}'"
+		"LOGFILE='${LOGFILE}'"
+		"NOCOLOR='${NOCOLOR}'"
+		"TEMP='${TEMP}'"
 	)
 
 	envvars+=(
-		UNPACK_FILE="${unpack_file}"
-		UNPACK_DIR="${unpack_dir}"
+		"UNPACK_FILE='${unpack_file}'"
+		"UNPACK_DIR='${unpack_dir}'"
 	)
 
+	if isTrue "${SANDBOX}"
+	then
+		envvars+=( "SANDBOX_WRITE='${LOGFILE}:${TEMP}'" )
+	fi
+
 	# set up unpack signal handler
 	local error_msg_detail="Failed to unpack '${unpack_file}' to '${unpack_dir}'!"
 	local error_msg="gen_worker.sh aborted: ${error_msg_detail}"
 	trap "gen_die \"${error_msg}\"" SIGABRT SIGHUP SIGQUIT SIGINT SIGTERM
 
-	env -i \
-		"${envvars[@]}" \
-		sandbox "${GK_SHARE}"/gen_worker.sh unpack 2>&1
+	local unpack_command=( "env -i" )
+	unpack_command+=( "${envvars[*]}" )
+	unpack_command+=( "${SANDBOX_COMMAND}" )
+	unpack_command+=( "${GK_SHARE}/gen_worker.sh" )
+	unpack_command+=( "unpack" )
+	unpack_command+=( "2>&1" )
+	eval "${unpack_command[@]}"
 
 	local RET=$?
 

diff --git a/genkernel b/genkernel
index 8886938..751b7af 100755
--- a/genkernel
+++ b/genkernel
@@ -112,6 +112,22 @@ done
 
 determine_real_args
 
+if isTrue "${BUILD_RAMDISK}" && ! isTrue "${SANDBOX}"
+then
+	print_warning 1 "${BOLD}WARNING:${NORMAL} Will build initramfs ${BOLD}without${NORMAL} sandbox support " 0
+
+	SANDBOX_WARNING_TIMER=0
+	while [[ ${SANDBOX_WARNING_TIMER} -lt 5 ]]
+	do
+		printf '.'
+		sleep 1
+		let SANDBOX_WARNING_TIMER=${SANDBOX_WARNING_TIMER}+1
+	done
+
+	print_warning 1 '' 1 0
+	print_warning 1 '' 1 0
+fi
+
 print_info 2 "Sourcing default modules_load from '${GK_SHARE}/defaults/modules_load' ..."
 source "${GK_SHARE}/defaults/modules_load" || gen_die "Could not read '${GK_SHARE}/defaults/modules_load'!"
 

diff --git a/genkernel.conf b/genkernel.conf
index cad0297..b4f1dbe 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -148,6 +148,9 @@ NOCOLOR="false"
 # Possible values: empty/"no", "grub", "grub2"
 #BOOTLOADER="no"
 
+# Use sandbox when building initramfs
+#SANDBOX="yes"
+
 # Add boot splash using splashutils
 #SPLASH="no"
 


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-07-21 16:26 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-07-21 16:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c85901916e603cac8f92f176a84fbb03d0f0bc6d
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 21 13:03:19 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 16:09:45 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c8590191

Add --kernel-localversion option

This option will set/unset kernel option CONFIG_LOCALVERSION.

Closes: https://bugs.gentoo.org/521774
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt  |  4 ++++
 gen_cmdline.sh       |  7 +++++++
 gen_configkernel.sh  | 19 +++++++++++++++++++
 gen_determineargs.sh | 19 +++++++++++++++++++
 genkernel.conf       |  4 ++++
 5 files changed, 53 insertions(+)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index e04e800..15beee6 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -124,6 +124,10 @@ KERNEL CONFIGURATION
 *--*[*no-*]*virtio*::
     Adds, or skip adding VirtIO support to kernel configuration.
 
+*--kernel-localversion*=<...>::
+    Set kernel option CONFIG_LOCALVERSION. Use special value "UNSET" to
+    unset any already set LOCALVERSION.
+
 
 KERNEL COMPILATION
 ~~~~~~~~~~~~~~~~~~

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index a8700cd..17d66d2 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -75,6 +75,9 @@ longusage() {
   echo "				Kernel configuration file to use for compilation; Use"
   echo "				'default' to explicitly start from scratch using"
   echo "				genkernel defaults"
+  echo "	--kernel-localversion=<...>"
+  echo "				Set kernel CONFIG_LOCALVERSION, use special value"
+  echo "				'UNSET' to unset any set LOCALVERSION"
   echo "	--module-prefix=<dir>	Prefix to kernel module destination, modules"
   echo "				will be installed in <prefix>/lib/modules"
   echo "  Low-Level Compile settings"
@@ -625,6 +628,10 @@ parse_cmdline() {
 			CMD_KERNEL_CONFIG="${*#*=}"
 			print_info 3 "CMD_KERNEL_CONFIG: ${CMD_KERNEL_CONFIG}"
 			;;
+		--kernel-localversion=*)
+			CMD_KERNEL_LOCALVERSION="${*#*=}"
+			print_info 3 "CMD_KERNEL_LOCALVERSION: ${CMD_KERNEL_LOCALVERSION}"
+			;;
 		--module-prefix=*)
 			CMD_INSTALL_MOD_PATH="${*#*=}"
 			print_info 3 "CMD_INSTALL_MOD_PATH: ${CMD_INSTALL_MOD_PATH}"

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 503812c..a5ad953 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -193,6 +193,25 @@ config_kernel() {
 		fi
 	fi
 
+	# --kernel-localversion handling
+	if [ -n "${KERNEL_LOCALVERSION}" ]
+	then
+		local cfg_CONFIG_LOCALVERSION=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_LOCALVERSION")
+		case "${KERNEL_LOCALVERSION}" in
+			UNSET)
+				print_info 2 "$(get_indent 1)>> Ensure that CONFIG_LOCALVERSION is unset ..."
+				if [ -n "${cfg_CONFIG_LOCALVERSION}" ]
+				then
+					kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_LOCALVERSION" ""
+				fi
+				;;
+			*)
+				print_info 2 "$(get_indent 1)>> Ensure that CONFIG_LOCALVERSION is set ..."
+				kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_LOCALVERSION" "\"${KERNEL_LOCALVERSION}\""
+				;;
+		esac
+	fi
+
 	# Do we support modules at all?
 	local cfg_CONFIG_MODULES=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULES")
 	if isTrue "${cfg_CONFIG_MODULES}"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index e2eafbb..a82fb0a 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -120,6 +120,7 @@ determine_real_args() {
 	set_config_with_override STRING CROSS_COMPILE            CMD_CROSS_COMPILE
 	set_config_with_override STRING BOOTDIR                  CMD_BOOTDIR                  "/boot"
 	set_config_with_override STRING KERNEL_OUTPUTDIR         CMD_KERNEL_OUTPUTDIR         "${KERNEL_DIR}"
+	set_config_with_override STRING KERNEL_LOCALVERSION      CMD_KERNEL_LOCALVERSION
 	set_config_with_override STRING MODPROBEDIR              CMD_MODPROBEDIR              "/etc/modprobe.d"
 
 	set_config_with_override BOOL   SPLASH                   CMD_SPLASH                   "no"
@@ -456,6 +457,24 @@ determine_real_args() {
 		fi
 	fi
 
+	if isTrue "${BUILD_KERNEL}"
+	then
+		if [ -n "${KERNEL_LOCALVERSION}" ]
+		then
+			case "${KERNEL_LOCALVERSION}" in
+				UNSET)
+					;;
+				*)
+					local valid_localversion_pattern='^-[A-Za-z0-9\-_]{1,}$'
+					if [[ ! "${KERNEL_LOCALVERSION}" =~ ${valid_localversion_pattern} ]]
+					then
+						gen_die "--kernel-localversion value '${KERNEL_LOCALVERSION}' does not match '${valid_localversion_pattern}' regex!"
+					fi
+					;;
+			esac
+		fi
+	fi
+
 	if ! isTrue "${BUILD_RAMDISK}"
 	then
 		INTEGRATED_INITRAMFS=0

diff --git a/genkernel.conf b/genkernel.conf
index b4f1dbe..b2af4de 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -278,6 +278,10 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux"
 # 'genkernel'
 #KNAME="genkernel"
 
+# This option will set kernel option CONFIG_LOCALVERSION.
+# Use special value "UNSET" to unset already set CONFIG_LOCALVERSION.
+#KERNEL_LOCALVERSION=""
+
 # This option is only valid if kerncache is
 # defined. If there is a valid kerncache no checks
 # will be made against a kernel source tree.


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-07-15 18:06 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-07-15 18:06 UTC (permalink / raw
  To: gentoo-commits

commit:     a3d49067e775c640a146514d68755dc0a4c6c613
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 15 17:59:44 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Jul 15 17:59:44 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=a3d49067

Add "--module-rebuild" parameter

MODULEREBUILD option will be enabled by default.

When enabled and we are building a non-static kernel for the same
host (no cross-compile!), also building modules and install into
into a non-custom location, we will now call `emerge @module-rebuild`.

Closes: https://bugs.gentoo.org/453372
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt  |  6 ++++++
 gen_cmdline.sh       |  7 +++++++
 gen_compile.sh       | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 gen_determineargs.sh |  1 +
 genkernel            |  1 +
 genkernel.conf       |  6 +++++-
 6 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 8b38279..177be51 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -170,6 +170,12 @@ KERNEL COMPILATION
 *--*[*no-*]*all-ramdisk-modules*::
     Copies or does not copy all kernel modules to the initrd.
 
+*--*[*no-*]*module-rebuild*::
+    Runs, or does not run "emerge @module-rebuild" to build out-of-tree
+    modules when possible, i.e. when non-static kernel and modules will be
+    build, installed, no custom INSTALL_MOD_PATH is set,
+    '/var/lib/module-rebuild/moduledb' exists and is not empty.
+
 *--callback*=<...>::
     Run the specified arguments in the current environment after the
     kernel and modules have been compiled.

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 098e3d4..9f1b7cf 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -62,6 +62,9 @@ longusage() {
   echo "	--ramdisk-modules	Copy required modules to the initramfs"
   echo "	--no-ramdisk-modules	Don't copy any modules to the initramfs"
   echo "	--all-ramdisk-modules	Copy all kernel modules to the initramfs"
+  echo "	--module-rebuild	Automatically run 'emerge @module-rebuild' when"
+  echo "				necessary (and possible)"
+  echo "	--no-module-rebuild	Don't automatically run 'emerge @module-rebuild'"
   echo "	--callback=<...>	Run the specified arguments after the"
   echo "				kernel and modules have been compiled"
   echo "	--static		Build a static (monolithic kernel)"
@@ -569,6 +572,10 @@ parse_cmdline() {
 			CMD_ALLRAMDISKMODULES=$(parse_optbool "$*")
 			print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}"
 			;;
+		--module-rebuild|--no-module-rebuild)
+			CMD_MODULEREBUILD=$(parse_optbool "$*")
+			print_info 2 "CMD_MODULEREBUILD: ${CMD_MODULEREBUILD}"
+			;;
 		--callback=*)
 			CMD_CALLBACK="${*#*=}"
 			print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"

diff --git a/gen_compile.sh b/gen_compile.sh
index f62d80d..cc7b1aa 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -1,6 +1,59 @@
 #!/bin/bash
 # $Id$
 
+compile_external_modules() {
+	local command="emerge --quiet @module-rebuild 2>&1"
+
+	if ! isTrue "${CMD_MODULEREBUILD}"
+	then
+		print_info 3 "$(get_indent 1)>> --no-module-rebuild set; Skipping 'emerge @module-rebuild' ..."
+		return
+	fi
+
+	if isTrue "$(tc-is-cross-compiler)"
+	then
+		print_info 3 "$(get_indent 1)>> Cross-compilation detected; Skipping 'emerge @module-rebuild' ..."
+		return
+	fi
+
+	if ! isTrue "${CMD_INSTALL}"
+	then
+		print_info 3 "$(get_indent 1)>> --no-install set; Skipping 'emerge @module-rebuild' ..."
+		return
+	fi
+
+	if [ -n "${INSTALL_MOD_PATH}" ]
+	then
+		# emerge would install to a different location
+		print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping 'emerge @module-rebuild' ..."
+		return
+	fi
+
+	local modulesdb_file="/var/lib/module-rebuild/moduledb"
+	if [ ! -s "${modulesdb_file}" ]
+	then
+		print_info 2 "$(get_indent 1)>> '${modulesdb_file}' does not exist or is empty; Skipping 'emerge @module-rebuild' ..."
+		return
+	fi
+
+	print_info 1 "$(get_indent 1)>> Compiling out-of-tree module(s) ..."
+	print_info 2 "COMMAND: ${command}" 1 0 1
+
+	if [ "${LOGLEVEL}" -gt 3 ]
+	then
+		# Output to stdout and logfile
+		eval ${command} | tee -a "${LOGFILE}"
+		RET=${PIPESTATUS[0]}
+	else
+		# Output to logfile only
+		eval ${command} >> "${LOGFILE}"
+		RET=$?
+	fi
+
+	[ ${RET} -ne 0 ] \
+		&& gen_die "$(get_useful_function_stack "${FUNCNAME}")${FUNCNAME}() failed to compile out-of-tree-modules!"
+}
+
 compile_gen_init_cpio() {
 	local gen_init_cpio_SRC="${KERNEL_DIR}/usr/gen_init_cpio.c"
 	local gen_init_cpio_DIR="${KERNEL_OUTPUTDIR}/usr"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 1b3abf8..9fa8357 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -133,6 +133,7 @@ determine_real_args() {
 
 	set_config_with_override STRING MINKERNPACKAGE           CMD_MINKERNPACKAGE
 	set_config_with_override STRING MODULESPACKAGE           CMD_MODULESPACKAGE
+	set_config_with_override BOOL   MODULEREBUILD            CMD_MODULEREBUILD            "yes"
 	set_config_with_override STRING KERNCACHE                CMD_KERNCACHE
 	set_config_with_override BOOL   RAMDISKMODULES           CMD_RAMDISKMODULES           "yes"
 	set_config_with_override BOOL   ALLRAMDISKMODULES        CMD_ALLRAMDISKMODULES        "no"

diff --git a/genkernel b/genkernel
index 15f7fbc..391879e 100755
--- a/genkernel
+++ b/genkernel
@@ -238,6 +238,7 @@ then
 	if isTrue "${BUILD_MODULES}" && ! isTrue "${BUILD_STATIC}"
 	then
 		compile_modules
+		compile_external_modules
 	fi
 
 	if isTrue "${SAVE_CONFIG}"

diff --git a/genkernel.conf b/genkernel.conf
index 9d809f5..cad0297 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -156,9 +156,13 @@ NOCOLOR="false"
 # This supersedes the "SPLASH_THEME" option in '/etc/conf.d/splash'.
 #SPLASH_THEME="gentoo"
 
+# Run "emerge @module-rebuild" automatically when possible and necessary
+# after kernel and modules have been compiled
+#MODULEREBUILD="yes"
+
 # Run the specified command in the current environment after the kernel and
 # modules have been compiled, useful to rebuild external kernel module
-# (use "emerge --quiet @module-rebuild" for >=portage-2.2) or installing additional
+# (see MODULEREBUILD above) or installing additional
 # files (use 'copy_image_with_preserve dtb path/to/dtb dtb ${KNAME}-${ARCH}-${KV}')
 #CMD_CALLBACK=""
 


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-03-29  4:13 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-03-29  4:13 UTC (permalink / raw
  To: gentoo-commits

commit:     66be1d9d8f1fc241de0e8d033f616735e5cb5d1e
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 29 04:03:57 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 04:13:05 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=66be1d9d

Add special value "default" for --kernel-config parameter

--kernel-config=default will make genkernel to ignoring all user
kernel configurations so that genkernel will use default kernel
configuration shipped with genkernel to build a kernel.

Useful to start from scratch if needed or for debugging.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt |  4 +++-
 gen_cmdline.sh      |  5 ++++-
 gen_configkernel.sh | 38 +++++++++++++++++++++++++++-----------
 3 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 04633cf..15d5454 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -181,11 +181,13 @@ KERNEL LOCATIONS
     This specifies the location of the kernel sources;  the default
     is '/usr/src/linux'.
 
-*--kernel-config*=<file>::
+*--kernel-config*=<file|default>::
     This specifies a kernel configuration file to use for compilation;
     by default genkernel uses the config from the previous
     build of the same kernel version or a default kernel config if
     there isn't a previous config.
+    Use the special value 'default' to force usage of default kernel
+    config.
 
 *--module-prefix*=<dir>::
     Prefix to kernel module destination, modules will be installed in

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 8971c51..795c2c6 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -63,7 +63,10 @@ longusage() {
   echo "	--no-static		Do not build a static (monolithic kernel)."
   echo "  Kernel settings"
   echo "	--kerneldir=<dir>	Location of the kernel sources"
-  echo "	--kernel-config=<file>	Kernel configuration file to use for compilation"
+  echo "	--kernel-config=<file|default>"
+  echo "				Kernel configuration file to use for compilation."
+  echo "				Use 'default' to explicitly start from scratch"
+  echo "				using genkernel defaults."
   echo "	--module-prefix=<dir>	Prefix to kernel module destination, modules"
   echo "				will be installed in <prefix>/lib/modules"
   echo "  Low-Level Compile settings"

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 34fdbe1..063c9ac 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -4,7 +4,8 @@
 # Fills variable KERNEL_CONFIG
 determine_config_file() {
 	print_info 2 "Checking for suitable kernel configuration..."
-	if [ -n "${CMD_KERNEL_CONFIG}" ]
+
+	if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" != "default" ]
 	then
 		KERNEL_CONFIG=$(expand_file "${CMD_KERNEL_CONFIG}")
 		if [ -z "${KERNEL_CONFIG}" ]
@@ -15,13 +16,21 @@ determine_config_file() {
 			gen_die "${error_msg}"
 		fi
 	else
-		for f in \
-			"/etc/kernels/kernel-config-${ARCH}-${KV}" \
-			"${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" \
-			"${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" \
-			"${GK_SHARE}/arch/${ARCH}/generated-config" \
-			"${GK_SHARE}/arch/${ARCH}/kernel-config" \
-			"${DEFAULT_KERNEL_CONFIG}"
+		local -a kconfig_candidates
+		kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" )
+		kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" )
+		kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" )
+		kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config" )
+		kconfig_candidates+=( "${DEFAULT_KERNEL_CONFIG}" )
+
+		if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ]
+		then
+			print_info 1 "Default configuration was forced. Will ignore any user kernel configuration!"
+		else
+			kconfig_candidates=( "/etc/kernels/kernel-config-${ARCH}-${KV}" ${kconfig_candidates[@]} )
+		fi
+
+		for f in "${kconfig_candidates[@]}"
 		do
 			[ -z "${f}" ] && continue
 
@@ -49,7 +58,7 @@ determine_config_file() {
 	# Validate the symlink result if any
 	if [ -z "${KERNEL_CONFIG}" -o ! -f "${KERNEL_CONFIG}" ]
 	then
-		if [ -n "${CMD_KERNEL_CONFIG}" ]
+		if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" != "default" ]
 		then
 			error_msg="No kernel .config: File '${CMD_KERNEL_CONFIG}' not found! "
 			error_msg+="Check --kernel-config value or unset "
@@ -77,21 +86,28 @@ config_kernel() {
 		print_info 1 "$(getIndent 1)>> --clean is disabled; not running 'make clean'."
 	fi
 
-	if isTrue "${MRPROPER}"
+	if isTrue "${MRPROPER}" || [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ]
 	then
 		# Backup current kernel .config
 		if [ -f "${KERNEL_OUTPUTDIR}/.config" ]
 		then
 			# Current .config is different then one we are going to use
-			if ! diff -q "${KERNEL_OUTPUTDIR}"/.config "${KERNEL_CONFIG}" > /dev/null
+			if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] || \
+				! diff -q "${KERNEL_OUTPUTDIR}"/.config "${KERNEL_CONFIG}" > /dev/null
 			then
 				NOW=`date +--%Y-%m-%d--%H-%M-%S`
 				cp "${KERNEL_OUTPUTDIR}/.config" "${KERNEL_OUTPUTDIR}/.config${NOW}.bak" \
 					|| gen_die "Could not backup kernel config (${KERNEL_OUTPUTDIR}/.config)"
 				print_info 1 "$(getIndent 1)>> Previous config backed up to .config${NOW}.bak"
+
+				[ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] &&
+					rm "${KERNEL_OUTPUTDIR}/.config" > /dev/null
 			fi
 		fi
+	fi
 
+	if isTrue "${MRPROPER}"
+	then
 		print_info 1 "$(getIndent 1)>> Running mrproper..."
 		compile_generic mrproper kernel
 	else


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-03-28 23:43 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-03-28 23:43 UTC (permalink / raw
  To: gentoo-commits

commit:     74252498f3c8e7b788df0eb24676a0e936391bde
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 28 23:22:07 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Mar 28 23:22:07 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=74252498

documentation: remove notes regarding static builds

- sys-fs/cryptsetup[static] is not required, follow up of
  commit b79bf458363f70195715111468f445144e96b7e0

- Since commit 265363f79df5a545dc47547dbee76972b387e9b7, we always build
  our own static sys-fs/lvm2 to help dmraid users.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt | 4 ++--
 gen_cmdline.sh      | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index d77b6ef..04633cf 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -278,8 +278,8 @@ INITIALIZATION
     Enables or disables keymap selection at boot.
 
 *--*[*no-*]*lvm*::
-    Adds or skips in LVM support from static binaries if they exist on the
-    system,  or compile static LVM binaries if static ones do not exist.
+    Includes or excludes LVM support.
+    When enabled, this will compile LVM for you.
 
 *--*[*no-*]*mdadm*::
     Includes or excludes mdadm/mdmon support.

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 5b7aafa..8971c51 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -135,7 +135,6 @@ longusage() {
   echo "	--disklabel		Include disk label and uuid support in your ramdisk"
   echo "	--no-disklabel		Exclude disk label and uuid support in your ramdisk"
   echo "	--luks			Include LUKS support"
-  echo "				--> 'emerge cryptsetup' with USE=static"
   echo "	--no-luks		Exclude LUKS support"
   echo "	--gpg			Include GPG-armored LUKS key support"
   echo "	--no-gpg		Exclude GPG-armored LUKS key support"


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2019-03-25  2:08 Thomas Deutschmann
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Deutschmann @ 2019-03-25  2:08 UTC (permalink / raw
  To: gentoo-commits

commit:     b79bf458363f70195715111468f445144e96b7e0
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 25 02:06:12 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Mar 25 02:06:12 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=b79bf458

sys-fs/cryptsetup[static] isn't required since 2012 anymore ...

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 doc/genkernel.8.txt | 9 ++++-----
 gen_initramfs.sh    | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 26196db..54ea00a 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -335,8 +335,7 @@ INITIALIZATION
     Includes or excludes disk label and uuid support in your initrd.
 
 *--*[*no-*]*luks*::
-    Includes or excludes Luks support from static binaries if they exist on
-    the system.
+    Includes or excludes LUKS support.
 
 *--*[*no-*]*gpg*::
     Includes or excludes support for GnuPG 1.x, the portable standalone branch
@@ -461,11 +460,11 @@ recognized by the kernel itself.
     Does the same as *root*=, which should be used in its place.
 
 *crypt_root*=<...>::
-    This specifies the device encrypted by Luks, which contains the
+    This specifies the device encrypted by LUKS, which contains the
     root filesystem to mount.
 
 *crypt_swap*=<...>::
-    This specifies the swap device encrypted by Luks.
+    This specifies the swap device encrypted by LUKS.
 
 *root_key*=<...>::
     In case your root is encrypted with a key, you can use a device
@@ -478,7 +477,7 @@ recognized by the kernel itself.
     look for the device in every boot.
 
 *root_trim*=(yes|no)::
-    Enables TRIM support for a Luks-based root device.  Only useful
+    Enables TRIM support for a LUKS-based root device.  Only useful
     with SSD setups.  Have a look at 'https://en.wikipedia.org/wiki/TRIM'
     for more information.
 

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index d684844..1469aaa 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -649,7 +649,7 @@ append_overlay(){
 }
 
 append_luks() {
-	local _luks_error_format="LUKS support cannot be included: %s. Please emerge sys-fs/cryptsetup[static]."
+	local _luks_error_format="LUKS support cannot be included: %s. Please emerge sys-fs/cryptsetup."
 	local _luks_source=/sbin/cryptsetup
 	local _luks_dest=/sbin/cryptsetup
 


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2017-01-08  0:40 Robin H. Johnson
  0 siblings, 0 replies; 14+ messages in thread
From: Robin H. Johnson @ 2017-01-08  0:40 UTC (permalink / raw
  To: gentoo-commits

commit:     1e94aa54a07defecaf20729914726318aa4f42c4
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  7 23:53:07 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Jan  7 23:53:07 2017 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=1e94aa54

Document --ssh option.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 doc/genkernel.8.txt | 3 +++
 gen_cmdline.sh      | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index dafa25b..944d596 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -303,6 +303,9 @@ INITIALIZATION
 *--*[*no-*]*iscsi*::
     Includes or excludes iSCSI support
 
+*--*[*no-*]*ssh*::
+    Includes or excludes SSH (dropbear) support for remote LUKS keys.
+
 *--bootloader*=*grub*::
     Add new kernel to GRUB configuration.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 64ea1ab..b4df913 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -114,6 +114,8 @@ longusage() {
   echo "	--no-multipath	Exclude Multipath support"
   echo "	--iscsi			Include iSCSI support"
   echo "	--no-iscsi		Exclude iSCSI support"
+  echo "	--ssh           Include SSH (dropbear) support"
+  echo "	--no-ssh 		Exclude SSH (dropbear) support"
   echo "	--bootloader=grub	Add new kernel to GRUB configuration"
   echo "	--linuxrc=<file>	Specifies a user created linuxrc"
   echo "	--busybox-config=<file>	Specifies a user created busybox config"


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: doc/, /
@ 2017-01-03  5:16 Robin H. Johnson
  0 siblings, 0 replies; 14+ messages in thread
From: Robin H. Johnson @ 2017-01-03  5:16 UTC (permalink / raw
  To: gentoo-commits

commit:     c2525c65b9f3d5849963bab6beb40817d7720218
Author:     Robert Trace <bugzilla-gentoo <AT> farcaster <DOT> org>
AuthorDate: Tue Jan  3 05:15:46 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Jan  3 05:15:46 2017 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c2525c65

Strip kernel & modules

Rebased and tweaked to apply since the original patch was ~7 years old.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 doc/genkernel.8.txt  |  7 +++++++
 gen_cmdline.sh       | 13 +++++++++++++
 gen_compile.sh       |  9 +++++++++
 gen_determineargs.sh |  1 +
 gen_funcs.sh         |  6 ++++++
 5 files changed, 36 insertions(+)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index a2d3c22..ca8eff0 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -384,6 +384,13 @@ OUTPUT SETTINGS
     Directory structure to include in the initramfs, only available
     on >=2.6 kernels
 
+*--strip*=<all|kernel|modules|none>::
+    Strip debug symbols from the installed kernel, modules, all
+    (default) or none.
+
+*--no-strip*::
+    Alias for *--strip=none*.
+
 *--*[*no-*]*firmware*::
     Enable or disables copying of firmware into initramfs.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 0e1e7ef..37d1b5c 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -174,6 +174,11 @@ longusage() {
   echo "				Compress or do not compress the generated initramfs"
   echo "	--compress-initramfs-type=<arg>"
   echo "				Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop)"
+  echo "	--strip=(all|kernel|modules|none)"
+  echo "				Strip debug symbols from the installed kernel, modules,"
+  echo "				all (default) or none"
+  echo "	--no-strip"
+  echo "				Don't strip installed kernel or modules (alias for --strip=none)"
   echo
   echo "For a detailed list of supported initramfs options and flags; issue:"
   echo "	man 8 genkernel"
@@ -669,6 +674,14 @@ parse_cmdline() {
 			CMD_NICE=0
 			print_info 2 "CMD_NICE: ${CMD_NICE}"
 			;;
+		--strip=*)
+			CMD_STRIP_TYPE=`parse_opt "$*"`
+			print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}"
+			;;
+		--no-strip)
+			CMD_STRIP_TYPE=none
+			print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}"
+			;;
 		all)
 			BUILD_KERNEL=1
 			BUILD_MODULES=1

diff --git a/gen_compile.sh b/gen_compile.sh
index 7cc4733..ef72a23 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -306,6 +306,14 @@ compile_modules() {
 	compile_generic modules kernel
 	export UNAME_MACHINE="${ARCH}"
 	[ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
+	if [ "${CMD_STRIP_TYPE}" == "all" -o "${CMD_STRIP_TYPE}" == "modules" ]
+	then
+		print_info 1 "        >> Installing ${KV} modules (and stripping)"
+		INSTALL_MOD_STRIP=1
+		export INSTALL_MOD_STRIP
+	else
+		print_info 1 "        >> Installing ${KV} modules"
+	fi
 	MAKEOPTS="${MAKEOPTS} -j1" compile_generic "modules_install" kernel
 	print_info 1 "        >> Generating module dependency data..."
 	if [ "${INSTALL_MOD_PATH}" != '' ]
@@ -315,6 +323,7 @@ compile_modules() {
 		depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map ${KV}
 	fi
 	unset UNAME_MACHINE
+	unset INSTALL_MOD_STRIP
 }
 
 compile_kernel() {

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 313dbd0..5f77c07 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -142,6 +142,7 @@ determine_real_args() {
 	set_config_with_override BOOL   KEYMAP               CMD_KEYMAP               "yes"
 	set_config_with_override BOOL   DOKEYMAPAUTO         CMD_DOKEYMAPAUTO
 	set_config_with_override STRING BUSYBOX_CONFIG       CMD_BUSYBOX_CONFIG
+	set_config_with_override STRING STRIP_TYPE           CMD_STRIP_TYPE           "all"
 	set_config_with_override BOOL   INSTALL              CMD_INSTALL              "yes"
 	set_config_with_override BOOL   DEBUGCLEANUP         CMD_DEBUGCLEANUP         "yes"
 

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 6234189..0e22a86 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -388,6 +388,12 @@ copy_image_with_preserve() {
 	cp "${newSrceImage}" "${BOOTDIR}/${currDestImage}" ||
 	    gen_die "Could not copy the ${symlinkName} image to ${BOOTDIR}!"
 
+	if [ "${CMD_STRIP_TYPE}" = "all" -o "${CMD_STRIP_TYPE}" = "kernel" ]
+	then
+		print_info 5 "  Stripping ${BOOTDIR}/${currDestImage}"
+		strip --strip-debug "${BOOTDIR}/${currDestImage}" >/dev/null 2>&1
+	fi
+
 	if [ "${SYMLINK}" = '1' ]
 	then
 		print_info 5 "  Make new symlink(s) (from ${BOOTDIR}):"


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-08-08  5:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 23:43 [gentoo-commits] proj/genkernel:master commit in: doc/, / Thomas Deutschmann
  -- strict thread matches above, loose matches on Subject: below --
2023-08-08  5:33 Sam James
2023-07-05 17:41 Sam James
2021-07-06 21:27 Thomas Deutschmann
2020-08-02 22:42 Thomas Deutschmann
2019-07-21 18:38 Thomas Deutschmann
2019-07-21 16:26 Thomas Deutschmann
2019-07-21 16:26 Thomas Deutschmann
2019-07-15 18:06 Thomas Deutschmann
2019-03-29  4:13 Thomas Deutschmann
2019-03-28 23:43 Thomas Deutschmann
2019-03-25  2:08 Thomas Deutschmann
2017-01-08  0:40 Robin H. Johnson
2017-01-03  5:16 Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox