Magellan Linux

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

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

revision 1025 by niro, Sun May 30 17:40:47 2010 UTC revision 1070 by niro, Mon May 31 22:51:09 2010 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $Id$  # $Id$
3    
4  source include/hwdetection.sh  source /etc/installer.conf
5    source ${INSTALLER_DIR}/include/hwdetection.sh
6    
7  : ${INSTALL_ROOT="/mnt/magellan"}  : ${INSTALL_ROOT="/mnt/magellan"}
8    
# Line 12  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 66  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 83  create_grub_conf() Line 95  create_grub_conf()
95   splashimage="magellan.xpm.gz"   splashimage="magellan.xpm.gz"
96    
97   # forcefully use gfxsplash   # forcefully use gfxsplash
98   [[ ! -f ${INSTALL_ROOT}/boot/${splashimage} ]] && cp data/magellan-black2.xpm.gz ${INSTALL_ROOT}/boot/${splashimage}   [[ ! -f ${INSTALL_ROOT}/boot/${splashimage} ]] && cp ${INSTALLER_DIR}/data/magellan-black2.xpm.gz ${INSTALL_ROOT}/boot/${splashimage}
99    
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   # old logo   add_grub_conf "splashimage $(convert_device ${grub_disk})/boot/${splashimage}"
  #add_grub_conf "splashimage /boot/magellan.xpm.gz"  
  #add_grub_conf "foreground FFFFFF"  
  #add_grub_conf "background 1B456B"  
   
  # the new one  
  add_grub_conf "splashimage $(convert_device ${PARTITION_DISK_BOOT})/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 106  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 116  create_grub_conf() Line 122  create_grub_conf()
122    
123  install_bootloader()  install_bootloader()
124  {  {
125   create_device_map >&2   create_device_map >> ${INSTALLER_LOG} 2>&1
126   echo 25   echo 25
127   create_grub_conf >&2   create_grub_conf >> ${INSTALLER_LOG} 2>&1
128   echo 50   echo 50
129   install_grub >&2   install_grub >> ${INSTALLER_LOG} 2>&1
130   echo 100   echo 100
131  }  }
   
 install_bootloader  

Legend:
Removed from v.1025  
changed lines
  Added in v.1070