/[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.41 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.41 2011/09/06 15:31:59 scarabeus 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/"
239 insinto /etc/default 239 insinto /etc/default
240 newins "${FILESDIR}"/grub.default grub 240 newins "${FILESDIR}"/grub.default grub
241 cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib 241 cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib
242 GRUB_DISTRIBUTOR="Gentoo" 242 GRUB_DISTRIBUTOR="Gentoo"
243EOF 243EOF
244
245 elog "Remember to run emerge --config =${CATEGORY}/${P} in order"
246 elog "to set up basic settings for this package."
244} 247}
245 248
246setup_boot_dir() { 249setup_boot_dir() {
247 local dir=$1 250 local dir=$1
248 251
249 # display the link to guide if user didn't set up anything yet. 252 # display the link to guide
250 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:"
251 elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml" 254 elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"
252 255
253 if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then 256 if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then
254 # This is first grub2 install and we have old configuraton for 257 # This is first grub2 install and we have old configuraton for
259 grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \ 262 grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \
260 ewarn "Running grub2-menulst2cfg failed!" 263 ewarn "Running grub2-menulst2cfg failed!"
261 264
262 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"
263 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"
264 einfo "configuration in '${ROOT}/etc/grub.d'." 267 einfo "configuration in '${ROOT}/etc/grub.d' and '${ROOT}/etc/defaults/grub'."
265 einfo 268 einfo
266 269
267 else 270 else
268 # 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
269 einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'" 272 einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'"
270 grub2-mkconfig -o "${dir}/grub.cfg" || \ 273 grub2-mkconfig -o "${dir}/grub.cfg" || \
271 ewarn "Running grub2-mkconfig failed! Check your configuration files!" 274 ewarn "Running grub2-mkconfig failed! Check your configuration files!"
272 fi 275 fi
273 276
274 elog "Remember to run \"grub2-mkconfig -o '${dir}/grub.cfg'\" every time"
275 elog "you update the configuration files!"
276
277 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"
278 elog "you update this package!" 278 elog "you update this package!"
279} 279}
280 280
281pkg_postinst() { 281pkg_config() {
282 local dir
283
282 mount-boot_mount_boot_partition 284 mount-boot_mount_boot_partition
283 285
284 setup_boot_dir "${ROOT}"boot/grub2 286 einfo "Enter the directory where you want to setup grub2 ('${ROOT}boot/grub2/'):"
287 read dir
285 288
286 # needs to be called after we call setup_boot_dir 289 [[ -z ${dir} ]] && dir="${ROOT}"boot/grub2
290
291 setup_boot_dir "${dir}"
292
287 mount-boot_pkg_postinst 293 mount-boot_pkg_postinst
288} 294}

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

  ViewVC Help
Powered by ViewVC 1.1.20