Some more generalcleanup and adding support for using a config file other than /etc/genkernel.conf to add flexibility.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@542 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Chris Gianelloni 18 years ago
parent 2716ac4dc2
commit 4005d85692

@ -2,6 +2,11 @@
# Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
17 Sep 2007; Chris Gianelloni <wolf31o2@gentoo.org> gen_cmdline.sh,
gen_configkernel.sh, genkernel:
Some more generalcleanup and adding support for using a config file other
than /etc/genkernel.conf to add flexibility.
17 Sep 2007; Chris Gianelloni <wolf31o2@gentoo.org>
-pkg/module-init-tools-0.9.15-pre4.tar.bz2,
-pkg/klibc-1.1.16-sparc2.patch, -pkg/klibc-1.2.1-nostdinc-flags.patch,

@ -12,6 +12,8 @@ longusage() {
echo " initrd Build only the initrd"
echo
echo "Available Options: "
echo " Configuration settings"
echo " --config=<file> genkernel configuration file to use"
echo " Debug settings"
echo " --debuglevel=<0-5> Debug Verbosity Level"
echo " --debugfile=<outfile> Output file for debug info"
@ -128,14 +130,6 @@ usage() {
echo ' genkernel --help'
}
parse_opt() {
case "$1" in
*\=*)
echo "$1" | cut -f2- -d=
;;
esac
}
parse_cmdline() {
case "$*" in
--kernel-cc=*)
@ -265,7 +259,6 @@ parse_cmdline() {
--menuconfig)
TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
then
echo "Error: You need a terminal with at least 80 columns"

@ -35,7 +35,7 @@ config_kernel() {
compile_generic mrproper kernel
fi
# If we're not cleaning, then we don't want to try to overwrite the configs there
# If we're not cleaning, then we don't want to try to overwrite the configs
# or we might remove configurations someone is trying to test.
if isTrue "${CLEAN}"
@ -52,7 +52,7 @@ config_kernel() {
else
print_info 1 ' >> Running oldconfig...'
fi
yes '' 2>/dev/null | compile_generic oldconfig kernel 2>/dev/null # Nullify to stop broken pipe messages
yes '' 2>/dev/null | compile_generic oldconfig kernel 2>/dev/null
fi
if isTrue "${CLEAN}"
then
@ -99,7 +99,8 @@ config_kernel() {
if [ "${KERN_24}" -eq '1' ]
then
# Make sure Ext2 support is on...
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_EXT2_FS[ =].*/CONFIG_EXT2_FS=y/g'
sed -e 's/#\? \?CONFIG_EXT2_FS[ =].*/CONFIG_EXT2_FS=y/g' \
-i ${KERNEL_DIR}/.config
fi
# Make sure lvm modules are on if --lvm/--lvm
@ -120,11 +121,4 @@ config_kernel() {
then
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g'
fi
# This check isn't complete: SOFTWARE_SUSPEND has extra deps on some systems such as CPU hotplug
# if isTrue ${CMD_SUSPEND}
# then
# sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_SOFTWARE_SUSPEND is.*/CONFIG_SOFTWARE_SUSPEND=y/g'
# fi
}

@ -1,5 +1,4 @@
#!/bin/bash
# Genkernel v3
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
GK_V='3.4.9_pre3'
@ -15,7 +14,25 @@ small_die() {
exit 1
}
source /etc/genkernel.conf || small_die "Could not read /etc/genkernel.conf"
parse_opt() {
case "$1" in
*\=*)
echo "$1" | cut -f2- -d=
;;
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
--config=*)
CMD_GK_CONFIG=`parse_opt "$*"`
;;
esac
}
source ${CMD_GK_CONFIG:-/etc/genkernel.conf} || small_die "Could not read /etc/genkernel.conf"
source ${GK_SHARE}/gen_funcs.sh || small_die "Could not read ${GK_SHARE}/gen_funcs.sh"
source ${GK_SHARE}/gen_cmdline.sh || gen_die "Could not read ${GK_SHARE}/gen_cmdline.sh"
source ${GK_SHARE}/gen_arch.sh || gen_die "Could not read ${GK_SHARE}/gen_arch.sh"

Loading…
Cancel
Save