public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2011-05-31 13:18 Sebastian Pipping
  0 siblings, 0 replies; 13+ messages in thread
From: Sebastian Pipping @ 2011-05-31 13:18 UTC (permalink / raw
  To: gentoo-commits

commit:     fad624bc41b33f7bf418845f677caa49a33b6a94
Author:     Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Tue May 31 13:03:12 2011 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Tue May 31 13:17:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=fad624bc

Add rootfstype= boot parameter (bug #221245)

---
 ChangeLog           |    7 +++++++
 defaults/linuxrc    |   11 ++++++++---
 doc/genkernel.8.txt |    5 +++++
 genkernel           |    4 ++++
 4 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 03f20db..6ef649f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,13 @@
 # Distributed under the GPL v2
 # $Id$
 
+  31 May 2011; Sebastian Pipping <sping@gentoo.org> defaults/linuxrc,
+  doc/genkernel.8.txt:
+  Add rootfstype= boot parameter (bug #221245)
+
+  Special thanks:
+  - Marcin Kurek
+
   31 May 2011; Nelson Batalha <nelson.batalha@gmail.com> defaults/initrd.defaults:
   Add Kernel 3.0.0 support (bug #369481)
 

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 1819d9f..51c4529 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -37,6 +37,7 @@ CMDLINE=`cat /proc/cmdline`
 # Scan CMDLINE for any specified real_root= or cdroot arguments
 FAKE_ROOT=''
 REAL_ROOTFLAGS=''
+ROOTFSTYPE='auto'
 CRYPT_SILENT=0
 for x in ${CMDLINE}
 do
@@ -212,6 +213,9 @@ do
 		real_rootflags\=*)
 			REAL_ROOTFLAGS=`parse_opt "${x}"`
 		;;
+		rootfstype\=*)
+			ROOTFSTYPE=`parse_opt "${x}"`
+		;;
 		keymap\=*)
 			keymap=`parse_opt "${x}"`
 		;;
@@ -495,10 +499,11 @@ do
 		else
 			# mount ro so fsck doesn't barf later
 			if [ "${REAL_ROOTFLAGS}" = '' ]; then
-				mount -o ro ${REAL_ROOT} ${NEW_ROOT}
+				good_msg "Using mount -t ${ROOTFSTYPE} -o ro"
+				mount -t ${ROOTFSTYPE} -o ro ${REAL_ROOT} ${NEW_ROOT}
 			else
-				good_msg "Using mount -o ro,${REAL_ROOTFLAGS}"
-				mount -o ro,${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT}
+				good_msg "Using mount -t ${ROOTFSTYPE} -o ro,${REAL_ROOTFLAGS}"
+				mount -t ${ROOTFSTYPE} -o ro,${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT}
 			fi
 		fi
 		

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index c435646..c12dca2 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -440,6 +440,11 @@ which the ramdisk scripts would recognize.
 *dokeymap*::
     Use keymap.  Usage of *keymap*= implies this option, already.
 
+*rootfstype*=<...>::
+    Specify the file system type to mount the real root filesystem as.
+    This can be useful when support for ext2/ext3/ext4 are
+    in competition.  Default is "auto".
+
 
 NETBOOTING
 ----------

diff --git a/genkernel b/genkernel
index 273d9da..6e18506 100755
--- a/genkernel
+++ b/genkernel
@@ -353,6 +353,10 @@ then
 	[ "${MDADM}" = '1' ] && print_warning 1 'add "domdadm" for RAID support'
 	[ "${DMRAID}" = '1' ] && print_warning 1 '	or "dodmraid=<additional options>"'
 	[ "${ISCSI}" = '1' ] && print_warning 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support'
+	if [ `grep 'CONFIG_EXT[0-9]_FS=' "${KERNEL_DIR}"/.config | wc -l` -ge 2 ]; then
+		print_warning 1 'With support for several ext* filesystems around it may be needed to'
+		print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4"'
+	fi
 fi
 
 [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2011-06-01  1:44 Sebastian Pipping
  0 siblings, 0 replies; 13+ messages in thread
From: Sebastian Pipping @ 2011-06-01  1:44 UTC (permalink / raw
  To: gentoo-commits

commit:     e82a8c99854b2d710d962a82dc3a9f4c625a1373
Author:     Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Wed Jun  1 01:43:08 2011 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Wed Jun  1 01:43:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=e82a8c99

Document option lvmraid= and make it imply dolvm (bug #153502)

---
 ChangeLog           |    4 ++++
 defaults/linuxrc    |    1 +
 doc/genkernel.8.txt |    4 ++++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9670a1c..b8dcc35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  01 Jun 2011; Sebastian Pipping <sping@gentoo.org> defaults/linuxrc,
+  doc/genkernel.8.txt:
+  Document option lvmraid= and make it imply dolvm (bug #153502)
+
   31 May 2011; Sebastian Pipping <sping@gentoo.org> defaults/linuxrc,
   doc/genkernel.8.txt:
   Add rootfstype= boot parameter (bug #221245)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 94a2ccd..ad6d780 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -137,6 +137,7 @@ do
 		lvmraid\=*)
 			RAID_DEVICES="`parse_opt ${x}`"
 			RAID_DEVICES="`echo ${RAID_DEVICES} | sed -e 's/,/ /g'`"
+			USE_LVM_NORMAL=1
 		;;
 		part\=*)
 			MDPART=`parse_opt "${x}"`

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index c12dca2..fb38d69 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -420,6 +420,10 @@ which the ramdisk scripts would recognize.
 *dolvm*::
     Activate LVM volumes on bootup
 
+*lvmraid*=<...>::
+    Specify RAID devices to set up before the activation of LVM volumes.
+    Implies option *dolvm*.
+
 *domdadm*::
     Scan for RAID arrays on bootup
 



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2011-07-20 15:55 Fabio Erculiani
  0 siblings, 0 replies; 13+ messages in thread
From: Fabio Erculiani @ 2011-07-20 15:55 UTC (permalink / raw
  To: gentoo-commits

commit:     dfca908b6fc9ce21c714b12bdc96d8049af70f8d
Author:     Fabio Erculiani <lxnay <AT> sabayon <DOT> org>
AuthorDate: Wed Jul 20 15:54:56 2011 +0000
Commit:     Fabio Erculiani <lxnay <AT> gentoo <DOT> org>
CommitDate: Wed Jul 20 15:54:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=dfca908b

Make possible to compile XEN based kernels providing --kernel-target= and --kernel-binary= switches

---
 defaults/config.sh  |    2 ++
 doc/genkernel.8.txt |    6 ++++++
 gen_cmdline.sh      |   11 +++++++++++
 gen_compile.sh      |   10 +++++++---
 4 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/defaults/config.sh b/defaults/config.sh
index 7f339ea..6d26757 100755
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -3,8 +3,10 @@
 # Arch-specific options that normally shouldn't be changed.
 #
 KERNEL_MAKE_DIRECTIVE="bzImage"
+KERNEL_MAKE_DIRECTIVE_OVERRIDE="--INVALID--"
 KERNEL_MAKE_DIRECTIVE_2=""
 KERNEL_BINARY="arch/i386/boot/bzImage"
+KERNEL_BINARY_OVERRIDE=""
 
 COMPRESS_INITRD=yes
 

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 2d7f775..fc00834 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -189,6 +189,12 @@ LOW-LEVEL COMPILATION OPTIONS
 *--kernel-make*=<makeprg>::
     GNU Make to use for the kernel compilation.
 
+*--kernel-target*=<t>::
+    Override default make target (bzImage)
+
+*--kernel-binary*=<path>::
+    Override default kernel binary path (arch/foo/boot/bar)
+
 *--utils-cc*=<compiler>::
     Compiler to use for utilities.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index f7eb707..b3e451d 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -57,6 +57,9 @@ longusage() {
   echo "	--kernel-ld=<linker>	Linker to use for kernel"
   echo "	--kernel-cross-compile=<cross var> CROSS_COMPILE kernel variable"
   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 "	--utils-cc=<compiler>	Compiler to use for utilities"
   echo "	--utils-as=<assembler>	Assembler to use for utils"
   echo "	--utils-ld=<linker>	Linker to use for utils"
@@ -166,6 +169,14 @@ parse_cmdline() {
 			CMD_KERNEL_MAKE=`parse_opt "$*"`
 			print_info 2 "CMD_KERNEL_MAKE: ${CMD_KERNEL_MAKE}"
 			;;
+		--kernel-target=*)
+			KERNEL_MAKE_DIRECTIVE_OVERRIDE=`parse_opt "$*"`
+			print_info 2 "KERNEL_MAKE_DIRECTIVE_OVERRIDE: ${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
+			;;
+		--kernel-binary=*)
+			KERNEL_BINARY_OVERRIDE=`parse_opt "$*"`
+			print_info 2 "KERNEL_BINARY_OVERRIDE: ${KERNEL_BINARY_OVERRIDE}"
+			;;
 		--kernel-cross-compile=*)
 			CMD_KERNEL_CROSS_COMPILE=`parse_opt "$*"`
 			CMD_KERNEL_CROSS_COMPILE=$(echo ${CMD_KERNEL_CROSS_COMPILE}|sed -e 's/.*[^-]$/&-/g')

diff --git a/gen_compile.sh b/gen_compile.sh
index 3a815e8..9fc35af 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -296,8 +296,12 @@ compile_kernel() {
 	[ "${KERNEL_MAKE}" = '' ] &&
 		gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!"
 	cd ${KERNEL_DIR}
-	print_info 1 "        >> Compiling ${KV} ${KERNEL_MAKE_DIRECTIVE/_install/ [ install ]/}..."
-	compile_generic "${KERNEL_MAKE_DIRECTIVE}" kernel
+	local kernel_make_directive="${KERNEL_MAKE_DIRECTIVE}"
+	if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "--INVALID--" ]; then
+		kernel_make_directive="${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
+	fi
+	print_info 1 "        >> Compiling ${KV} ${kernel_make_directive/_install/ [ install ]/}..."
+	compile_generic "${kernel_make_directive}" kernel
 	if [ "${KERNEL_MAKE_DIRECTIVE_2}" != '' ]
 	then
 		print_info 1 "        >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..."
@@ -313,7 +317,7 @@ compile_kernel() {
 		print_info 1 "        >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..."
 	fi
 
-	local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
+	local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}})
 	local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
 	if [ -z "${tmp_kernel_binary}" ]
 	then



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2011-07-20 19:24 Fabio Erculiani
  0 siblings, 0 replies; 13+ messages in thread
From: Fabio Erculiani @ 2011-07-20 19:24 UTC (permalink / raw
  To: gentoo-commits

commit:     85a271a4ed9699704300b6dbe21bbe68e32832b5
Author:     Fabio Erculiani <lxnay <AT> sabayon <DOT> org>
AuthorDate: Wed Jul 20 19:26:12 2011 +0000
Commit:     Fabio Erculiani <lxnay <AT> gentoo <DOT> org>
CommitDate: Wed Jul 20 19:26:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=85a271a4

better document new --make-target= option

---
 defaults/config.sh  |    6 +++++-
 doc/genkernel.8.txt |    4 +++-
 gen_compile.sh      |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/defaults/config.sh b/defaults/config.sh
index 6d26757..d135e0e 100755
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -3,7 +3,11 @@
 # Arch-specific options that normally shouldn't be changed.
 #
 KERNEL_MAKE_DIRECTIVE="bzImage"
-KERNEL_MAKE_DIRECTIVE_OVERRIDE="--INVALID--"
+# since "" is allowed (this will translate in `make `, which is nice
+# for xen-based kernels, the default value of
+# KERNEL_MAKE_DIRECTIVE_OVERRIDE cannot be ""
+DEFAULT_KERNEL_MAKE_DIRECTIVE_OVERRIDE="--INVALID--"
+KERNEL_MAKE_DIRECTIVE_OVERRIDE="${DEFAULT_KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
 KERNEL_MAKE_DIRECTIVE_2=""
 KERNEL_BINARY="arch/i386/boot/bzImage"
 KERNEL_BINARY_OVERRIDE=""

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index fc00834..caee447 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -190,7 +190,9 @@ LOW-LEVEL COMPILATION OPTIONS
     GNU Make to use for the kernel compilation.
 
 *--kernel-target*=<t>::
-    Override default make target (bzImage)
+    Override default make target (bzImage), note that values
+    like --kernel-target= are also valid (useful for Xen
+    based kernel sources)
 
 *--kernel-binary*=<path>::
     Override default kernel binary path (arch/foo/boot/bar)

diff --git a/gen_compile.sh b/gen_compile.sh
index 9fc35af..0758c3a 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -297,7 +297,7 @@ compile_kernel() {
 		gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!"
 	cd ${KERNEL_DIR}
 	local kernel_make_directive="${KERNEL_MAKE_DIRECTIVE}"
-	if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "--INVALID--" ]; then
+	if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "${DEFAULT_KERNEL_MAKE_DIRECTIVE_OVERRIDE}" ]; then
 		kernel_make_directive="${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
 	fi
 	print_info 1 "        >> Compiling ${KV} ${kernel_make_directive/_install/ [ install ]/}..."



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2011-08-28  9:19 Fabio Erculiani
  0 siblings, 0 replies; 13+ messages in thread
From: Fabio Erculiani @ 2011-08-28  9:19 UTC (permalink / raw
  To: gentoo-commits

commit:     4d54e7d0984dfdfe09b121dd845f6131c5b715d5
Author:     Fabio Erculiani <lxnay <AT> sabayon <DOT> org>
AuthorDate: Sun Aug 28 09:23:03 2011 +0000
Commit:     Fabio Erculiani <lxnay <AT> gentoo <DOT> org>
CommitDate: Sun Aug 28 09:23:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=4d54e7d0

aufs: add basic support to AUFS2, requires kernel with aufs module or built-in

---
 ChangeLog               |    4 ++++
 defaults/initrd.scripts |   35 +++++++++++++++++++++++++++++++++++
 defaults/linuxrc        |   16 ++++++++++++----
 doc/genkernel.8.txt     |    3 +++
 4 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fdba306..0f04500 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  28 Aug 2011; Fabio Erculiani <lxnay@gentoo.org> defaults/initrd.scripts,
+  defaults/linuxrc, doc/genkernel.8.txt:
+  Add basic support to AUFS2, requires kernel with aufs module or built-in
+
   16 Aug 2011; Fabio Erculiani <lxnay@gentoo.org> gen_compile.sh:
   gen_compile: correct MAKEOPTS usage on utils task
 

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 51ebcce..32e3417 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -924,6 +924,13 @@ sdelay() {
 	then
 		good_msg "Waiting ${SDELAY} seconds..."
 		sleep ${SDELAY}
+	elif [ "${CDROOT}" = '1' ]
+	then
+		# many CD/DVD drives require extra sleep, especially when
+		# connected via USB. Many people reported that 1 second sleep
+		# is not enough on their notebooks, that's why sleep 3, when booting
+		# off a livecd is a better default.
+		sleep 3
 	else
 		good_msg 'Hint: Use parameter scandelay[=seconds] if you need waiting here'
 	fi
@@ -1082,6 +1089,34 @@ getdvhoff() {
 	echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512))
 }
 
+setup_squashfs_aufs() {
+	(
+	# Setup aufs directories and vars
+	local overlay=/mnt/overlay
+	local static=/mnt/livecd
+
+	for i in "${overlay}" "${static}"; do
+		[ ! -d "${i}" ] && mkdir -p "${i}"
+	done
+	good_msg "Loading aufs"
+	modprobe aufs > /dev/null 2>&1
+
+	cd "${NEW_ROOT}"
+	mount -t squashfs -o loop,ro "mnt/cdrom${LOOPEXT}${LOOP}" "${static}"
+	mount -t tmpfs none "${overlay}"
+	mount -t aufs -o br:${overlay}:${static} aufs "${NEW_ROOT}"
+
+	[ ! -d "${NEW_ROOT}${overlay}" ] && mkdir -p "${NEW_ROOT}${overlay}"
+	[ ! -d "${NEW_ROOT}${static}" ] && mkdir -p "${NEW_ROOT}${static}"
+	echo "aufs / aufs defaults 0 0" > "${NEW_ROOT}"/etc/fstab
+	for i in "${overlay}" "${static}"; do mount --move "${i}" "${NEW_ROOT}${i}"; done
+
+	# have handy /mnt/cdrom as well
+	[ ! -d "${NEW_ROOT}/mnt/cdrom" ] && mkdir -p "${NEW_ROOT}/mnt/cdrom"
+	mount --bind mnt/cdrom "${NEW_ROOT}/mnt/cdrom"
+	)
+}
+
 setup_unionfs() {
 	local rw_dir=$1
 	local ro_dir=$2

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 0843f5d..7aa11e3 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -213,6 +213,9 @@ do
 		keymap\=*)
 			keymap=`parse_opt "${x}"`
 		;;
+		aufs)
+			USE_AUFS_NORMAL=1
+		;;
 		unionfs)
 			if [ ! -x /sbin/unionfs ]
 			then
@@ -569,9 +572,14 @@ then
 			FS_LOCATION='mnt/livecd'
 		elif [ "${LOOPTYPE}" = 'squashfs' ]
 		then
-			good_msg 'Mounting squashfs filesystem'
-			mount -t squashfs -o loop,ro "${NEW_ROOT}/mnt/cdrom/${LOOPEXT}${LOOP}" "${NEW_ROOT}/mnt/livecd"
-			test_success 'Mount filesystem'
+			if [ "${USE_AUFS_NORMAL}" != '1' ]; then
+				good_msg 'Mounting squashfs filesystem'
+				mount -t squashfs -o loop,ro "${NEW_ROOT}/mnt/cdrom/${LOOPEXT}${LOOP}" "${NEW_ROOT}/mnt/livecd"
+			else
+				good_msg 'Mounting squashfs & aufs filesystems'
+				setup_squashfs_aufs
+				test_success 'Mount filesystem'
+			fi
 			FS_LOCATION='mnt/livecd'
 		elif [ "${LOOPTYPE}" = 'gcloop' ]
 		then
@@ -636,7 +644,7 @@ then
 	then
 		setup_unionfs ${NEW_ROOT} ${NEW_ROOT}/${FS_LOCATION}
 		CHROOT=/union
-	else
+	elif [ "${USE_AUFS_NORMAL}" != '1' ]; then
 	
 	good_msg "Copying read-write image contents to tmpfs"
 	# Copy over stuff that should be writable

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 21c7919..bf621ce 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -511,6 +511,9 @@ which the ramdisk scripts would recognize.
 *nounionfs*::
     Enables/disables UnionFS.
 
+*aufs*::
+    Enables support for AUFS2 (if available in the kernel).
+
 *real_rootflags*=<...>::
     Additional flags to mount the real root system with.
     For example *real_rootflags*=noatime would make "-o ro,noatime".



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2012-07-19 20:24 Richard Yao
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Yao @ 2012-07-19 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     6b7408443e17e74662d2105a86b62240f7194ebc
Author:     Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu>
AuthorDate: Thu Jul 19 19:59:03 2012 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Thu Jul 19 20:22:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=6b740844

Support module options set in /etc/module.d, amend cmdline options patch

---
 defaults/linuxrc     |   12 +-----------
 defaults/modprobe    |    2 +-
 doc/genkernel.8.txt  |    3 +++
 gen_cmdline.sh       |    5 +++++
 gen_determineargs.sh |    2 ++
 gen_initramfs.sh     |   37 +++++++++++++++++++++++++++++++++++++
 6 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 91a3396..6e9e9d8 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -241,23 +241,13 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		## for "module.param[=val]" we creating
-		## /etc/modprobe.d/module.param.conf: "options module param[=val]"
-		## /etc/cmdline/module.param:"param[=val]"
-		## first for CONFIG_MODPROBE_SMALL=n, next for script modprobe
 		*=*)
 			case "${x%%=*}" in
 			*.*)
-				y="${x%%[=/]*}"
-				echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/$y.conf"
-				echo "${x#*.}" >"/etc/cmdline/$y"
+				echo "options ${x%%.*} ${x#*.}" >> "/etc/module_options/${x%%[=/]*}.conf"
 			;;
 			esac
 		;;
-		*.*)
-			echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/${x%%/*}.conf"
-			echo "${x#*.}" >"/etc/cmdline/${x%%/*}"
-		;;
 	esac
 done
 

diff --git a/defaults/modprobe b/defaults/modprobe
index 1f606bd..6bbe7e4 100755
--- a/defaults/modprobe
+++ b/defaults/modprobe
@@ -112,7 +112,7 @@ modprobe2() {
 	done
 	# placing options into x
 	x="${real_path##*/}"
-	x="`cat "/etc/cmdline/${x%.ko*}".* 2>/dev/null`"
+	x="`cat "/etc/module_options/${x%.ko*}".* 2>/dev/null`"
 	${INSMOD} ${real_path} ${x} > /dev/null 2>&1
 	ret=$?
 	if [ ${ret} -eq 0 ]

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 547b7fe..9a96f32 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -221,6 +221,9 @@ LOW-LEVEL COMPILATION OPTIONS
 *--bootdir*=<dir>::
     Set the location of the boot-directory, default is '/boot'.
 
+*--modprobedir*=<dir>::
+    Set the location of the modprobe.d-directory, default is '/etc/modprobe.d'.
+
 *--makeopts*=<makeopts>::
     GNU Make options such as -j2, etc.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 184db65..938b1a5 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -75,6 +75,7 @@ longusage() {
   echo "	--mountboot		Mount BOOTDIR automatically if mountable"
   echo "	--no-mountboot		Don't mount BOOTDIR automatically"  
   echo "	--bootdir=<dir>		Set the location of the boot-directory, default is /boot"
+  echo "	--modprobedir=<dir>	Set the location of the modprobe.d-directory, default is /etc/modprobe.d"
   echo "  Initialization"
   echo "	--splash=<theme>	Enable framebuffer splash using <theme>"
   echo "	--splash-res=<res>	Select splash theme resolutions to install"
@@ -248,6 +249,10 @@ parse_cmdline() {
 			CMD_BOOTDIR=`parse_opt "$*"`
 			print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
 			;;
+		--modprobedir=*)
+			CMD_MODPROBEDIR=`parse_opt "$*"`
+			print_info 2 "CMD_MODPROBEDIR: ${CMD_MODPROBEDIR}"
+			;;
 		--do-keymap-auto)
 			CMD_DOKEYMAPAUTO=1
 			CMD_KEYMAP=1

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index bbff166..3bc1b29 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -90,6 +90,7 @@ determine_real_args() {
 	set_config_with_override STRING KERNEL_CROSS_COMPILE CMD_KERNEL_CROSS_COMPILE
 	set_config_with_override STRING UTILS_CROSS_COMPILE  CMD_UTILS_CROSS_COMPILE
 	set_config_with_override STRING BOOTDIR              CMD_BOOTDIR              "/boot"
+	set_config_with_override STRING MODPROBEDIR          CMD_MODPROBEDIR              "/etc/modprobe.d"
 
 	set_config_with_override BOOL   SPLASH               CMD_SPLASH
 	set_config_with_override BOOL   POSTCLEAR            CMD_POSTCLEAR
@@ -135,6 +136,7 @@ determine_real_args() {
 
 	BOOTDIR=`arch_replace "${BOOTDIR}"`
 	BOOTDIR=${BOOTDIR%/}    # Remove any trailing slash
+	MODPROBEDIR=${MODPROBEDIR%/}    # Remove any trailing slash
 
 	CACHE_DIR=`arch_replace "${CACHE_DIR}"`
 	BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 43ef155..ac90830 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -577,6 +577,41 @@ append_modules() {
 	rm -r "${TEMP}/initramfs-modules-${KV}-temp/"	
 }
 
+append_modprobed() {
+	local TDIR="${TEMP}/initramfs-modprobe.d-temp"
+	if [ -d "${TDIR}" ]
+	then
+		rm -r "${TDIR}"
+	fi
+
+	mkdir -p "${TDIR}/etc/module_options/"
+
+	# Load module parameters
+	for dir in $(find "${MODPROBEDIR}"/*)
+	do
+		while read x
+		do
+			case "${x}" in
+				options*)
+					module_name="$(echo "$x" | cut -d ' ' -f 2)"
+					[ "${module_name}" != "$(echo)" ] || continue
+					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
+					[ "${module_options}" != "$(echo)" ] || continue
+					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
+				;;
+			esac
+		done < "${dir}"
+	done
+
+	cd "${TDIR}"
+	log_future_cpio_content
+	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+			|| gen_die "compressing modprobe.d cpio"
+
+	cd "${TEMP}"
+	rm -rf "${TDIR}" > /dev/null
+}
+
 # check for static linked file with objdump
 is_static() {
 	LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
@@ -729,6 +764,8 @@ create_initramfs() {
 
 	append_data 'splash' "${SPLASH}"
 
+	append_data 'modprobed'
+
 	if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ]
 	then
 		append_data 'firmware'



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2012-07-19 20:43 Richard Yao
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Yao @ 2012-07-19 20:43 UTC (permalink / raw
  To: gentoo-commits

commit:     f44c8b2e274b0e386e958123b360d859c635804c
Author:     Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu>
AuthorDate: Thu Jul 19 19:59:03 2012 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Thu Jul 19 20:41:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=f44c8b2e

Support module options set in /etc/module.d, amend cmdline options patch

---
 defaults/linuxrc     |   12 +-----------
 defaults/modprobe    |    2 +-
 doc/genkernel.8.txt  |    3 +++
 gen_cmdline.sh       |    5 +++++
 gen_determineargs.sh |    2 ++
 gen_initramfs.sh     |   37 +++++++++++++++++++++++++++++++++++++
 6 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 91a3396..3ce0a4b 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -241,23 +241,13 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		## for "module.param[=val]" we creating
-		## /etc/modprobe.d/module.param.conf: "options module param[=val]"
-		## /etc/cmdline/module.param:"param[=val]"
-		## first for CONFIG_MODPROBE_SMALL=n, next for script modprobe
 		*=*)
 			case "${x%%=*}" in
 			*.*)
-				y="${x%%[=/]*}"
-				echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/$y.conf"
-				echo "${x#*.}" >"/etc/cmdline/$y"
+				echo "${x%%.*} ${x#*.}" >> "/etc/module_options/${x%%[=/]*}.conf"
 			;;
 			esac
 		;;
-		*.*)
-			echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/${x%%/*}.conf"
-			echo "${x#*.}" >"/etc/cmdline/${x%%/*}"
-		;;
 	esac
 done
 

diff --git a/defaults/modprobe b/defaults/modprobe
index 1f606bd..6bbe7e4 100755
--- a/defaults/modprobe
+++ b/defaults/modprobe
@@ -112,7 +112,7 @@ modprobe2() {
 	done
 	# placing options into x
 	x="${real_path##*/}"
-	x="`cat "/etc/cmdline/${x%.ko*}".* 2>/dev/null`"
+	x="`cat "/etc/module_options/${x%.ko*}".* 2>/dev/null`"
 	${INSMOD} ${real_path} ${x} > /dev/null 2>&1
 	ret=$?
 	if [ ${ret} -eq 0 ]

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 547b7fe..9a96f32 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -221,6 +221,9 @@ LOW-LEVEL COMPILATION OPTIONS
 *--bootdir*=<dir>::
     Set the location of the boot-directory, default is '/boot'.
 
+*--modprobedir*=<dir>::
+    Set the location of the modprobe.d-directory, default is '/etc/modprobe.d'.
+
 *--makeopts*=<makeopts>::
     GNU Make options such as -j2, etc.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 184db65..938b1a5 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -75,6 +75,7 @@ longusage() {
   echo "	--mountboot		Mount BOOTDIR automatically if mountable"
   echo "	--no-mountboot		Don't mount BOOTDIR automatically"  
   echo "	--bootdir=<dir>		Set the location of the boot-directory, default is /boot"
+  echo "	--modprobedir=<dir>	Set the location of the modprobe.d-directory, default is /etc/modprobe.d"
   echo "  Initialization"
   echo "	--splash=<theme>	Enable framebuffer splash using <theme>"
   echo "	--splash-res=<res>	Select splash theme resolutions to install"
@@ -248,6 +249,10 @@ parse_cmdline() {
 			CMD_BOOTDIR=`parse_opt "$*"`
 			print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
 			;;
+		--modprobedir=*)
+			CMD_MODPROBEDIR=`parse_opt "$*"`
+			print_info 2 "CMD_MODPROBEDIR: ${CMD_MODPROBEDIR}"
+			;;
 		--do-keymap-auto)
 			CMD_DOKEYMAPAUTO=1
 			CMD_KEYMAP=1

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index bbff166..3bc1b29 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -90,6 +90,7 @@ determine_real_args() {
 	set_config_with_override STRING KERNEL_CROSS_COMPILE CMD_KERNEL_CROSS_COMPILE
 	set_config_with_override STRING UTILS_CROSS_COMPILE  CMD_UTILS_CROSS_COMPILE
 	set_config_with_override STRING BOOTDIR              CMD_BOOTDIR              "/boot"
+	set_config_with_override STRING MODPROBEDIR          CMD_MODPROBEDIR              "/etc/modprobe.d"
 
 	set_config_with_override BOOL   SPLASH               CMD_SPLASH
 	set_config_with_override BOOL   POSTCLEAR            CMD_POSTCLEAR
@@ -135,6 +136,7 @@ determine_real_args() {
 
 	BOOTDIR=`arch_replace "${BOOTDIR}"`
 	BOOTDIR=${BOOTDIR%/}    # Remove any trailing slash
+	MODPROBEDIR=${MODPROBEDIR%/}    # Remove any trailing slash
 
 	CACHE_DIR=`arch_replace "${CACHE_DIR}"`
 	BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 43ef155..ac90830 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -577,6 +577,41 @@ append_modules() {
 	rm -r "${TEMP}/initramfs-modules-${KV}-temp/"	
 }
 
+append_modprobed() {
+	local TDIR="${TEMP}/initramfs-modprobe.d-temp"
+	if [ -d "${TDIR}" ]
+	then
+		rm -r "${TDIR}"
+	fi
+
+	mkdir -p "${TDIR}/etc/module_options/"
+
+	# Load module parameters
+	for dir in $(find "${MODPROBEDIR}"/*)
+	do
+		while read x
+		do
+			case "${x}" in
+				options*)
+					module_name="$(echo "$x" | cut -d ' ' -f 2)"
+					[ "${module_name}" != "$(echo)" ] || continue
+					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
+					[ "${module_options}" != "$(echo)" ] || continue
+					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
+				;;
+			esac
+		done < "${dir}"
+	done
+
+	cd "${TDIR}"
+	log_future_cpio_content
+	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+			|| gen_die "compressing modprobe.d cpio"
+
+	cd "${TEMP}"
+	rm -rf "${TDIR}" > /dev/null
+}
+
 # check for static linked file with objdump
 is_static() {
 	LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
@@ -729,6 +764,8 @@ create_initramfs() {
 
 	append_data 'splash' "${SPLASH}"
 
+	append_data 'modprobed'
+
 	if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ]
 	then
 		append_data 'firmware'



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2012-07-19 20:56 Richard Yao
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Yao @ 2012-07-19 20:56 UTC (permalink / raw
  To: gentoo-commits

commit:     908a463e07491d3c69aa1daf853b4d699dbb8534
Author:     Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu>
AuthorDate: Thu Jul 19 19:59:03 2012 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Thu Jul 19 20:53:59 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=908a463e

Support module options set in /etc/module.d, amend cmdline options patch

---
 defaults/linuxrc     |   12 +-----------
 defaults/modprobe    |    2 +-
 doc/genkernel.8.txt  |    3 +++
 gen_cmdline.sh       |    5 +++++
 gen_determineargs.sh |    2 ++
 gen_initramfs.sh     |   37 +++++++++++++++++++++++++++++++++++++
 6 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 91a3396..90099c8 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -241,23 +241,13 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-		## for "module.param[=val]" we creating
-		## /etc/modprobe.d/module.param.conf: "options module param[=val]"
-		## /etc/cmdline/module.param:"param[=val]"
-		## first for CONFIG_MODPROBE_SMALL=n, next for script modprobe
 		*=*)
 			case "${x%%=*}" in
 			*.*)
-				y="${x%%[=/]*}"
-				echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/$y.conf"
-				echo "${x#*.}" >"/etc/cmdline/$y"
+				echo "${x#*.}" >> "/etc/module_options/${x%%.*}.conf"
 			;;
 			esac
 		;;
-		*.*)
-			echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/${x%%/*}.conf"
-			echo "${x#*.}" >"/etc/cmdline/${x%%/*}"
-		;;
 	esac
 done
 

diff --git a/defaults/modprobe b/defaults/modprobe
index 1f606bd..6bbe7e4 100755
--- a/defaults/modprobe
+++ b/defaults/modprobe
@@ -112,7 +112,7 @@ modprobe2() {
 	done
 	# placing options into x
 	x="${real_path##*/}"
-	x="`cat "/etc/cmdline/${x%.ko*}".* 2>/dev/null`"
+	x="`cat "/etc/module_options/${x%.ko*}".* 2>/dev/null`"
 	${INSMOD} ${real_path} ${x} > /dev/null 2>&1
 	ret=$?
 	if [ ${ret} -eq 0 ]

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 547b7fe..9a96f32 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -221,6 +221,9 @@ LOW-LEVEL COMPILATION OPTIONS
 *--bootdir*=<dir>::
     Set the location of the boot-directory, default is '/boot'.
 
+*--modprobedir*=<dir>::
+    Set the location of the modprobe.d-directory, default is '/etc/modprobe.d'.
+
 *--makeopts*=<makeopts>::
     GNU Make options such as -j2, etc.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 184db65..938b1a5 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -75,6 +75,7 @@ longusage() {
   echo "	--mountboot		Mount BOOTDIR automatically if mountable"
   echo "	--no-mountboot		Don't mount BOOTDIR automatically"  
   echo "	--bootdir=<dir>		Set the location of the boot-directory, default is /boot"
+  echo "	--modprobedir=<dir>	Set the location of the modprobe.d-directory, default is /etc/modprobe.d"
   echo "  Initialization"
   echo "	--splash=<theme>	Enable framebuffer splash using <theme>"
   echo "	--splash-res=<res>	Select splash theme resolutions to install"
@@ -248,6 +249,10 @@ parse_cmdline() {
 			CMD_BOOTDIR=`parse_opt "$*"`
 			print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
 			;;
+		--modprobedir=*)
+			CMD_MODPROBEDIR=`parse_opt "$*"`
+			print_info 2 "CMD_MODPROBEDIR: ${CMD_MODPROBEDIR}"
+			;;
 		--do-keymap-auto)
 			CMD_DOKEYMAPAUTO=1
 			CMD_KEYMAP=1

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index bbff166..3bc1b29 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -90,6 +90,7 @@ determine_real_args() {
 	set_config_with_override STRING KERNEL_CROSS_COMPILE CMD_KERNEL_CROSS_COMPILE
 	set_config_with_override STRING UTILS_CROSS_COMPILE  CMD_UTILS_CROSS_COMPILE
 	set_config_with_override STRING BOOTDIR              CMD_BOOTDIR              "/boot"
+	set_config_with_override STRING MODPROBEDIR          CMD_MODPROBEDIR              "/etc/modprobe.d"
 
 	set_config_with_override BOOL   SPLASH               CMD_SPLASH
 	set_config_with_override BOOL   POSTCLEAR            CMD_POSTCLEAR
@@ -135,6 +136,7 @@ determine_real_args() {
 
 	BOOTDIR=`arch_replace "${BOOTDIR}"`
 	BOOTDIR=${BOOTDIR%/}    # Remove any trailing slash
+	MODPROBEDIR=${MODPROBEDIR%/}    # Remove any trailing slash
 
 	CACHE_DIR=`arch_replace "${CACHE_DIR}"`
 	BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 43ef155..ac90830 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -577,6 +577,41 @@ append_modules() {
 	rm -r "${TEMP}/initramfs-modules-${KV}-temp/"	
 }
 
+append_modprobed() {
+	local TDIR="${TEMP}/initramfs-modprobe.d-temp"
+	if [ -d "${TDIR}" ]
+	then
+		rm -r "${TDIR}"
+	fi
+
+	mkdir -p "${TDIR}/etc/module_options/"
+
+	# Load module parameters
+	for dir in $(find "${MODPROBEDIR}"/*)
+	do
+		while read x
+		do
+			case "${x}" in
+				options*)
+					module_name="$(echo "$x" | cut -d ' ' -f 2)"
+					[ "${module_name}" != "$(echo)" ] || continue
+					module_options="$(echo "$x" | cut -d ' ' -f 3-)"
+					[ "${module_options}" != "$(echo)" ] || continue
+					echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
+				;;
+			esac
+		done < "${dir}"
+	done
+
+	cd "${TDIR}"
+	log_future_cpio_content
+	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+			|| gen_die "compressing modprobe.d cpio"
+
+	cd "${TEMP}"
+	rm -rf "${TDIR}" > /dev/null
+}
+
 # check for static linked file with objdump
 is_static() {
 	LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
@@ -729,6 +764,8 @@ create_initramfs() {
 
 	append_data 'splash' "${SPLASH}"
 
+	append_data 'modprobed'
+
 	if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ]
 	then
 		append_data 'firmware'



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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2012-10-13 22:52 Robin H. Johnson
  0 siblings, 0 replies; 13+ messages in thread
From: Robin H. Johnson @ 2012-10-13 22:52 UTC (permalink / raw
  To: gentoo-commits

commit:     bddbeeb8874bd22b8b60e27dd366bc5f3a8d1cee
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 13 22:52:42 2012 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Oct 13 22:52:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=bddbeeb8

Bug #351873: More livecd control, and initramfs livecd argument documentation.

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

---
 ChangeLog                |    5 +++++
 defaults/initrd.defaults |    7 +++++--
 defaults/initrd.scripts  |    2 +-
 defaults/linuxrc         |    6 +++++-
 doc/genkernel.8.txt      |   14 ++++++++++++--
 5 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6204a06..05484d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,11 @@
 # Distributed under the GPL v2
 # $Id$
 
+  13 Oct 2012; Robin H. Johnson <robbat2@gentoo.org> defaults/initrd.defaults,
+  defaults/initrd.scripts, defaults/linuxrc, doc/genkernel.8.txt:
+  Bug #351873: More livecd control, and initramfs livecd argument
+  documentation.
+
   13 Oct 2012; Robin H. Johnson <robbat2@gentoo.org> arch/alpha/kernel-config,
   arch/ppc/kernel-config, arch/x86/kernel-config, arch/x86_64/kernel-config,
   defaults/kernel-config:

diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 73fe4c9..90f73f4 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -67,12 +67,15 @@ else
 fi
 
 REAL_ROOT=''
+CONSOLE='/dev/console'
+NEW_ROOT='/newroot'
 CDROOT='0'
 CDROOT_DEV=''
 CDROOT_TYPE='auto'
-NEW_ROOT='/newroot'
 CDROOT_PATH='/mnt/cdrom'
-CONSOLE='/dev/console'
+# This is the file that the cdroot will be checked for as a
+# marker. It must exist RELATIVE to the cdroot.
+CDROOT_MARKER='/livecd'
 
 LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
 

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 03e61e0..227fc99 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -159,7 +159,7 @@ bootstrapCD() {
 	# a bunch of extra devices
 	[ -n "${CDROOT_DEV}" ] && DEVICES="${CDROOT_DEV}"
 
-	findmediamount "cdrom" "${SUBDIR}/livecd" "REAL_ROOT" "${CDROOT_PATH}" ${DEVICES}
+	findmediamount "cdrom" "${SUBDIR}/${CDROOT_MARKER}" "REAL_ROOT" "${CDROOT_PATH}" ${DEVICES}
 }
 
 bootstrapKey() {

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 011505c..54a57c6 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -39,6 +39,7 @@ FAKE_ROOT=''
 REAL_ROOTFLAGS=''
 ROOTFSTYPE='auto'
 CRYPT_SILENT=0
+
 mkdir -p /etc/cmdline /etc/modprobe.d
 for x in ${CMDLINE}
 do
@@ -69,6 +70,9 @@ do
 		cdroot_type=*)
 			CDROOT_TYPE=${x#*=}
 		;;
+		cdroot_marker=*)
+			CDROOT_MARKER=${x#*=}
+		;;
 		# Start livecd loop, looptype options
 		loop=*)
 			LOOP=${x#*=}
@@ -657,7 +661,7 @@ then
 	# If encrypted, find key and mount, otherwise mount as usual
 	if [ -n "${CRYPT_ROOT}" ]
 	then
-		CRYPT_ROOT_KEY="$(head -n 1 "${CDROOT_PATH}"/livecd)"
+		CRYPT_ROOT_KEY="$(head -n 1 "${CDROOT_PATH}"/${CDROOT_MARKER})"
 		CRYPT_ROOT='/dev/loop0'
 		good_msg 'You booted an encrypted livecd' "${CRYPT_SILENT}"
 

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 912f899..6376e28 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -551,11 +551,21 @@ which the ramdisk scripts would recognize.
 
 *cdroot*[=<...>]::
 *cdroot_type*=<...>::
-    TO BE DOCUMENTED
+*cdroot_marker*=<...>::
+    Used for LiveCDs. *cdroot* without arguments will cause the initramfs to
+    scan all devices for a LiveCD. An argument to *cdroot* will cause it to
+    scan only that device. A LiveCD is any device containing a file with the
+    name & Path of *cdroot_marker* (default of "/livecd"). *cdroot_type*
+    (default of "auto") is the filesystem type to use while mounting devices
+    to check. On success, the LiveCD will be mounted at $CDROOT_PATH.
 
 *loop*=<...>::
 *looptype*=<...>::
-    TO BE DOCUMENTED
+    Used for LiveCDs. After mounting the LiveCD or ISO, look for a file at
+    *loop*=path to use as a loopback image for the main type. Mount it with
+    filesystem type *looptype*. Possible values for *looptype*: normal,
+    squashfs, gcloop, zisofs, noloop, sgimips. If *looptype* is not specified,
+    a guess is made, based on the name or extension of *loop*.
 
 *isoboot*=<...>::
     Loop-mount an ISO file from the boot device to get the filesystem image.


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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2019-07-29 20:10 Thomas Deutschmann
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Deutschmann @ 2019-07-29 20:10 UTC (permalink / raw
  To: gentoo-commits

commit:     c452f3d690dc695a55aee63f0f2e4ab0cbb7b93a
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 20:56:30 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 20:00:26 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c452f3d6

Change kernel and initramfs default filename in $BOOTDIR

This commit will change default kernel and initramfs filename:

  kernel-genkernel-%%ARCH%%-%%KV%%      -> vmlinuz-%%KV%%
  System.map-genkernel--%%ARCH%%-%%KV%% -> System.map-%%KV%%
  initramfs-genkernel-%%ARCH%%-%%KV%%   -> initramfs-%%KV%%.img

The new naming will be consistent with kernel's "make install" and
will allow to match files in /lib/modules with actual kernel.

In addition, $ARCH value was moved to kernel's LOCALVERSION. This will
ensure that this information is still present and when you do
cross-compilation, that /lib/modules content don't get mixed.

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

 defaults/config.sh   |  6 +++---
 doc/genkernel.8.txt  | 21 ++++++++++++++++-----
 gen_configkernel.sh  |  2 +-
 gen_determineargs.sh | 11 +++++++++--
 genkernel            | 10 ++++++++++
 genkernel.conf       |  6 +++---
 6 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/defaults/config.sh b/defaults/config.sh
index 7232671..9d15633 100644
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -21,11 +21,11 @@ KERNEL_SUPPORT_MICROCODE=no
 # Arch-specific defaults that can be overridden in the config file or on the
 # command line.
 #
-DEFAULT_INITRAMFS_FILENAME="initramfs-genkernel-%%ARCH%%-%%KV%%"
+DEFAULT_INITRAMFS_FILENAME="initramfs-%%KV%%.img"
 DEFAULT_INITRAMFS_SYMLINK_NAME="initramfs"
-DEFAULT_KERNEL_FILENAME="kernel-genkernel-%%ARCH%%-%%KV%%"
+DEFAULT_KERNEL_FILENAME="vmlinuz-%%KV%%"
 DEFAULT_KERNEL_SYMLINK_NAME="kernel"
-DEFAULT_SYSTEMMAP_FILENAME="System.map-%%ARCH%%-%%KV%%"
+DEFAULT_SYSTEMMAP_FILENAME="System.map-%%KV%%"
 DEFAULT_SYSTEMMAP_SYMLINK_NAME="System.map"
 
 DEFAULT_COMPRESS_INITRD=yes

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index e94fa12..35762a2 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -125,8 +125,19 @@ KERNEL CONFIGURATION
     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.
+Set kernel option *LOCALVERSION*. Use special value *UNSET* to
+unset any already set *LOCALVERSION*. The following placeholders are
+available:
++
+[horizontal]
+*%%ARCH%%*:::
+Will be replaced with genkernel arch value, for example 'x86_64'.
+
++
+*LOCALVERSION* is only allowed to contain characters like 'a-z' or 'A-Z',
+'0-9', '_', '.' and '-'.
++
+By default, *LOCALVERSION* will be set to '-%%ARCH%%'.
 
 
 KERNEL COMPILATION
@@ -437,7 +448,7 @@ Set initramfs filename which will be used when initramfs will be installed
 into *BOOTDIR* (implies *--install* option). Please see
 *--kernel-filename* option for available placeholders and restrictions.
 +
-By default, initramfs filename will be set to 'initramfs-genkernel-%%ARCH%%-%%KV%%'.
+By default, initramfs filename will be set to 'initramfs-%%KV%%.img'.
 
 *--initramfs-symlink-name*=<...>::
 Set initramfs symlink name which will be used when initramfs will be
@@ -477,7 +488,7 @@ Will be replaced with kernel version, for example '5.2.3-gentoo'.
 Kernel filename is only allowed to contain characters like 'a-z' or 'A-Z',
 '0-9', '_', '.' and '-'.
 +
-By default, kernel name will be set to 'kernel-genkernel-%%ARCH%%-%%KV%%'.
+By default, kernel name will be set to 'vmlinuz-%%KV%%'.
 
 NOTE: When setting a custom kernel name make sure that your bootloader and
 tools like *kexec* when used are recognizing your custom kernel name.
@@ -502,7 +513,7 @@ Set System.map filename which will be used when kernel will be installed
 into *BOOTDIR* (implies *--install* option). Please see
 *--kernel-filename* option for available placeholders and restrictions.
 +
-By default, System.map filename will be set to 'System.map-genkernel-%%ARCH%%-%%KV%%'.
+By default, System.map filename will be set to 'System.map-%%KV%%'.
 
 *--systemmap-symlink-name*=<...>::
 Set System.map symlink name which will be used when kernel will be

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 124852e..4cfd246 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -27,7 +27,7 @@ determine_kernel_config_file() {
 		then
 			print_info 1 "Default configuration was forced. Will ignore any user kernel configuration!"
 		else
-			kconfig_candidates=( "/etc/kernels/${GK_FILENAME_CONFIG}" ${kconfig_candidates[@]} )
+			kconfig_candidates=( "/etc/kernels/${GK_FILENAME_CONFIG}" "/etc/kernels/kernel-config-${ARCH}-${KV}" ${kconfig_candidates[@]} )
 		fi
 
 		local f

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 2689f86..df0934d 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -86,7 +86,7 @@ determine_KV() {
 determine_output_filenames() {
 	print_info 5 '' 1 0
 
-	GK_FILENAME_CONFIG="kernel-config-${ARCH}-${KV}"
+	GK_FILENAME_CONFIG="kernel-config-${KV}"
 	GK_FILENAME_KERNELZ="kernelz-${KV}"
 	GK_FILENAME_TEMP_CONFIG="config-${ARCH}-${KV}"
 	GK_FILENAME_TEMP_INITRAMFS="initramfs-${ARCH}-${KV}"
@@ -290,7 +290,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 KERNEL_LOCALVERSION                   CMD_KERNEL_LOCALVERSION                   "-%%ARCH%%"
 	set_config_with_override STRING MODPROBEDIR                           CMD_MODPROBEDIR                           "/etc/modprobe.d"
 
 	set_config_with_override BOOL   SPLASH                                CMD_SPLASH                                "no"
@@ -644,6 +644,13 @@ determine_real_args() {
 				UNSET)
 					;;
 				*)
+					KERNEL_LOCALVERSION=$(arch_replace "${KERNEL_LOCALVERSION}")
+					if [ -z "${KERNEL_LOCALVERSION}" ]
+					then
+						# We somehow lost value...
+						gen_die "Internal error: Variable 'KERNEL_LOCALVERSION' is empty!"
+					fi
+
 					local valid_localversion_pattern='^[A-Za-z0-9_.-]{1,}$'
 					if [[ ! "${KERNEL_LOCALVERSION}" =~ ${valid_localversion_pattern} ]]
 					then

diff --git a/genkernel b/genkernel
index 3c125c9..31a880d 100755
--- a/genkernel
+++ b/genkernel
@@ -247,6 +247,16 @@ then
 			print_warning 1 "Unable to copy the kernel configuration file; Ignoring non-fatal error ..."
 			# Just a warning because ordinary users are not allowed to write in /etc
 	fi
+elif [[ -n "${KERNEL_LOCALVERSION}" && "${KERNEL_LOCALVERSION}" != "${LOV}" ]]
+then
+	if [[ "${KERNEL_LOCALVERSION}" == "UNSET" && -z "${LOV}" ]]
+	then
+		# LOV is already unset...
+		:
+	else
+		print_warning 1 '' 1 0
+		print_warning 1 "Current kernel's LOCALVERSION is set to '${LOV}'; Will ignore set --kernel-localversion value '${KERNEL_LOCALVERSION}' because kernel was not build ..."
+	fi
 fi
 
 if isTrue "${CMD_INSTALL}"

diff --git a/genkernel.conf b/genkernel.conf
index 23e015b..aa458fb 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -281,7 +281,7 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux"
 #
 # Set kernel filename which will be used when kernel will be installed
 # into BOOTDIR. See man page to learn more about available placeholders.
-#KERNEL_FILENAME="kernel-genkernel-%%ARCH%%-%%KV%%"
+#KERNEL_FILENAME="vmlinuz-%%KV%%"
 
 # Set kernel symlink name which will be used when kernel will be installed
 # into BOOTDIR and SYMLINK option is enabled
@@ -289,7 +289,7 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux"
 
 # This option will set kernel option CONFIG_LOCALVERSION.
 # Use special value "UNSET" to unset already set CONFIG_LOCALVERSION.
-#KERNEL_LOCALVERSION=""
+#KERNEL_LOCALVERSION="-%%ARCH%%"
 
 # This option is only valid if kerncache is
 # defined. If there is a valid kerncache no checks
@@ -318,7 +318,7 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux"
 # Set initramfs filename which will be used when initramfs will be
 # installed into BOOTDIR. See man page to learn more about available
 # placeholders.
-#INITRAMFS_FILENAME="initramfs-genkernel-%%ARCH%%-%%KV%%"
+#INITRAMFS_FILENAME="initramfs-%%KV%%.img"
 
 # Set initramfs symlink name which will be used when initramfs will be
 # installed into BOOTDIR and SYMLINK option is enabled


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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2019-10-02 22:45 Thomas Deutschmann
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Deutschmann @ 2019-10-02 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     2ca8d5bb635d8f9db68d87e078f4ce4f410e9152
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 23:07:57 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 23:07:57 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=2ca8d5bb

Add --utils-cxx option

To compile thin-provisioning-tools, required for LVM thin provisioning
support which was added in commit 9dea735590ebfff278710148fa8743777a18c4bd,
we need a C++ compiler.

This option will allow user to specify custom C++ compiler (for example
when using ccache/distcc).

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

 defaults/config.sh   | 1 +
 doc/genkernel.8.txt  | 5 ++++-
 gen_cmdline.sh       | 7 ++++++-
 gen_determineargs.sh | 1 +
 gen_funcs.sh         | 3 +++
 genkernel.conf       | 6 +++++-
 6 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/defaults/config.sh b/defaults/config.sh
index 9d15633..d9ea32c 100644
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -43,5 +43,6 @@ DEFAULT_KERNEL_LD=ld
 
 DEFAULT_UTILS_CFLAGS="-Os -pipe -fomit-frame-pointer"
 DEFAULT_UTILS_CC=gcc
+DEFAULT_UTILS_CXX=g++
 DEFAULT_UTILS_AS=as
 DEFAULT_UTILS_LD=ld

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 82da1e1..3932e3d 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -269,7 +269,10 @@ LOW-LEVEL COMPILATION OPTIONS
     C compiler flags used to compile utilities.
 
 *--utils-cc*=<compiler>::
-    Compiler to use for utilities.
+    C Compiler to use for utilities.
+
+*--utils-cxx*=<compiler>::
+    C++ Compiler to use for utilities.
 
 *--utils-ld*=<linker>::
     Linker to use for utilities.

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 7e74182..d74c8f8 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -94,7 +94,8 @@ longusage() {
   echo "	--kernel-outputdir=<path>"
   echo "				Save output files outside the source tree"
   echo "	--utils-as=<assembler>	Assembler to use for utils"
-  echo "	--utils-cc=<compiler>	Compiler to use for utilities"
+  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-make=<makeprog>	GNU Make to use for utils"
@@ -309,6 +310,10 @@ parse_cmdline() {
 			CMD_UTILS_CC="${*#*=}"
 			print_info 3 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
 			;;
+		--utils-cxx=*)
+			CMD_UTILS_CXX="${*#*=}"
+			print_info 3 "CMD_UTILS_CXX: ${CMD_UTILS_CXX}"
+			;;
 		--utils-cflags=*)
 			CMD_UTILS_CFLAGS="${*#*=}"
 			print_info 3 "CMD_UTILS_CFLAGS: ${CMD_UTILS_CFLAGS}"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index f3cfedf..28590d3 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -285,6 +285,7 @@ determine_real_args() {
 	set_config_with_override STRING KERNEL_LD                             CMD_KERNEL_LD                             "$DEFAULT_KERNEL_LD"
 	set_config_with_override STRING KERNEL_AS                             CMD_KERNEL_AS                             "$DEFAULT_KERNEL_AS"
 	set_config_with_override STRING UTILS_CC                              CMD_UTILS_CC                              "$DEFAULT_UTILS_CC"
+	set_config_with_override STRING UTILS_CXX                             CMD_UTILS_CXX                             "$DEFAULT_UTILS_CXX"
 	set_config_with_override STRING UTILS_LD                              CMD_UTILS_LD                              "$DEFAULT_UTILS_LD"
 	set_config_with_override STRING UTILS_AS                              CMD_UTILS_AS                              "$DEFAULT_UTILS_AS"
 

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 23f6d30..1d4a91d 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -1061,6 +1061,9 @@ _tc-getPROG() {
 			CC)
 				[[ -n "${multilib_cflags}" ]] && prog+=( "${multilib_cflags}" )
 				;;
+			CXX)
+				[[ -n "${multilib_cflags}" ]] && prog+=( "${multilib_cflags}" )
+				;;
 			LD)
 				[[ -n "${multilib_ldflags}" ]] &&  prog+=( "${multilib_ldflags}" )
 				;;

diff --git a/genkernel.conf b/genkernel.conf
index aa458fb..388502f 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -205,10 +205,14 @@ NOCOLOR="false"
 # option.
 #UTILS_MAKE="make"
 
-# Compiler to use for the utilities (e.g. distcc).  See also the --utils-cc
+# C Compiler to use for the utilities (e.g. distcc).  See also the --utils-cc
 # command line option.
 #UTILS_CC="gcc"
 
+# C++ Compiler to use for the utilities (e.g. distcc).  See also the --utils-cxx
+# command line option.
+#UTILS_CXX="g++"
+
 # Assembler to use for the utilities.  See also the --utils-as command line
 # option.
 #UTILS_AS="as"


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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2020-03-04  0:02 Thomas Deutschmann
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Deutschmann @ 2020-03-04  0:02 UTC (permalink / raw
  To: gentoo-commits

commit:     8768d9f1b9e8d166dbbd3428b221578c7504679c
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  3 00:38:31 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Mar  3 23:53:06 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=8768d9f1

Make kernel config filename customizable

This commit will make kernel config filename used by --save-config
feature customizable like previous commit 769a07fd3e947 did for
initramfs and kernel image.

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

 defaults/config.sh   |  1 +
 doc/genkernel.8.txt  |  6 ++++++
 gen_cmdline.sh       |  6 ++++++
 gen_configkernel.sh  |  2 +-
 gen_determineargs.sh | 19 +++++++++++++++++--
 5 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/defaults/config.sh b/defaults/config.sh
index fed5355..8c7cf7e 100644
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -23,6 +23,7 @@ KERNEL_SUPPORT_MICROCODE=no
 #
 DEFAULT_INITRAMFS_FILENAME="initramfs-%%KV%%.img"
 DEFAULT_INITRAMFS_SYMLINK_NAME="initramfs"
+DEFAULT_KERNEL_CONFIG_FILENAME="kernel-config-%%KV%%"
 DEFAULT_KERNEL_FILENAME="vmlinuz-%%KV%%"
 DEFAULT_KERNEL_SYMLINK_NAME="kernel"
 DEFAULT_SYSTEMMAP_FILENAME="System.map-%%KV%%"

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index e00e028..7cd65fe 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -506,6 +506,12 @@ NOTE: No modules outside of the initramfs will be included!
     Archive file created using tar containing kernel binary, content of
     '/lib/modules' and the kernel config after the callbacks have run.
 
+*--kernel-config-filename*=<...>::
+Set the kernel config filename used by *--save-config*. Please see
+*--kernel-filename* option for available placeholders and restrictions.
++
+By default, kernel config filename will be set to 'kernel-config-%%KV%%'.
+
 *--kernel-filename*=<...>::
 Set kernel filename which will be used when kernel will be installed
 into *BOOTDIR* (implies *--install* option). The following placeholders

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index aa54c29..a34a739 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -193,6 +193,8 @@ longusage() {
   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"
+  echo "	--kernel-config-filename=<...>"
+  echo "				Set kernel config filename"
   echo "	--kernel-filename=<...>"
   echo "				Set kernel filename"
   echo "	--kernel-symlink-name=<...>"
@@ -701,6 +703,10 @@ parse_cmdline() {
 			CMD_KERNCACHE="${*#*=}"
 			print_info 3 "KERNCACHE: ${CMD_KERNCACHE}"
 			;;
+		--kernel-config-filename=*)
+			CMD_KERNEL_CONFIG_FILENAME="${*#*=}"
+			print_info 3 "CMD_KERNEL_CONFIG_FILENAME: ${CMD_KERNEL_CONFIG_FILENAME}"
+			;;
 		--kernel-filename=*)
 			CMD_KERNEL_FILENAME="${*#*=}"
 			print_info 3 "CMD_KERNEL_FILENAME: ${CMD_KERNEL_FILENAME}"

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 2f9a6a5..7804949 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -44,7 +44,7 @@ determine_kernel_config_file() {
 		else
 			local -a user_kconfig_candidates
 
-			# Always prefer kernel config based on actual $KV reading
+			# Always prefer kernel config based on set --kernel-config-filename
 			user_kconfig_candidates+=( "/etc/kernels/${GK_FILENAME_CONFIG}" )
 
 			if [ -n "${KERNEL_LOCALVERSION}" -a "${KERNEL_LOCALVERSION}" != "UNSET" ]

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 14ef757..6c5d01c 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -87,7 +87,6 @@ determine_KV() {
 determine_output_filenames() {
 	print_info 5 '' 1 0
 
-	GK_FILENAME_CONFIG="kernel-config-${KV}"
 	GK_FILENAME_KERNELZ="kernelz-${KV}"
 	GK_FILENAME_TEMP_CONFIG="config-${ARCH}-${KV}"
 	GK_FILENAME_TEMP_INITRAMFS="initramfs-${ARCH}-${KV}"
@@ -96,7 +95,10 @@ determine_output_filenames() {
 	GK_FILENAME_TEMP_SYSTEMMAP="System.map-${ARCH}-${KV}"
 
 	# Do we have values?
-	if [ -z "${KERNEL_FILENAME}" ]
+	if [ -z "${KERNEL_CONFIG_FILENAME}" ]
+	then
+		gen_die "--kernel-config-filename must be set to a non-empty value!"
+	elif [ -z "${KERNEL_FILENAME}" ]
 	then
 		gen_die "--kernel-filename must be set to a non-empty value!"
 	elif [ -z "${KERNEL_SYMLINK_NAME}" ]
@@ -116,6 +118,17 @@ determine_output_filenames() {
 		gen_die "--initramfs-filename must be set to a non-empty value!"
 	fi
 
+	# Kernel .config
+	GK_FILENAME_CONFIG=$(arch_replace "${KERNEL_CONFIG_FILENAME}")
+	GK_FILENAME_CONFIG=$(kv_replace "${GK_FILENAME_CONFIG}")
+
+	if [ -z "${GK_FILENAME_CONFIG}" ]
+	then
+		gen_die "Internal error: Variable 'GK_FILENAME_CONFIG' is empty!"
+	else
+		print_info 5 "GK_FILENAME_CONFIG set to '${GK_FILENAME_CONFIG}' (was: '${KERNEL_CONFIG_FILENAME}')"
+	fi
+
 	# Kernel
 	GK_FILENAME_KERNEL=$(arch_replace "${KERNEL_FILENAME}")
 	GK_FILENAME_KERNEL=$(kv_replace "${GK_FILENAME_KERNEL}")
@@ -221,6 +234,7 @@ determine_output_filenames() {
 	fi
 
 	local -a filename_vars
+	filename_vars+=( 'GK_FILENAME_CONFIG;--kernel-config-filename' )
 	filename_vars+=( 'GK_FILENAME_KERNEL;--kernel-filename' )
 	filename_vars+=( 'GK_FILENAME_KERNEL_SYMLINK;--kernel-symlink-name' )
 	filename_vars+=( 'GK_FILENAME_INITRAMFS;--initramfs-filename' )
@@ -275,6 +289,7 @@ determine_real_args() {
 	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}"
+	set_config_with_override STRING KERNEL_CONFIG_FILENAME                CMD_KERNEL_CONFIG_FILENAME                "${DEFAULT_KERNEL_CONFIG_FILENAME}"
 	set_config_with_override STRING KERNEL_FILENAME                       CMD_KERNEL_FILENAME                       "${DEFAULT_KERNEL_FILENAME}"
 	set_config_with_override STRING KERNEL_SYMLINK_NAME                   CMD_KERNEL_SYMLINK_NAME                   "${DEFAULT_KERNEL_SYMLINK_NAME}"
 	set_config_with_override STRING SYSTEMMAP_FILENAME                    CMD_SYSTEMMAP_FILENAME                    "${DEFAULT_SYSTEMMAP_FILENAME}"


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

* [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
@ 2020-07-16 15:03 Thomas Deutschmann
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Deutschmann @ 2020-07-16 15:03 UTC (permalink / raw
  To: gentoo-commits

commit:     944da1fc61bd64a47c2bc6415da5e5d5611b6ff5
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 14 14:17:30 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 14:29:15 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=944da1fc

gen_initramfs.sh: create_initramfs(): Move and unify validation of --compress-initramfs-type to determine_real_args()

This will allow us to error out early if required user space tool
needed to compress initramfs based on specified --compress-initramfs-type
is missing or selected type is invalid/unsupported.

Best/fastest list is based on results from [Link1][Link2][Link3].

Link1: https://events.static.linuxfound.org/sites/events/files/lcjpcojp13_klee.pdf
Link2: https://kernel.ubuntu.com/~cking/boot-speed-eoan-5.3/kernel-compression-method.txt
Link3: https://lwn.net/Articles/817134/
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 defaults/compression_methods.sh | 37 +++++++++++++++++
 doc/genkernel.8.txt             | 10 +++--
 gen_cmdline.sh                  |  3 +-
 gen_determineargs.sh            | 91 +++++++++++++++++++++++++++++++++++++++++
 gen_funcs.sh                    | 24 +++++++++++
 gen_initramfs.sh                | 67 +++---------------------------
 genkernel                       |  1 +
 7 files changed, 168 insertions(+), 65 deletions(-)

diff --git a/defaults/compression_methods.sh b/defaults/compression_methods.sh
new file mode 100644
index 0000000..41ee9c4
--- /dev/null
+++ b/defaults/compression_methods.sh
@@ -0,0 +1,37 @@
+# NOTE:
+# - This file (compression_methods.sh) is sourced by genkernel.
+#   Rather than changing this very file, please override specific variables
+#   somewhere in /etc/genkernel.conf .
+#
+# - This file should not override previously defined variables, as their values may
+#   originate from user changes to /etc/genkernel.conf .
+
+GKICM_BZ2_KOPTNAME="BZIP2"
+GKICM_BZ2_CMD="bzip2 -z -f -9"
+GKICM_BZ2_EXT=".bz2"
+GKICM_BZ2_PKG="app-arch/bzip2"
+
+GKICM_GZ_KOPTNAME="GZIP"
+GKICM_GZ_CMD="gzip -f -9"
+GKICM_GZ_EXT=".gz"
+GKICM_GZ_PKG="app-arch/gzip"
+
+GKICM_LZO_KOPTNAME="LZO"
+GKICM_LZO_CMD="lzop -f -9"
+GKICM_LZO_EXT=".lzo"
+GKICM_LZO_PKG="app-arch/lzop"
+
+GKICM_LZ4_KOPTNAME="LZ4"
+GKICM_LZ4_CMD="lz4 -f -9 -l -q"
+GKICM_LZ4_EXT=".lz4"
+GKICM_LZ4_PKG="app-arch/lz4"
+
+GKICM_LZMA_KOPTNAME="LZMA"
+GKICM_LZMA_CMD="lzma -z -f -9"
+GKICM_LZMA_EXT=".lzma"
+GKICM_LZMA_PKG="app-arch/xz-utils"
+
+GKICM_XZ_KOPTNAME="XZ"
+GKICM_XZ_CMD="xz -e --check=none -z -f -9"
+GKICM_XZ_EXT=".xz"
+GKICM_XZ_PKG="app-arch/xz-utils"

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 494a29c..40c591e 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -598,9 +598,13 @@ NOTE: System.map filename and System.map symlink name must be different.
     Deprecated alias for *--*[*no-*]*compress-initramfs*.
 
 *--compress-initramfs-type*=<arg>::
-    Compression type for initramfs (best, xz, lzma, bzip2, gzip, lzop, lz4).
-    "Best" causes selection of the best available algorithm that is selected
-    in your kernel configuration.
+    Compression type for initramfs (best, bzip2, fastest, gzip, lz4, lzma, lza, xz).
++
+*best* will select the algorithm providing best compression
+from those selected in your kernel configuration.
++
+*fastest* will select the algorithm providing fastest decompression
+from those selected in your kernel configuration.
 
 *--strip*=<all|kernel|modules|none>::
     Strip debug symbols from none, all, installed kernel (obsolete) or

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 9e59ed2..1daee5c 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -243,7 +243,8 @@ longusage() {
   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, lz4)"
+  echo "				Compression type for initramfs (best, bzip2, fastest, gzip, lz4,"
+  echo "				lzma, lza, xz)"
   echo "	--strip=(all|kernel|modules|none)"
   echo "				Strip debug symbols from none, all, installed kernel (obsolete) or"
   echo "				modules (default)"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 0cbba36..406d1d5 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -619,6 +619,73 @@ determine_real_args() {
 	done
 	unset v pn pn_varname pkg_prefixes
 
+	declare -gA GKICM_LOOKUP_TABLE_CMD=()
+	declare -gA GKICM_LOOKUP_TABLE_EXT=()
+	declare -gA GKICM_LOOKUP_TABLE_PKG=()
+	local known_initramfs_compression_methods_by_compression=( $(get_initramfs_compression_method_by_compression) )
+	local known_initramfs_compression_methods_by_speed=( $(get_initramfs_compression_method_by_speed) )
+	local initramfs_compression_methods=( $(compgen -A variable |grep '^GKICM_.*_KOPTNAME$') )
+	local initramfs_compression_method key var_name var_prefix
+	for initramfs_compression_method in "${initramfs_compression_methods[@]}"
+	do
+		if [ -z "${!initramfs_compression_method}" ]
+		then
+			gen_die "Invalid config found: Check value of '${initramfs_compression_method}'!"
+		fi
+
+		if [[ "${known_initramfs_compression_methods_by_compression[@]} " != *"${!initramfs_compression_method}"* ]]
+		then
+			gen_die "Internal error: Initramfs compression method '${!initramfs_compression_method}' was not added to get_initramfs_compression_method_by_compression()!"
+		else
+			known_initramfs_compression_methods_by_compression=( $(printf '%s\n' "${known_initramfs_compression_methods_by_compression[@]//${!initramfs_compression_method}/}") )
+		fi
+
+		if [[ "${known_initramfs_compression_methods_by_speed[@]} " != *"${!initramfs_compression_method}"* ]]
+		then
+			gen_die "Internal error: Initramfs compression method '${!initramfs_compression_method}' was not added to get_initramfs_compression_method_by_speed()!"
+		else
+			known_initramfs_compression_methods_by_speed=( $(printf '%s\n' "${known_initramfs_compression_methods_by_speed[@]//${!initramfs_compression_method}/}") )
+		fi
+
+		var_prefix="${initramfs_compression_method%_KOPTNAME}"
+
+		for key in CMD EXT PKG
+		do
+			var_name="${var_prefix}_${key}"
+			if [ -z "${!var_name}" ]
+			then
+				gen_die "Internal error: Variable '${var_name}' is not set!"
+			fi
+
+			case ${key} in
+				CMD)
+					GKICM_LOOKUP_TABLE_CMD[${!initramfs_compression_method}]="${!var_name}"
+					;;
+				EXT)
+					GKICM_LOOKUP_TABLE_EXT[${!initramfs_compression_method}]="${!var_name}"
+					;;
+				PKG)
+					GKICM_LOOKUP_TABLE_PKG[${!initramfs_compression_method}]="${!var_name}"
+					;;
+			esac
+		done
+	done
+	unset initramfs_compression_methods initramfs_compression_method key var_name var_prefix
+
+	# It is enough to check just one data set because we validated
+	# both data sets above.
+	if [[ ${#known_initramfs_compression_methods_by_compression[@]} -gt 0 ]]
+	then
+		local unhandled_method
+		for unhandled_method in "${known_initramfs_compression_methods_by_compression[@]}"
+		do
+			print_error 1 "Do not know how to handle initramfs compression type '${unhandled_method}'!"
+		done
+
+		gen_die "Internal error: Not all known initramfs compression methods are defined!"
+	fi
+	unset known_initramfs_compression_methods_by_compression known_initramfs_compression_methods_by_speed
+
 	if [ -n "${CMD_BOOTLOADER}" ]
 	then
 		BOOTLOADER="${CMD_BOOTLOADER}"
@@ -1009,6 +1076,30 @@ determine_real_args() {
 			gen_die "'\"${LDDTREE_COMMAND}\" -l \"${CPIO_COMMAND}\"' failed -- cannot generate initramfs without working lddtree!"
 		fi
 
+		if isTrue "${COMPRESS_INITRD}"
+		then
+			local pattern_auto='^(BEST|FASTEST)$'
+			local pattern_manual="$(get_initramfs_compression_method_by_speed)"
+			pattern_manual=${pattern_manual// /|}
+			pattern_manual="^(${pattern_manual})$"
+
+			if [[ "${COMPRESS_INITRD_TYPE^^}" =~ ${pattern_auto} ]]
+			then
+				# Will be handled in set_initramfs_compression_method()
+				:;
+			elif [[ ! "${COMPRESS_INITRD_TYPE^^}" =~ ${pattern_manual} ]]
+			then
+				gen_die "Specified --compress-initramfs-type '${COMPRESS_INITRD_TYPE}' is unknown"
+			elif ! hash ${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE^^}]/%\ */} &>/dev/null
+			then
+				gen_die "'${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE^^}]/%\ */}', the tool to compress initramfs based on selected --compress-initramfs-type was not found. Is ${GKICM_LOOKUP_TABLE_PKG[${COMPRESS_INITRD_TYPE^^}]} installed?"
+			fi
+			unset pattern_auto pattern_manual
+
+			# Ensure that value matches keys in GKICM_* arrays
+			COMPRESS_INITRD_TYPE=${COMPRESS_INITRD_TYPE^^}
+		fi
+
 		SANDBOX_COMMAND=
 		if isTrue "${SANDBOX}"
 		then

diff --git a/gen_funcs.sh b/gen_funcs.sh
index 8c6f412..e681c1e 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -464,6 +464,30 @@ get_indent() {
 	echo "${_indent}"
 }
 
+get_initramfs_compression_method_by_compression() {
+	local -a methods=()
+	methods+=( XZ )
+	methods+=( LZMA )
+	methods+=( GZIP )
+	methods+=( BZIP2 )
+	methods+=( LZO )
+	methods+=( LZ4 )
+
+	echo "${methods[@]}"
+}
+
+get_initramfs_compression_method_by_speed() {
+	local -a methods=()
+	methods+=( LZ4 )
+	methods+=( LZO )
+	methods+=( GZIP )
+	methods+=( BZIP2 )
+	methods+=( LZMA )
+	methods+=( XZ )
+
+	echo "${methods[@]}"
+}
+
 setup_cache_dir() {
 	if [ ! -d "${GK_V_CACHEDIR}" ]
 	then

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index fd9583b..617c656 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1770,7 +1770,6 @@ append_data() {
 }
 
 create_initramfs() {
-	local compress_ext=""
 	print_info 1 "initramfs: >> Initializing ..."
 
 	# Create empty cpio
@@ -1894,6 +1893,8 @@ create_initramfs() {
 		print_info 1 "$(get_indent 1)>> --integrated-initramfs is set; Setting CONFIG_INITRAMFS_* options ..."
 
 		[ -f "${KCONFIG_MODIFIED_MARKER}" ] && rm "${KCONFIG_MODIFIED_MARKER}"
+		[ -f "${KCONFIG_REQUIRED_OPTIONS}" ] && rm "${KCONFIG_REQUIRED_OPTIONS}"
+
 		kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_BLK_DEV_INITRD" "y"
 		kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_SOURCE" "\"${CPIO_ARCHIVE}.cpio\""
 		kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_INITRAMFS_ROOT_UID" "0"
@@ -1911,66 +1912,10 @@ create_initramfs() {
 	else
 		if isTrue "${COMPRESS_INITRD}"
 		then
-			local cmd_xz=$(type -p xz)
-			local cmd_lzma=$(type -p lzma)
-			local cmd_bzip2=$(type -p bzip2)
-			local cmd_gzip=$(type -p gzip)
-			local cmd_lzop=$(type -p lzop)
-			local cmd_lz4=$(type -p lz4)
-			local pkg_xz='app-arch/xz-utils'
-			local pkg_lzma='app-arch/xz-utils'
-			local pkg_bzip2='app-arch/bzip2'
-			local pkg_gzip='app-arch/gzip'
-			local pkg_lzop='app-arch/lzop'
-			local pkg_lz4='app-arch/lz4'
-			local compression
-			case ${COMPRESS_INITRD_TYPE} in
-				xz|lzma|bzip2|gzip|lzop|lz4) compression=${COMPRESS_INITRD_TYPE} ;;
-				lzo) compression=lzop ;;
-				best|fastest)
-					local tuple
-					for tuple in \
-							'CONFIG_RD_XZ    cmd_xz    xz' \
-							'CONFIG_RD_LZMA  cmd_lzma  lzma' \
-							'CONFIG_RD_BZIP2 cmd_bzip2 bzip2' \
-							'CONFIG_RD_GZIP  cmd_gzip  gzip' \
-							'CONFIG_RD_LZO   cmd_lzop  lzop' \
-							'CONFIG_RD_LZ4   cmd_lz4   lz4' \
-							; do
-						set -- ${tuple}
-						local kernel_option=${1}
-						local cmd_variable_name=${2}
-						if ${CONFGREP} -q "^${kernel_option}=y" "${ACTUAL_KERNEL_CONFIG}" && test -n "${!cmd_variable_name}" ; then
-							compression=${3}
-							[[ ${COMPRESS_INITRD_TYPE} == best ]] && break
-						fi
-					done
-					[[ -z "${compression}" ]] && gen_die "None of the initramfs compression methods we tried are supported by your kernel (config file \"${ACTUAL_KERNEL_CONFIG}\"), strange!?"
-					;;
-				*)
-					gen_die "Compression '${COMPRESS_INITRD_TYPE}' unknown"
-					;;
-			esac
-
-			# Check for actual availability
-			local cmd_variable_name=cmd_${compression}
-			local pkg_variable_name=pkg_${compression}
-			[[ -z "${!cmd_variable_name}" ]] && gen_die "Compression '${compression}' is not available. Please install package '${!pkg_variable_name}'."
-
-			local compress_ext compress_cmd
-			case ${compression} in
-				xz) compress_ext='.xz' compress_cmd="${cmd_xz} -e --check=none -z -f -9" ;;
-				lzma) compress_ext='.lzma' compress_cmd="${cmd_lzma} -z -f -9" ;;
-				bzip2) compress_ext='.bz2' compress_cmd="${cmd_bzip2} -z -f -9" ;;
-				gzip) compress_ext='.gz' compress_cmd="${cmd_gzip} -f -9" ;;
-				lzop) compress_ext='.lzo' compress_cmd="${cmd_lzop} -f -9" ;;
-				lz4) compress_ext='.lz4' compress_cmd="${cmd_lz4} -f -9 -l -q" ;;
-			esac
-
-			print_info 1 "$(get_indent 1)>> Compressing cpio data (${compress_ext}) ..."
-			print_info 3 "COMMAND: ${compress_cmd} ${CPIO_ARCHIVE}" 1 0 1
-			${compress_cmd} "${CPIO_ARCHIVE}" || gen_die "Compression (${compress_cmd}) failed"
-			mv -f "${CPIO_ARCHIVE}${compress_ext}" "${CPIO_ARCHIVE}" || gen_die "Rename failed"
+			print_info 1 "$(get_indent 1)>> Compressing cpio data (${GKICM_LOOKUP_TABLE_EXT[${COMPRESS_INITRD_TYPE}]}) ..."
+			print_info 3 "COMMAND: ${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE}]} ${CPIO_ARCHIVE}" 1 0 1
+			${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE}]} "${CPIO_ARCHIVE}" || gen_die "Initramfs compression using '${GKICM_LOOKUP_TABLE_CMD[${COMPRESS_INITRD_TYPE}]}' failed"
+			mv -f "${CPIO_ARCHIVE}${GKICM_LOOKUP_TABLE_EXT[${COMPRESS_INITRD_TYPE}]}" "${CPIO_ARCHIVE}" || gen_die "Rename failed"
 		else
 			print_info 3 "$(get_indent 1)>> --no-compress-initramfs is set; Skipping compression of initramfs ..."
 		fi

diff --git a/genkernel b/genkernel
index 0856e25..c0fd96d 100755
--- a/genkernel
+++ b/genkernel
@@ -69,6 +69,7 @@ source "${_GENKERNEL_CONF}" || small_die "Could not read ${_GENKERNEL_CONF}"
 LOGLEVEL=${LOGLEVEL:-1}
 
 # Start sourcing other scripts
+source "${GK_SHARE}"/defaults/compression_methods.sh || small_die "Could not read '${GK_SHARE}/defaults/compression_methods.sh'"
 source "${GK_SHARE}"/defaults/software.sh || small_die "Could not read '${GK_SHARE}/defaults/software.sh'"
 source "${GK_SHARE}"/defaults/config.sh || small_die "Could not read '${GK_SHARE}/defaults/config.sh'"
 source "${GK_SHARE}"/gen_funcs.sh || small_die "Could not read '${GK_SHARE}/gen_funcs.sh'"


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

end of thread, other threads:[~2020-07-16 15:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-29 20:10 [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/ Thomas Deutschmann
  -- strict thread matches above, loose matches on Subject: below --
2020-07-16 15:03 Thomas Deutschmann
2020-03-04  0:02 Thomas Deutschmann
2019-10-02 22:45 Thomas Deutschmann
2012-10-13 22:52 Robin H. Johnson
2012-07-19 20:56 Richard Yao
2012-07-19 20:43 Richard Yao
2012-07-19 20:24 Richard Yao
2011-08-28  9:19 Fabio Erculiani
2011-07-20 19:24 Fabio Erculiani
2011-07-20 15:55 Fabio Erculiani
2011-06-01  1:44 Sebastian Pipping
2011-05-31 13:18 Sebastian Pipping

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