git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@159 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Tim Yamin 20 years ago
parent e27358d67e
commit b428a4ce58

@ -17,7 +17,7 @@ set_grub_bootloader() {
# Extract block device information from /etc/fstab
local GRUB_ROOTFS=$(awk '/[[:space:]]\/[[:space:]]/ { print $1 }' /etc/fstab)
local GRUB_BOOTFS=$(awk '/[[:space:]]\/boot[[:space:]]/ { print $1 }' /etc/fstab)
local GRUB_BOOTFS=$(awk '/^[^#].+[[:space:]]\/boot[[:space:]]/ { print $1 }' /etc/fstab)
# If /boot is not defined in /etc/fstab, it must be the same as /
[ "x$GRUB_BOOTFS" == 'x' ] && GRUB_BOOTFS=$GRUB_ROOTFS

@ -20,10 +20,19 @@ modules_scan() {
MODS=`cat /etc/modules/${1}`
for x in ${MODS}
do
echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..."
modprobe ${x} -n
backup
echo -ne "${NORMAL}"
MLOAD=`echo ${MLIST} | sed -e "s/.*${x}.*/${x}/"`
if [ "${MLIST}" = "${x}" ] # Only module to no-load
then
echo -e "${BOLD} ::${NORMAL} Skipping ${x}..."
elif [ "${MLOAD}" = "${MLIST}" ] # == No change == No specified no-load
then
echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..."
modprobe ${x} -n
backup
echo -ne "${NORMAL}"
else
echo -e "${BOLD} ::${NORMAL} Skipping ${x}..."
fi
done
}
@ -65,7 +74,6 @@ kill_devfsd() {
}
runUdev() {
mount -t tmpfs -o size=100k udev /dev
mkdir /dev/pts
mkdir /dev/shm
@ -75,5 +83,4 @@ runUdev() {
ln -snf /proc/self/fd/1 /dev/stdout
ln -snf /proc/self/fd/2 /dev/stderr
ln -snf /proc/kcore /dev/core
}

@ -62,10 +62,16 @@ do
real_init\=*)
REAL_INIT=`parse_opt "${x}"`
;;
scandelay=\*)
SDELAY=`parse_opt "${x}"`
;;
scandelay)
SDELAY=10
;;
*)
noload\=*)
MLIST=`parse_opt "${x}"`
MLIST="`echo ${MLIST} | sed -e \"s/,/ /\"`"
export MLIST
;;
esac
done
@ -163,6 +169,7 @@ then
fi
fi
bootstrapCD() {
if [ "${CDROOT_DEV}" = '' ]
then
findcdmount /newroot/dev/cdroms/*
@ -174,6 +181,22 @@ then
# Device specified on command line
findcdmount /newroot/${CDROOT_DEV}
fi
}
bootstrapCD
if [ "${REAL_ROOT}" = '' ]
then
echo -n -e "${WARN}>>${NORMAL}${BOLD} No bootable medium found. Waiting for new devices"
sleep 3
echo -n '.'
sleep 3
echo -n '.'
sleep 3
echo -n '.'
sleep 1
echo -e "${NORMAL}"
bootstrapCD
fi
if [ "${REAL_ROOT}" = '' ]
then
@ -418,7 +441,7 @@ if [ "${USE_DEVFS_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
then
umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
mount -n --move /tmp/.initrd/dev dev || echo '*: Failed to move over the /dev tree!'
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
rm -rf /tmp/.initrd/dev || '*: Failed to remove the initrd /dev!'
elif [ "${USE_UDEV_NORMAL}" -eq '1' ]
then
rm /tmp/.initrd/dev/fd || echo '*: Failed to rm the initrd fd!'
@ -434,7 +457,7 @@ then
umount /tmp/.initrd/proc || echo "*: Failed to unmount the initrd /proc!"
umount /dev 2>/dev/null
mount -n --move /tmp/.initrd/dev dev 2>/dev/null
rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
rm -rf /tmp/.initrd/dev || '*: Failed to remove the initrd /dev!'
umount /sys 2>/dev/null
umount /tmp/.initrd/sys 2>/dev/null

@ -1,7 +1,7 @@
#!/bin/bash
# Genkernel v3
GK_V='3.1.0d'
GK_V='3.1.0e'
TEMP='/var/tmp/genkernel'
TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.
@ -171,8 +171,10 @@ then
echo
echo
eval ${CMD_POSTCONF} | tee -a ${DEBUGFILE}
CMD_STATUS="${PIPESTATUS[0]}"
echo
print_info 1 "<<< Postconf callback exit status: ${PIPESTATUS[0]}"
print_info 1 "<<< Postconf callback exit status: ${CMD_STATUS}"
[ "${CMD_STATUS}" -ne 0 ] && gen_die '--postconf failed!'
else
echo
print_info 1 '>>> Postconf cancelled...'
@ -188,7 +190,10 @@ then
[ -z "${GENSPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash
[ -z "${GENSPLASH_THEME}" ] && GENSPLASH_THEME=default
print_info 1 " >> Installing gensplash [ using the ${GENSPLASH_THEME} theme ]..."
# 2.6.9
sed -i -e 's:$(obj)/gen_init_cpio $(initramfs-y) FORCE:$(if $(shell [ ! -f $(obj)/initramfs_data.cpio ] \&\& echo 1 ), $(obj)/gen_init_cpio $(initramfs-y)):' ${KERNEL_DIR}/usr/Makefile
# 2.6.10
sed -i -e 's:$(obj)/gen_init_cpio \\:$(if $(shell [ ! -f $(obj)/initramfs_data.cpio ] \&\& echo 1 ), $(obj)/gen_init_cpio $(initramfs-y) $(obj)/initramfs_list):' -e 's:$(initramfs-y) $(obj)/initramfs_list FORCE::' ${KERNEL_DIR}/usr/Makefile
splash_geninitramfs -g ${KERNEL_DIR}/usr/initramfs_data.cpio.gz ${GENSPLASH_THEME}
gunzip ${KERNEL_DIR}/usr/initramfs_data.cpio.gz
else
@ -231,8 +236,10 @@ then
echo
echo
eval ${CMD_CALLBACK} | tee -a ${DEBUGFILE}
CMD_STATUS="${PIPESTATUS[0]}"
echo
print_info 1 "<<< Callback exit status: ${PIPESTATUS[0]}"
print_info 1 "<<< Callback exit status: ${CMD_STATUS}"
[ "${CMD_STATUS}" -ne 0 ] && gen_die '--callback failed!'
else
echo
print_info 1 ">>> Callback cancelled..."

Loading…
Cancel
Save