Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366077 - Version bump to grub-1.99 and various ebuild improvements
Summary: Version bump to grub-1.99 and various ebuild improvements
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 369439 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-05 12:10 UTC by Tomáš Chvátal (RETIRED)
Modified: 2011-08-28 20:20 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patchfile for live grub (grub-9999.patch,5.28 KB, patch)
2011-05-05 12:10 UTC, Tomáš Chvátal (RETIRED)
Details | Diff
patch from grub-1.99_rc1 to grub-1.99 (grub-1.99.patch,1.84 KB, patch)
2011-05-31 10:07 UTC, Dmitry S. Kulyabov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Chvátal (RETIRED) gentoo-dev 2011-05-05 12:10:01 UTC
Created attachment 272179 [details, diff]
Patchfile for live grub

Hi,
I migrated my computers to use grub2 so i updated the ebuild a bit to be technically correct and do what it is supposed to do.

0) migrate to EAPI=4
1) use only one line inherit
2) wrap all lines to be 80 chars or less
3) pass paralel make with -j30
4) fix installation of default settings to proper place
5) in postinst phase update grub.cfg from menu.lst if found otherwise just update from the grub.d folder.
6) display elog information pointing to guide (for now archlinux as we dont have any)


And I would be interested in your opinions about those FIXME and NOTE I wrote in there.
Comment 1 Leho Kraav (:macmaN @lkraav) 2011-05-21 15:32:52 UTC
1.99-rc2 has been released a month ago, how come rc1 ebuild hasn't been bumped? ran into needing this for btrfs /boot.
Comment 2 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-05-31 10:02:10 UTC
*** Bug 369439 has been marked as a duplicate of this bug. ***
Comment 3 Dmitry S. Kulyabov 2011-05-31 10:07:29 UTC
Created attachment 275285 [details, diff]
patch from grub-1.99_rc1 to grub-1.99
Comment 4 Piotrek Juzwiak 2011-07-22 22:27:50 UTC
It would be very desired to have grub bumped to 1.99, i was unable to boot from a btrfs root partition (no separate /boot) and apparently grub2 gained that "ability" just from version 1.99_rc2 and the latest (except 9999) is rc1 so i was left cold unable to boot.
Comment 5 Tomáš Chvátal (RETIRED) gentoo-dev 2011-07-23 00:04:19 UTC
So test the grub from my dev overlay and report if it works or not.

I just tested it on my machines and it is in sabayon package. So if people confirm it works maybe base system will get me allowance to commit it.
Comment 6 Leho Kraav (:macmaN @lkraav) 2011-07-23 09:36:40 UTC
i've been doing stuff with 1.99_rc1 and 1.99_rc2 for a while on x86, with no apparent issues. including the btrfs /boot thing.
Comment 7 kahrl 2011-08-02 06:36:11 UTC
I think there should be a build dependency on bison, as it is not guaranteed to be installed (it's not part of the system set anymore, on my system at least). Bug 377371 is related.
Comment 8 safety0ff.bugz 2011-08-07 12:49:21 UTC
Seems to have worked but the there were warnings about prestripped files and unrecognized ./configure options.

1.99 rc1 and rc2 have a bug which breaks booting memtest for me(refs: Ubuntu bug #683904, Arch linux bug #22993).
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2011-08-07 22:11:25 UTC
Tomáš why do you need subshell here:
+	if ( use extras )

mkdir -p ${S}/grub-extras/${i}
cd ${S}/grub-extras/${i}
this should be quoted. 

./autogen.sh

why autotools eclass fails here?
Comment 10 Tomáš Chvátal (RETIRED) gentoo-dev 2011-08-08 07:09:51 UTC
(In reply to comment #9)
> Tomáš why do you need subshell here:
> +    if ( use extras )
> 
> mkdir -p ${S}/grub-extras/${i}
> cd ${S}/grub-extras/${i}
> this should be quoted. 
> 
> ./autogen.sh
> 
> why autotools eclass fails here?

Bad idea to review the attachment as way more work was really done in the overlay :)
Also the extras code is done by Dmitry not by me :P

The ebuild by me is this: http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=blob;f=sys-boot/grub/grub-9999.ebuild

Anyway the autogen.sh is required because it is doing more stuff than just eautoreconf, and if you notice src_prepare phase it sed the autoreconf in there and runs eautoreconf afterwards so it gets executed properly.
Comment 11 Peter Volkov (RETIRED) gentoo-dev 2011-08-08 11:49:31 UTC
(In reply to comment #10)
> (In reply to comment #9)
> Bad idea to review the attachment as way more work was really done in the
> overlay :)

It's good idea roll it forward (at least mark attachment as old) to make bug more useful. It's your bug, not mine ;)

   7 if [[ ${PV} == "9999" ]] ; then
   8         EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
   9         LIVE_ECLASS="autotools bzr"

  18 inherit mount-boot eutils flag-o-matic toolchain-funcs ${LIVE_ECLASS}
  19 unset LIVE_ECLASS
 
Why don't inherit inside if block and drop this unset?

  40 for i in ${GRUB_PLATFORMS}; do
  41         IUSE+=" grub_platforms_${i}"
  42 done
  43 unset i

With printf "grub_platforms_%s " $GRUB_PLATFORMS you'll get the same without cycle and unset.

  84 grub_run_phase() {
  85         local phase=$1
  86         local platform=$2
  87         [[ -z ${phase} ]] && die "${FUNCNAME}: Phase is undefined"
  88         [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined"
  
It's better to do one check on the number of parameters passed to function.

  90         [[ -d "${WORKDIR}/build-${platform}" ]] || \
  91                 { mkdir "${WORKDIR}/build-${platform}" || die ; }

Probably it's good idea to drop check for directory existence and just
 mkdir -p "${WORKDIR}/build-${platform}"

  94         echo ">>> Running ${phase} for platform \"${platform}\""
  95         echo ">>> Working in: \"${WORKDIR}/build-${platform}\""

Here and below, einfo ? 

  97         grub_${phase} ${platform}

|| die

 167 grub_src_compile() {
 168         default_src_compile
 169 }

What is this? I guess this should be dropped.

 242         cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
 243         GRUB_DISTRIBUTOR="Gentoo"
 244 EOF

EOF should be with the same indentation as cat. Any way for one line it's better to use echo.

I'm sure there are more things but I have to run :)
Comment 12 Tomáš Chvátal (RETIRED) gentoo-dev 2011-08-08 20:03:15 UTC
(In reply to comment #11)
> 
>    7 if [[ ${PV} == "9999" ]] ; then
>    8         EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
>    9         LIVE_ECLASS="autotools bzr"
> 
>   18 inherit mount-boot eutils flag-o-matic toolchain-funcs ${LIVE_ECLASS}
>   19 unset LIVE_ECLASS
> 
> Why don't inherit inside if block and drop this unset?
Multiple inherit lines are considered ugly. So I actually rather use this approach.
> 
>   40 for i in ${GRUB_PLATFORMS}; do
>   41         IUSE+=" grub_platforms_${i}"
>   42 done
>   43 unset i
> 
> With printf "grub_platforms_%s " $GRUB_PLATFORMS you'll get the same without
> cycle and unset.
> 
>   84 grub_run_phase() {
>   85         local phase=$1
>   86         local platform=$2
>   87         [[ -z ${phase} ]] && die "${FUNCNAME}: Phase is undefined"
>   88         [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined"
> 
> It's better to do one check on the number of parameters passed to function.
Yep sounds sane, will do :)
> 
>   90         [[ -d "${WORKDIR}/build-${platform}" ]] || \
>   91                 { mkdir "${WORKDIR}/build-${platform}" || die ; }
> 
> Probably it's good idea to drop check for directory existence and just
>  mkdir -p "${WORKDIR}/build-${platform}"
Ack
> 
>   94         echo ">>> Running ${phase} for platform \"${platform}\""
>   95         echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
> 
> Here and below, einfo ? 
I tried not to polute the build and rather use the output like ">>> Unpacked to..." as it does not look so disruptive in the log yet it is simple to find.
> 
>   97         grub_${phase} ${platform}
> 
> || die
The phases die themselves so no need for die.
> 
>  167 grub_src_compile() {
>  168         default_src_compile
>  169 }
> 
> What is this? I guess this should be dropped.
It is required as you don't want the default phase to be overriden, alternative
would be to write there emake || die.
> 
>  242         cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
>  243         GRUB_DISTRIBUTOR="Gentoo"
>  244 EOF
> 
> EOF should be with the same indentation as cat. Any way for one line it's
> better to use echo.
Good spot :)
> 
> I'm sure there are more things but I have to run :)

Thanks a lot, if you will be bored again, feel free to review it again :)
Comment 13 Peter Asplund 2011-08-11 23:57:28 UTC
Hi! I added your overlay and tried the ebuild, but it got stuck in "error no such disk" and reverted to
grub rescue >

I reverted the install and went back to grub-1.99_rc1 and thankfully it worked =)
Or actually I haven't tried yet, I'm just testing it through qemu, but I'll try it now!
Comment 14 Robert Förster 2011-08-12 00:26:38 UTC
did you use the 9999 ebuild? if so, disable the nls useflag (for 9999 --disable-nls should be hardcoded, really (unless someone desperately wants to implement the locale mess as specified in the README in the po directory.))
if not, check if the locale directory in /boot/grub is populated, or just kill the whole locale stuff in the grub.cfg

that made the "no such disk" error go away for me.
Comment 15 Tomáš Chvátal (RETIRED) gentoo-dev 2011-08-12 07:26:25 UTC
(In reply to comment #14)
> did you use the 9999 ebuild? if so, disable the nls useflag (for 9999
> --disable-nls should be hardcoded, really (unless someone desperately wants to
> implement the locale mess as specified in the README in the po directory.))
> if not, check if the locale directory in /boot/grub is populated, or just kill
> the whole locale stuff in the grub.cfg
> 
> that made the "no such disk" error go away for me.

That is a good question, cause i rather disable the nls on my machine.
So maybe the nls useflag should actually disappear and we should make sure that it is always in english.
Comment 16 Peter Asplund 2011-08-12 09:53:58 UTC
No, I was using the 1.99 ebuild, I figured it was a bit more safe to use a released and stable version. Perhaps not ;)

Regarding locales, me being Swedish I of course think that it's good to be able to change to different languages, but I think getting grub 2 up'n'running on Gentoo in a stable fashion is way more important. Baby steps, right?

As long as it's UTF-8 (or other Unicode), I'm happy! I'm a dvorak user, so the ability to change key-mappings is also very welcome.
Comment 17 Tomáš Chvátal (RETIRED) gentoo-dev 2011-08-27 13:41:15 UTC
In main tree.
Comment 18 Tomáš Chvátal (RETIRED) gentoo-dev 2011-08-27 13:42:00 UTC
Also i figured out what caused the no-such-disk and fixed it so the version in main tree should not suffer with it anymore.
Comment 19 Peter Asplund 2011-08-28 20:20:44 UTC
Awesome work! Saw your new changes in the Grub2 changelog (had to check it out since some versions were missing, etc), great that you've accepted maintenance responsibility for grub2!