Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#18715 - [grub2] issues
Attached to Project:
Arch Linux
Opened by Mario Vazquez (darkcoder) - Tuesday, 16 March 2010, 21:03 GMT
Last edited by Ronald van Haren (pressh) - Monday, 22 March 2010, 08:35 GMT
Opened by Mario Vazquez (darkcoder) - Tuesday, 16 March 2010, 21:03 GMT
Last edited by Ronald van Haren (pressh) - Monday, 22 March 2010, 08:35 GMT
|
DetailsDescription:
Arch grub2 packages dating back to 1.97 have some issues with Arch. I will explain it briefly. grub2 relies on a new script system to create configurations. The main script is grub-mkconfig in /usr/bin, which do all the glue. There are some scripts in /etc/grub.d/ that are executed by grub-mkconfig in order to detect your current and other systems installed. And all scripts get the default settings from /etc/default/grub. The problem with Arch is that those files as they come from upstream, do not work as expected here. Some changes where done to the new 1.98 grub2 packages, but there are some issues still to be resolved. I had a package for a couple of days in AUR that fixed many of those issues, but found that today someone removed the package without asking me, or checking the differences with the new (and buggier) Arch implementation in extra. My forum link is http://bbs.archlinux.org/viewtopic.php?pid=725676 My package link in AUR used to be http://bbs.archlinux.org/viewtopic.php?pid=725676 until some funny administrator or maintainer decides that is wasn't needed by very likely name only, and not by PKGBUILD/patches content. Some of the issues in Arch 1.98-(1-3) packages include: * No kernel entry using kernel26-fallback.img is created. * The CLASS variable, unlike the GRUB_DISTRIBUTOR cannot have spaces. Instead of defining it as: CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' ) ${CLASS}" it must be defined as: CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | tr -d ' ') ${CLASS}" While this do not affect the menu functionality, you will not be able to see an Arch icon on gfxmode. * He copied the 05_theme script entry as used by Debian, but that has his problems as I reported like a month ago or more in Debian http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564180 * Due to the way grub2 works, it needs to load modules before doing an action. So without some of the patches I had, some features will not work at all. Example: themes will fail to load since fonts and pictures will not be loaded prior to their use. * And the expanded /etc/default/grub with all the pre-defined defaults that will work in normal occasions. * Detection of things like LVM and encrypted partitions which I was working until now with the community. * Detection of other operating systems due to an application not available either in Arch repos or in AUR. Which BTW I will have it working by tonight or tomorrow. this one affects http://bugs.archlinux.org/task/18713 Additional info: * any grub2 package in Arch extra upto 1.98-3 Steps to reproduce: |
This task depends upon
Closed by Ronald van Haren (pressh)
Monday, 22 March 2010, 08:35 GMT
Reason for closing: Implemented
Additional comments about closing: patches are in grub2 now
Monday, 22 March 2010, 08:35 GMT
Reason for closing: Implemented
Additional comments about closing: patches are in grub2 now
here is the content of your build.
1. It fails to recognize the kernel26-fallback.img, which means that no entry for
that image is not created. The area of my patch that handles that is as follows
@@ -109,13 +109,12 @@
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
- alt_version=`echo $version | sed -e "s,\.old$,,g"`
+ base_init=`echo $basename | sed -e "s,vmlinuz,kernel,g"`
+ alt_version="${base_init}-fallback"
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
initrd=
- for i in "initrd.img-${version}" "initrd-${version}.img" \
- "initrd-${version}" "initrd.img-${alt_version}" \
- "initrd-${alt_version}.img" "initrd-${alt_version}"; do
+ for i in "${base_init}.img"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
@@ -130,6 +129,9 @@
linux_entry "${OS}" "${version}" false \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ initrd="${alt_version}.img"
+ linux_entry "${OS}" "${version} Fallback" false \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}" "${version}" true \
"single ${GRUB_CMDLINE_LINUX}"
What I do is created a new variable to hold the main img name (kernel26), and then using the
alt_version variable unused in Arch to hold the kernel26-fallback name. And later added another
linux entry between the 2 included in the script to include the fallback image. Maybe this approach
is not the best, but it works.
2. grubconfig.archlinux.patch first fix do this
@@ -28,10 +28,10 @@
CLASS="--class gnu-linux --class gnu --class os"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
- OS=GNU/Linux
+ OS="Arch Linux"
else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
+ OS="${GRUB_DISTRIBUTOR} Arch Linux"
+ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' ) ${CLASS}"
fi
First, that if executes the following way. If a GRUB_DISTRIBUTOR entry
is not found in /etc/default/grub, then the first section is executed, otherwise
the else with the OS and CLASS are defined.
What I do in that case was to follow the default of other Linux distros, and
have the GRUB_DISTRIBUTOR variable defined in /etc/default/grub. In that case
the first section (if) don't have to be modified at all since will not be executed.
The else suppresses the GNU/Linux attached to GRUB_DISTRIBUTOR since we are not called
Arch GNU/Linux or Arch Linux GNU/Linux.
@@ -30,8 +30,8 @@
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
+ OS="${GRUB_DISTRIBUTOR}"
+ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | tr -d ' ') ${CLASS}"
fi
by no defining GRUB_DISTRIBUTOR, the CLASS variable will not be defined. Also I change
the CLASS assignment to remove the space between Arch and Linux. Unlike the OS entry,
that one cannot have the space.
And speaking of the CLASS, that variable is used only for GFXMODE (GFX_THEME variable used).
While Arch do not support themes as standard, skipping that fix will prevent users
from seeing icons on Arch entries when enable themes, and is inoffensive in other configurations.
version will most likely will work without problems, the script is executed after the timeout entry
which resides in 00_header. That means that in some configurations the theme will not be
executed until after the timeout is over.
I opened a bug on debian more than a month ago http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564180
describing the problem. While I haven't tested menu color entries only, again if a
user decides to include theme information at that place, it will be in trouble land.
Following the way that upstream wants grub2 to work, is to define the entries in /etc/default/grub
and grub-mkconfig placing them where they should go, before the timeout, like in the GFX_THEME entries
already included in the 00_header.
The patch included, add support of the menu entries in grub-mkconfig, and 00_header.
While grub accepts them, the script don't know about their existence. With those changes,
and the entries defined in the /etc/default/grub, they will be placed before the timeout
entry in /boot/grub/grub.cfg
recognize, or use the entry at all. This patch places that support just over
the GRUB_THEME support in 00_header, and add the entry to grub-mkconfig list of
options. In addition to adding the theme if defined, it searches for the type of
picture module needed by the image. Due to a known issue in grub2, modules
are not autoloaded. You have to load them manually.
Again while Arch do not do theming, skipping this will cause many headaches in the
community when the option fails to work.
that fails to load dependencies, they fail to load. This one adds
code to the GFX_THEME section to search for fonts and images. Detect
the images format, and add the entries just before setting the theme.
Like previous patches, not needed by Arch unbranded style, but will
take a lot of issues out when people start using the feature.
in grub-mkconfig, where it enables the timeout as this:
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=${GRUB_TIMEOUT}
fi
That means exactly what it looks. It will enable a interruptible hidden timeout counter,
and when that counter expires, or is interrupted, it will performed the regular
grub timeout. The fix is to set that set timeout to 0.
This was, also with the 05_theme, part of the issue reported to debian.
Except for the arch-script fixes, all other patches are diffed against a clean grub2-1.98
source. So I will be able to send them upstream to fix the issues mentioned here.
I remade the one from debian a little more simplified and using more up to date
grub script syntax.
The file should be installed as follows:
install -Dm755 ${srcdir}/20_memtest86+ $startdir/pkg/etc/grub.d/20_memtest86+
If the file is not executable, will not be invoked by grub-mkconfig.
even menu color set as default. Resolution as default (640x480), with a commented entry of a
very safe by today's day of 1024x768. Also the GFX_PAYLOAD_KEEP entry is commented.
Since grub handles now more files, the PKGBUILD needs to backup 3 files instead of one.
/boot/grub/grub.cfg -> the lasted active boot configuration
/etc/default/grub -> user configuration used to generate grub.cfg
/etc/grub.d/40_custom -> a file designated by upstream to store custom entries, or
entries not recognized by the other scripts.
backup=('boot/grub/grub.cfg' '/etc/default/grub' '/etc/grub.d/40_custom')
Let me get a package up here in the next few days so you can verify that it indeed does what you intended it to do.
hidden timeout
https://savannah.gnu.org/bugs/?29250
theme deps
https://savannah.gnu.org/bugs/?29251
background image support in scripts
https://savannah.gnu.org/bugs/?29252
menu color entries support in scripts
https://savannah.gnu.org/bugs/?29258
Also I had 2 issues in my forum thread to be resolved. And saw that someone opened a ticket about LVM. Debian package has a fix for that. I'm gonna release a new package in AUR (with another name btw) to test with the community 2 issues, then I'm gonna open tickets with patches as soon I confirmed they work.
Bison does not have to be in makedepends, it is in base-devel, you are supposed to have that whole group installed when building packages.