diff -uNr genkernel-3.3.11d.orig/gen_bootloader.sh genkernel-3.3.11d/gen_bootloader.sh --- genkernel-3.3.11d.orig/gen_bootloader.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_bootloader.sh 2006-07-10 14:17:46.000000000 +0200 @@ -10,7 +10,7 @@ } set_grub_bootloader() { - local GRUB_CONF='/boot/grub/grub.conf' + local GRUB_CONF='${BOOTDIR}/grub/grub.conf' print_info 1 '' print_info 1 "Adding kernel to $GRUB_CONF..." @@ -20,9 +20,9 @@ else # Extract block device information from /etc/fstab GRUB_ROOTFS=$(awk '/^[^#].+[[:space:]]\/[[:space:]]/ { print $1 }' /etc/fstab) - GRUB_BOOTFS=$(awk '/^[^#].+[[:space:]]\/boot[[:space:]]/ { print $1 }' /etc/fstab) + GRUB_BOOTFS=$(awk '/^[^#].+[[:space:]]\${BOOTDIR}[[:space:]]/ { print $1 }' /etc/fstab) - # If /boot is not defined in /etc/fstab, it must be the same as / + # If ${BOOTDIR} is not defined in /etc/fstab, it must be the same as / [ "x$GRUB_BOOTFS" == 'x' ] && GRUB_BOOTFS=$GRUB_ROOTFS fi @@ -70,8 +70,8 @@ fi echo >> $GRUB_CONF else - print_error 1 'Error! /boot/grub/grub.conf does not exist and the correct settings can not be automatically detected.' - print_error 1 'Please manually create your /boot/grub/grub.conf file.' + print_error 1 'Error! ${BOOTDIR}/grub/grub.conf does not exist and the correct settings can not be automatically detected.' + print_error 1 'Please manually create your ${BOOTDIR}/grub/grub.conf file.' fi else # grub.conf already exists; so... diff -uNr genkernel-3.3.11d.orig/gen_cmdline.sh genkernel-3.3.11d/gen_cmdline.sh --- genkernel-3.3.11d.orig/gen_cmdline.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_cmdline.sh 2006-07-10 14:17:46.000000000 +0200 @@ -62,8 +62,9 @@ echo " --utils-cross-compile= CROSS_COMPILE utils variable" echo " --utils-arch= Force to arch for utils only instead of autodetect." echo " --makeopts= Make options such as -j2, etc..." - echo " --mountboot Mount /boot automatically" - echo " --no-mountboot Don't mount /boot automatically" + echo " --mountboot Mount BOOTDIR automatically if mountable" + echo " --no-mountboot Don't mount BOOTDIR automatically" + echo " --bootdir= Set the location of the boot-directory, default is /boot" echo " Initialization" echo " --bootsplash= Force bootsplash using " echo " --gensplash= Force gensplash using " @@ -184,6 +185,10 @@ CMD_MOUNTBOOT=0 print_info 2 "CMD_MOUNTBOOT: $CMD_MOUNTBOOT" ;; + --bootdir=*) + BOOTDIR=`parse_opt "$*"` + print_info 2 "BOOTDIR: $BOOTDIR" + ;; --do-keymap-auto) CMD_DOKEYMAPAUTO=1 print_info 2 "CMD_DOKEYMAPAUTO: $CMD_DOKEYMAPAUTO" diff -uNr genkernel-3.3.11d.orig/gen_compile.sh genkernel-3.3.11d/gen_compile.sh --- genkernel-3.3.11d.orig/gen_compile.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_compile.sh 2006-07-10 14:17:46.000000000 +0200 @@ -295,14 +295,14 @@ fi if ! isTrue "${CMD_NOINSTALL}" then - cp "${KERNEL_BINARY}" "/boot/kernel-${KNAME}-${ARCH}-${KV}" || - gen_die 'Could not copy the kernel binary to /boot!' - cp "System.map" "/boot/System.map-${KNAME}-${ARCH}-${KV}" || - gen_die 'Could not copy System.map to /boot!' + cp "${KERNEL_BINARY}" "${BOOTDIR}/kernel-${KNAME}-${ARCH}-${KV}" || + gen_die 'Could not copy the kernel binary to ${BOOTDIR}!' + cp "System.map" "${BOOTDIR}/System.map-${KNAME}-${ARCH}-${KV}" || + gen_die 'Could not copy System.map to ${BOOTDIR}!' if [ "${KERNEL_BINARY_2}" != '' -a "${GENERATE_Z_IMAGE}" = '1' ] then - cp "${KERNEL_BINARY_2}" "/boot/kernelz-${KV}" || - gen_die 'Could not copy the kernelz binary to /boot!' + cp "${KERNEL_BINARY_2}" "${BOOTDIR}/kernelz-${KV}" || + gen_die 'Could not copy the kernelz binary to ${BOOTDIR}!' fi else cp "${KERNEL_BINARY}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" || diff -uNr genkernel-3.3.11d.orig/gen_determineargs.sh genkernel-3.3.11d/gen_determineargs.sh --- genkernel-3.3.11d.orig/gen_determineargs.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_determineargs.sh 2006-07-10 14:17:46.000000000 +0200 @@ -172,6 +172,14 @@ UTILS_CROSS_COMPILE="${CMD_UTILS_CROSS_COMPILE}" fi + if [ "${BOOTDIR}" != '' ] + then + BOOTDIR=`arch_replace "${BOOTDIR}"` + BOOTDIR=${BOOTDIR%/} # Remove any trailing slash + else + BOOTDIR="/boot" + fi + CACHE_DIR=`arch_replace "${CACHE_DIR}"` CACHE_CPIO_DIR="${CACHE_DIR}/cpio" BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"` diff -uNr genkernel-3.3.11d.orig/gen_funcs.sh genkernel-3.3.11d/gen_funcs.sh --- genkernel-3.3.11d.orig/gen_funcs.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_funcs.sh 2006-07-10 14:17:46.000000000 +0200 @@ -252,7 +252,7 @@ isBootRO() { - for mo in `grep ' /boot ' /proc/mounts | cut -d ' ' -f 4 | sed -e 's/,/ /'` + for mo in `grep ' ${BOOTDIR} ' /proc/mounts | cut -d ' ' -f 4 | sed -e 's/,/ /'` do if [ "x${mo}x" == "xrox" ] then diff -uNr genkernel-3.3.11d.orig/gen_initramfs.sh genkernel-3.3.11d/gen_initramfs.sh --- genkernel-3.3.11d.orig/gen_initramfs.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_initramfs.sh 2006-07-10 14:17:46.000000000 +0200 @@ -632,8 +632,8 @@ then if [ "${GENERATE_Z_IMAGE}" != '1' ] then - cp ${TMPDIR}/initramfs-${KV} /boot/initramfs-${KNAME}-${ARCH}-${KV} || - gen_die 'Could not copy the initramfs to /boot!' + cp ${TMPDIR}/initramfs-${KV} ${BOOTDIR}/initramfs-${KNAME}-${ARCH}-${KV} || + gen_die 'Could not copy the initramfs to ${BOOTDIR}!' fi fi } diff -uNr genkernel-3.3.11d.orig/gen_initrd.sh genkernel-3.3.11d/gen_initrd.sh --- genkernel-3.3.11d.orig/gen_initrd.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_initrd.sh 2006-07-10 14:17:46.000000000 +0200 @@ -389,8 +389,8 @@ fi if ! isTrue "${CMD_NOINSTALL}" then - cp ${TMPDIR}/initrd-${KV} /boot/initrd-${KNAME}-${ARCH}-${KV} || - gen_die 'Could not copy the initrd to /boot!' + cp ${TMPDIR}/initrd-${KV} ${BOOTDIR}/initrd-${KNAME}-${ARCH}-${KV} || + gen_die 'Could not copy the initrd to ${BOOTDIR}!' fi # Pegasos hack for merging the initrd into the kernel at compile time diff -uNr genkernel-3.3.11d.orig/gen_package.sh genkernel-3.3.11d/gen_package.sh --- genkernel-3.3.11d.orig/gen_package.sh 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/gen_package.sh 2006-07-10 14:17:46.000000000 +0200 @@ -89,12 +89,12 @@ gen_kerncache_extract_kernel() { /bin/tar -f ${KERNCACHE} -C ${TEMP} -xj - cp "${TEMP}/kernel-${ARCH}-${KV}" "/boot/kernel-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to /boot!' + cp "${TEMP}/kernel-${ARCH}-${KV}" "${BOOTDIR}/kernel-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to ${BOOTDIR}!' if [ "${KERNEL_BINARY_2}" != '' -a "${GENERATE_Z_IMAGE}" = '1' ] then - cp "${TEMP}/kernelz-${ARCH}-${KV}" "/boot/kernelz-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to /boot!' + cp "${TEMP}/kernelz-${ARCH}-${KV}" "${BOOTDIR}/kernelz-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to ${BOOTDIR}!' fi - cp "${TEMP}/System.map-${ARCH}-${KV}" "/boot/System.map-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy System.map to /boot!' + cp "${TEMP}/System.map-${ARCH}-${KV}" "${BOOTDIR}/System.map-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy System.map to ${BOOTDIR}!' } gen_kerncache_extract_modules() diff -uNr genkernel-3.3.11d.orig/genkernel genkernel-3.3.11d/genkernel --- genkernel-3.3.11d.orig/genkernel 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/genkernel 2006-07-10 14:17:46.000000000 +0200 @@ -127,27 +127,29 @@ fi fi -# Check /boot is mounted +# Check BOOTDIR is mounted if isTrue ${CMD_NOINSTALL} then isTrue ${MOUNTBOOT} && print_info 2 'Skipping automatic mount of boot' else - if ! egrep -q ' /boot ' /proc/mounts + [[ -d ${BOOTDIR} ]] || gen_die "${BOOTDIR} is not a directory" + + if ! egrep -q ' ${BOOTDIR} ' /proc/mounts then - if egrep -q '^[^#].+ /boot ' /etc/fstab + if egrep -q '^[^#].+[ \t]${BOOTDIR}[ \t]' /etc/fstab then if isTrue ${MOUNTBOOT} then - if ! mount /boot + if ! mount ${BOOTDIR} then - print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to mount /boot!" + print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to mount ${BOOTDIR}!" echo else - print_info 1 'mount: /boot mounted successfully!' + print_info 1 'mount: ${BOOTDIR} mounted successfully!' fi else - print_warning 1 "${BOLD}WARNING${NORMAL}: No mounted /boot partition detected!" - print_warning 1 ' Run ``mount /boot`` to mount it!' + print_warning 1 "${BOLD}WARNING${NORMAL}: No mounted ${BOOTDIR} partition detected!" + print_warning 1 ' Run ``mount ${BOOTDIR}`` to mount it!' echo fi fi @@ -155,12 +157,12 @@ then if isTrue ${MOUNTBOOT} then - if ! mount -o remount,rw /boot + if ! mount -o remount,rw ${BOOTDIR} then - print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to remount /boot RW!" + print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to remount ${BOOTDIR} RW!" echo else - print_info 1 "mount: /boot remounted read/write successfully!" + print_info 1 "mount: ${BOOTDIR} remounted read/write successfully!" BOOTRW=1 fi fi @@ -407,10 +409,10 @@ print_info 1 ' creating kernel name symlink!' - if [ -e /boot/kernel-${KNAME}-${ARCH}-${KV} ] + if [ -e ${BOOTDIR}/kernel-${KNAME}-${ARCH}-${KV} ] then - /bin/rm /boot/kernel - ln -s /boot/kernel-${KNAME}-${ARCH}-${KV} /boot/kernel + /bin/rm ${BOOTDIR}/kernel + ln -s ${BOOTDIR}/kernel-${KNAME}-${ARCH}-${KV} ${BOOTDIR}/kernel ret=$? [ ${ret} = '1' ] && print_error 1 'kernel link failed' fi @@ -418,19 +420,19 @@ if [ "${KERN_24}" != '1' -a "${CMD_BOOTSPLASH}" != '1' ] then print_info 1 ' creating initramfs name symlink!' - if [ -e /boot/initramfs-${KNAME}-${ARCH}-${KV} ] + if [ -e ${BOOTDIR}/initramfs-${KNAME}-${ARCH}-${KV} ] then - /bin/rm /boot/initramfs - ln -s /boot/initramfs-${KNAME}-${ARCH}-${KV} /boot/initramfs + /bin/rm ${BOOTDIR}/initramfs + ln -s ${BOOTDIR}/initramfs-${KNAME}-${ARCH}-${KV} ${BOOTDIR}/initramfs ret=$? [ ${ret} = '1' ] && print_error 1 'initramfs link failed' fi else print_info 1 ' creating initrd name symlink!' - if [ -e /boot/initrd-${KNAME}-${ARCH}-${KV} ] + if [ -e ${BOOTDIR}/initrd-${KNAME}-${ARCH}-${KV} ] then - /bin/rm /boot/initrd - ln -s /boot/initrd-${KNAME}-${ARCH}-${KV} /boot/initrd + /bin/rm ${BOOTDIR}/initrd + ln -s ${BOOTDIR}/initrd-${KNAME}-${ARCH}-${KV} ${BOOTDIR}/initrd ret=$? [ ${ret} = '1' ] && print_error 1 'initrd link failed' fi @@ -438,7 +440,7 @@ fi -[ "${BOOTRW}" != '' ] && mount -o remount,ro /boot +[ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR} echo print_info 1 'Do NOT report kernel bugs as genkernel bugs unless your bug' diff -uNr genkernel-3.3.11d.orig/genkernel.conf genkernel-3.3.11d/genkernel.conf --- genkernel-3.3.11d.orig/genkernel.conf 2006-07-10 14:17:32.000000000 +0200 +++ genkernel-3.3.11d/genkernel.conf 2006-07-10 14:18:45.000000000 +0200 @@ -45,6 +45,9 @@ # %%ARCH%% - Final determined architecture # %%CACHE%% - Final determined cache location +# Set the boot directory, default is /boot +#BOOTDIR="/boot" + # Default share directory location GK_SHARE="/usr/share/genkernel"