From 965c970cac9caa2e41de59f576402b28483e44d4 Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Tue, 4 Oct 2011 18:23:19 +0000 Subject: Include option to prompt for grub1 configuration. Thanks to Robert Trace rtrace{at}farcaster.org for the patch. Package-Manager: portage-2.2.0_alpha60/cvs/Linux x86_64 --- sys-boot/grub/ChangeLog | 7 +++- sys-boot/grub/Manifest | 32 ++++++++--------- sys-boot/grub/grub-1.99-r2.ebuild | 75 +++++++++++++++++++++++++-------------- sys-boot/grub/grub-9999.ebuild | 75 +++++++++++++++++++++++++-------------- 4 files changed, 120 insertions(+), 69 deletions(-) (limited to 'sys-boot') diff --git a/sys-boot/grub/ChangeLog b/sys-boot/grub/ChangeLog index c84676626967..3165d221d9df 100644 --- a/sys-boot/grub/ChangeLog +++ b/sys-boot/grub/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-boot/grub # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.168 2011/10/03 09:10:13 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.169 2011/10/04 18:23:19 scarabeus Exp $ + + 04 Oct 2011; Tomáš Chvátal grub-1.99-r2.ebuild, + grub-9999.ebuild: + Include option to prompt for grub1 configuration. Thanks to Robert Trace + rtrace{at}farcaster.org for the patch. 03 Oct 2011; Tomáš Chvátal grub-1.99-r2.ebuild, grub-9999.ebuild: diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index 7086bd8df0d4..78c71ba7bc0c 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -41,24 +41,24 @@ EBUILD grub-0.97-r6.ebuild 8801 RMD160 3da0ba7ea62758c9fd352f7290b441c3e9f08fb6 EBUILD grub-0.97-r8.ebuild 8941 RMD160 4caee80e02de14e6a88a3ab016df32f90c258f09 SHA1 be1f73938f4763cf6413afee97062abb8666ffbb SHA256 5876009e82e6556be90d2355defd3039d244f5a53313ba29ce937e9c14e169ff EBUILD grub-0.97-r9.ebuild 9045 RMD160 5db30743506d7ae274695a94bd1c7c5fea8003e2 SHA1 4796cd56c8e77239719bd31a0542b11129e7922f SHA256 153939f732549503f08dd2acff27325b3e398ffc065e16c1749281c6c66a97d5 EBUILD grub-0.97.ebuild 4494 RMD160 f798b7101af90add6d45725e34aeb7f219e0b748 SHA1 fbb215b293127635ba41e7fa952518e5e07f118a SHA256 d08c03989b1cd6ad91fa2e1a098e0230994570472d0f11a6d926e21e06071c58 -EBUILD grub-1.99-r2.ebuild 7758 RMD160 3397d3eca513512a27d07f74bfb2bd736eea8f93 SHA1 f2556faa5d263f234ebc5cba9e5a089cb8a566fa SHA256 1c464401560e59ebabc458c6750fe66e837c66fe72d73861f6f21b517cce2dec -EBUILD grub-9999.ebuild 7543 RMD160 5dce1585f004694c229d6ad0ebf4999cbbf5f664 SHA1 e1aa0fcfce14d5a30e6dab130bbd28c82b9b736f SHA256 0f9c0a749f770dc30f38c4f2b76f0eae6ed944d8bf174db74c9f45f781ab9d69 -MISC ChangeLog 34533 RMD160 3239dcb947a6ac7f920787b187acd5fd37759a84 SHA1 ef75f9be36cd887b56f1a38852c14a3f79581f28 SHA256 f78d8b614cd109cd9341bc7565277a239c3cb88f99317e938377e4bce3fa5b85 +EBUILD grub-1.99-r2.ebuild 7920 RMD160 50fbed308527298d07f7496548fefd4a6b4cc352 SHA1 4f355451b6bf22717038f03cb637a86539b51b7f SHA256 0edce7952ec39265ddfac804c7e7e76f504fd0f4d7983c1820335adb2fb11221 +EBUILD grub-9999.ebuild 7705 RMD160 654570be7597b4e7002a0c5072fe6cc2fab2d74e SHA1 7dc468d1128fa60dae41208dca25da980c9b1887 SHA256 5a6d2a699a8c470e6a2970b947c82c259bbeedbae59ab476ecdf125b53d62bf0 +MISC ChangeLog 34746 RMD160 96ccfb56167a5b2e3a8d4bdc46fbdde87bcf768c SHA1 7c1d4a34ee7ff673372f35bf046e2576ea32a408 SHA256 e6c4bf1077a68838c9a75a949a81182ab7c0e0c19c80f5d17261205fe5466593 MISC metadata.xml 515 RMD160 7ff103974a6e301b4ba14c55c674c1bf35b1a045 SHA1 05d70f211a5f37e1368b74f7a74b0830d8198787 SHA256 dc713fb7db877b0d8405ac8dba28c4253347205a46d677ffe71901c2f017fb0c -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) -iQIcBAEBAgAGBQJOiXy4AAoJEOSiRoyO7jvoFcQP/jQCv6VDwht+xActVb6XrOHR -OPzjwcBkdLvDZn8WRTl0GuXd7IQo4rimU1UkNIRG2OGfyttVAey7GpU0KmEqAyWe -bwl5Bg1IZJ5ALEJy4+n2c3pkkBecEu7UqiSdlXBfCyFnGnEZRRcM/XtjLQgGz880 -ndWj4YRzclPBvUsZovK8cW9rg9c62nPdOf2FedJQcA+cHgoQgJA2ltL3rMZAyvw2 -AFzwAWh2nvbbmbcqjfGLKdxxD+npUzMJkv661F8TfctPW63r+XmyKrFiYzPMSFMM -DFjrJ1CnJC+6dlgkVNrmptKpWyrIuAO3cE/RuQ9oOQANNUL9/Hd4dw9NfYYsrmsy -DY7Bh0VTMZA/T1JuQjwm2uygkwLP3k8HoR5EUeLemRckh2l7/slRbSUdl33ewPSj -0nRxJ7vIB9sLS68WyXYpekaREycLaa4EK7UJItgKlK4w7U4tftSP1zDF1aXcy8DV -aGLNAN/5FsOWyaHBxCzkh/XMDWq8jLIBfpzZkgs1o2S3gM0/c+Q+EO4ikn49Pr+x -dI7vyMzbdUt4TSS1/jP3/G4kNMDtqnPscVCx0Z/L4LTHyrVRi5DdzhnOcrqiPMew -rRc1Ee2Xwc2a3T1AcoNcI+3gd4NJqKFi7eP/Ifl2upavlQo33jWeF/BcDr4dtcRH -NaTUYjMyDSykw5n9WlD0 -=NCth +iQIcBAEBAgAGBQJOi07tAAoJEOSiRoyO7jvo8sgP/2esuIp0+ztcPz8ZOrzKoWpJ +hQryqebvANC7/AeWBFsQhEfR+PIDyeKmpI/CuJWk7T7n+PTYNaX0lDLIuiqejagQ +A5LiZxcImvXDRBpn2aLL5hYtcBklrV3PQjk+8NQEMW3+nowWjOu9YfixrNleGb/e +ck3bi/pzpcE0TOTSNLKYiHDycrZxZDy8L80FVpy5YENOHzb9pR+6FKBHrWacFquL +C9gp1Vphk59HEL6ZLViHF3s/OwoFDbvMUR/QqCwg2iulLiiuMP8eX9wePqiDPDgW +eR3N+iUXlJr35StkrTI03uxPvqp6CkzsmKww8D7FyeDCvgyD4zDSI/PhQy3AUeGe +Mm48T+FXBNEypN4GE93YvPOAZwyrHun82ElSrW7BFrvuNGj5Q3QhVbfZ7Stba52M +whXOsuMayrJTAmJlNH6F0f48a7q6QiRgpXdiWY3k2bo60lLW0h7f9/yeHLm6qxdO +5STXxQnW5YKWec8sRmmubADVXu9jzafYqpQEgCVQ8mtu7JomTMCTCKr8IpEWh2g1 +mm6aaWVuhkZ9oJ2UHsDuK3E6Uaumzupyc/ukl76dxoVWGxeWlvW+K46tkhSqbQRs +LeCVtFwYyodNcYDv3mRiGgAMFwjbOxGDBsDxR44XRKsh84rqoVGJXaE7lSDVLPr2 +gpKYHDMbZ2cCle8gYjHR +=TWBP -----END PGP SIGNATURE----- diff --git a/sys-boot/grub/grub-1.99-r2.ebuild b/sys-boot/grub/grub-1.99-r2.ebuild index 846e65dff81b..e83dd270524d 100644 --- a/sys-boot/grub/grub-1.99-r2.ebuild +++ b/sys-boot/grub/grub-1.99-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-1.99-r2.ebuild,v 1.4 2011/10/03 09:10:13 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-1.99-r2.ebuild,v 1.5 2011/10/04 18:23:19 scarabeus Exp $ EAPI=4 @@ -187,7 +187,7 @@ src_prepare() { use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}" done [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed" - einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}" + elog "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}" } src_configure() { @@ -246,43 +246,66 @@ src_install() { GRUB_DISTRIBUTOR="Gentoo" EOF - elog "Remember to run emerge --config =${CATEGORY}/${PF} in order" - elog "to set up basic settings for this package." -} - -setup_boot_dir() { - local dir=$1 + elog + elog "To configure GRUB 2, check the defaults in /etc/default/grub and" + elog "then run 'emerge --config =${CATEGORY}/${PF}'." # display the link to guide + show_doc_url +} + +show_doc_url() { + elog elog "For informations how to configure grub-2 please refer to the guide:" elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml" +} + +setup_boot_dir() { + local dir=$1 + local use_legacy='n' # Make sure target directory exists mkdir -p "${dir}" - if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then - # This is first grub2 install and we have old configuraton for - # grub1 around. Lets try to generate grub.cfg from it so user - # does not loose any stuff when rebooting. - # NOTE: in long term he still NEEDS to migrate to grub.d stuff. - einfo "Running: grub2-menulst2cfg '${dir/2/}/menu.lst' '${dir}/grub.cfg'" - grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \ - ewarn "Running grub2-menulst2cfg failed!" + if [[ -e ${dir/2/}/menu.lst ]] ; then + # Legacy config exists, ask user what to do + einfo "Found legacy GRUB configuration. Do you want to convert it" + einfo "instead of using autoconfig (y/N)?" + read use_legacy + + use_legacy=${use_legacy,,[A-Z]} + fi + + if [[ ${use_legacy} == y* ]] ; then + grub1_cfg=${dir/2/}/menu.lst + grub2_cfg=${dir}/grub.cfg + + # GRUB legacy configuration exists. Use it instead of doing + # our normal autoconfigure. + # + + einfo "Converting legacy config at '${grub1_cfg}' for use by GRUB2." + ebegin "Running: grub2-menulst2cfg '${grub1_cfg}' '${grub2_cfg}'" + grub2-menulst2cfg "${grub1_cfg}" "${grub2_cfg}" &> /dev/null + eend $? - einfo "Even if we just created configuration for your grub2 using old" - einfo "grub-legacy configuration file you should migrate to use new style" - einfo "configuration in '${ROOT}/etc/grub.d' and '${ROOT}/etc/defaults/grub'." - einfo + ewarn + ewarn "Even though the conversion above succeeded, you are STRONGLY" + ewarn "URGED to upgrade to the new GRUB2 configuration format." + # Remind the user about the documentation + show_doc_url else - # we need to refresh the grub.cfg everytime just to play it safe - einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'" - grub2-mkconfig -o "${dir}/grub.cfg" || \ - ewarn "Running grub2-mkconfig failed! Check your configuration files!" + # Run GRUB 2 autoconfiguration + einfo "Running GRUB 2 autoconfiguration." + ebegin "grub2-mkconfig -o '${dir}/grub.cfg'" + grub2-mkconfig -o "${dir}/grub.cfg" &> /dev/null + eend $? fi - elog "Remember to run grub2-install to install your grub every time" - elog "you update this package!" + einfo + einfo "Remember to run grub2-install to activate GRUB2 as your default" + einfo "bootloader." } pkg_config() { diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild index d9d99c5c7465..c5cc7d7a546a 100644 --- a/sys-boot/grub/grub-9999.ebuild +++ b/sys-boot/grub/grub-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.43 2011/10/03 09:10:13 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.44 2011/10/04 18:23:19 scarabeus Exp $ EAPI=4 @@ -183,7 +183,7 @@ src_prepare() { use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}" done [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed" - einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}" + elog "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}" } src_configure() { @@ -242,43 +242,66 @@ src_install() { GRUB_DISTRIBUTOR="Gentoo" EOF - elog "Remember to run emerge --config =${CATEGORY}/${PF} in order" - elog "to set up basic settings for this package." -} - -setup_boot_dir() { - local dir=$1 + elog + elog "To configure GRUB 2, check the defaults in /etc/default/grub and" + elog "then run 'emerge --config =${CATEGORY}/${PF}'." # display the link to guide + show_doc_url +} + +show_doc_url() { + elog elog "For informations how to configure grub-2 please refer to the guide:" elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml" +} + +setup_boot_dir() { + local dir=$1 + local use_legacy='n' # Make sure target directory exists mkdir -p "${dir}" - if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then - # This is first grub2 install and we have old configuraton for - # grub1 around. Lets try to generate grub.cfg from it so user - # does not loose any stuff when rebooting. - # NOTE: in long term he still NEEDS to migrate to grub.d stuff. - einfo "Running: grub2-menulst2cfg '${dir/2/}/menu.lst' '${dir}/grub.cfg'" - grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \ - ewarn "Running grub2-menulst2cfg failed!" + if [[ -e ${dir/2/}/menu.lst ]] ; then + # Legacy config exists, ask user what to do + einfo "Found legacy GRUB configuration. Do you want to convert it" + einfo "instead of using autoconfig (y/N)?" + read use_legacy + + use_legacy=${use_legacy,,[A-Z]} + fi + + if [[ ${use_legacy} == y* ]] ; then + grub1_cfg=${dir/2/}/menu.lst + grub2_cfg=${dir}/grub.cfg + + # GRUB legacy configuration exists. Use it instead of doing + # our normal autoconfigure. + # + + einfo "Converting legacy config at '${grub1_cfg}' for use by GRUB2." + ebegin "Running: grub2-menulst2cfg '${grub1_cfg}' '${grub2_cfg}'" + grub2-menulst2cfg "${grub1_cfg}" "${grub2_cfg}" &> /dev/null + eend $? - einfo "Even if we just created configuration for your grub2 using old" - einfo "grub-legacy configuration file you should migrate to use new style" - einfo "configuration in '${ROOT}/etc/grub.d' and '${ROOT}/etc/defaults/grub'." - einfo + ewarn + ewarn "Even though the conversion above succeeded, you are STRONGLY" + ewarn "URGED to upgrade to the new GRUB2 configuration format." + # Remind the user about the documentation + show_doc_url else - # we need to refresh the grub.cfg everytime just to play it safe - einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'" - grub2-mkconfig -o "${dir}/grub.cfg" || \ - ewarn "Running grub2-mkconfig failed! Check your configuration files!" + # Run GRUB 2 autoconfiguration + einfo "Running GRUB 2 autoconfiguration." + ebegin "grub2-mkconfig -o '${dir}/grub.cfg'" + grub2-mkconfig -o "${dir}/grub.cfg" &> /dev/null + eend $? fi - elog "Remember to run grub2-install to install your grub every time" - elog "you update this package!" + einfo + einfo "Remember to run grub2-install to activate GRUB2 as your default" + einfo "bootloader." } pkg_config() { -- cgit v1.2.3-65-gdbad