* [gentoo-commits] proj/genkernel:master commit in: /, defaults/, doc/
@ 2015-08-19 19:27 Richard Farina
0 siblings, 0 replies; 3+ messages in thread
From: Richard Farina @ 2015-08-19 19:27 UTC (permalink / raw
To: gentoo-commits
commit: d41ebc4d721a8706d0b0f7c5cd1ed8dab42d667c
Author: Niklas Haas <git <AT> nand <DOT> wakku <DOT> to>
AuthorDate: Wed Aug 19 19:13:20 2015 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Aug 19 19:27:25 2015 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d41ebc4d
Support multi-device Btrfs filesystems
This requires running `/sbin/btrfs device` scan during boot, which is
exposed via the new parameter ``dobtrfs''.
defaults/initrd.scripts | 10 ++++++++++
defaults/linuxrc | 3 +++
doc/genkernel.8.txt | 6 ++++++
gen_cmdline.sh | 6 ++++++
gen_determineargs.sh | 1 +
gen_initramfs.sh | 21 +++++++++++++++++++++
genkernel | 1 +
genkernel.conf | 3 +++
8 files changed, 51 insertions(+)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index e05809c..4724b55 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -997,6 +997,16 @@ startVolumes() {
bad_msg "vgscan or vgchange not found: skipping LVM volume group activation!"
fi
fi
+
+ if [ "${USE_BTRFS}" = '1' ]
+ then
+ if [ -x '/sbin/btrfs' ]
+ then
+ /sbin/btrfs device scan
+ else
+ bad_msg "btrfs not found: skipping btrfs device scanning!"
+ fi
+ fi
if [ "${USE_ZFS}" = '1' ]
then
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 19b9878..46b2151 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -120,6 +120,9 @@ do
ZPOOL_FORCE=-f
fi
;;
+ dobtrfs*)
+ USE_BTRFS=1
+ ;;
quiet)
QUIET=1
;;
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index f8d7a10..45af60e 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -275,6 +275,9 @@ INITIALIZATION
*--*[*no-*]*zfs*::
Includes or excludes ZFS support.
+*--*[*no-*]*btrfs*::
+ Includes or excludes Btrfs support.
+
*--*[*no-*]*multipath*::
Includes or excludes Multipath support
@@ -476,6 +479,9 @@ which the ramdisk & initramfs scripts would recognize.
Scan for bootable ZFS pools on bootup. Optionally force import if
necessary.
+*dobtrfs*::
+ Scan for attached Btrfs devices on bootup.
+
*domultipath*::
Activate Multipath on bootup
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 2678d5d..c4f027a 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -99,6 +99,8 @@ longusage() {
echo " --no-e2fsprogs Exclude e2fsprogs"
echo " --zfs Include ZFS support"
echo " --no-zfs Exclude ZFS support"
+ echo " --btrfs Include Btrfs support"
+ echo " --no-btrfs Exclude Btrfs support"
echo " --multipath Include Multipath support"
echo " --no-multipath Exclude Multipath support"
echo " --iscsi Include iSCSI support"
@@ -331,6 +333,10 @@ parse_cmdline() {
CMD_ZFS=`parse_optbool "$*"`
print_info 2 "CMD_ZFS: ${CMD_ZFS}"
;;
+ --btrfs|--no-btrfs)
+ CMD_BTRFS=`parse_optbool "$*"`
+ print_info 2 "CMD_BTRFS: ${CMD_BTRFS}"
+ ;;
--virtio)
CMD_VIRTIO=`parse_optbool "$*"`
print_info 2 "CMD_VIRTIO: ${CMD_VIRTIO}"
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 59af78b..cbc88ba 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -125,6 +125,7 @@ determine_real_args() {
set_config_with_override STRING MDADM_CONFIG CMD_MDADM_CONFIG
set_config_with_override BOOL E2FSPROGS CMD_E2FSPROGS "no"
set_config_with_override BOOL ZFS CMD_ZFS "$(rootfs_type_is zfs)"
+ set_config_with_override BOOL BTRFS CMD_BTRFS "$(rootfs_type_is btrfs)"
set_config_with_override BOOL VIRTIO CMD_VIRTIO "no"
set_config_with_override BOOL MULTIPATH CMD_MULTIPATH
set_config_with_override BOOL FIRMWARE CMD_FIRMWARE
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index e7f72df..99a99c4 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -462,6 +462,25 @@ append_zfs(){
rm -rf "${TEMP}/initramfs-zfs-temp" > /dev/null
}
+append_btrfs() {
+ if [ -d "${TEMP}/initramfs-btrfs-temp" ]
+ then
+ rm -r "${TEMP}/initramfs-btrfs-temp"
+ fi
+
+ mkdir -p "${TEMP}/initramfs-btrfs-temp"
+
+ # Copy binaries
+ copy_binaries "${TEMP}/initramfs-btrfs-temp" /sbin/btrfs
+
+ cd "${TEMP}/initramfs-btrfs-temp/"
+ log_future_cpio_content
+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+ || gen_die "compressing btrfs cpio"
+ cd "${TEMP}"
+ rm -rf "${TEMP}/initramfs-btrfs-temp" > /dev/null
+}
+
append_linker() {
if [ -d "${TEMP}/initramfs-linker-temp" ]
then
@@ -817,6 +836,8 @@ create_initramfs() {
append_data 'zfs' "${ZFS}"
+ append_data 'btrfs' "${BTRFS}"
+
append_data 'blkid' "${DISKLABEL}"
append_data 'unionfs_fuse' "${UNIONFS}"
diff --git a/genkernel b/genkernel
index 9f3ec9c..15ea11f 100755
--- a/genkernel
+++ b/genkernel
@@ -370,6 +370,7 @@ then
[ "${DMRAID}" = '1' ] && print_warning 1 ' or "dodmraid=<additional options>"'
[ "${ZFS}" = '1' ] && print_warning 1 'add "dozfs" for ZFS volume management support'
[ "${ZFS}" = '1' ] && print_warning 1 ' and either "root=ZFS" to use bootfs autodetection or "root=ZFS=<dataset>" to force booting from a specific dataset'
+ [ "${BTRFS}" = '1' ] && print_warning 1 'add "dobtrfs" for Btrfs device scanning support'
[ "${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 [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == application/x-gzip ]]; then
diff --git a/genkernel.conf b/genkernel.conf
index a34e6e7..2e38e41 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -96,6 +96,9 @@ USECOLOR="yes"
# Include support for zfs volume management.
#ZFS="no"
+# Add BTRFS support.
+#BTRFS="no"
+
# Enable copying of firmware into initramfs
#FIRMWARE="no"
# Specify directory to pull from
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: /, defaults/, doc/
@ 2020-01-12 14:59 Thomas Deutschmann
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Deutschmann @ 2020-01-12 14:59 UTC (permalink / raw
To: gentoo-commits
commit: da5a5fa797a5fffa6c4d694cbfe2edc83bab4890
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 10 17:10:08 2020 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 19:54:40 2020 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=da5a5fa7
--module-rebuild: Call emerge with --ignore-default-opts
It's possible that user has set conflicting emerge options like
"--ask" in EMERGE_DEFAULT_OPTS which could break genkernel.
Calling emerge with --ignore-default-opts will allow us to
avoid such scenarios.
In addition, --module-rebuild-cmd (MODULEREBUILD_CMD) option was
added to allow user to alter default command.
Closes: https://bugs.gentoo.org/705082
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
defaults/config.sh | 2 ++
doc/genkernel.8.txt | 15 +++++++++++----
gen_cmdline.sh | 6 ++++++
gen_compile.sh | 18 ++++++++----------
gen_determineargs.sh | 12 ++++++++++++
5 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/defaults/config.sh b/defaults/config.sh
index d9ea32c..678c0f9 100644
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -34,6 +34,8 @@ DEFAULT_COMPRESS_INITRD_TYPE=best
PORTAGE_MAKEOPTS="$(portageq envvar MAKEOPTS)"
DEFAULT_MAKEOPTS="${PORTAGE_MAKEOPTS:- -j2}"
+DEFAULT_MODULEREBUILD_CMD="emerge --ignore-default-opts --quiet @module-rebuild"
+
DEFAULT_KERNEL_MAKE=make
DEFAULT_UTILS_MAKE=make
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 6c4c155..e9076a4 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -196,10 +196,17 @@ specified.
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.
+ Runs, or does not run "emerge --ignore-default-opts --quiet @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.
+
+NOTE: Command can be customized using '--module-rebuild-cmd' command-line
+argument or 'MODULEREBUILD_CMD' in '/etc/genkernel.conf'.
+
+*--module-rebuild-cmd*=<...>::
+ Overwrite default *--module-rebuild* command.
*--callback*=<...>::
Run the specified arguments in the current environment after the
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 025187f..db9c1f8 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -65,6 +65,8 @@ longusage() {
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 " --module-rebuild-cmd=<...>"
+ echo " Overwrite default --module-rebuild command"
echo " --callback=<...> Run the specified arguments after the"
echo " kernel and modules have been compiled"
echo " --static Build a static (monolithic kernel)"
@@ -606,6 +608,10 @@ parse_cmdline() {
CMD_MODULEREBUILD=$(parse_optbool "$*")
print_info 3 "CMD_MODULEREBUILD: ${CMD_MODULEREBUILD}"
;;
+ --module-rebuild-cmd=*)
+ CMD_MODULEREBUILD_CMD="${*#--module-rebuild-cmd=}"
+ print_info 3 "CMD_MODULEREBUILD_CMD: ${CMD_MODULEREBUILD_CMD}"
+ ;;
--callback=*)
CMD_CALLBACK="${*#*=}"
print_info 3 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
diff --git a/gen_compile.sh b/gen_compile.sh
index 3f10adb..3b96f48 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -2,53 +2,51 @@
# $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' ..."
+ print_info 3 "$(get_indent 1)>> --no-module-rebuild set; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
if isTrue "$(tc-is-cross-compiler)"
then
- print_info 3 "$(get_indent 1)>> Cross-compilation detected; Skipping 'emerge @module-rebuild' ..."
+ print_info 3 "$(get_indent 1)>> Cross-compilation detected; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
if ! isTrue "${CMD_INSTALL}"
then
- print_info 3 "$(get_indent 1)>> --no-install set; Skipping 'emerge @module-rebuild' ..."
+ print_info 3 "$(get_indent 1)>> --no-install set; Skipping '${MODULEREBUILD_CMD}' ..."
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' ..."
+ print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping '${MODULEREBUILD_CMD}' ..."
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' ..."
+ 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) ..."
- print_info 3 "COMMAND: ${command}" 1 0 1
+ print_info 3 "COMMAND: ${MODULEREBUILD_CMD}" 1 0 1
if [ "${LOGLEVEL}" -gt 3 ]
then
# Output to stdout and logfile
- eval ${command} | tee -a "${LOGFILE}"
+ eval ${MODULEREBUILD_CMD} 2>&1 | tee -a "${LOGFILE}"
RET=${PIPESTATUS[0]}
else
# Output to logfile only
- eval ${command} >> "${LOGFILE}"
+ eval ${MODULEREBUILD_CMD} 2>&1 >> "${LOGFILE}"
RET=$?
fi
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 616f4fe..61521d6 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -317,6 +317,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 MODULEREBUILD_CMD CMD_MODULEREBUILD_CMD "${DEFAULT_MODULEREBUILD_CMD}"
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"
@@ -781,6 +782,17 @@ determine_real_args() {
# Kernel Makefile doesn't support spaces in outputdir path...
gen_die "--kernel-outputdir '${KERNEL_OUTPUTDIR}' contains space character(s) which are not supported!"
fi
+
+ if isTrue "${CMD_MODULEREBUILD}"
+ then
+ if [ -z "${MODULEREBUILD_CMD}" ]
+ then
+ gen_die "--module-rebuild-cmd cannot be empty when --module-rebuild is set!"
+ elif [[ "${MODULEREBUILD_CMD}" == *[\$\&\|\>\(\)]* ]]
+ then
+ gen_die "--module-rebuild-cmd '${MODULEREBUILD_CMD}' contains at least one of the following disallowed characters: '\$&|>()'!"
+ fi
+ fi
fi
if isTrue "${BUILD_RAMDISK}"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/genkernel:master commit in: /, defaults/, doc/
@ 2020-09-11 20:05 Thomas Deutschmann
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Deutschmann @ 2020-09-11 20:05 UTC (permalink / raw
To: gentoo-commits
commit: 369cfa98f72675a285ec98439e9054ab57b234c9
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 11 20:01:37 2020 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Sep 11 20:03:24 2020 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=369cfa98
Remove "dobtrfs" kernel command-line argument
This is no longer necessary with the switch to UDEV.
Bug: https://bugs.gentoo.org/739892
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
defaults/initrd.scripts | 32 --------------------------------
defaults/linuxrc | 6 ------
doc/genkernel.8.txt | 3 ---
genkernel | 1 -
4 files changed, 42 deletions(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 5181d6c..f6e84fc 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -75,7 +75,6 @@ modules_scan() {
elif [ "${USE_MDADM}" = '1' ] \
|| [ "${USE_LVM_NORMAL}" = '1' ] \
|| [ "${USE_CRYPTSETUP}" = '1' ] \
- || [ "${USE_BTRFS}" = '1' ] \
|| [ "${USE_ZFS}" = '1' ] \
|| [ "${USE_DMRAID_NORMAL}" = '1' ]
then
@@ -1612,25 +1611,6 @@ start_volumes() {
fi
fi
- if [ "${USE_BTRFS}" = '1' ]
- then
- if ! hash btrfs >/dev/null 2>&1
- then
- bad_msg "dobtrfs invoked but 'btrfs' not found; Skipping btrfs device scanning ..."
- else
- good_msg "Scanning for BTRFS devices ..."
-
- local btrfs_cmd="run btrfs device scan 2>&1"
- is_log_enabled && btrfs_cmd="${btrfs_cmd} | tee -a '${GK_INIT_LOG}'"
-
- eval "${btrfs_cmd}"
- if [ $? -ne 0 ]
- then
- bad_msg "Scanning for BTRFS devices failed!"
- fi
- fi
- fi
-
if [ "${USE_ZFS}" = '1' ]
then
# Avoid race involving asynchronous module loading
@@ -2510,18 +2490,6 @@ cdupdate() {
fi
}
-setup_btrfsctl() {
- # start BTRFS volume detection, if available
- if hash btrfsctl >/dev/null 2>&1
- then
- local btrfs_cmd="run btrfsctl -a 2>&1"
- is_log_enabled && btrfs_cmd="${btrfs_cmd} | tee -a '${GK_INIT_LOG}'"
-
- eval "${btrfs_cmd}"
- udevsettle
- fi
-}
-
rundebugshell() {
if is_debug
then
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 6d07d9b..df0f570 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -151,9 +151,6 @@ do
;;
esac
;;
- dobtrfs)
- USE_BTRFS=1
- ;;
quiet|quiet_genkernel)
QUIET=1
;;
@@ -615,9 +612,6 @@ fi
# Apply scan delay if specified
sdelay
-# Setup btrfs, see bug 303529
-setup_btrfsctl
-
# Scan volumes
start_volumes
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 5d7b74d..8909fc7 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -775,9 +775,6 @@ when not set. This will allow remote user to provide answer through
Scan for bootable ZFS pools on bootup. Optionally use cachefile or force import if
necessary or perform both actions.
-*dobtrfs*::
- Scan for attached Btrfs devices on bootup.
-
*domultipath*::
Activate Multipath on bootup.
diff --git a/genkernel b/genkernel
index 595c6ea..6ec8905 100755
--- a/genkernel
+++ b/genkernel
@@ -485,7 +485,6 @@ then
print_warning 1 "${BOLD}WARNING... WARNING... WARNING...${NORMAL}"
print_warning 1 'Additional kernel parameters that *may* be required to boot properly:'
isTrue "${SPLASH}" && print_warning 1 "- Add \"vga=791 splash=silent,theme:${SPLASH_THEME} console=tty1 quiet\" if you use a splash framebuffer ]"
- isTrue "${BTRFS}" && print_warning 1 '- Add "dobtrfs" for Btrfs device scanning support'
isTrue "${MULTIPATH}" && print_warning 1 '- Add "domultipath" for multipath support'
isTrue "${ISCSI}" && print_warning 1 '- For iSCSI support, add at least:'
isTrue "${ISCSI}" && print_warning 1 ' - "iscsi_initiatorname=<initiator name>"'
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-11 20:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 19:27 [gentoo-commits] proj/genkernel:master commit in: /, defaults/, doc/ Richard Farina
-- strict thread matches above, loose matches on Subject: below --
2020-01-12 14:59 Thomas Deutschmann
2020-09-11 20:05 Thomas Deutschmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox