- echo -e "\tkernel /kernel-$KV root=/dev/ram0 init=/linuxrc real_root=$GRUB_ROOTFS" >> $GRUB_CONF
- echo -e "\tinitrd /initrd-$KV" >> $GRUB_CONF
+ # grub.conf doesn't exist - create it with standard defaults
+ 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' ]
+ then
+ echo -e "\tkernel /kernel-$KV root=$GRUB_ROOTFS" >> $GRUB_CONF
+ else
+ 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