From: Tim Yamin Date: Thu, 17 Feb 2005 01:46:47 +0000 (+0000) Subject: Add DMRAID support (thanks rocket!); fix AMD64 udev issues (#65985). X-Git-Tag: v3.4.10.902~584 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=405c8a110030309d28b5bdc2c118595614eac155;p=genkernel.git Add DMRAID support (thanks rocket!); fix AMD64 udev issues (#65985). git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@168 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 7f7fa96..b6562b3 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -66,6 +66,7 @@ longusage() { echo " --evms2 Include EVMS2 support" echo " --> 'emerge evms' in the host operating system first" echo " --lvm2 Include LVM2 support" + echo " --dmraid Include DMRAID support" echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --linuxrc= Specifies a user created linuxrc" echo " Internals" @@ -159,6 +160,10 @@ parse_cmdline() { CMD_LVM2=1 print_info 2 'CMD_LVM2: 1' ;; + --dmraid) + CMD_DMRAID=1 + print_info 2 'CMD_DMRAID: 1' + ;; --bootloader=*) CMD_BOOTLOADER=`parse_opt "$*"` print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER" diff --git a/gen_compile.sh b/gen_compile.sh index d8754bb..fb51001 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -317,6 +317,47 @@ compile_lvm2() { fi } +compile_dmraid() { + compile_device_mapper + if [ ! -f "${DMRAID_BINCACHE}" ] + then + [ -f "${DMRAID_SRCTAR}" ] || + gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" + cd "${TEMP}" + rm -rf ${DMRAID_DIR} > /dev/null + tar -jxpf ${DMRAID_SRCTAR} || + gen_die 'Could not extract DMRAID source tarball!' + [ -d "${DMRAID_DIR}" ] || + gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!' + rm -rf "${TEMP}/device-mapper" > /dev/null + tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" || + gen_die "Could not extract device-mapper binary cache!"; + + cd "${DMRAID_DIR}" + print_info 1 'dmraid: >> Configuring...' + + LDFLAGS="-L${TEMP}/device-mapper/lib" \ + CFLAGS="-I${TEMP}/device-mapper/include" \ + CPPFLAGS="-I${TEMP}/device-mapper/include" \ + ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${DEBUGFILE} 2>&1 || + gen_die 'Configure of dmraid failed!' + mkdir "${TEMP}/dmraid" + print_info 1 'dmraid: >> Compiling...' + compile_generic '' utils + #compile_generic 'install' utils + mkdir ${TEMP}/dmraid/sbin + install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid" + print_info 1 ' >> Copying to bincache...' + cd "${TEMP}/dmraid" + tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid || + gen_die 'Could not create binary cache' + + cd "${TEMP}" + rm -rf "${TEMP}/device-mapper" > /dev/null + rm -rf "${DMRAID_DIR}" dmraid + fi +} + compile_modutils() { # I've disabled dietlibc support for the time being since the # version we use misses a few needed system calls. diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 0d0463e..6ea48ad 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -94,6 +94,7 @@ determine_real_args() { UDEV_BINCACHE=`cache_replace "${UDEV_BINCACHE}"` DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"` LVM2_BINCACHE=`cache_replace "${LVM2_BINCACHE}"` + DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` @@ -107,6 +108,7 @@ determine_real_args() { UDEV_BINCACHE=`arch_replace "${UDEV_BINCACHE}"` DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"` LVM2_BINCACHE=`arch_replace "${LVM2_BINCACHE}"` + DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"` if [ "${CMD_BOOTSPLASH}" != '' ] then @@ -222,4 +224,11 @@ determine_real_args() { else LVM2=0 fi + + if isTrue "${CMD_DMRAID}" + then + DMRAID=1 + else + DMRAID=0 + fi } diff --git a/gen_initrd.sh b/gen_initrd.sh index f8b1ebd..346c3f1 100644 --- a/gen_initrd.sh +++ b/gen_initrd.sh @@ -37,6 +37,7 @@ create_base_initrd_sys() { mkdir -p ${TEMP}/initrd-temp/temp mkdir -p ${TEMP}/initrd-temp/sys mkdir -p ${TEMP}/initrd-temp/.initrd + mkdir -p ${TEMP}/initrd-temp/var/lock/dmraid ln -s bin ${TEMP}/initrd-temp/sbin ln -s ../bin ${TEMP}/initrd-temp/usr/bin ln -s ../bin ${TEMP}/initrd-temp/usr/sbin @@ -92,6 +93,14 @@ create_base_initrd_sys() { # bunzip2 "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" || # gen_die "could not uncompress devfsd.conf" + # DMRAID + if [ "${DMRAID}" = '1' ] + then + print_info 1 'DMRAID: Adding support (compiling binaries)...' + compile_dmraid + tar -jxpf "${DMRAID_BINCACHE}" -C "${TEMP}/initrd-temp" || + gen_die "Could not extract dmraid binary cache!"; + fi # LVM2 if [ "${LVM2}" = '1' ] then @@ -294,7 +303,6 @@ create_initrd() { INITRD_CALC_SIZE=`calc_initrd_size` INITRD_SIZE=`expr ${INITRD_CALC_SIZE} + 100` print_info 1 " :: Size is at ${INITRD_SIZE}K" - print_info 1 " >> Creating loopback filesystem..." create_initrd_loop ${INITRD_SIZE} diff --git a/generic/linuxrc b/generic/linuxrc index 0ea798c..6ce1cbd 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -10,6 +10,7 @@ USE_DEVFS_NORMAL=1 USE_UDEV_NORMAL=2 USE_EVMS_NORMAL=1 USE_LVM2_NORMAL=1 +USE_DMRAID_NORMAL=1 if [ "$$" != '1' ] then @@ -51,6 +52,9 @@ do nolvm2) USE_LVM2_NORMAL=0 ;; + nodmraid) + USE_DMRAID_NORMAL=0 + ;; noevms) USE_EVMS_NORMAL=0 ;; @@ -254,6 +258,12 @@ then devfsd /dev -np fi +if [ -e '/sbin/dmraid' -a "${USE_DMRAID_NORMAL}" -eq '1' ] +then + echo -e "${GOOD}>>${NORMAL}${BOLD} Activating device-mapper raid array(s)...${NORMAL}" + /sbin/dmraid -ay +fi + if [ "${DO_lvm2}" -a "${USE_LVM2_NORMAL}" -eq '1' ] then if [ -e '/sbin/vgscan' -a -e '/sbin/vgchange' ] diff --git a/genkernel.conf b/genkernel.conf index 74b6717..904d71f 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -104,3 +104,8 @@ LVM2_VER="2.00.25" LVM2_DIR="LVM2.${LVM2_VER}" LVM2_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM2_VER}.tgz" LVM2_BINCACHE="%%CACHE%%/LVM2.${LVM2_VER}-%%ARCH%%.tar.bz2" + +DMRAID_VER="1.0.0-rc5f" +DMRAID_DIR="dmraid/${DMRAID_VER}" +DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2" +DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2" diff --git a/pkg/udev-039.tar.bz2 b/pkg/udev-039.tar.bz2 index 265af48..860efa3 100644 Binary files a/pkg/udev-039.tar.bz2 and b/pkg/udev-039.tar.bz2 differ