Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 216307 - sys-boot/grub-0.97-r5 passes junk at the end of boot options
Summary: sys-boot/grub-0.97-r5 passes junk at the end of boot options
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 216364 216507 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-05 10:42 UTC by Philipp
Modified: 2008-06-20 01:46 UTC (History)
16 users (show)

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


Attachments
Grub configuration file (grub.conf,174 bytes, application/octet-stream)
2008-04-06 10:15 UTC, Hans Nieser
Details
550_all_grub-0.97-long-commandline.patch (550_all_grub-0.97-long-commandline.patch,1.80 KB, patch)
2008-04-06 11:45 UTC, Alon Bar-Lev (RETIRED)
Details | Diff
550_all_grub-0.97-long-commandline.patch.diff (550_all_grub-0.97-long-commandline.patch.diff,471 bytes, patch)
2008-04-06 11:45 UTC, Alon Bar-Lev (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp 2008-04-05 10:42:59 UTC
I recently upgraded my notebook to grub-0.97-r5 and saw the message appearing at the end of the ebuild to upgrade my grub stages as well. So I did in the grub shell and on the next boot, the kernel complained about not finding my root device "hda3\n". The \n in there caught my attention and I looked at my home computer to see what is different there because I upgraded my grub stages on it as well.

The difference was obvious: The root= option isn't the last one on my home computer so the kernel didn't complain about not finding the root partition. To fix the issue on my notebook I simply appended another option after the root= option.

Reproducible: Always

Steps to Reproduce:
1. install sys-boot/grub-0.97-r5
2. update the grub stages using the grub shell
3. have root= as your last boot option
4. reboot

Actual Results:  
The kernel doesn't boot.

Expected Results:  
The kernel should boot.

There are some things I don't know:
1) Maybe earlier grub versions are affected too, I just tested with 0.97-r5.
2) Maybe this is a kernel bug. I tested with gentoo-sources-2.6.24-r3 and -r4.
Comment 1 Hans Nieser 2008-04-05 11:15:17 UTC
I am having a similar problem, except I don't see a newline, but just some garbled text (I do have a newline in my menu.lst though). After upgrading to grub-0.97-r5 from 0.97-r4, and rewriting the MBR, this is what I get when Linux starts:

...
Starting balanced_irq
Using IPI Shortcut mode
<3 garbled characters> or unknown-block(0,0)<22 garbled characters>
Please append a correct "root=" boot option; here are the available partitions:
0300    4194302 hda driver: ide-cdrom
0340    4194302 hdb driver: ide-cdrom
0800  195359927 sda driver: sd
  0801   41945683 sda1
  0802          1 sda2
  0803   95739367 sda3
  0805      40131 sda5
  0806     506016 sda6
  0807   30909028 sda7
0810  312571224 sdb driver: sd
  0811  312568641 sdb1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) 

The garbled text is always the same (I just don't know how to reproduce all those funky characters).

I'm also running gentoo-sources-2.6.22-r4 so this is not kernel-specific it seems. Downgrading to grub-0.97-r4 (and again rewriting MBR) makes my system boot again.

Also, pressing 'e' in the GRUB menu to edit the kernel line and then booting has the same problem, so the problem does not seem to be merely reading the menu.lst file, but rather maybe passing the args to the kernel (maybe not null-terminated? just guessing here).
Comment 2 John Youells 2008-04-05 13:00:32 UTC
I had the same problem with grub-0.97-r5 and 2.6.23-gentoo-r6.
Going back to grub-0.97-r4 stops the kernel panic.

Comment 3 Philipp 2008-04-05 18:17:55 UTC
So it is junk appended at the end. I didn't know since it just looked like a newline in my case.
Comment 4 Wilbur Pan 2008-04-05 18:47:09 UTC
I had the same issue as Hans (#2).  Reverting to grub-0.97-r4 fixed the issue.
Comment 5 Ryan Tandy 2008-04-05 20:41:06 UTC
Confirmed; reinstalling the MBR with grub didn't seem to help, either.
Comment 6 kouyu 2008-04-05 21:07:36 UTC
I have the same problem too.
$ dmesg | head
Command line: root=/dev/sda8 video=uvesafb:1024x768-32,mtrr:3,ywrap
acpi_sleep=s3_bios softlevel=ethwirelessonly??K?1???q??H?S?d???

The last option is softlevel=ethwirelessonly, but you can see there are junk
after that option.

btw: I found Bug 216364 is same with this.
Comment 7 Hans Nieser 2008-04-06 08:02:32 UTC
I've narrowed this down to a patch that was added to to -r5 to allow long kernel commandlines (see #183443). Not applying this patch makes it all work again. I'll leave a comment there pointing to this bug.
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-06 08:29:37 UTC
I will check this out.
Can you please attach the grub.conf entry which causes the issues?
Comment 9 Hans Nieser 2008-04-06 10:15:38 UTC
Created attachment 148825 [details]
Grub configuration file

This is the grub.conf that I currently use that exhibits the problem (I've selected the binary content-type to make sure nothing gets mangled just in case my grub.conf is actually malformed or something)
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-06 11:45:02 UTC
Created attachment 148837 [details, diff]
550_all_grub-0.97-long-commandline.patch

Oh!
So short... :)

I believe I found the problem, updated patch.
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-06 11:45:36 UTC
Created attachment 148840 [details, diff]
550_all_grub-0.97-long-commandline.patch.diff

Incremental diff.
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-06 11:48:00 UTC
*** Bug 216364 has been marked as a duplicate of this bug. ***
Comment 13 Jon Portnoy 2008-04-06 15:46:52 UTC
Ran into this one also
Comment 14 Daniel Drake (RETIRED) gentoo-dev 2008-04-06 16:44:36 UTC
*** Bug 216507 has been marked as a duplicate of this bug. ***
Comment 15 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-06 19:00:04 UTC
robbat2: Do you want me to bump grub with updated patch?
Comment 16 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-04-06 19:22:33 UTC
alonbl: it will be there, i'm just working on another grub bug to release at the same time.
Comment 17 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-04-07 17:31:46 UTC
alonbl et al: I just updated the patchset in -r5 for now to contain this fix, there will be a revbump when I solve bug 215799.
Comment 18 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-05-02 19:54:57 UTC
This is in the newer -r5.
PATCHVER="1.7"
Comment 19 Tobias Klausmann gentoo-dev 2008-06-04 18:12:06 UTC
I still get this even with -r5 (yes, I reinstalled using the grubshell+root()+setup()). I've also tried adding a space at the end of my kernel options, which adds a space before the garbage, si ti looks like this:

$ dmesg |head
Linux version 2.6.24 (klausman@deckard) (gcc version 4.2.4 (Gentoo 4.2.4 p1.0)) #11 SMP Wed Jun 4 19:42:48 CEST 2008
Command line: root=/dev/sda1 video=vesafb:mtrr:3 vga=795 é{þÿÿLd$H¾T
BIOS-provided physical RAM map:
...

Relevant menu.lst entry:
title Linux (2.6.24)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24 root=/dev/sda1 video=vesafb:mtrr:3 vga=795


emerge --info:
Portage 2.1.5.3 (default-linux/amd64/2007.0, gcc-4.2.4, glibc-2.7-r2, 2.6.24 x86_64)
=================================================================
System uname: 2.6.24 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
Timestamp of tree: Sun, 01 Jun 2008 16:45:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon64 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildsyspkg distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gentoo.tiscali.nl/"
INSTALL_MASK="/etc/udev/rules.d/75-persistent-net-generator.rules"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude lost+found"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/java-overlay"
SYNC="rsync://rsync5.de.gentoo.org/gentoo-portage"
USE="07/Feb/2008 19:48 3dnow 3dnowext UTC X a52 acl alsa amd64 apache2 audacious audiofile bash-completion berkdb bzip2 calendar cdparanoia cdr cli cracklib crypt cups dio dri dvd dvdr dvdread encode ethereal exif ffmpeg fftw firefox fortran ftp gdbm glitz gpm gtk iconv imlib2 isdnlog jpeg kdeenablefinal ladcca lame lcms lua mad matroska midi mmap mmx mng moznocompose moznoirc moznomail mozsvg mp3 mpeg mplayer mudflap mysqli ncurses nls nptl nptlonly offensive ogg opengl openmp pam pcre pdflib perl png ppds pppd python qt4 readline recode reflection session sharedmem sockets sox spl sse sse2 ssl svg szip tcpd tetex theora unicode usb v4l v4l2 vcd vim vim-pager vlm vorbis wmf xcb xcomposite xorg xosd xpm xscreensaver xvid zlib" ALSA_CARDS="emu10k1 ice1724" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="vesa nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

Comment 20 Alon Bar-Lev 2008-06-05 13:33:53 UTC
klausman: Please re-emerge the package, as per comment#18, there was a fix without revbump.
Comment 21 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-06-05 17:43:01 UTC
alon.barlev: I had him re-open it because he reported to me in #-dev first, that doing the re-merge as well as the update didn't seem to fix it at all for him.
Comment 22 Tobias Klausmann gentoo-dev 2008-06-07 13:08:44 UTC
I merged -r6 today and the problem went away. As such I probably had a sync fail and got the old -r5. Apologies for wasting your time (and hooray for revbumps :)).
Comment 23 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-06-20 01:46:08 UTC
*** Bug 222091 has been marked as a duplicate of this bug. ***