/[gentoo-x86]/sys-boot/grub/grub-9999.ebuild
Gentoo

Diff of /sys-boot/grub/grub-9999.ebuild

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

Revision 1.40 Revision 1.42
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/Attic/grub-9999.ebuild,v 1.40 2011/08/31 11:27:51 alexxy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/Attic/grub-9999.ebuild,v 1.42 2011/09/14 17:57:08 scarabeus Exp $
4 4
5EAPI=4 5EAPI=4
6 6
7if [[ ${PV} == "9999" ]] ; then 7if [[ ${PV} == "9999" ]] ; then
8 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/" 8 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
81 bin/grub2-mkfont 81 bin/grub2-mkfont
82 bin/grub2-editenv 82 bin/grub2-editenv
83 bin/grub2-mkimage 83 bin/grub2-mkimage
84" 84"
85 85
86QA_WX_LOAD="
87 lib*/grub2/*/kernel.img
88 lib*/grub2/*/setjmp.mod
89"
90
86grub_run_phase() { 91grub_run_phase() {
87 local phase=$1 92 local phase=$1
88 local platform=$2 93 local platform=$2
89 [[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]" 94 [[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
90 95
234 insinto /etc/default 239 insinto /etc/default
235 newins "${FILESDIR}"/grub.default grub 240 newins "${FILESDIR}"/grub.default grub
236 cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib 241 cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib
237 GRUB_DISTRIBUTOR="Gentoo" 242 GRUB_DISTRIBUTOR="Gentoo"
238EOF 243EOF
244
245 elog "Remember to run emerge --config =${CATEGORY}/${P} in order"
246 elog "to set up basic settings for this package."
239} 247}
240 248
241setup_boot_dir() { 249setup_boot_dir() {
242 local dir=$1 250 local dir=$1
243 251
244 # display the link to guide if user didn't set up anything yet. 252 # display the link to guide
245 elog "For informations how to configure grub-2 please reffer to the guide:" 253 elog "For informations how to configure grub-2 please reffer to the guide:"
246 elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml" 254 elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"
247 255
248 if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then 256 if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then
249 # This is first grub2 install and we have old configuraton for 257 # This is first grub2 install and we have old configuraton for
254 grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \ 262 grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \
255 ewarn "Running grub2-menulst2cfg failed!" 263 ewarn "Running grub2-menulst2cfg failed!"
256 264
257 einfo "Even if we just created configuration for your grub2 using old" 265 einfo "Even if we just created configuration for your grub2 using old"
258 einfo "grub-legacy configuration file you should migrate to use new style" 266 einfo "grub-legacy configuration file you should migrate to use new style"
259 einfo "configuration in '${ROOT}/etc/grub.d'." 267 einfo "configuration in '${ROOT}/etc/grub.d' and '${ROOT}/etc/defaults/grub'."
260 einfo 268 einfo
261 269
262 else 270 else
263 # we need to refresh the grub.cfg everytime just to play it safe 271 # we need to refresh the grub.cfg everytime just to play it safe
264 einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'" 272 einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'"
265 grub2-mkconfig -o "${dir}/grub.cfg" || \ 273 grub2-mkconfig -o "${dir}/grub.cfg" || \
266 ewarn "Running grub2-mkconfig failed! Check your configuration files!" 274 ewarn "Running grub2-mkconfig failed! Check your configuration files!"
267 fi 275 fi
268 276
269 elog "Remember to run \"grub2-mkconfig -o '${dir}/grub.cfg'\" every time"
270 elog "you update the configuration files!"
271
272 elog "Remember to run grub2-install to install your grub every time" 277 elog "Remember to run grub2-install to install your grub every time"
273 elog "you update this package!" 278 elog "you update this package!"
274} 279}
275 280
276pkg_postinst() { 281pkg_config() {
282 local dir
283
277 mount-boot_mount_boot_partition 284 mount-boot_mount_boot_partition
278 285
279 setup_boot_dir "${ROOT}"boot/grub2 286 einfo "Enter the directory where you want to setup grub2 ('${ROOT}boot/grub2/'):"
287 read dir
280 288
281 # needs to be called after we call setup_boot_dir 289 [[ -z ${dir} ]] && dir="${ROOT}"boot/grub2
290
291 setup_boot_dir "${dir}"
292
282 mount-boot_pkg_postinst 293 mount-boot_pkg_postinst
283} 294}

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.42

  ViewVC Help
Powered by ViewVC 1.1.20