gen_die 'Could not create unionfs modules binary cache'
cd"${TEMP}"
rm -rf "${UNIONFS_DIR}" > /dev/null
rm -rf unionfs > /dev/null
fi
}
compile_unionfs_utils(){
if[ ! -f "${UNIONFS_BINCACHE}"]
then
[ -f "${UNIONFS_SRCTAR}"]||
gen_die "Could not find unionfs source tarball: ${UNIONFS_SRCTAR}!"
cd"${TEMP}"
rm -rf ${UNIONFS_DIR} > /dev/null
rm -rf unionfs > /dev/null
mkdir -p unionfs/sbin
/bin/tar -zxpf ${UNIONFS_SRCTAR}||
gen_die 'Could not extract unionfs source tarball!'
[ -d "${UNIONFS_DIR}"]||
gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!'
cd"${UNIONFS_DIR}"
print_info 1'unionfs tools: >> Compiling...'
sed -i Makefile -e 's|${CC} -o|${CC} -static -o|g'
compile_generic utils utils
print_info 1'unionfs: >> Copying to cache...'
strip uniondbg unionctl
cp uniondbg ${TEMP}/unionfs/sbin/ ||
gen_die 'Could not copy the uniondbg binary to the tmp directory'
cp unionctl ${TEMP}/unionfs/sbin/ ||
gen_die 'Could not copy the unionctl binary to the tmp directory'
cd${TEMP}/unionfs
/bin/tar -cjf "${UNIONFS_BINCACHE}" . ||
gen_die 'Could not create unionfs tools binary cache'
cd"${TEMP}"
rm -rf "${UNIONFS_DIR}" > /dev/null
rm -rf unionfs > /dev/null
fi
}
compile_busybox(){
compile_busybox(){
if[ ! -f "${BUSYBOX_BINCACHE}"]
if[ ! -f "${BUSYBOX_BINCACHE}"]
then
then
@ -249,7 +326,7 @@ compile_busybox() {
gen_die "Cound not find busybox config file: ${BUSYBOX_CONFIG}!"
gen_die "Cound not find busybox config file: ${BUSYBOX_CONFIG}!"
cd"${TEMP}"
cd"${TEMP}"
rm -rf ${BUSYBOX_DIR} > /dev/null
rm -rf ${BUSYBOX_DIR} > /dev/null
tar -jxpf ${BUSYBOX_SRCTAR}||
/bin/tar -jxpf ${BUSYBOX_SRCTAR}||
gen_die 'Could not extract busybox source tarball!'
gen_die 'Could not extract busybox source tarball!'
[ -d "${BUSYBOX_DIR}"]||
[ -d "${BUSYBOX_DIR}"]||
gen_die 'Busybox directory ${BUSYBOX_DIR} is invalid!'
gen_die 'Busybox directory ${BUSYBOX_DIR} is invalid!'
@ -283,12 +360,12 @@ compile_lvm2() {
gen_die "Could not find LVM2 source tarball: ${LVM2_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
gen_die "Could not find LVM2 source tarball: ${LVM2_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
cd"${TEMP}"
cd"${TEMP}"
rm -rf ${LVM2_DIR} > /dev/null
rm -rf ${LVM2_DIR} > /dev/null
tar -zxpf ${LVM2_SRCTAR}||
/bin/tar -zxpf ${LVM2_SRCTAR}||
gen_die 'Could not extract LVM2 source tarball!'
gen_die 'Could not extract LVM2 source tarball!'
[ -d "${LVM2_DIR}"]||
[ -d "${LVM2_DIR}"]||
gen_die 'LVM2 directory ${LVM2_DIR} is invalid!'
gen_die 'LVM2 directory ${LVM2_DIR} is invalid!'
rm -rf "${TEMP}/device-mapper" > /dev/null
rm -rf "${TEMP}/device-mapper" > /dev/null
tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}"||
gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
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}"
cd"${TEMP}"
rm -rf ${DMRAID_DIR} > /dev/null
rm -rf ${DMRAID_DIR} > /dev/null
tar -jxpf ${DMRAID_SRCTAR}||
/bin/tar -jxpf ${DMRAID_SRCTAR}||
gen_die 'Could not extract DMRAID source tarball!'
gen_die 'Could not extract DMRAID source tarball!'
[ -d "${DMRAID_DIR}"]||
[ -d "${DMRAID_DIR}"]||
gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!'
gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!'
rm -rf "${TEMP}/device-mapper" > /dev/null
rm -rf "${TEMP}/device-mapper" > /dev/null
tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}"||
gen_die "Could not find module-init-tools source tarball: ${MODULE_INIT_TOOLS_SRCTAR}"
gen_die "Could not find module-init-tools source tarball: ${MODULE_INIT_TOOLS_SRCTAR}"
cd"${TEMP}"
cd"${TEMP}"
rm -rf "${MODULE_INIT_TOOLS_DIR}"
rm -rf "${MODULE_INIT_TOOLS_DIR}"
tar -jxpf "${MODULE_INIT_TOOLS_SRCTAR}"
/bin/tar -jxpf "${MODULE_INIT_TOOLS_SRCTAR}"
[ ! -d "${MODULE_INIT_TOOLS_DIR}"]&&
[ ! -d "${MODULE_INIT_TOOLS_DIR}"]&&
gen_die "Module-init-tools directory ${MODULE_INIT_TOOLS_DIR} is invalid"
gen_die "Module-init-tools directory ${MODULE_INIT_TOOLS_DIR} is invalid"
cd"${MODULE_INIT_TOOLS_DIR}"
cd"${MODULE_INIT_TOOLS_DIR}"
@ -475,7 +552,7 @@ compile_devfsd() {
gen_die "Could not find devfsd source tarball: ${DEVFSD_SRCTAR}"
gen_die "Could not find devfsd source tarball: ${DEVFSD_SRCTAR}"
cd"${TEMP}"
cd"${TEMP}"
rm -rf "${DEVFSD_DIR}"
rm -rf "${DEVFSD_DIR}"
tar -jxpf "${DEVFSD_SRCTAR}"
/bin/tar -jxpf "${DEVFSD_SRCTAR}"
[ ! -d "${DEVFSD_DIR}"]&&
[ ! -d "${DEVFSD_DIR}"]&&
gen_die "Devfsd directory ${DEVFSD_DIR} invalid"
gen_die "Devfsd directory ${DEVFSD_DIR} invalid"
cd"${DEVFSD_DIR}"
cd"${DEVFSD_DIR}"
@ -524,7 +601,7 @@ compile_device_mapper() {
gen_die "Could not find device-mapper source tarball: ${DEVICE_MAPPER_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
gen_die "Could not find device-mapper source tarball: ${DEVICE_MAPPER_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
cp "${KERNEL_BINARY}""${TEMP}/minkernpackage/kernel-${KV}"|| gen_die 'Could not the copy kernel for the min kernel package!'
cp "${KERNEL_BINARY}""${TEMP}/minkernpackage/kernel-${KV}"|| gen_die 'Could not the copy kernel for the min kernel package!'
@ -21,7 +21,7 @@ gen_minkernpackage()
["${BUILD_INITRD}" -ne 0]&&{ cp "${TEMP}/initrd-${KV}""${TEMP}/minkernpackage/initrd-${ARCH}-${KV}"|| gen_die 'Could not copy the initrd for the kernel package!';}
["${BUILD_INITRD}" -ne 0]&&{ cp "${TEMP}/initrd-${KV}""${TEMP}/minkernpackage/initrd-${ARCH}-${KV}"|| gen_die 'Could not copy the initrd for the kernel package!';}
fi
fi
cd"${TEMP}/minkernpackage"
cd"${TEMP}/minkernpackage"
tar -jcpf ${MINKERNPACKAGE} * || gen_die 'Could not compress the kernel package!'
/bin/tar -jcpf ${MINKERNPACKAGE} * || gen_die 'Could not compress the kernel package!'
[ "${KMAJOR}" -eq 2 -a "${KMINOR}" -lt '6' -a "${USE_UDEV_NORMAL}" -eq 1 ] &&
then
USE_UDEV_NORMAL=0
CHROOT=${UNION}
else
CHROOT=${NEW_ROOT}
fi
# Disable devfs if we want udev...
# Run debug shell if requested
[ -e /dev/.devfsd -a "${USE_UDEV_NORMAL}" -eq 1 ] && echo '>> Enabling devfsd in favour of udev; use "nodevfs" if this is not intended...' && USE_UDEV_NORMAL=0