Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 242125 Details for
Bug 330127
[TRACKER][PATCH] sys-kernel/genkernel: Integrate with Dracut
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dracut-integrated-into-update.patch
0001-dracut-integrated-into.patch (text/plain), 27.89 KB, created by
Amadeusz Żołnowski (RETIRED)
on 2010-08-09 19:10:45 UTC
(
hide
)
Description:
dracut-integrated-into-update.patch
Filename:
MIME Type:
Creator:
Amadeusz Żołnowski (RETIRED)
Created:
2010-08-09 19:10:45 UTC
Size:
27.89 KB
patch
obsolete
>From 30a9c5ccee2f030f8ae32d0123477bc58a8b648f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name> >Date: Mon, 19 Jul 2010 12:54:34 +0200 >Subject: [PATCH] dracut integrated into > >--- > gen_cmdline.sh | 335 +++++++++++++++++++++++++++++++------------------- > gen_determineargs.sh | 14 ++- > gen_dracut.sh | 84 +++++++++++++ > genkernel | 116 ++++++++++++------ > genkernel.conf | 30 +++-- > 5 files changed, 405 insertions(+), 174 deletions(-) > create mode 100755 gen_dracut.sh > >diff --git a/gen_cmdline.sh b/gen_cmdline.sh >index bb0d8fd..d711dd8 100755 >--- a/gen_cmdline.sh >+++ b/gen_cmdline.sh >@@ -14,6 +14,7 @@ longusage() { > echo > echo "Available Options: " > echo " Configuration settings" >+ echo " --local Local mode; source modules from current directory" > echo " --config=<file> genkernel configuration file to use" > echo " Debug settings" > echo " --loglevel=<0-5> Debug Verbosity Level" >@@ -33,15 +34,11 @@ longusage() { > echo " --no-clean Do not run make clean before compilation" > echo " --no-mrproper Do not run make mrproper before compilation" > echo " --oldconfig Implies --no-clean and runs a 'make oldconfig'" >- echo " --gensplash Install framebuffer splash support into initramfs" >- echo " --splash Install framebuffer splash support into initramfs" >- echo " --no-splash Do not install framebuffer splash" > echo " --install Install the kernel after building" > echo " --no-install Do not install the kernel after building" > echo " --symlink Manage symlinks in /boot for installed images" > echo " --no-symlink Do not manage symlinks" > echo " --no-ramdisk-modules Don't copy any modules to the ramdisk" >- echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk" > echo " --callback=<...> Run the specified arguments after the" > echo " kernel and modules have been compiled" > echo " --static Build a static (monolithic kernel)." >@@ -65,39 +62,72 @@ longusage() { > echo " autodetect." > echo " --makeopts=<makeopts> Make options such as -j2, etc..." > echo " --mountboot Mount BOOTDIR automatically if mountable" >- echo " --no-mountboot Don't mount BOOTDIR automatically" >+ echo " --no-mountboot Don't mount BOOTDIR automatically" > echo " --bootdir=<dir> Set the location of the boot-directory, default is /boot" > echo " Initialization" >- echo " --gensplash=<theme> Enable framebuffer splash using <theme>" >- echo " --gensplash-res=<res> Select splash theme resolutions to install" >- echo " --splash=<theme> Enable framebuffer splash using <theme>" >- echo " --splash-res=<res> Select splash theme resolutions to install" >+ echo " --bootloader=grub Add new kernel to GRUB configuration" >+ echo " --dmraid Include DMRAID support" >+ echo " --iscsi Include iSCSI support" >+ echo " --luks Include LUKS support" >+ echo " --> 'emerge cryptsetup-luks' with USE=-dynamic" >+ echo " --lvm Include LVM support" >+ echo " --mdadm Copy /etc/mdadm.conf to initramfs" >+ echo " (obsolete with Dracut; use --mdraid)" >+ echo " --multipath Include Multipath support" >+ echo " Internal engine" >+ echo " --all-ramdisk-modules Copy all kernel modules to the ramdisk" > echo " --do-keymap-auto Forces keymap selection at boot" > echo " --no-keymap Disables keymap selection support" >+ echo " --splash Enable framebuffer splash using default theme" >+ echo " --splash=<theme> Enable framebuffer splash using <theme>" >+ echo " --splash-res=<res> Select splash theme resolutions to install" >+ echo " --no-splash Do not install framebuffer splash" > echo " --evms Include EVMS support" > echo " --> 'emerge evms' in the host operating system" > echo " first" >- echo " --evms2 Include EVMS support" >- echo " --> 'emerge evms' in the host operating system" >- echo " first" >- echo " --lvm Include LVM support" >- echo " --lvm2 Include LVM support" >- echo " --mdadm Copy /etc/mdadm.conf to initramfs" >- echo " --dmraid Include DMRAID support" >- echo " --multipath Include Multipath support" >- echo " --iscsi Include iSCSI support" > echo " --slowusb Enables extra pauses for slow USB CD boots" >- echo " --bootloader=grub Add new kernel to GRUB configuration" >+ echo " --no-busybox Do not include busybox in the initramfs." >+ echo " --unionfs Include EXPERIMENTAL support for unionfs" >+ echo " --netboot Create a self-contained env in the initramfs" >+ echo " --real-root=<foo> Specify a default for real_root=" > echo " --linuxrc=<file> Specifies a user created linuxrc" > echo " --busybox-config=<file> Specifies a user created busybox config" > echo " --disklabel Include disk label and uuid support in your" > echo " ramdisk" >- echo " --luks Include LUKS support" >- echo " --> 'emerge cryptsetup-luks' with USE=-dynamic" >- echo " --no-busybox Do not include busybox in the initramfs." >- echo " --unionfs Include support for unionfs" >- echo " --netboot Create a self-contained env in the initramfs" >- echo " --real-root=<foo> Specify a default for real_root=" >+ echo " Dracut engine" >+ echo " --no-dracut Build system using old internal engine" >+ echo " (will be removed in the future)" >+ echo " --dracut-dir=<dir> Directory of Dracut sources; if given Dracut" >+ echo " is run in local mode (see description of '-l'" >+ echo " in 'man 8 dracut'); script changes current" >+ echo " directory to <dir>, so don't use relative" >+ echo " paths then" >+ echo " --auto Rely on Dracut system check instead of" >+ echo " specifying modules by hand" >+ echo " --generic Build generic initramfs instead of" >+ echo " default hostonly. Notice that generic => huge" >+ echo " --mdraid Include RAID support via mdadm" >+ echo " --gensplash Enable framebuffer splash (splashutils);" >+ echo " set up in /etc/conf.d/splash" >+ echo " --gensplash=<theme>[:<res>]" >+ echo " Enable framebuffer splash using <theme>" >+ echo " and optionally select splash theme resolutions" >+ echo " to install; <res> is comma-separated list of" >+ echo " resolutions" >+ echo " --no-gensplash Do not install framebuffer splash" >+ echo " --gensplash-no8bpp Ignore 8bpp gensplash images (can save a lot of" >+ echo " space)" >+ echo " --plymouth Enable EXPERIMENTAL Plymouth splash; set up" >+ echo " configuration in /etc/plymouth/plymouthd.conf" >+ echo " requires >=plymouth-0.8.3 to be installed" >+ echo " --add-modules=<modules list>" >+ echo " Additional Dracut modules;" >+ echo " see /usr/share/dracut/modules.d for possible" >+ echo " values; separate modules by space, e.g.:" >+ echo " --add-modules=\"lvm crypt nfs\"" >+ echo " --extra-options=<options>" >+ echo " Pass extra options to dracut;" >+ echo " see 'man 8 dracut'" > echo " Internals" > echo " --arch-override=<arch> Force to arch instead of autodetect" > echo " --cachedir=<dir> Override the default cache location" >@@ -152,6 +182,8 @@ usage() { > } > > parse_cmdline() { >+ local tmp >+ > case "$*" in > --kernel-cc=*) > CMD_KERNEL_CC=`parse_opt "$*"` >@@ -215,25 +247,6 @@ parse_cmdline() { > CMD_BOOTDIR=`parse_opt "$*"` > print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}" > ;; >- --do-keymap-auto) >- CMD_DOKEYMAPAUTO=1 >- CMD_KEYMAP=1 >- print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}" >- ;; >- --no-keymap) >- CMD_KEYMAP=0 >- print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" >- ;; >- --evms) >- CMD_EVMS=1 >- print_info 2 "CMD_EVMS: ${CMD_EVMS}" >- ;; >- --evms2) >- CMD_EVMS=1 >- print_info 2 "CMD_EVMS: ${CMD_EVMS}" >- echo >- print_warning 1 "Please use --evms, as --evms2 is deprecated." >- ;; > --lvm) > CMD_LVM=1 > print_info 2 "CMD_LVM: ${CMD_LVM}" >@@ -245,28 +258,15 @@ parse_cmdline() { > print_warning 1 "Please use --lvm, as --lvm2 is deprecated." > ;; > --mdadm) >- CMD_MDADM=1 >- print_info 2 "CMD_MDADM: $CMD_MDADM" >- ;; >- --no-busybox) >- CMD_BUSYBOX=0 >- print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}" >- ;; >- --unionfs) >- CMD_UNIONFS=1 >- print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}" >- ;; >- --netboot) >- CMD_NETBOOT=1 >- print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}" >- ;; >- --real-root=*) >- CMD_REAL_ROOT=`parse_opt "$*"` >- print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}" >- ;; >- --slowusb) >- CMD_SLOWUSB=1 >- print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}" >+ if ! [[ "${CMD_DRACUT}" = '0' ]] && ! [[ $* =~ --no-dracut ]]; then >+ CMD_MDRAID=1 >+ print_info 2 "CMD_MDRAID: $CMD_MDRAID" >+ echo >+ print_warning 1 "Please use --mdraid, as --mdadm is obsolete." >+ else >+ CMD_MDADM=1 >+ print_info 2 "CMD_MDADM: $CMD_MDADM" >+ fi > ;; > --dmraid) > if [ ! -e /usr/include/libdevmapper.h ] >@@ -355,46 +355,6 @@ parse_cmdline() { > print_info 2 "CMD_CLEAN: ${CMD_CLEAN}" > print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}" > ;; >- --gensplash=*) >- CMD_SPLASH=1 >- SPLASH_THEME=`parse_opt "$*"` >- print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >- print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" >- echo >- print_warning 1 "Please use --splash, as --gensplash is deprecated." >- ;; >- --gensplash) >- CMD_SPLASH=1 >- SPLASH_THEME='default' >- print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >- echo >- print_warning 1 "Please use --splash, as --gensplash is deprecated." >- ;; >- --splash=*) >- CMD_SPLASH=1 >- SPLASH_THEME=`parse_opt "$*"` >- print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >- print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" >- ;; >- --splash) >- CMD_SPLASH=1 >- SPLASH_THEME='default' >- print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >- ;; >- --no-splash) >- CMD_SPLASH=0 >- print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >- ;; >- --gensplash-res=*) >- SPLASH_RES=`parse_opt "$*"` >- print_info 2 "SPLASH_RES: ${SPLASH_RES}" >- echo >- print_warning 1 "Please use --splash-res, as --gensplash-res is deprecated." >- ;; >- --splash-res=*) >- SPLASH_RES=`parse_opt "$*"` >- print_info 2 "SPLASH_RES: ${SPLASH_RES}" >- ;; > --install) > CMD_NOINSTALL=0 > print_info 2 "CMD_NOINSTALL: ${CMD_NOINSTALL}" >@@ -407,10 +367,6 @@ parse_cmdline() { > CMD_NORAMDISKMODULES=1 > print_info 2 "CMD_NORAMDISKMODULES: ${CMD_NORAMDISKMODULES}" > ;; >- --all-ramdisk-modules) >- CMD_ALLRAMDISKMODULES=1 >- print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}" >- ;; > --callback=*) > CMD_CALLBACK=`parse_opt "$*"` > print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" >@@ -424,11 +380,11 @@ parse_cmdline() { > TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ > print_info 2 "TMPDIR: ${TMPDIR}" > print_info 2 "TEMP: ${TEMP}" >- ;; >+ ;; > --postclear) > CMD_POSTCLEAR=1 > print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}" >- ;; >+ ;; > --arch-override=*) > CMD_ARCHOVERRIDE=`parse_opt "$*"` > print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}" >@@ -497,14 +453,6 @@ parse_cmdline() { > CMD_INITRAMFS_OVERLAY=`parse_opt "$*"` > print_info 2 "CMD_INITRAMFS_OVERLAY: ${CMD_INITRAMFS_OVERLAY}" > ;; >- --linuxrc=*) >- CMD_LINUXRC=`parse_opt "$*"` >- print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}" >- ;; >- --busybox-config=*) >- CMD_BUSYBOX_CONFIG=`parse_opt "$*"` >- print_info 2 "CMD_BUSYBOX_CONFIG: ${CMD_BUSYBOX_CONFIG}" >- ;; > --genzimage) > KERNEL_MAKE_DIRECTIVE_2='zImage.initrd' > KERNEL_BINARY_2='arch/powerpc/boot/zImage.initrd' >@@ -512,13 +460,16 @@ parse_cmdline() { > # ENABLE_PEGASOS_HACKS="yes" > # print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}" > ;; >- --disklabel) >- CMD_DISKLABEL=1 >- print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" >- ;; > --luks) >- CMD_LUKS=1 >- print_info 2 "CMD_LUKS: ${CMD_LUKS}" >+ if ! [[ "${CMD_DRACUT}" = '0' ]] && ! [[ $* =~ --no-dracut ]]; then >+ CMD_CRYPT=1 >+ print_info 2 "CMD_CRYPT: ${CMD_CRYPT}" >+ echo >+ print_warning 1 "Please use --crypt, as --luks is obsolete." >+ else >+ CMD_LUKS=1 >+ print_info 2 "CMD_LUKS: ${CMD_LUKS}" >+ fi > ;; > --firmware) > CMD_FIRMWARE=1 >@@ -541,6 +492,138 @@ parse_cmdline() { > --config=*) > print_info 2 "CMD_GK_CONFIG: `parse_opt "$*"`" > ;; >+ --local) >+ ;; >+ >+ # Internal engine >+ --no-busybox) >+ CMD_BUSYBOX=0 >+ print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}" >+ ;; >+ --unionfs) >+ CMD_UNIONFS=1 >+ print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}" >+ ;; >+ --netboot) >+ CMD_NETBOOT=1 >+ print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}" >+ ;; >+ --real-root=*) >+ CMD_REAL_ROOT=`parse_opt "$*"` >+ print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}" >+ ;; >+ --slowusb) >+ CMD_SLOWUSB=1 >+ print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}" >+ ;; >+ --do-keymap-auto) >+ CMD_DOKEYMAPAUTO=1 >+ CMD_KEYMAP=1 >+ print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}" >+ ;; >+ --no-keymap) >+ CMD_KEYMAP=0 >+ print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" >+ ;; >+ --evms) >+ CMD_EVMS=1 >+ print_info 2 "CMD_EVMS: ${CMD_EVMS}" >+ ;; >+ --evms2) >+ CMD_EVMS=1 >+ print_info 2 "CMD_EVMS: ${CMD_EVMS}" >+ echo >+ print_warning 1 "Please use --evms, as --evms2 is deprecated." >+ ;; >+ --disklabel) >+ CMD_DISKLABEL=1 >+ print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}" >+ ;; >+ --all-ramdisk-modules) >+ CMD_ALLRAMDISKMODULES=1 >+ print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}" >+ ;; >+ --linuxrc=*) >+ CMD_LINUXRC=`parse_opt "$*"` >+ print_info 2 "CMD_LINUXRC: ${CMD_LINUXRC}" >+ ;; >+ --busybox-config=*) >+ CMD_BUSYBOX_CONFIG=`parse_opt "$*"` >+ print_info 2 "CMD_BUSYBOX_CONFIG: ${CMD_BUSYBOX_CONFIG}" >+ ;; >+ --splash=*) >+ CMD_SPLASH=1 >+ SPLASH_THEME=`parse_opt "$*"` >+ print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >+ print_info 2 "SPLASH_THEME: ${SPLASH_THEME}" >+ ;; >+ --splash) >+ CMD_SPLASH=1 >+ SPLASH_THEME='default' >+ print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >+ ;; >+ --no-splash) >+ CMD_SPLASH=0 >+ print_info 2 "CMD_SPLASH: ${CMD_SPLASH}" >+ ;; >+ --splash-res=*) >+ SPLASH_RES=`parse_opt "$*"` >+ print_info 2 "SPLASH_RES: ${SPLASH_RES}" >+ ;; >+ >+ # Dracut engine >+ --no-dracut) >+ CMD_DRACUT=0 >+ print_info 2 "CMD_DRACUT: ${CMD_DRACUT}" >+ ;; >+ --dracut-dir=*) >+ CMD_DRACUT_DIR=`parse_opt "$*"` >+ print_info 2 "CMD_DRACUT_DIR: ${CMD_DRACUT_DIR}" >+ ;; >+ --auto) >+ CMD_AUTO=1 >+ print_info 2 "CMD_AUTO: ${CMD_AUTO}" >+ ;; >+ --generic) >+ CMD_GENERIC=1 >+ print_info 2 "CMD_GENERIC: ${CMD_GENERIC}" >+ ;; >+ --mdraid) >+ CMD_MDRAID=1 >+ print_info 2 "CMD_MDRAID: ${CMD_MDRAID}" >+ ;; >+ --crypt) >+ CMD_CRYPT=1 >+ print_info 2 "CMD_CRYPT: ${CMD_CRYPT}" >+ ;; >+ --gensplash) >+ CMD_GENSPLASH=1 >+ print_info 2 "CMD_GENSPLASH: ${CMD_GENSPLASH}" >+ ;; >+ --gensplash=*) >+ CMD_GENSPLASH=1 >+ tmp=`parse_opt "$*"` >+ GENSPLASH_THEME=${tmp%%:*} >+ print_info 2 "GENSPLASH: ${GENSPLASH}" >+ print_info 2 "GENSPLASH_THEME: ${GENSPLASH_THEME}" >+ [[ ${tmp} =~ : ]] && { >+ GENSPLASH_RES=${tmp#*:} >+ print_info 2 "GENSPLASH_RES: ${GENSPLASH_RES}" >+ } >+ ;; >+ --plymouth) >+ CMD_PLYMOUTH=1 >+ print_info 2 "CMD_PLYMOUTH: ${CMD_PLYMOUTH}" >+ ;; >+ --add-modules=*) >+ CMD_ADD_MODULES=`parse_opt "$*"` >+ print_info 2 "CMD_ADD_MODULES: ${CMD_ADD_MODULES}" >+ ;; >+ --extra-options=*) >+ CMD_EXTRA_OPTIONS=`parse_opt "$*"` >+ print_info 2 "CMD_EXTRA_OPTIONS: ${CMD_EXTRA_OPTIONS}" >+ ;; >+ > all) > BUILD_KERNEL=1 > BUILD_MODULES=1 >diff --git a/gen_determineargs.sh b/gen_determineargs.sh >index d911f07..69f0ff8 100755 >--- a/gen_determineargs.sh >+++ b/gen_determineargs.sh >@@ -97,7 +97,7 @@ determine_real_args() { > set_config_with_override 1 MOUNTBOOT CMD_MOUNTBOOT > set_config_with_override 1 BUILD_STATIC CMD_STATIC > set_config_with_override 1 SAVE_CONFIG CMD_SAVE_CONFIG >- set_config_with_override 1 SYMLINK CMD_SYMLINK >+ set_config_with_override 1 SYMLINK CMD_SYMLINK > set_config_with_override 2 INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH > set_config_with_override 1 OLDCONFIG CMD_OLDCONFIG > set_config_with_override 1 LVM CMD_LVM >@@ -120,6 +120,16 @@ determine_real_args() { > set_config_with_override 1 KEYMAP CMD_KEYMAP "yes" > set_config_with_override 1 DOKEYMAPAUTO CMD_DOKEYMAPAUTO > set_config_with_override 2 BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG >+ set_config_with_override 1 AUTO CMD_AUTO >+ set_config_with_override 1 GENERIC CMD_GENERIC >+ set_config_with_override 1 DRACUT CMD_DRACUT "yes" >+ set_config_with_override 2 DRACUT_DIR CMD_DRACUT_DIR >+ set_config_with_override 1 MDRAID CMD_MDRAID >+ set_config_with_override 1 CRYPT CMD_CRYPT >+ set_config_with_override 1 PLYMOUTH CMD_PLYMOUTH >+ set_config_with_override 1 GENSPLASH CMD_GENSPLASH >+ set_config_with_override 2 ADD_MODULES CMD_ADD_MODULES >+ set_config_with_override 2 EXTRA_OPTIONS CMD_EXTRA_OPTIONS > > BOOTDIR=`arch_replace "${BOOTDIR}"` > BOOTDIR=${BOOTDIR%/} # Remove any trailing slash >@@ -133,7 +143,7 @@ determine_real_args() { > BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"` > FUSE_BINCACHE=`cache_replace "${FUSE_BINCACHE}"` > UNIONFS_FUSE_BINCACHE=`cache_replace "${UNIONFS_FUSE_BINCACHE}"` >- >+ > DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` > BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` > BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"` >diff --git a/gen_dracut.sh b/gen_dracut.sh >new file mode 100755 >index 0000000..1f58c47 >--- /dev/null >+++ b/gen_dracut.sh >@@ -0,0 +1,84 @@ >+#!/bin/bash >+# $Id$ >+ >+BASIC_MODULES=dash\ i18n\ kernel-modules\ resume\ rootfs-block\ terminfo >+BASIC_MODULES+=\ udev-rules\ uswsusp\ base >+MODULES=lvm\ dmraid\ iscsi\ mdraid\ crypt\ multipath\ plymouth\ gensplash >+ >+dracut_modules() { >+ local a=() o=() >+ >+ isTrue "${PLYMOUTH}" && isTrue "${GENSPLASH}" && gen_die 'Gentoo Splash and Plymouth selected! You cannot choose both splash engines.' >+ isTrue "${EVMS}" && gen_die 'EVMS is no longer supported. If you *really* need it, file a bug report and we bring it back to life.' >+ isTrue "${UNIONFS}" && gen_die 'UnionFS not yet supported.' >+ >+ for var in ${MODULES} >+ do >+ var="${var^^}" >+ isTrue "${!var}" && a+=(${var,,}) >+ done >+ >+ a+=(${ADD_MODULES}) >+ >+ ! isTrue "${AUTO}" && echo -n "-m '${BASIC_MODULES}'" >+ [[ ${a[*]} ]] && echo -n " -a '${a[*]}'" >+ [[ ${o[*]} ]] && echo -n " -o '${o[*]}'" >+} >+ >+create_initramfs() { >+ local tmprd="${TMPDIR}/initramfs-${KV}" opts='-f -v' add_files=() >+ >+ print_info 1 'initramfs: >> Initializing Dracut...' >+ >+ if isTrue "${GENERIC}" >+ then >+ print_info 1 ' >> Will build generic (read: huge) initramfs' >+ else >+ opts+=\ -H >+ fi >+ >+ if isTrue "${NORAMDISKMODULES}" >+ then >+ print_info 1 ' >> Not copying kernel modules and firmware...' >+ opts+=\ --ignore-kernel-modules >+ else >+ isTrue "${FIRMWARE}" && opts+=" --fwdir ${FIRMWARE_DIR}" >+ [[ ${FIRMWARE_FILES} ]] && add_files+=(${FIRMWARE_FILES}) >+ fi >+ >+ [[ ${DRACUT_DIR} ]] && opts="-l ${opts}" >+ [[ ${INITRAMFS_OVERLAY} ]] && opts+=" ${INITRAMFS_OVERLAY} /" >+ [[ ${add_files[*]} ]] && opts+=" -I '${add_files[*]}'" >+ opts+=" ${EXTRA_OPTIONS}" >+ opts+=" $(dracut_modules)" >+ >+ export DRACUT_GENSPLASH_THEME=${GENSPLASH_THEME} >+ export DRACUT_GENSPLASH_RES=${GENSPLASH_RES} >+ print_info 1 " >> DRACUT_GENSPLASH_THEME=${GENSPLASH_THEME}" >+ print_info 1 " >> DRACUT_GENSPLASH_RES=${GENSPLASH_RES}" >+ print_info 1 " >> dracut ${opts} '${tmprd}' '${KV}'" >+ if [[ ${DRACUT_DIR} ]]; then >+ cd "${DRACUT_DIR}" >+ eval ./dracut ${opts} \'${tmprd}\' \'${KV}\' >+ cd - >/dev/null >+ else >+ eval dracut ${opts} \'${tmprd}\' \'${KV}\' >+ fi >+ >+ if isTrue "${INTEGRATED_INITRAMFS}" >+ then >+ mv ${tmprd} ${tmprd}.cpio.gz >+ sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config >+ echo -e "CONFIG_INITRAMFS_SOURCE=\"${tmprd}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" \ >+ >> ${KERNEL_DIR}/.config >+ fi >+ >+ if ! isTrue "${CMD_NOINSTALL}" >+ then >+ if ! isTrue "${INTEGRATED_INITRAMFS}" >+ then >+ copy_image_with_preserve initramfs "${tmprd}" \ >+ "initramfs-${KNAME}-${ARCH}-${KV}" >+ fi >+ fi >+} >diff --git a/genkernel b/genkernel >index 23cb667..a46d084 100755 >--- a/genkernel >+++ b/genkernel >@@ -23,6 +23,10 @@ parse_opt() { > esac > } > >+case "$*" in >+ *--local*) GK_LOCAL_MODE=1 ;; >+esac >+ > # We don't know where our config is, so we check for it, and default to using > # /etc/genkernel.conf if nobody has specified one. > case "$*" in >@@ -32,7 +36,9 @@ case "$*" in > esac > > # Pull in our configuration >+[ "${GK_LOCAL_MODE}" = 1 ] && CMD_GK_CONFIG=./genkernel.conf > source ${CMD_GK_CONFIG:-/etc/genkernel.conf} || small_die "Could not read /etc/genkernel.conf" >+[ "${GK_LOCAL_MODE}" = 1 ] && GK_SHARE=. > > # Start sourcing other scripts > source ${GK_SHARE}/gen_funcs.sh || small_die "Could not read ${GK_SHARE}/gen_funcs.sh" >@@ -41,7 +47,12 @@ source ${GK_SHARE}/gen_arch.sh || gen_die "Could not read ${GK_SHARE}/gen_arch.s > source ${GK_SHARE}/gen_determineargs.sh || gen_die "Could not read ${GK_SHARE}/gen_determineargs.sh" > source ${GK_SHARE}/gen_compile.sh || gen_die "Could not read ${GK_SHARE}/gen_compile.sh" > source ${GK_SHARE}/gen_configkernel.sh || gen_die "Could not read ${GK_SHARE}/gen_configkernel.sh" >-source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_initramfs.sh" >+if isTrue "${DRACUT}" >+then >+ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_initramfs.sh" >+else >+ source ${GK_SHARE}/gen_dracut.sh || gen_die "Could not read ${GK_SHARE}/gen_dracut.sh" >+fi > source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" > source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" > source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" >@@ -94,7 +105,8 @@ fi > > clear_log > NORMAL=${GOOD} print_info 1 "Gentoo Linux Genkernel; Version ${GK_V}${NORMAL}" >-print_info 1 "Running with options: ${Options}" >+[ "${GK_LOCAL_MODE}" = 1 ] && localmsg=' in local mode' >+print_info 1 "Running${localmsg} with options: ${Options}" > echo > > # Set ${ARCH} >@@ -122,9 +134,11 @@ set_kernel_arch > > [ ! -f "${TEMP}" ] && mkdir -p "${TEMP}" > >-setup_cache_dir >- >-check_distfiles >+if ! isTrue "${DRACUT}" >+then >+ setup_cache_dir >+ check_distfiles >+fi > > dump_debugcache > >@@ -279,17 +293,20 @@ fi > > if [ "${BUILD_RAMDISK}" -eq '1' ] > then >- [ "${DISKLABEL}" -eq '1' ] && compile_e2fsprogs >- >- if [ "${BUSYBOX}" -eq '1' ] >+ if ! isTrue "${DRACUT}" > then >- # Compile Busybox >- compile_busybox >- fi >+ [ "${DISKLABEL}" -eq '1' ] && compile_e2fsprogs > >- if isTrue "${UNIONFS}" >- then >- compile_unionfs_fuse >+ if [ "${BUSYBOX}" -eq '1' ] >+ then >+ # Compile Busybox >+ compile_busybox >+ fi >+ >+ if isTrue "${UNIONFS}" >+ then >+ compile_unionfs_fuse >+ fi > fi > > # Compile initramfs >@@ -320,38 +337,65 @@ then > print_info 1 '' > print_info 1 "Kernel compiled successfully!" > print_info 1 '' >- print_info 1 'Required Kernel Parameters:' >- if [ "${BUILD_RAMDISK}" -eq '0' ] >+ if ! isTrue "${DRACUT}" > then >- print_info 1 ' root=/dev/$ROOT' >- print_info 1 ' [ And "vga=0x317 splash=verbose" if you use a framebuffer ]' >+ print_info 1 'Required Kernel Parameters:' >+ >+ if [ "${BUILD_RAMDISK}" -eq '0' ] >+ then >+ print_info 1 ' root=/dev/$ROOT' >+ print_info 1 ' [ And "vga=0x317 splash=verbose" if you use a framebuffer ]' >+ print_info 1 '' >+ print_info 1 ' Where $ROOT is the device node for your root partition as the' >+ print_info 1 ' one specified in /etc/fstab' >+ else >+ print_info 1 ' real_root=/dev/$ROOT' >+ print_info 1 '' >+ print_info 1 ' Where $ROOT is the device node for your root partition as the' >+ print_info 1 ' one specified in /etc/fstab' >+ print_info 1 '' >+ print_info 1 "If you require Genkernel's hardware detection features; you MUST" >+ print_info 1 'tell your bootloader to use the provided INITRAMFS file. Otherwise;' >+ print_info 1 'substitute the root argument for the real_root argument if you are' >+ print_info 1 'not planning to use the initramfs...' >+ fi >+ fi >+fi >+ >+if [ "${BUILD_RAMDISK}" -eq '1' ] >+then >+ if isTrue "${DRACUT}" >+ then >+ print_info 1 'Required kernel arguments:' > print_info 1 '' >- print_info 1 ' Where $ROOT is the device node for your root partition as the' >- print_info 1 ' one specified in /etc/fstab' >- else >- print_info 1 ' real_root=/dev/$ROOT' >+ print_info 1 ' root=/dev/$ROOT' > print_info 1 '' > print_info 1 ' Where $ROOT is the device node for your root partition as the' > print_info 1 ' one specified in /etc/fstab' >- print_info 1 '' >- print_info 1 "If you require Genkernel's hardware detection features; you MUST" >- print_info 1 'tell your bootloader to use the provided INITRAMFS file. Otherwise;' >- print_info 1 'substitute the root argument for the real_root argument if you are' >- print_info 1 'not planning to use the initramfs...' >+ [ "${BUILD_RAMDISK}" -eq '0' ] || { >+ print_info 1 '' >+ print_info 1 ' resume=/dev/$SWAP' >+ print_info 1 '' >+ print_info 1 ' Where $SWAP is the swap device used by hibernate software of your choice.' >+ print_info 1 '' >+ print_info 1 ' Please consult "man 7 dracut.kernel" for additional kernel arguments.' >+ } > fi >-fi > >-if [ "${BUILD_RAMDISK}" -eq '1' ] >-then > echo > print_info 1 'WARNING... WARNING... WARNING...' > print_info 1 'Additional kernel cmdline arguments that *may* be required to boot properly...' >- [ "${SPLASH}" -eq '1' ] && print_info 1 "add \"vga=791 splash=silent,theme:${SPLASH_THEME} console=tty1 quiet\" if you use a splash framebuffer ]" >- [ "${LVM}" -eq '1' ] && print_info 1 'add "dolvm" for lvm support' >- [ "${EVMS}" -eq '1' ] && print_info 1 'add "doevms" for evms support' >- [ "${DMRAID}" -eq '1' ] && print_info 1 'add "dodmraid" for dmraid support' >- [ "${DMRAID}" -eq '1' ] && print_info 1 ' or "dodmraid=<additional options>"' >- [ "${ISCSI}" -eq '1' ] && print_info 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support' >+ if isTrue "${DRACUT}" >+ then >+ isTrue "${GENSPLASH}" && print_info 1 "add \"splash=silent,theme:${SPLASH_THEME} console=tty1 quiet\" if you use a splash framebuffer" >+ else >+ [ "${SPLASH}" -eq '1' ] && print_info 1 "add \"vga=791 splash=silent,theme:${SPLASH_THEME} console=tty1 quiet\" if you use a splash framebuffer ]" >+ [ "${LVM}" -eq '1' ] && print_info 1 'add "dolvm" for lvm support' >+ [ "${EVMS}" -eq '1' ] && print_info 1 'add "doevms" for evms support' >+ [ "${DMRAID}" -eq '1' ] && print_info 1 'add "dodmraid" for dmraid support' >+ [ "${DMRAID}" -eq '1' ] && print_info 1 ' or "dodmraid=<additional options>"' >+ [ "${ISCSI}" -eq '1' ] && print_info 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support' >+ fi > fi > > [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR} >diff --git a/genkernel.conf b/genkernel.conf >index a71ce69..949474c 100644 >--- a/genkernel.conf >+++ b/genkernel.conf >@@ -53,17 +53,9 @@ USECOLOR="yes" > # compile static LVM binaries if static ones do not exist. > # LVM="no" > >-# Add in EVMS support from static binaries if they exist on the system: you >-# should run "emerge evms" first. >-# EVMS="no" >- > # Add DMRAID support. > # DMRAID="no" > >-# Include (or suppresses the inclusion of) busybox in the initrd or initramfs. >-# If included, busybox is rebuilt if the cached copy is out of date. >-# BUSYBOX="yes" >- > # Copy /etc/mdadm.conf to initramfs. > # MDADM="no" > >@@ -80,11 +72,29 @@ USECOLOR="yes" > # Specify specific firmware files to include. This overrides FIRMWARE_DIR > # FIRMWARE_FILES="" > >+# Add new kernel to grub? >+# BOOTLOADER="grub" >+ >+# ==============Internal engine=============== >+# > # Enable disklabel support (copies blkid to initrd) > DISKLABEL="yes" > >-# Add new kernel to grub? >-# BOOTLOADER="grub" >+# Include (or suppresses the inclusion of) busybox in the initrd or initramfs. >+# If included, busybox is rebuilt if the cached copy is out of date. >+# BUSYBOX="yes" >+ >+# Add in EVMS support from static binaries if they exist on the system: you >+# should run "emerge evms" first. >+# EVMS="no" >+ >+# ===============Dracut engine================ >+ >+# Build system using Dracut [yes] or old internal engine [no]. "yes" is default. >+# DRACUT="yes" >+ >+# Include RAID support via mdadm >+# MDRAID="no" > > # =========Low Level Compile Settings========= > # >-- >1.7.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 330127
:
240377
| 242125