Bug 1302024

Summary: netbsd ELF image doesn't get boot command line
Product: Red Hat Enterprise Linux 6 Reporter: Karel Volný <kvolny>
Component: grubAssignee: David Kaspar // Dee'Kej <deekej>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.7CC: pholica
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
TBD
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-13 12:48:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1356056    

Description Karel Volný 2016-01-26 14:32:51 UTC
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):
memtest86+-5.01-1.el6.x86_64

How reproducible:
always

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 14:45:40 UTC
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 16:22:49 UTC
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 18:33:52 UTC
(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 14:12:13 UTC
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 15:00:29 UTC
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 10:45:32 UTC
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 10:52:43 UTC
Reproducer:
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 12:48:12 UTC
Hello,

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,

David