Bug 1302024 - netbsd ELF image doesn't get boot command line
netbsd ELF image doesn't get boot command line
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grub (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: David Kaspar [Dee'Kej]
Release Test Team
Depends On:
Blocks: 1356056
  Show dependency treegraph
Reported: 2016-01-26 09:32 EST by Karel Volný
Modified: 2016-10-13 08:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Release Note
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-10-13 08:48:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Karel Volný 2016-01-26 09:32:51 EST
Description of problem:
Trying to use memtest on a machine that I have no physical access to, but which is connected to conserver, I fail to get any output over the serial line.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. enable serial support - I've added this to the specfile:

sed -i -e 's/#define SERIAL_CONSOLE_DEFAULT 0/#define SERIAL_CONSOLE_DEFAULT 1/' config.h
sed -i -e 's/#define SERIAL_BAUD_RATE 9600/#define SERIAL_BAUD_RATE 115200/' config.h

2. rpmbuild -ba memtest86+.spec
3. rpm -i memtest86+-5.01-1.el6.x86_64.rpm
4. memtest-setup
5. edit /boot/grub/grub.conf, add console=[your parameters] on memtest line
6. reboot to memtest

Actual results:
no memtest output on the client connected to conserver

Expected results:
normal memtest screen on the client

Additional info:
Comment 3 Jaroslav Škarvada 2016-01-26 09:45:40 EST
Nobody requested this feature, so I didn't spend time on it, but it should work even without re-compilation. IIRC it uses BIOS calls so it's abilities are quite limited, e.g. it only supports ttyS0 and ttyS1 and supported speeds may be also limited. I will check.
Comment 6 Jaroslav Škarvada 2016-01-26 11:22:49 EST
It works for me in VirtualBox if recompiled memtest with serial port enabled (used default 9k6, this is safe for most BIOSes), but it doesn't work with the command line, I will check why. Maybe it is not compatible with the way how grub legacy hands over the command line, or maybe it has never worked (this wouldn't surprised me :) I will look on it.
Comment 7 Karel Volný 2016-01-26 13:33:52 EST
(In reply to Jaroslav Škarvada from comment #6)
> or maybe it has never worked
> (this wouldn't surprised me :)

well, googling for help, I have found that at least Ubuntu used to have two boot options for memtest in grub, one with serial support and without, so I'd hope that someone was using that - i.e. that it worked ...
Comment 9 Karel Volný 2016-01-27 09:12:13 EST
cool, trying on Fedora, I'm not even able to recompile memtest ...

the last error message is:

lib.o: In function `check_input':
lib.c(.text+0x17be): undefined reference to `reboot'
Comment 12 Jaroslav Škarvada 2016-01-28 10:00:29 EST
I traced it down and the command line is not handed by bootloader. This observation matches with the grub documentation [1]:

"For now, however, GRUB doesn't allow you to pass kernel parameters"

To be honest I don't know whether it is possible with ELF at all (e.g. by using different bootloader). But grub RFE could be filled.

We cannot switch from ELF to binary image:
- due to backward compatibility in RHEL.
- loading of memtest86+ binary image is unreliable

We cannot enable serial console by default due to slow down of the test.

The only way how to get serial console working now is recompilation of memtest86+.

[1] https://www.gnu.org/software/grub/manual/legacy/grub.html#NetBSD
Comment 13 Jaroslav Škarvada 2016-01-29 05:45:32 EST
It's unfixable at the moment in memtest86+. It would require changing from ELF boot image to e.g. binary image and rewriting the code / adding workarounds to work correctly when booted from the grub. It's something we shouldn't do during distribution life-time.

Reassigning to grub for further investigation if it is possible to add command line support to netbsd ELF booting.
Comment 14 Jaroslav Škarvada 2016-01-29 05:52:43 EST
1) set command line in grub
2) boot ELF netbsd image (with 'kernel --type=netbsd')

Actual result:
Command line is not handed to boot image

Expected result:
Command line handed to boot image

Additional info:
I am not sure whether it is possible. Reassigning to grub for further investigation, because in the doc [1], there is written:

"For now, however, GRUB doesn't allow you to pass kernel parameters"

which implies to me that there should be a way how to do it.

[1] https://www.gnu.org/software/grub/manual/legacy/grub.html#NetBSD
Comment 19 David Kaspar [Dee'Kej] 2016-10-13 08:48:12 EDT

I'm sorry, but this classifies as RFE, and since we are in the phase 2 of RHEL6 lifecycle, no RFEs are allowed by default.

In case you need this functionality, you could try using grub2 instead.

Best regards,


Note You need to log in before you can comment on or make changes to this bug.