diff options
author | 2011-06-09 00:20:17 +0200 | |
---|---|---|
committer | 2011-06-09 00:20:17 +0200 | |
commit | a7e7d20e08041f409c67795e3e51091802b15d5c (patch) | |
tree | 1803ffe47f96d82f8919b48665ca92e3ca4a9450 | |
parent | [sys-boot/grub] Update the elog informations to be more clear. (diff) | |
download | scarabeus-a7e7d20e08041f409c67795e3e51091802b15d5c.tar.gz scarabeus-a7e7d20e08041f409c67795e3e51091802b15d5c.tar.bz2 scarabeus-a7e7d20e08041f409c67795e3e51091802b15d5c.zip |
[sys-boot/grub] fully support side-by-side install with old grub.
-rw-r--r-- | profiles/updates/2Q-2011 | 1 | ||||
-rw-r--r-- | sys-boot/grub/Manifest | 4 | ||||
-rw-r--r-- | sys-boot/grub/grub-1.99.ebuild | 76 | ||||
-rw-r--r-- | sys-boot/grub/grub-9999.ebuild | 76 |
4 files changed, 125 insertions, 32 deletions
diff --git a/profiles/updates/2Q-2011 b/profiles/updates/2Q-2011 new file mode 100644 index 0000000..28c4b75 --- /dev/null +++ b/profiles/updates/2Q-2011 @@ -0,0 +1 @@ +slotmove >=sys-boot/grub-1.99 0 2 diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index d06afcf..9f6ccf6 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -1,5 +1,5 @@ AUX grub.default 1127 RMD160 a884e842cb203687cac4cac6551b0feed58d3b7a SHA1 5878147845b5d4b4aac34ce046ead60b93c3170c SHA256 32664f2e0bdd05cf9579f8e098aa0add76ef7bf7b37eb103c6d0f625204f44d3 DIST grub-1.99.tar.xz 2639224 RMD160 d59a47fa40b2be0d5ea5b2b00ff5538cfa147747 SHA1 a5ae9558f30ce7757a76aa130088b053a87e2fb6 SHA256 f308148d4c83c6f16a73b58a0cd39381656edb740929028cae7ad5f0d651021b -EBUILD grub-1.99.ebuild 6407 RMD160 62d79889abf49dc4b1b78591479c7d7976ce1f7d SHA1 2d9b795313b53f5d0c65786b1526df79ff459ac0 SHA256 d4b4f6ce1b140807bf1850df16855a1e5fd0b187b5dd0d93f2932fca81d9af63 -EBUILD grub-9999.ebuild 6407 RMD160 62d79889abf49dc4b1b78591479c7d7976ce1f7d SHA1 2d9b795313b53f5d0c65786b1526df79ff459ac0 SHA256 d4b4f6ce1b140807bf1850df16855a1e5fd0b187b5dd0d93f2932fca81d9af63 +EBUILD grub-1.99.ebuild 7683 RMD160 586653c6286ea53086b11dfe663a5052dd2a78c1 SHA1 77ac581dc7e23d937ff37308faa2d226f8a6fe8c SHA256 022b97492e4b2b1cace0f853e87b8282a2e6cdfe19e0d469836b400c0fd9cea7 +EBUILD grub-9999.ebuild 7683 RMD160 586653c6286ea53086b11dfe663a5052dd2a78c1 SHA1 77ac581dc7e23d937ff37308faa2d226f8a6fe8c SHA256 022b97492e4b2b1cace0f853e87b8282a2e6cdfe19e0d469836b400c0fd9cea7 MISC metadata.xml 264 RMD160 3cb995676f964b9637fbfc0027a81b9409802608 SHA1 c4d35e3a71c545cdf1aae525de803126bf54f596 SHA256 9bd1ce830cf1b821978ab90c81b2e369177a8d7c1bfe2dd2868419872c097f64 diff --git a/sys-boot/grub/grub-1.99.ebuild b/sys-boot/grub/grub-1.99.ebuild index 32ce10f..c229a4c 100644 --- a/sys-boot/grub/grub-1.99.ebuild +++ b/sys-boot/grub/grub-1.99.ebuild @@ -22,7 +22,7 @@ DESCRIPTION="GNU GRUB boot loader" HOMEPAGE="http://www.gnu.org/software/grub/" LICENSE="GPL-3" -SLOT="0" +SLOT="2" [[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~x86 ~mips ~ppc ~ppc64" IUSE="custom-cflags debug device-mapper nls static sdl truetype" @@ -63,13 +63,22 @@ else DEPEND+=" app-arch/xz-utils" fi -export STRIP_MASK="*/grub/*/*.mod" +export STRIP_MASK="*/grub/*/*.{mod,img}a" QA_EXECSTACK=" - sbin/grub-probe - sbin/grub-setup - sbin/grub-mkdevicemap - bin/grub-script-check - bin/grub-fstest + lib64/grub/*/setjmp.mod + lib64/grub/*/kernel.img + sbin/grub2-probe + sbin/grub2-setup + sbin/grub2-mkdevicemap + bin/grub2-script-check + bin/grub2-fstest + bin/grub2-mklayout + bin/grub2-menulst2cfg + bin/grub2-mkrelpath + bin/grub2-mkpasswd-pbkdf2 + bin/grub2-mkfont + bin/grub2-editenv + bin/grub2-mkimage " grub_run_phase() { @@ -90,6 +99,27 @@ grub_run_phase() { popd > /dev/null || die } +grub_rename_files() { + # specifies if we do sed work too + local deep=$1 + [[ ${deep} == deep ]] && shift || deep="" + local path=$@ + + [[ -z ${path} ]] && die "${FUNCNAME}: Path is undefined" + + pushd "${path}" > /dev/null + for i in grub*; do + echo ">>> Slotting \"${path}/${i}\" to \"${path}/${i/grub/grub2}\"" + if [[ -n $deep ]]; then + sed -i \ + -e 's:\([[:space:]]\+\)grub-:\1grub2-:g' \ + ${i} || die + fi + mv ${i} ${i/grub/grub2} || die + done + popd > /dev/null +} + grub_src_configure() { local platform=$1 local target @@ -189,6 +219,22 @@ src_install() { grub_run_phase ${FUNCNAME} ${i} done + # Slot all binaries/info/man to state grub2-* instead of grub-*. + # Can this be done better? + grub_rename_files "${ED}"/sbin/ + grub_rename_files "${ED}"/bin/ + grub_rename_files deep "${ED}"/usr/share/info/ + grub_rename_files deep "${ED}"/usr/share/man/man1/ + grub_rename_files deep "${ED}"/usr/share/man/man8/ + # Rename direct binaries calls in the bash scripts provided by grub + dosym /lib64/grub/grub-mkconfig_lib /lib64/grub/grub2-mkconfig_lib + sed -i \ + -e 's:echo grub-:echo grub2-:' \ + "${ED}"/{sbin,bin,lib64/grub}/* + sed -i \ + -e 's:grub-:grub2-:' + "${ED}"/etc/grub.d/* + # can't be in docs array as we use defualt_src_install in different builddir dodoc AUTHORS ChangeLog NEWS README THANKS TODO insinto /etc/default @@ -214,9 +260,9 @@ setup_boot_dir() { # 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: grub-menulst2cfg '${dir}/menu.lst' '${dir}/grub.cfg'" - grub-menulst2cfg "${dir}/menu.lst" "${dir}/grub.cfg" || \ - ewarn "Running grub-menulst2cfg failed!" + einfo "Running: grub2-menulst2cfg '${dir}/menu.lst' '${dir}/grub.cfg'" + grub2-menulst2cfg "${dir}/menu.lst" "${dir}/grub.cfg" || \ + ewarn "Running grub2-menulst2cfg failed!" einfo "Even if we just created configuration for your grub-2 using old" einfo "grub-1 configuration file you should migrate to use new style" @@ -225,15 +271,15 @@ setup_boot_dir() { else # we need to refresh the grub.cfg everytime just to play it safe - einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'" - grub-mkconfig -o "${dir}/grub.cfg" || \ - ewarn "Running grub-mkconfig failed! Check your configuration files!" + einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'" + grub2-mkconfig -o "${dir}/grub.cfg" || \ + ewarn "Running grub2-mkconfig failed! Check your configuration files!" fi - elog "Remember to run \"grub-mkconfig -o '${dir}/grub.cfg'\" every time" + elog "Remember to run \"grub2-mkconfig -o '${dir}/grub.cfg'\" every time" elog "you update the configuration files!" - elog "Remember to run grub-install to install your grub every time" + elog "Remember to run grub2-install to install your grub every time" elog "you update this package!" } diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild index 32ce10f..c229a4c 100644 --- a/sys-boot/grub/grub-9999.ebuild +++ b/sys-boot/grub/grub-9999.ebuild @@ -22,7 +22,7 @@ DESCRIPTION="GNU GRUB boot loader" HOMEPAGE="http://www.gnu.org/software/grub/" LICENSE="GPL-3" -SLOT="0" +SLOT="2" [[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~x86 ~mips ~ppc ~ppc64" IUSE="custom-cflags debug device-mapper nls static sdl truetype" @@ -63,13 +63,22 @@ else DEPEND+=" app-arch/xz-utils" fi -export STRIP_MASK="*/grub/*/*.mod" +export STRIP_MASK="*/grub/*/*.{mod,img}a" QA_EXECSTACK=" - sbin/grub-probe - sbin/grub-setup - sbin/grub-mkdevicemap - bin/grub-script-check - bin/grub-fstest + lib64/grub/*/setjmp.mod + lib64/grub/*/kernel.img + sbin/grub2-probe + sbin/grub2-setup + sbin/grub2-mkdevicemap + bin/grub2-script-check + bin/grub2-fstest + bin/grub2-mklayout + bin/grub2-menulst2cfg + bin/grub2-mkrelpath + bin/grub2-mkpasswd-pbkdf2 + bin/grub2-mkfont + bin/grub2-editenv + bin/grub2-mkimage " grub_run_phase() { @@ -90,6 +99,27 @@ grub_run_phase() { popd > /dev/null || die } +grub_rename_files() { + # specifies if we do sed work too + local deep=$1 + [[ ${deep} == deep ]] && shift || deep="" + local path=$@ + + [[ -z ${path} ]] && die "${FUNCNAME}: Path is undefined" + + pushd "${path}" > /dev/null + for i in grub*; do + echo ">>> Slotting \"${path}/${i}\" to \"${path}/${i/grub/grub2}\"" + if [[ -n $deep ]]; then + sed -i \ + -e 's:\([[:space:]]\+\)grub-:\1grub2-:g' \ + ${i} || die + fi + mv ${i} ${i/grub/grub2} || die + done + popd > /dev/null +} + grub_src_configure() { local platform=$1 local target @@ -189,6 +219,22 @@ src_install() { grub_run_phase ${FUNCNAME} ${i} done + # Slot all binaries/info/man to state grub2-* instead of grub-*. + # Can this be done better? + grub_rename_files "${ED}"/sbin/ + grub_rename_files "${ED}"/bin/ + grub_rename_files deep "${ED}"/usr/share/info/ + grub_rename_files deep "${ED}"/usr/share/man/man1/ + grub_rename_files deep "${ED}"/usr/share/man/man8/ + # Rename direct binaries calls in the bash scripts provided by grub + dosym /lib64/grub/grub-mkconfig_lib /lib64/grub/grub2-mkconfig_lib + sed -i \ + -e 's:echo grub-:echo grub2-:' \ + "${ED}"/{sbin,bin,lib64/grub}/* + sed -i \ + -e 's:grub-:grub2-:' + "${ED}"/etc/grub.d/* + # can't be in docs array as we use defualt_src_install in different builddir dodoc AUTHORS ChangeLog NEWS README THANKS TODO insinto /etc/default @@ -214,9 +260,9 @@ setup_boot_dir() { # 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: grub-menulst2cfg '${dir}/menu.lst' '${dir}/grub.cfg'" - grub-menulst2cfg "${dir}/menu.lst" "${dir}/grub.cfg" || \ - ewarn "Running grub-menulst2cfg failed!" + einfo "Running: grub2-menulst2cfg '${dir}/menu.lst' '${dir}/grub.cfg'" + grub2-menulst2cfg "${dir}/menu.lst" "${dir}/grub.cfg" || \ + ewarn "Running grub2-menulst2cfg failed!" einfo "Even if we just created configuration for your grub-2 using old" einfo "grub-1 configuration file you should migrate to use new style" @@ -225,15 +271,15 @@ setup_boot_dir() { else # we need to refresh the grub.cfg everytime just to play it safe - einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'" - grub-mkconfig -o "${dir}/grub.cfg" || \ - ewarn "Running grub-mkconfig failed! Check your configuration files!" + einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'" + grub2-mkconfig -o "${dir}/grub.cfg" || \ + ewarn "Running grub2-mkconfig failed! Check your configuration files!" fi - elog "Remember to run \"grub-mkconfig -o '${dir}/grub.cfg'\" every time" + elog "Remember to run \"grub2-mkconfig -o '${dir}/grub.cfg'\" every time" elog "you update the configuration files!" - elog "Remember to run grub-install to install your grub every time" + elog "Remember to run grub2-install to install your grub every time" elog "you update this package!" } |