Add DMRAID support (thanks rocket!); fix AMD64 udev issues (#65985).
authorTim Yamin <plasmaroo@gentoo.org>
Thu, 17 Feb 2005 01:46:47 +0000 (01:46 +0000)
committerTim Yamin <plasmaroo@gentoo.org>
Thu, 17 Feb 2005 01:46:47 +0000 (01:46 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@168 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_compile.sh
gen_determineargs.sh
gen_initrd.sh
generic/linuxrc
genkernel.conf
pkg/udev-039.tar.bz2

index 7f7fa96c5261a7101e1920274c5af0508337f02d..b6562b3a20e1af5463c1935a090df4ec72aa155f 100755 (executable)
@@ -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=<file>        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"
index d8754bbd2a6a22674e82d7cd3927c01d01d90f5c..fb51001ec63685a0a91a802c7fc36fccbdeb4291 100644 (file)
@@ -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.
index 0d0463e3a52042269424f6515118df4eb20ea0ca..6ea48adda8a38afbaca805949448efcb56add864 100644 (file)
@@ -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
 }
index f8b1ebded19271b022e13b9d7cd302ec50c47749..346c3f1c7582d9340266864944d119d545f729c5 100644 (file)
@@ -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}
 
index 0ea798c92a8fdd8d19c9f378fc97c8369ae5555e..6ce1cbd7704f1f5738c13465806c3d70d9eae333 100644 (file)
@@ -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' ]
index 74b67173cf18614155be6810b79212d6e8edfc31..904d71f2a114edd2b0a54d4f31a0e501f4fd444e 100755 (executable)
@@ -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"
index 265af486b800ebc874ed79627fe0b4c413a8178d..860efa33e6a349493a0be2d6ea76096c93bbf633 100644 (file)
Binary files a/pkg/udev-039.tar.bz2 and b/pkg/udev-039.tar.bz2 differ