Magellan Linux

Diff of /trunk/installer-simple/bin/installer.sh.in

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

revision 2483 by niro, Wed Jan 8 10:36:44 2014 UTC revision 2642 by niro, Wed Apr 2 11:28:21 2014 UTC
# Line 9  Line 9 
9    
10  # setup locales  # setup locales
11  TEXTDOMAIN=installer  TEXTDOMAIN=installer
 LC_MESSAGES=C  
12    
13  # include dir  # include dir
14  INSTALLER_LIBDIR="%LIBDIR%"  INSTALLER_LIBDIR="%LIBDIR%"
# Line 41  do Line 40  do
40   fi   fi
41  done  done
42    
 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !  
 # -> now in images.conf  
 CDIMAGENAME=""  
 TOTALLINES=""  
 CURRENTLINE=0  
 if [ -e /mnt/cdrom/system/images.conf ]  
 then  
  source /mnt/cdrom/system/images.conf  
  # check if all required variables are set  
  [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in /mnt/cdrom/system/images.conf"  
  [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in /mnt/cdrom/system/images.conf"  
 else  
  die "/mnt/cdrom/system/images.conf not found"  
 fi  
   
43  ### System/Config Version  ### System/Config Version
44  VERSION="%VERSIONTAG%"  VERSION="%VERSIONTAG%"
45  TITLE="${DEFAULT_TITLE} - ${VERSION}"  TITLE="${DEFAULT_TITLE} - ${VERSION}"
46    
47  # some sane defaults  # some sane defaults
48  CDROOT="${DEFAULT_CDROOT}"  IMAGEROOT="${DEFAULT_IMAGEROOT}"
49  INSTALLROOT="${DEFAULT_INSTALLROOT}"  INSTALLROOT="${DEFAULT_INSTALLROOT}"
50  KERNELPKG="${DEFAULT_KERNELPKG}"  KERNELPKG="${DEFAULT_KERNELPKG}"
51  KERNELOPTS="${DEFAULT_KERNELOPTS}"  KERNELOPTS="${DEFAULT_KERNELOPTS}"
# Line 72  SPECIALDEVICE="" Line 56  SPECIALDEVICE=""
56  FORMFACTOR="${DEFAULT_FORMFACTOR}"  FORMFACTOR="${DEFAULT_FORMFACTOR}"
57  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
58    
59    # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
60    # -> now in images.conf
61    CDIMAGENAME=""
62    TOTALLINES=""
63    CURRENTLINE=0
64    if [ -e ${IMAGEROOT}/images.conf ]
65    then
66     source ${IMAGEROOT}/images.conf
67     # check if all required variables are set
68     [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in ${IMAGEROOT}/images.conf"
69     [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in ${IMAGEROOT}/images.conf"
70    else
71     die "${IMAGEROOT}/images.conf not found"
72    fi
73    
74  ### helper scripts ###  ### helper scripts ###
75    
# Line 100  install_meter() Line 98  install_meter()
98   return 0   return 0
99  }  }
100    
101    mount_rootfs()
102    {
103     local retval
104    
105     if is_mounted --location "${INSTALLROOT}"
106     then
107     echo $"${INSTALLROOT} already mounted" >&2
108     else
109     mount "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'"
110     fi
111     [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
112    }
113    
114    umount_rootfs()
115    {
116     is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
117     is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
118    }
119    
120    install_do_reboot()
121    {
122     reboot
123    }
124    
125  run_hardware_detection()  run_hardware_detection()
126  {  {
127   local hwinfo   local hwinfo
# Line 187  setup_hdd_partitions_auto() Line 209  setup_hdd_partitions_auto()
209   # run this only if FDISKPARTITIONBELOW256MB is not already 1   # run this only if FDISKPARTITIONBELOW256MB is not already 1
210   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
211   then   then
212   if hdd_size_below_256mb ${HDD}   if device_minimum_size "${HDD}" 256
213   then   then
214   FDISKPARTIONBELOW256MB=1   FDISKPARTIONBELOW256MB=1
215   else   else
# Line 262  setup_hdd_format() Line 284  setup_hdd_format()
284   mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die   mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die
285  }  }
286    
 install_mount_rootfs()  
 {  
  is_mounted --location "${INSTALLROOT}" || mount "${ROOTHDD}" "${INSTALLROOT}"  
  install -d ${INSTALLROOT}/boot || dialog_die  
 }  
   
287  install_system_image()  install_system_image()
288  {  {
289   pushd ${INSTALLROOT} > /dev/null   pushd ${INSTALLROOT} > /dev/null
290   tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}   tar xvjpf ${IMAGEROOT}}/${CDIMAGENAME} -C ${INSTALLROOT}
291   popd > /dev/null   popd > /dev/null
292  }  }
293    
# Line 293  install_system_settings() Line 309  install_system_settings()
309   addconfig 'NETWORKING="dhcp"'   addconfig 'NETWORKING="dhcp"'
310    
311   # intel framebuffer quirk   # intel framebuffer quirk
312   if [ -e ${INSTALLROOT}/etc/splash/splash.conf ]   CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
313     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
314   then   then
315   if [ -e /proc/fb ]   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
316   then   then
317   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
318   then   [[ ${fbdev} != 0 ]] && sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${CONFIG} || dialog_die
  fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')  
  if [[ ${fbdev} != 0 ]]  
  then  
  sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die  
  fi  
  fi  
319   fi   fi
320   fi   fi
321  }  }
322    
 install_umount_rootfs()  
 {  
  is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot  
  is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}  
 }  
   
 install_do_reboot()  
 {  
  reboot  
 }  
   
323    
324  ### installer dialogs ###  ### installer dialogs ###
325    
# Line 482  run_install_normal() Line 482  run_install_normal()
482   task_setup_hdd_partitions_manual   task_setup_hdd_partitions_manual
483   dialog_setup_hdd_format   dialog_setup_hdd_format
484   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
485   install_mount_rootfs   mount_rootfs
486   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image
487    
488   dialog_install_settings   dialog_install_settings
# Line 499  run_install_normal() Line 499  run_install_normal()
499   bootloader_config   bootloader_config
500   bootloader_install   bootloader_install
501    
502   install_umount_rootfs   umount_rootfs
503   dialog_install_successful   dialog_install_successful
504  }  }
505    
# Line 510  run_install_auto() Line 510  run_install_auto()
510   task_setup_hdd_partitions_auto   task_setup_hdd_partitions_auto
511   dialog_setup_hdd_format   dialog_setup_hdd_format
512   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
513   install_mount_rootfs   mount_rootfs
514   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image
515    
516   dialog_install_settings   dialog_install_settings
# Line 527  run_install_auto() Line 527  run_install_auto()
527   bootloader_config   bootloader_config
528   bootloader_install   bootloader_install
529    
530   install_umount_rootfs   umount_rootfs
531   dialog_install_successful   dialog_install_successful
532  }  }
533    

Legend:
Removed from v.2483  
changed lines
  Added in v.2642