gen_die 'Could not copy the kernelz binary to /boot!'
fi
else
- cp "${KERNEL_BINARY}" "${TEMP}/kernel-${KNAME}-${ARCH}-${KV}" ||
- gen_die "Could not copy the kernel binary to ${TEMP}!"
- cp "System.map" "${TEMP}/System.map-${KNAME}-${ARCH}-${KV}" ||
- gen_die "Could not copy System.map to ${TEMP}!"
+ cp "${KERNEL_BINARY}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
+ gen_die "Could not copy the kernel binary to ${TMPDIR}!"
+ cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
+ gen_die "Could not copy System.map to ${TMPDIR}!"
if [ "${KERNEL_BINARY_2}" != '' ]
then
- cp "${KERNEL_BINARY_2}" "${TEMP}/kernelz-${KV}" ||
- gen_die "Could not copy the kernelz binary to ${TEMP}!"
+ cp "${KERNEL_BINARY_2}" "${TMPDIR}/kernelz-${KV}" ||
+ gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
fi
fi
}
print_info 1 ''
print_info 1 'Please do *not* report compilation failures as genkernel bugs!'
print_info 1 ''
- exit 1
# Cleanup temp dirs and caches if requested
cleanup
+ exit 1
}
has_loop() {
then
print_info 1 "Clearing cache dir contents from ${CACHE_DIR}"
CACHE_DIR_CONTENTS=`ls ${CACHE_DIR}|grep -v CVS|grep -v cpio|grep -v README`
+
for i in ${CACHE_DIR_CONTENTS}
do
print_info 1 " >> removing ${i}"
}
+clear_tmpdir()
+{
+if ! isTrue ${CMD_NOINSTALL}
+then
+ TMPDIR_CONTENTS=`ls ${TMPDIR}`
+ print_info 1 "Removing tmp dir contents"
+ for i in ${TMPDIR_CONTENTS}
+ do
+ print_info 1 " >> removing ${i}"
+ rm ${TMPDIR}/${i}
+ done
+fi
+}
echo " $i"
done
- cat ${MERGE_LIST} > ${TEMP}/initramfs-${KV}
+ cat ${MERGE_LIST} > ${TMPDIR}/initramfs-${KV}
[ "${KERNEL_MAKE_DIRECTIVE}" == 'zImage.initrd' ] ||
[ "${KERNEL_MAKE_DIRECTIVE_2}" == 'zImage.initrd' ] &&
if ! isTrue "${CMD_NOINSTALL}"
then
- cp ${TEMP}/initramfs-${KV} /boot/initramfs-${KNAME}-${ARCH}-${KV} ||
+ cp ${TMPDIR}/initramfs-${KV} /boot/initramfs-${KNAME}-${ARCH}-${KV} ||
gen_die 'Could not copy the initramfs to /boot!'
fi
}
[ "$#" -ne '1' ] && gen_die 'create_initrd_loop(): Not enough arguments!'
mkdir -p ${TEMP}/initrd-mount ||
gen_die 'Could not create loopback mount directory!'
- dd if=/dev/zero of=${TEMP}/initrd-${KV} bs=1k count=${1} >> "${DEBUGFILE}" 2>&1 ||
+ dd if=/dev/zero of=${TMPDIR}/initrd-${KV} bs=1k count=${1} >> "${DEBUGFILE}" 2>&1 ||
gen_die "Could not zero initrd-${KV}"
- mke2fs -F -N500 -q "${TEMP}/initrd-${KV}" >> "${DEBUGFILE}" 2>&1 ||
+ mke2fs -F -N500 -q "${TMPDIR}/initrd-${KV}" >> "${DEBUGFILE}" 2>&1 ||
gen_die "Could not format initrd-${KV}!"
- mount -t ext2 -o loop "${TEMP}/initrd-${KV}" "${TEMP}/initrd-mount" >> "${DEBUGFILE}" 2>&1 ||
+ mount -t ext2 -o loop "${TMPDIR}/initrd-${KV}" "${TEMP}/initrd-mount" >> "${DEBUGFILE}" 2>&1 ||
gen_die 'Could not mount the initrd filesystem!'
}
fi
# devfsd
- if [ "${NODEVFSD}" = '' ]
+ if [ "${UDEV}" != '1' ]
then
cp "${DEVFSD_BINCACHE}" "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die 'Could not copy devfsd executable from bincache!'
bunzip2 "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die 'Could not uncompress devfsd!'
if [ "${COMPRESS_INITRD}" ]
then
- gzip -f -9 ${TEMP}/initrd-${KV}
- mv ${TEMP}/initrd-${KV}.gz ${TEMP}/initrd-${KV}
+ gzip -f -9 ${TMPDIR}/initrd-${KV}
+ mv ${TMPDIR}/initrd-${KV}.gz ${TMPDIR}/initrd-${KV}
fi
if [ "${BOOTSPLASH}" -eq "1" ]
do
if [ -f "/etc/bootsplash/${BOOTSPLASH_THEME}/config/bootsplash-${bootRes}.cfg" ]
then
- /sbin/splash -s -f /etc/bootsplash/${BOOTSPLASH_THEME}/config/bootsplash-${bootRes}.cfg >> ${TEMP}/initrd-${KV} ||
+ /sbin/splash -s -f /etc/bootsplash/${BOOTSPLASH_THEME}/config/bootsplash-${bootRes}.cfg >> ${TMPDIR}/initrd-${KV} ||
gen_die "Error: could not copy ${bootRes} bootsplash!"
else
print_warning 1 "splash: Did not find a bootsplash for the ${bootRes} resolution..."
fi
if ! isTrue "${CMD_NOINSTALL}"
then
- cp ${TEMP}/initrd-${KV} /boot/initrd-${KNAME}-${ARCH}-${KV} ||
+ cp ${TMPDIR}/initrd-${KV} /boot/initrd-${KNAME}-${ARCH}-${KV} ||
gen_die 'Could not copy the initrd to /boot!'
fi
[ "${KERNEL_MAKE_DIRECTIVE}" == 'zImage.initrd' ] ||
[ "${KERNEL_MAKE_DIRECTIVE_2}" == 'zImage.initrd' ] &&
- cp ${TEMP}/initrd-${KV} ${KERNEL_DIR}/arch/${ARCH}/boot/images/ramdisk.image.gz
+ cp ${TMPDIR}/initrd-${KV} ${KERNEL_DIR}/arch/${ARCH}/boot/images/ramdisk.image.gz
}
USE_UNIONFS_NORMAL=0
bad_msg 'Unionctl not found: aborting use of unionfs!'
else
- USE_UNIONFS_NORMAL=1
- UNIONFS=`parse_opt "${x}"`
+ USE_UNIONFS_NORMAL=1
+ UNIONFS=`parse_opt "${x}"`
fi
;;
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
GK_V='3.2.7'
-TEMP='/var/tmp/genkernel'
+TMPDIR='/var/tmp/genkernel'
TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.
small_die() {
source ${GK_BIN}/gen_package.sh || gen_die "Could not read ${GK_BIN}/gen_package.sh"
source ${GK_BIN}/gen_bootloader.sh || gen_die "Could not read ${GK_BIN}/gen_bootloader.sh"
-TEMP=${TEMP}/$RANDOM.$RANDOM.$RANDOM.$$
+TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
cleanup(){
if [ -n "$TEMP" -a -d "$TEMP" ]; then
if isTrue ${POSTCLEAR}
then
- print_info 1 ''
+ echo
print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP'
print_info 1 "CACHE_DIR: ${CACHE_DIR}"
CLEAR_CACHE_DIR='yes'
setup_cache_dir
- ls -la ${CACHE_DIR}
+ echo
print_info 1 "CACHE_CPIO_DIR: ${CACHE_CPIO_DIR}"
CLEAR_CPIO_CACHE='yes'
clear_cpio_dir
- ls -la ${CACHE_CPIO_DIR}
+ echo
+ print_info 1 "TMPDIR: ${TMPDIR}"
+ clear_tmpdir
fi
exit 1