aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Yamin <plasmaroo@gentoo.org>2004-09-19 09:16:29 +0000
committerTim Yamin <plasmaroo@gentoo.org>2004-09-19 09:16:29 +0000
commit318333f6ac87a41d117f9082b35f15dfea289209 (patch)
treea9f18e4a43f180ab2833728af054433a0d4af83f /gen_bootloader.sh
parentAdding robbat2's patch for bug #62365. (diff)
downloadgenkernel-318333f6ac87a41d117f9082b35f15dfea289209.tar.gz
genkernel-318333f6ac87a41d117f9082b35f15dfea289209.tar.bz2
genkernel-318333f6ac87a41d117f9082b35f15dfea289209.zip
Adding updated grub.conf patch from Mathias Gug, bug #57576.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@134 67a159dc-881f-0410-a524-ba9dfbe2cb84
Diffstat (limited to 'gen_bootloader.sh')
-rw-r--r--gen_bootloader.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/gen_bootloader.sh b/gen_bootloader.sh
index 75491c0..e74d308 100644
--- a/gen_bootloader.sh
+++ b/gen_bootloader.sh
@@ -50,8 +50,10 @@ set_grub_bootloader() {
touch $GRUB_CONF
echo 'default 0' >> $GRUB_CONF
echo 'timeout 5' >> $GRUB_CONF
+ echo "" >> $GRUB_CONF
# Add grub configuration to grub.conf
+ echo "# Genkernel generated entry, see GRUB documentation for details" >> $GRUB_CONF
echo "title=Gentoo Linux ($KV)" >> $GRUB_CONF
echo -e "\troot (hd$GRUB_ROOT_DISK,$GRUB_ROOT_PARTITION)" >> $GRUB_CONF
if [ "${BUILD_INITRD}" -eq '0' ]
@@ -61,16 +63,19 @@ set_grub_bootloader() {
echo -e "\tkernel /kernel-$KV root=/dev/ram0 init=/linuxrc real_root=$GRUB_ROOTFS" >> $GRUB_CONF
echo -e "\tinitrd /initrd-$KV" >> $GRUB_CONF
fi
+ echo "" >> $GRUB_CONF
else
# grub.conf already exists; so...
- # * Copy the first boot definition and change the version.
+ # ... Clone the first boot definition and change the version.
cp $GRUB_CONF $GRUB_CONF.bak
- awk 'BEGIN { RS="title=";FS="\n";OFS="\n";ORS=""}
- NR == 2 {
- sub(/\(.+\)/,"(" ch KV ch ")",$1);
+ awk 'BEGIN { RS="" ; FS="\n" ; OFS="\n" ; ORS="\n\n" }
+ NR == 2 {
+ ORIG=$0;
+ sub(/\(.+\)/,"(" KV ")",$1);
sub(/kernel-[[:alnum:][:punct:]]+/, "kernel-" KV, $3);
sub(/initrd-[[:alnum:][:punct:]]+/, "initrd-" KV, $4);
- print RS ch $0 }' \
- KV=$KV $GRUB_CONF.bak >> $GRUB_CONF
+ print RS $0;
+ print RS ORIG;}
+ NR != 2 { print RS $0; }' KV=$KV $GRUB_CONF.bak > $GRUB_CONF
fi
}