From 513fbad013ba2b289e67678cf638db8bd87d8fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= Date: Sun, 8 Aug 2010 22:29:38 +0200 Subject: [PATCH] fixes for Dracut --- targets/support/kmerge.sh | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 deletions(-) diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index b4d67d8..b9fd52d 100644 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -7,7 +7,15 @@ check_genkernel_version install -d /tmp/kerncache PKGDIR=/tmp/kerncache/${clst_kname}/ebuilds +# true if $2 in $1 +str2in1() { + [ "${1#*$2*}" != "$1" ] +} + setup_gk_args() { + local use_dracut=yes + str2in1 "${clst_gk_mainargs}" '--no-dracut' && use_dracut='' + # default genkernel args GK_ARGS="${clst_gk_mainargs} \ ${clst_kernel_gk_kernargs} \ @@ -17,6 +25,7 @@ setup_gk_args() { --modulespackage=/tmp/kerncache/${clst_kname}-modules-${clst_version_stamp}.tar.bz2 \ --minkernpackage=/tmp/kerncache/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 all" # extra genkernel options that we have to test for + [ "${use_dracut}" = yes ] && GK_ARGS="${GK_ARGS} --generic" if [ -n "${clst_KERNCACHE}" ] then GK_ARGS="${GK_ARGS} --kerncache=/tmp/kerncache/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2" @@ -28,13 +37,24 @@ setup_gk_args() { if [ -n "${clst_splash_theme}" ] then - GK_ARGS="${GK_ARGS} --splash=${clst_splash_theme}" + if [ "${use_dracut}" = yes ] + then + GK_ARGS="${GK_ARGS} --gensplash=${clst_splash_theme}" + else + GK_ARGS="${GK_ARGS} --splash=${clst_splash_theme}" + fi # Setup case structure for livecd_type case ${clst_livecd_type} in gentoo-release-minimal|gentoo-release-universal) case ${clst_hostarch} in amd64|x86) - GK_ARGS="${GK_ARGS} --splash-res=1024x768" + if [ "${use_dracut}" = yes ] + then + # we assume there's no space after theme name + GK_ARGS="${GK_ARGS}:1024x768" + else + GK_ARGS="${GK_ARGS} --splash-res=1024x768" + fi ;; esac ;; @@ -52,16 +72,29 @@ setup_gk_args() { if [ -n "${clst_linuxrc}" ] then + [ "${use_dracut}" = yes ] && { + echo "--linuxrc doesn't work with Dracut engine" + return 1 + } GK_ARGS="${GK_ARGS} --linuxrc=/tmp/linuxrc" fi if [ -n "${clst_busybox_config}" ] then + [ "${use_dracut}" = yes ] && { + echo "--busybox-config doesn't work with Dracut engine" + return 1 + } GK_ARGS="${GK_ARGS} --busybox-config=/tmp/busy-config" fi if [ "${clst_target}" == "netboot" ] then + [ "${use_dracut}" = yes ] && { + echo "For netboot target use internal Genkernel engine" + echo "(append --no-dracut to gk_mainargs)" + exit 1 + } GK_ARGS="${GK_ARGS} --netboot" if [ -n "${clst_merge_path}" ] -- 1.7.2