Magellan Linux

Annotation of /trunk/installer-simple/functions/grub2.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2446 - (hide annotations) (download) (as text)
Tue Jan 7 14:56:12 2014 UTC (10 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 845 byte(s)
-disable old mkinitrd and bootloader functions (will get removed soon) and add includes to support grub1, grub2, mkinitrd and dracut
1 niro 2446 bootloader_config()
2     {
3     # set kernelopts
4     if [[ -n ${KERNELOPTS} ]]
5     then
6     if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]]
7     then
8     sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die
9     else
10     CONFIG="${INSTALLROOT}/etc/conf.d/grub"
11     clearconfig
12     addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\""
13     fi
14     fi
15     }
16    
17     bootloader_install()
18     {
19     local CONFIG
20     local grub2conf="/boot/grub/grub.cfg"
21    
22     CONFIG="${INSTALLROOT}/root/.installrc"
23     clearconfig
24     # only grub 1.99
25     addconfig 'type -P grub-mkdevicemap && grub-mkdevicemap'
26     addconfig "grub-install --no-floppy ${HDD} &> /dev/null"
27     addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null"
28     addconfig "exit 0"
29    
30     # run installrc
31     chrooted /bin/bash --rcfile /root/.installrc -i
32     rm ${INSTALLROOT}/root/.installrc
33     }