Commit patches #91453, #91481 from bug #139866.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@420 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Tim Yamin 19 years ago
parent d54cb08b41
commit 4c3ad7159b

@ -10,7 +10,7 @@ set_bootloader() {
}
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..."
@ -19,8 +19,8 @@ set_grub_bootloader() {
GRUB_BOOTFS=${BOOTFS}
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_ROOTFS=$(awk 'BEGIN{RS="((#[^\n]*)?\n)"}( $2 == "/" ) { print $1; exit }' /etc/fstab)
GRUB_BOOTFS=$(awk 'BEGIN{RS="((#[^\n]*)?\n)"}( $2 == "'${BOOTDIR}'") { print $1; exit }' /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 @@ EOF
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...

@ -252,14 +252,7 @@ has_loop() {
isBootRO()
{
for mo in `grep ' ${BOOTDIR} ' /proc/mounts | cut -d ' ' -f 4 | sed -e 's/,/ /'`
do
if [ "x${mo}x" == "xrox" ]
then
return 0
fi
done
return 1
return $(awk '( $2 == "'${BOOTDIR}'" && $4 ~ /(^|,)ro(,|$)/){ I=1; exit }END{print !I }' /proc/mounts);
}
setup_cache_dir()

@ -89,12 +89,12 @@ gen_kerncache()
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()

@ -133,9 +133,9 @@ then
else
[[ -d ${BOOTDIR} ]] || gen_die "${BOOTDIR} is not a directory"
if ! egrep -q ' ${BOOTDIR} ' /proc/mounts
if ! egrep -q "[[:space:]]${BOOTDIR}[[:space:]]" /proc/mounts
then
if egrep -q '^[^#].+[ \t]${BOOTDIR}[ \t]' /etc/fstab
if egrep -q "^[^#].+[[:space:]]${BOOTDIR}[[:space:]]" /etc/fstab
then
if isTrue ${MOUNTBOOT}
then
@ -144,11 +144,11 @@ else
print_warning 1 "${BOLD}WARNING${NORMAL}: Failed to mount ${BOOTDIR}!"
echo
else
print_info 1 'mount: ${BOOTDIR} mounted successfully!'
print_info 1 "mount: ${BOOTDIR} mounted successfully!"
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

Loading…
Cancel
Save