Magellan Linux

Diff of /tags/grubby-8_37/new-kernel-pkg

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

revision 1778 by niro, Sat Mar 3 16:05:42 2012 UTC revision 2237 by niro, Mon Oct 21 13:22:08 2013 UTC
# Line 91  then Line 91  then
91  elif [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]]  elif [[ ${ARCH} = ppc64 ]] || [[ ${ARCH} = ppc ]]
92  then  then
93   liloConfig=/etc/yaboot.conf   liloConfig=/etc/yaboot.conf
94     grub2Config=/boot/grub/grub.cfg
95   bootPrefix=/boot   bootPrefix=/boot
96   lilo=/sbin/ybin   lilo=/sbin/ybin
97   liloFlag=yaboot   liloFlag=yaboot
# Line 111  then Line 112  then
112   lilo=/sbin/zipl   lilo=/sbin/zipl
113   runLilo="yes"   runLilo="yes"
114   isx86=""   isx86=""
115  elif [[ ${ARCH} = armv7l ]] || [[ ${ARCH} = armv7hl ]] || [[ ${ARCH} = armv5tel ]]  elif [[ ${ARCH} =~ armv[5|7].*l ]]
116  then  then
  machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//')  
117   liloConfig=""   liloConfig=""
118   bootPrefix=/boot   bootPrefix=/boot
119   ubootDir=${UBOOT_DIR:-"/boot/uboot"}   ubootDir=${UBOOT_DIR:-"/boot"}
120   ubootScript=$ubootDir/${UBOOT_SCR:-"boot.scr"}   ubootScript=$ubootDir/${UBOOT_SCR:-"boot.scr"}
121   ubootKList=${UBOOT_KLIST:-"klist.txt"}   ubootKList=${UBOOT_KLIST:-"klist.txt"}
122   ubootDevice=/dev/${UBOOT_DEVICE:-"mmcblk0p1"}   ubootDevice=/dev/${UBOOT_DEVICE:-"mmcblk0p1"}
123   ubootDefaultImage=${UBOOT_UIMAGE:-"uImage"}   ubootDefaultImage=${UBOOT_UIMAGE:-"uImage"}
124   ubootDefaultInitrd=${UBOOT_UINITRD:-"uInitrd"}   ubootDefaultInitrd=${UBOOT_UINITRD:-"uInitrd"}
125     ubootAddress=${UBOOT_IMGADDR:-"0x00008000"}
126   mounted=""   mounted=""
127   liloFlag=""   liloFlag=""
128   isx86=""   isx86=""
  if [[ ${machine} == "OMAP3 Beagle Board" ]] || [[ ${machine} == "OMAP4 Panda board" ]]  
  then  
  ubootAddress=0x80008000  
  else  
  ubootAddress=0x00008000  
  fi  
129  else  else
130   # this leaves i?86 and x86_64   # this leaves i?86 and x86_64
131   liloConfig=/etc/lilo.conf   liloConfig=/etc/lilo.conf
# Line 211  install() Line 206  install()
206    
207   # get the root filesystem to use   # get the root filesystem to use
208   rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab)   rootdevice=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/fstab)
209     if [[ -z $rootdevice ]]
210     then
211     rootdevice=$(grep -o -P "(?<=root=)\S+" /proc/cmdline)
212     fi
213    
214   if [[ -n ${mbkernel} ]] && [[ -n ${cfgLilo} ]] && [[ ${liloFlag} != elilo ]]   if [[ -n ${mbkernel} ]] && [[ -n ${cfgLilo} ]] && [[ ${liloFlag} != elilo ]]
215   then   then
# Line 283  install() Line 282  install()
282   else   else
283   title="Magellan Linux [ ${version} ]"   title="Magellan Linux [ ${version} ]"
284   fi   fi
285   ${grubby} --grub2 -c ${grub2EfiConfig} \   ${grubby} --grub2 -c ${grub2EfiConfig} --efi \
286   --add-kernel=${bootPrefix}/${kernelName}-${version} \   --add-kernel=${bootPrefix}/${kernelName}-${version} \
287   ${INITRD} --copy-default ${makedefault} --title "${title}" \   ${INITRD} --copy-default ${makedefault} --title "${title}" \
288   ${mbkernel:+--add-multiboot="${mbkernel}"} \   ${mbkernel:+--add-multiboot="${mbkernel}"} \
# Line 372  remove() Line 371  remove()
371   if [[ -n ${cfgGrub2Efi} ]]   if [[ -n ${cfgGrub2Efi} ]]
372   then   then
373   [[ -n ${verbose} ]] && echo "removing ${version} from ${grub2EfiConfig}"   [[ -n ${verbose} ]] && echo "removing ${version} from ${grub2EfiConfig}"
374   ${grubby} --grub2 -c ${grub2EfiConfig} \   ${grubby} --grub2 -c ${grub2EfiConfig} --efi \
375   --remove-kernel=${bootPrefix}/${kernelName}-${version}   --remove-kernel=${bootPrefix}/${kernelName}-${version}
376   else   else
377   [[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby grub 2 with UEFI"   [[ -n ${verbose} ]] && echo "${grub2EfiConfig} does not exist, not running grubby grub 2 with UEFI"
# Line 405  remove() Line 404  remove()
404   then   then
405   tmpKList=$(mktemp ${ubootDir}/${ubootKList}.XXXX)   tmpKList=$(mktemp ${ubootDir}/${ubootKList}.XXXX)
406   curversion=$(tail -n1 ${ubootDir}/${ubootKList})   curversion=$(tail -n1 ${ubootDir}/${ubootKList})
407   sed "/${version}/d" ${ubootDir}/${ubootKList} > ${tmpKList}   sed "/$version$/d" ${ubootDir}/${ubootKList} > ${tmpKList}
408   newversion=$(tail -n1 ${tmpKList})   newversion=$(tail -n1 ${tmpKList})
409   if [ -f ${ubootDir}/uImage-${newversion} ] && [ -f ${ubootDir}/uInitrd-${newversion} ]   if [ -f ${ubootDir}/uImage-${newversion} ] && [ -f ${ubootDir}/uInitrd-${newversion} ]
410   then   then
# Line 508  update() Line 507  update()
507   if [[ -n ${cfgGrub2Efi} ]]   if [[ -n ${cfgGrub2Efi} ]]
508   then   then
509   [[ -n ${verbose} ]] && echo "updating ${version} from ${grub2EfiConfig}"   [[ -n ${verbose} ]] && echo "updating ${version} from ${grub2EfiConfig}"
510   ${grubby} --grub2 -c ${grub2EfiConfig} \   ${grubby} --grub2 -c ${grub2EfiConfig} --efi \
511   --update-kernel=${bootPrefix}/${kernelName}-${version} \   --update-kernel=${bootPrefix}/${kernelName}-${version} \
512   ${INITRD} \   ${INITRD} \
513   ${kernargs:+--args="${kernargs}"} \   ${kernargs:+--args="${kernargs}"} \
# Line 801  fi Line 800  fi
800  # add dracut i18n, keyboard and plymouth kernel args if requested  # add dracut i18n, keyboard and plymouth kernel args if requested
801  if [[ -n ${dracut} ]] || [[ -n ${adddracutargs} ]]  if [[ -n ${dracut} ]] || [[ -n ${adddracutargs} ]]
802  then  then
803   [ -r /etc/conf.d/keymap ] && . /etc/conf.d/keymap   if [ -r /etc/vconsole.conf ]
  [ -r /etc/conf.d/consolefont ] && . /etc/conf.d/consolefont  
   
  if [[ -n ${KEYMAP} ]]  
804   then   then
805   kernargs="${kernargs} KEYTABLE=${KEYMAP}"   . /etc/vconsole.conf
806    
807     for i in SYSFONT SYSFONTACM UNIMAP KEYTABLE
808     do
809     val=$(eval echo \$$i)
810     [[ -n ${val} ]] && kernargs="${kernargs} ${i}=${val}"
811     done
812     else
813     if [ -r /etc/conf.d/consolefont ]
814     then
815     . /etc/conf.d/consolefont
816    
817     if [[ -n ${CONSOLEFONT} ]]
818     then
819     kernargs="${kernargs} SYSFONT=${CONSOLEFONT}"
820     fi
821     fi
822    
823     if  [ -r /etc/conf.d/keymap ]
824     then
825     . /etc/conf.d/keymap
826    
827     if [[ -n ${KEYMAP} ]]
828     then
829     kernargs="${kernargs} KEYTABLE=${KEYMAP}"
830     fi
831     fi
832   fi   fi
833    
834   if [[ -n ${CONSOLEFONT} ]]   if [ -r /etc/locale.conf ]
835   then   then
836   kernargs="${kernargs} SYSFONT=${CONSOLEFONT}"   . /etc/locale.conf
837    
838     if [[ -n ${LANG} ]]
839     then
840     kernargs="${kernargs} LANG=${LANG}"
841     fi
842   fi   fi
843  fi  fi
844    
# Line 869  then Line 896  then
896   fi   fi
897  fi  fi
898    
899    # if we're using U-Boot, check if the default load address should change
900    if [[ -n ${cfguBoot} ]] && [[ -z ${UBOOT_IMGADDR} ]]
901    then
902     [[ ${version}  =~ .([^.]*)$ ]]
903     platform=${BASH_REMATCH[1]}
904     # A few platforms use an alternate kernel load address
905     if [[ ${platform} = omap ]]
906     then
907     ubootAddress=0x80008000
908     elif [[ ${platform} = imx ]]
909     then
910     ubootAddress=0x90008000
911     fi
912    fi
913    
914  # if we have a lilo config on an x86 box, see if the default boot loader  # if we have a lilo config on an x86 box, see if the default boot loader
915  # is lilo to determine if it should be run  # is lilo to determine if it should be run
916  if [[ -n ${cfgLilo} ]] && [[ -n ${isx86} ]]  if [[ -n ${cfgLilo} ]] && [[ -n ${isx86} ]]

Legend:
Removed from v.1778  
changed lines
  Added in v.2237