Magellan Linux

Diff of /tags/installer-0_1_2/include/prepare_bootloader.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/installer/include/prepare_bootloader.sh revision 1035 by niro, Sun May 30 18:37:54 2010 UTC tags/installer-0_1_2/include/prepare_bootloader.sh revision 1074 by niro, Tue Jun 1 18:03:27 2010 UTC
# Line 13  create_device_map() Line 13  create_device_map()
13   [[ ! -z ${INSTALL_ROOT} ]] && chroot=chrooted   [[ ! -z ${INSTALL_ROOT} ]] && chroot=chrooted
14    
15   # create device.map   # create device.map
16   ${chroot} grub --batch --no-floppy --no-config-file --device-map=/boot/grub/device.map </dev/null &>/dev/null   ${chroot} grub --batch --no-floppy --no-config-file --device-map=/boot/grub/device.map </dev/null
17  }  }
18    
19  install_grub()  install_grub()
20  {  {
21   local chroot   local chroot
22     local grub_disk
23    
24     if [[ -z ${PARTITION_DISK_BOOT} ]]
25     then
26     grub_disk="${PARTITION_DISK_ROOT}"
27     else
28     grub_disk="${PARTITION_DISK_BOOT}"
29     fi
30    
31   [[ ! -z ${INSTALL_ROOT} ]] && chroot=chrooted   [[ ! -z ${INSTALL_ROOT} ]] && chroot=chrooted
32    
33   # update grub   # update grub
34   ${chroot} grub --batch --no-floppy << EOF 1> /dev/null 2> /dev/null   ${chroot} grub --batch --no-floppy << EOF
35  root $(convert_device ${PARTITION_DISK_BOOT})  root $(convert_device ${grub_disk})
36  setup $(convert_device ${PARTITION_DISK_BOOT} | sed "s:,[0-9]::")  setup $(convert_device ${grub_disk} | sed "s:,[0-9]::")
37  quit  quit
38  EOF  EOF
39    
# Line 67  add_grub_conf() Line 75  add_grub_conf()
75  create_grub_conf()  create_grub_conf()
76  {  {
77   local splashimage   local splashimage
78     local grub_disk
79    
80   if [[ -z ${PARTITION_DISK_BOOT} ]]   if [[ -z ${PARTITION_DISK_BOOT} ]]
81   then   then
82   export PARTITION_DISK_BOOT="${PARTITION_DISK_ROOT}"   grub_disk="${PARTITION_DISK_ROOT}"
83     else
84     grub_disk="${PARTITION_DISK_BOOT}"
85   fi   fi
86    
87   # create an empty one   # create an empty one
# Line 89  create_grub_conf() Line 100  create_grub_conf()
100   if [[ -f ${INSTALL_ROOT}/boot/${splashimage} ]]   if [[ -f ${INSTALL_ROOT}/boot/${splashimage} ]]
101   then   then
102   add_grub_conf "# splash image"   add_grub_conf "# splash image"
103   add_grub_conf "splashimage $(convert_device ${PARTITION_DISK_BOOT})/boot/${splashimage}"   add_grub_conf "splashimage $(convert_device ${grub_disk})/boot/${splashimage}"
104   add_grub_conf "foreground FFFFFF"   add_grub_conf "foreground FFFFFF"
105   add_grub_conf "background 253861"   add_grub_conf "background 253861"
106    
# Line 101  create_grub_conf() Line 112  create_grub_conf()
112   fi   fi
113    
114   add_grub_conf "title Magellan-Linux $(< ${INSTALL_ROOT}/etc/mageversion) ($(readlink ${INSTALL_ROOT}/boot/vmlinuz | sed s:kernel-::))"   add_grub_conf "title Magellan-Linux $(< ${INSTALL_ROOT}/etc/mageversion) ($(readlink ${INSTALL_ROOT}/boot/vmlinuz | sed s:kernel-::))"
115   add_grub_conf "root $(convert_device ${PARTITION_DISK_BOOT})"   add_grub_conf "root $(convert_device ${grub_disk})"
116   add_grub_conf "kernel /boot/$(readlink ${INSTALL_ROOT}/boot/vmlinuz) root=$(get_uuid ${PARTITION_DISK_ROOT})"   add_grub_conf "kernel /boot/$(readlink ${INSTALL_ROOT}/boot/vmlinuz) root=UUID=$(get_uuid ${PARTITION_DISK_ROOT})"
117   add_grub_conf "initrd /boot/$(readlink ${INSTALL_ROOT}/boot/initrd)"   add_grub_conf "initrd /boot/$(readlink ${INSTALL_ROOT}/boot/initrd)"
118    
119   # add an empty line as spacer between other boot entries   # add an empty line as spacer between other boot entries
# Line 111  create_grub_conf() Line 122  create_grub_conf()
122    
123  install_bootloader()  install_bootloader()
124  {  {
125   create_device_map &> /dev/null   create_device_map >> ${INSTALLER_LOG} 2>&1
126   echo 25   echo 25
127   create_grub_conf &> /dev/null   create_grub_conf >> ${INSTALLER_LOG} 2>&1
128   echo 50   echo 50
129   install_grub &> /dev/null   install_grub >> ${INSTALLER_LOG} 2>&1
130   echo 100   echo 100
131  }  }
132    

Legend:
Removed from v.1035  
changed lines
  Added in v.1074