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
cleanup-cruft
Tim Yamin 20 years ago
parent 433bbad70c
commit 405c8a1100

@ -66,6 +66,7 @@ longusage() {
echo " --evms2 Include EVMS2 support" echo " --evms2 Include EVMS2 support"
echo " --> 'emerge evms' in the host operating system first" echo " --> 'emerge evms' in the host operating system first"
echo " --lvm2 Include LVM2 support" echo " --lvm2 Include LVM2 support"
echo " --dmraid Include DMRAID support"
echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --bootloader=grub Add new kernel to GRUB configuration"
echo " --linuxrc=<file> Specifies a user created linuxrc" echo " --linuxrc=<file> Specifies a user created linuxrc"
echo " Internals" echo " Internals"
@ -159,6 +160,10 @@ parse_cmdline() {
CMD_LVM2=1 CMD_LVM2=1
print_info 2 'CMD_LVM2: 1' print_info 2 'CMD_LVM2: 1'
;; ;;
--dmraid)
CMD_DMRAID=1
print_info 2 'CMD_DMRAID: 1'
;;
--bootloader=*) --bootloader=*)
CMD_BOOTLOADER=`parse_opt "$*"` CMD_BOOTLOADER=`parse_opt "$*"`
print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER" print_info 2 "CMD_BOOTLOADER: $CMD_BOOTLOADER"

@ -317,6 +317,47 @@ compile_lvm2() {
fi 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() { compile_modutils() {
# I've disabled dietlibc support for the time being since the # I've disabled dietlibc support for the time being since the
# version we use misses a few needed system calls. # version we use misses a few needed system calls.

@ -94,6 +94,7 @@ determine_real_args() {
UDEV_BINCACHE=`cache_replace "${UDEV_BINCACHE}"` UDEV_BINCACHE=`cache_replace "${UDEV_BINCACHE}"`
DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"` DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"`
LVM2_BINCACHE=`cache_replace "${LVM2_BINCACHE}"` LVM2_BINCACHE=`cache_replace "${LVM2_BINCACHE}"`
DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
@ -107,6 +108,7 @@ determine_real_args() {
UDEV_BINCACHE=`arch_replace "${UDEV_BINCACHE}"` UDEV_BINCACHE=`arch_replace "${UDEV_BINCACHE}"`
DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"` DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"`
LVM2_BINCACHE=`arch_replace "${LVM2_BINCACHE}"` LVM2_BINCACHE=`arch_replace "${LVM2_BINCACHE}"`
DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"`
if [ "${CMD_BOOTSPLASH}" != '' ] if [ "${CMD_BOOTSPLASH}" != '' ]
then then
@ -222,4 +224,11 @@ determine_real_args() {
else else
LVM2=0 LVM2=0
fi fi
if isTrue "${CMD_DMRAID}"
then
DMRAID=1
else
DMRAID=0
fi
} }

@ -37,6 +37,7 @@ create_base_initrd_sys() {
mkdir -p ${TEMP}/initrd-temp/temp mkdir -p ${TEMP}/initrd-temp/temp
mkdir -p ${TEMP}/initrd-temp/sys mkdir -p ${TEMP}/initrd-temp/sys
mkdir -p ${TEMP}/initrd-temp/.initrd 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/sbin
ln -s ../bin ${TEMP}/initrd-temp/usr/bin ln -s ../bin ${TEMP}/initrd-temp/usr/bin
ln -s ../bin ${TEMP}/initrd-temp/usr/sbin ln -s ../bin ${TEMP}/initrd-temp/usr/sbin
@ -92,6 +93,14 @@ create_base_initrd_sys() {
# bunzip2 "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" || # bunzip2 "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" ||
# gen_die "could not uncompress devfsd.conf" # 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 # LVM2
if [ "${LVM2}" = '1' ] if [ "${LVM2}" = '1' ]
then then
@ -294,7 +303,6 @@ create_initrd() {
INITRD_CALC_SIZE=`calc_initrd_size` INITRD_CALC_SIZE=`calc_initrd_size`
INITRD_SIZE=`expr ${INITRD_CALC_SIZE} + 100` INITRD_SIZE=`expr ${INITRD_CALC_SIZE} + 100`
print_info 1 " :: Size is at ${INITRD_SIZE}K" print_info 1 " :: Size is at ${INITRD_SIZE}K"
print_info 1 " >> Creating loopback filesystem..." print_info 1 " >> Creating loopback filesystem..."
create_initrd_loop ${INITRD_SIZE} create_initrd_loop ${INITRD_SIZE}

@ -10,6 +10,7 @@ USE_DEVFS_NORMAL=1
USE_UDEV_NORMAL=2 USE_UDEV_NORMAL=2
USE_EVMS_NORMAL=1 USE_EVMS_NORMAL=1
USE_LVM2_NORMAL=1 USE_LVM2_NORMAL=1
USE_DMRAID_NORMAL=1
if [ "$$" != '1' ] if [ "$$" != '1' ]
then then
@ -51,6 +52,9 @@ do
nolvm2) nolvm2)
USE_LVM2_NORMAL=0 USE_LVM2_NORMAL=0
;; ;;
nodmraid)
USE_DMRAID_NORMAL=0
;;
noevms) noevms)
USE_EVMS_NORMAL=0 USE_EVMS_NORMAL=0
;; ;;
@ -254,6 +258,12 @@ then
devfsd /dev -np devfsd /dev -np
fi 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' ] if [ "${DO_lvm2}" -a "${USE_LVM2_NORMAL}" -eq '1' ]
then then
if [ -e '/sbin/vgscan' -a -e '/sbin/vgchange' ] if [ -e '/sbin/vgscan' -a -e '/sbin/vgchange' ]

@ -104,3 +104,8 @@ LVM2_VER="2.00.25"
LVM2_DIR="LVM2.${LVM2_VER}" LVM2_DIR="LVM2.${LVM2_VER}"
LVM2_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM2_VER}.tgz" LVM2_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM2_VER}.tgz"
LVM2_BINCACHE="%%CACHE%%/LVM2.${LVM2_VER}-%%ARCH%%.tar.bz2" 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"

Binary file not shown.
Loading…
Cancel
Save