Magellan Linux

Diff of /trunk/grubby/new-kernel-pkg

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

revision 1752 by niro, Sat Feb 18 01:22:03 2012 UTC revision 1778 by niro, Sat Mar 3 16:05:42 2012 UTC
# Line 25  Line 25 
25  # along with this program.  If not, see <http://www.gnu.org/licenses/>.  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
26  #  #
27    
28    read_os_release()
29    {
30     local NAME
31     local ID
32     local Version
33     local Version_ID
34     local PRETTY_NAME
35     local ANSI_COLOR
36     local CPE_NAME
37    
38     if [[ -f /etc/os-release ]]
39     then
40     source /etc/os-release
41    
42     case $1 in
43     name) echo "${NAME}" ;;
44     id) echo "${ID}" ;;
45     version) echo "${Version}" ;;
46     version_id) echo "${Version_ID}" ;;
47     pretty_name) echo "${PRETTY_NAME}" ;;
48     ansi_color) echo "${ANSI_COLOR}" ;;
49     cpe_name) echo "${CPE_NAME}" ;;
50     esac
51     fi
52    }
53    
54  PATH=/sbin:/bin:$PATH  PATH=/sbin:/bin:$PATH
55    
56  lilo=/sbin/lilo  lilo=/sbin/lilo
# Line 85  then Line 111  then
111   lilo=/sbin/zipl   lilo=/sbin/zipl
112   runLilo="yes"   runLilo="yes"
113   isx86=""   isx86=""
114  elif [[ ${ARCH} = armv7l ]] || [[ ${ARCH} = armv7hl ]]  elif [[ ${ARCH} = armv7l ]] || [[ ${ARCH} = armv7hl ]] || [[ ${ARCH} = armv5tel ]]
115  then  then
116   machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//')   machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//')
117   liloConfig=""   liloConfig=""
# Line 198  install() Line 224  install()
224    
225   if [[ -n ${banner} ]]   if [[ -n ${banner} ]]
226   then   then
227   title="${banner} (${version})"   title="${banner} [ ${version} ]"
228   elif [ -f /etc/mageversion ]   elif [ -f /etc/mageversion ]
229   then   then
230   title="Magellan Linux $(< /etc/mageversion) (${version})"   title="Magellan Linux $(< /etc/mageversion) [ ${version} ]"
231     elif [[ $(read_os_release id) = magellan ]]
232     then
233     title="$(read_os_release name) $(read_os_release version_id) [ ${version} ]"
234   else   else
235   title="Magellan Linux (${version})"   title="Magellan Linux [ ${version} ]"
236   fi   fi
237   ${grubby} --grub -c ${grubConfig} \   ${grubby} --grub -c ${grubConfig} \
238   --add-kernel=${bootPrefix}/${kernelName}-${version} \   --add-kernel=${bootPrefix}/${kernelName}-${version} \
# Line 219  install() Line 248  install()
248    
249   if [[ -n ${banner} ]]   if [[ -n ${banner} ]]
250   then   then
251   title="${banner} (${version})"   title="${banner} [ ${version} ]"
252   elif [ -f /etc/mageversion ]   elif [ -f /etc/mageversion ]
253   then   then
254   title="Magellan Linux $(< /etc/mageversion) (${version})"   title="Magellan Linux $(< /etc/mageversion) [ ${version} ]"
255     elif [[ $(read_os_release id) = magellan ]]
256     then
257     title="$(read_os_release name) $(read_os_release version_id) [ ${version} ]"
258   else   else
259   title="Magellan Linux (${version})"   title="Magellan Linux [ ${version} ]"
260   fi   fi
261   ${grubby} --grub2 -c ${grub2Config} \   ${grubby} --grub2 -c ${grub2Config} \
262   --add-kernel=${bootPrefix}/${kernelName}-${version} \   --add-kernel=${bootPrefix}/${kernelName}-${version} \
# Line 241  install() Line 273  install()
273    
274   if [[ -n ${banner} ]]   if [[ -n ${banner} ]]
275   then   then
276   title="${banner} (${version})"   title="${banner} [ ${version} ]"
277   elif [ -f /etc/mageversion ]   elif [ -f /etc/mageversion ]
278   then   then
279   title="Magellan Linux $(< /etc/mageversion) (${version})"   title="Magellan Linux $(< /etc/mageversion) [ ${version} ]"
280     elif [[ $(read_os_release id) = magellan ]]
281     then
282     title="$(read_os_release name) $(read_os_release version_id) [ ${version} ]"
283   else   else
284   title="Magellan Linux (${version})"   title="Magellan Linux [ ${version} ]"
285   fi   fi
286   ${grubby} --grub2 -c ${grub2EfiConfig} \   ${grubby} --grub2 -c ${grub2EfiConfig} \
287   --add-kernel=${bootPrefix}/${kernelName}-${version} \   --add-kernel=${bootPrefix}/${kernelName}-${version} \
# Line 288  install() Line 323  install()
323    
324   if [[ -n ${banner} ]]   if [[ -n ${banner} ]]
325   then   then
326   title="${banner} (${version})"   title="${banner} [ ${version} ]"
327   elif [ -f /etc/mageversion ]   elif [ -f /etc/mageversion ]
328   then   then
329   title="Magellan Linux $(< /etc/mageversion) (${version})"   title="Magellan Linux $(< /etc/mageversion) [ ${version} ]"
330     elif [[ $(read_os_release id) = magellan ]]
331     then
332     title="$(read_os_release name) $(read_os_release version_id) [ ${version} ]"
333   else   else
334   title="Magellan Linux (${version})"   title="Magellan Linux [ ${version} ]"
335   fi   fi
336   ${grubby} --extlinux -c ${extlinuxConfig} \   ${grubby} --extlinux -c ${extlinuxConfig} \
337   --add-kernel=${bootPrefix}/${kernelName}-${version} \   --add-kernel=${bootPrefix}/${kernelName}-${version} \
# Line 548  update() Line 586  update()
586   fi   fi
587  }  }
588    
589  mkinitrd()  makeinitrd()
590  {  {
591   if [[ -n ${dracut} ]]   if [[ -n ${dracut} ]]
592   then   then
# Line 795  fi Line 833  fi
833    
834  if [[ ${initrd} = make ]]  if [[ ${initrd} = make ]]
835  then  then
836   mkinitrd   makeinitrd
837  elif [[ ${initrd} = remove ]]  elif [[ ${initrd} = remove ]]
838  then  then
839   rminitrd   rminitrd

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