Index: gen_bootloader.sh =================================================================== RCS file: /var/cvsroot/gentoo/src/genkernel_bradmssw/gen_bootloader.sh,v retrieving revision 1.12 diff -u -r1.12 gen_bootloader.sh --- gen_bootloader.sh 11 Jul 2006 11:33:08 -0000 1.12 +++ gen_bootloader.sh 11 Jul 2006 12:08:42 -0000 @@ -10,7 +10,7 @@ } set_grub_bootloader() { - local GRUB_CONF='${BOOTDIR}/grub/grub.conf' + local GRUB_CONF="${BOOTDIR}/grub/grub.conf" print_info 1 '' print_info 1 "Adding kernel to $GRUB_CONF..." @@ -20,7 +20,7 @@ else # Extract block device information from /etc/fstab GRUB_ROOTFS=$(awk '/^[^#].+[[:space:]]\/[[:space:]]/ { print $1 }' /etc/fstab) - GRUB_BOOTFS=$(awk '/^[^#].+[[:space:]]\${BOOTDIR}[[:space:]]/ { print $1 }' /etc/fstab) + GRUB_BOOTFS=$(awk '/^[^#].+[[:space:]]'"$(escape_slashes ${BOOTDIR})"'[[:space:]]/ { print $1 }' /etc/fstab) # If ${BOOTDIR} is not defined in /etc/fstab, it must be the same as / [ "x$GRUB_BOOTFS" == 'x' ] && GRUB_BOOTFS=$GRUB_ROOTFS @@ -70,8 +70,8 @@ fi echo >> $GRUB_CONF else - 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.' + 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... Index: gen_funcs.sh =================================================================== RCS file: /var/cvsroot/gentoo/src/genkernel_bradmssw/gen_funcs.sh,v retrieving revision 1.18 diff -u -r1.18 gen_funcs.sh --- gen_funcs.sh 11 Jul 2006 11:33:09 -0000 1.18 +++ gen_funcs.sh 11 Jul 2006 12:08:42 -0000 @@ -178,6 +178,11 @@ echo "${3}" | sed -e "s/%%${1}%%/${SAFE_VAR}/g" - } +escape_slashes() +{ + echo ${*//\//\\\/} +} + arch_replace() { var_replace "ARCH" "${ARCH}" "${1}" } Index: gen_package.sh =================================================================== RCS file: /var/cvsroot/gentoo/src/genkernel_bradmssw/gen_package.sh,v retrieving revision 1.18 diff -u -r1.18 gen_package.sh --- gen_package.sh 11 Jul 2006 11:33:09 -0000 1.18 +++ gen_package.sh 11 Jul 2006 12:08:42 -0000 @@ -89,12 +89,12 @@ gen_kerncache_extract_kernel() { /bin/tar -f ${KERNCACHE} -C ${TEMP} -xj - cp "${TEMP}/kernel-${ARCH}-${KV}" "${BOOTDIR}/kernel-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to ${BOOTDIR}!' + 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}" "${BOOTDIR}/kernelz-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the kernel binary to ${BOOTDIR}!' + 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}" "${BOOTDIR}/System.map-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy System.map to ${BOOTDIR}!' + 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() Index: genkernel =================================================================== RCS file: /var/cvsroot/gentoo/src/genkernel_bradmssw/genkernel,v retrieving revision 1.117 diff -u -r1.117 genkernel --- genkernel 11 Jul 2006 11:33:09 -0000 1.117 +++ genkernel 11 Jul 2006 12:08:42 -0000 @@ -133,9 +133,9 @@ else [[ -d ${BOOTDIR} ]] || gen_die "${BOOTDIR} is not a directory" - if ! egrep -q ' ${BOOTDIR} ' /proc/mounts + if ! egrep -q " ${BOOTDIR} " /proc/mounts then - if egrep -q '^[^#].+[ \t]${BOOTDIR}[ \t]' /etc/fstab + if egrep -q '^[^#].+[ \t]'${BOOTDIR}'[ \t]' /etc/fstab then if isTrue ${MOUNTBOOT} then @@ -148,7 +148,7 @@ fi else print_warning 1 "${BOLD}WARNING${NORMAL}: No mounted ${BOOTDIR} partition detected!" - print_warning 1 ' Run ``mount ${BOOTDIR}`` to mount it!' + print_warning 1 ' Run ``mount '${BOOTDIR}'`` to mount it!' echo fi fi