Bug 2426 - live image installer does not preserve BSP specified console= kernel parameter
Summary: live image installer does not preserve BSP specified console= kernel parameter
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M3
Assignee: Radu Moisan
QA Contact:
URL:
Whiteboard: (P1)(scheduled)
Depends on:
Blocks:
 
Reported: 2012-05-04 19:47 UTC by Darren Hart
Modified: 2012-09-26 21:52 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hart 2012-05-04 19:47:24 UTC
When installing the sato image on the FRI2, the "console=ttyPCH1,115200 console=tty0" options were not preserved, resulting in no serial output during boot after install.
Comment 1 Saul Wold 2012-05-08 20:17:45 UTC
This is an issue in grub
Comment 2 Dexuan Cui 2012-06-04 05:46:07 UTC
(In reply to comment #1)
> This is an issue in grub

We need to pass the value of APPEND (we may need to extract all the console= options) into the grub config file properly, i.e., we need to change the 2 below files.

meta/recipes-bsp/grub/grub-1.99/40_custom
  6 menuentry "Linux" {
  7     set root=(hd0,1)
  8     linux /boot/vmlinuz root=__ROOTFS__ rw __VIDEO_MODE__ __VGA_MODE__ quiet
  9 }


meta/recipes-core/initrdscripts/files/init-install.sh
154 if [ -f /ssd/etc/grub.d/40_custom ] ; then
155     echo "Preparing custom grub2 menu..."
156     sed -i "s@__ROOTFS__@$rootfs $rootwait@g" /ssd/etc/grub.d/40_custom
157     sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom
158     sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom
159     mount $bootfs /bootmnt
160     cp /ssd/etc/grub.d/40_custom /bootmnt/40_custom
161     umount /bootmnt
162 fi
Comment 3 Shane Wang 2012-06-13 00:59:18 UTC
Per Dexuan's comment, that is not a grub issue but have to change grub config file. Give it to Alex for him to reassign to the team.
Comment 4 Alexandru Damian 2012-06-13 06:18:11 UTC
Radu, please take a look at it.
Comment 5 Alexandru Damian 2012-06-13 06:18:48 UTC
Radu, please take a look at it.
Comment 6 Radu Moisan 2012-06-19 11:00:01 UTC
Dexuan please elabore more on your post. I've looked into this problem but I don't manage to get a hold on the magic behind the scenes. For instance grub.cfg is generated ok in the following locations: 

build/tmp/work/fri2_noemgd-poky-linux/core-image-minimal-1.0-r0/core-image-minimal-1.0/grub.cfg
build/tmp/work/fri2_noemgd-poky-linux/core-image-minimal-1.0-r0/core-image-minimal-1.0/hddimg/EFI/BOOT/grub.cfg
build/tmp/work/fri2_noemgd-poky-linux/core-image-minimal-1.0-r0/core-image-minimal-1.0/iso/EFI/BOOT/grub.cfg

with something like

# Automatically created by OE
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
default=boot
timeout=10

menuentry 'boot'{
linux /vmlinuz LABEL=boot root=/dev/ram0   console=ttyPCH1,115200 console=tty0 video=vesafb vga=0x318
initrd /initrd
}

menuentry 'install'{
linux /vmlinuz LABEL=install root=/dev/ram0   console=ttyPCH1,115200 console=tty0 video=vesafb vga=0x318
initrd /initrd
}

However, I cant find /boot/grub/grub.cfg on the device - actually there is not /boot to look for. 

Can you shed some light on this matter, in particular to how grub.cfg is generated (and where) so that I can further trace this on my own.
Comment 7 Radu Moisan 2012-06-19 11:59:26 UTC
I've just took a second look on the device and the 40_custom is indeed missing the serial params, but grub.conf is still nowhere to be found, /boot has only the compressed and uncompressed kernel. Any hints would be very helpfull.
Comment 8 Darren Hart 2012-06-20 15:36:47 UTC
I suggest reviewing the installation script to understand how grub is installed and then comparing that with the image you have on hand.
Comment 9 Dexuan Cui 2012-06-21 01:52:38 UTC
(In reply to comment #7)
> I've just took a second look on the device and the 40_custom is indeed
> missing the serial params, but grub.conf is still nowhere to be found, /boot
> has only the compressed and uncompressed kernel. Any hints would be very
> helpfull.

Hi Radu,
I think the original report "no serial output during boot after install" means the  post-installation boot rather than the installation boot.

I think Comment 6 only means the installation boot is OK. Did you try the post-installation boot?
Comment 10 Radu Moisan 2012-06-22 08:33:45 UTC
The post installation boot is missing the parameters. This is my target.
Comment 11 Radu Moisan 2012-06-22 14:34:27 UTC
Did this feature work in the past? From what I'm seing now, It looks much like it was never there, but again I might be missing something. What I'm tring to say is that install.sh (or init-install.sh as it appreas in poky repository) will set the __ROOTFS__, __VIDEO_MODE__ and __VGA_MODE__ in 40_custom file (grub init file) but I cannot see any trace of the console parameters SERIAL_CONSOLE (set in fri2.conf).

So the scripts look to me like they are working fine, as intended. The paremeters added in fri2.conf, as I understand it, override the ia32-base.inc file. But further away, I cannot relate these two files with the above mentioned process.
Comment 12 Radu Moisan 2012-06-22 14:37:47 UTC
One small addition to my previous post. If I understood correctly 40_custom literaly becomes the grub.cfg file at install time. Please comment is otherwise.
Comment 13 Darren Hart 2012-06-22 14:41:06 UTC
(In reply to comment #12)
> One small addition to my previous post. If I understood correctly 40_custom
> literaly becomes the grub.cfg file at install time. Please comment is
> otherwise.

You have this right.SERIAL_CONSOLE (via APPEND I think) should be respected and treated in a similar way to __VIDEO_MODE__ and __VGA_MODE__.
Comment 14 Dexuan Cui 2012-06-24 08:42:09 UTC
(In reply to comment #11)
> Did this feature work in the past? From what I'm seing now, It looks much
I doubt it worked in the past.

> like it was never there, but again I might be missing something. What I'm
> tring to say is that install.sh (or init-install.sh as it appreas in poky
> repository) will set the __ROOTFS__, __VIDEO_MODE__ and __VGA_MODE__ in
> 40_custom file (grub init file) but I cannot see any trace of the console
> parameters SERIAL_CONSOLE (set in fri2.conf).
> 
> So the scripts look to me like they are working fine, as intended. The
> paremeters added in fri2.conf, as I understand it, override the
> ia32-base.inc file. But further away, I cannot relate these two files with
> the above mentioned process.
Comment 15 Song Liu 2012-07-04 20:22:07 UTC
Moving to M3, no chance of completion in M2
Comment 16 Radu Moisan 2012-07-18 12:09:50 UTC
I have modified 40_custom, init-install.sh and init-live.sh so that they process the "console=..." parameters as well. However, when I tried to test the changed, I realised that console=ttyPCH1,115200 is not taking effect, even if introdiced manually in grub. Can anyone confirm this?
Comment 17 Darren Hart 2012-07-18 14:43:58 UTC
(In reply to comment #16)
> I have modified 40_custom, init-install.sh and init-live.sh so that they
> process the "console=..." parameters as well. However, when I tried to test
> the changed, I realised that console=ttyPCH1,115200 is not taking effect,
> even if introdiced manually in grub. Can anyone confirm this?

How do you mean "it is not taking effect" ? Does it no appear in /proc/cmdline? Are you just unable to use the serial console? Are you testing on an FRI2?
Comment 18 Radu Moisan 2012-07-19 07:20:20 UTC
(In reply to comment #17)
> How do you mean "it is not taking effect" ? Does it no appear in
> /proc/cmdline? Are you just unable to use the serial console? Are you
> testing on an FRI2?
Yes I'm testing on FRI2. I have serial output in bios and in grub but nothing once the kernel kicks in. I used "console=ttyPCH1,11520" in grub as kernel boot option. The option is present in the output of "cat /proc/cmdline" once the kernel finished booting.
Comment 19 Radu Moisan 2012-07-19 07:22:03 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > How do you mean "it is not taking effect" ? Does it no appear in
> > /proc/cmdline? Are you just unable to use the serial console? Are you
> > testing on an FRI2?
> Yes I'm testing on FRI2. I have serial output in bios and in grub but
> nothing once the kernel kicks in. I used "console=ttyPCH1,11520" in grub as
> kernel boot option. The option is present in the output of "cat
> /proc/cmdline" once the kernel finished booting.

At this point I'm adding this option manually just to exclude from the ecuation my patch.
Comment 20 Radu Moisan 2012-07-19 12:01:09 UTC
submitted a patch, waiting review for now.
the problem with the serial device still applies. I've checked the kernel config and it seems fine, it may be a driver issue... anyway we should address this problem in a separate bug.
Comment 21 Darren Hart 2012-07-19 14:27:18 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > How do you mean "it is not taking effect" ? Does it no appear in
> > /proc/cmdline? Are you just unable to use the serial console? Are you
> > testing on an FRI2?
> Yes I'm testing on FRI2. I have serial output in bios and in grub but
> nothing once the kernel kicks in. I used "console=ttyPCH1,11520" in grub as
> kernel boot option. The option is present in the output of "cat
> /proc/cmdline" once the kernel finished booting.

Is "console=ttyPCH1,11520" a typo? It should be "console=ttyPCH1,115200".
Comment 22 Darren Hart 2012-07-19 14:28:24 UTC
(In reply to comment #20)
> submitted a patch, waiting review for now.
> the problem with the serial device still applies. I've checked the kernel
> config and it seems fine, it may be a driver issue... anyway we should
> address this problem in a separate bug.

I'm confused as I use this on a regular basis, it does work. Which FRI2 revision are you using?
Comment 23 Radu Moisan 2012-07-20 06:34:31 UTC
I used "console=ttyPCH1,115200" manually added to grub kernel options and I had not output on serial console (in the context where grub was working fine on serial console). I am using Rev.1.0
However, my patch was accepted so now the options should be preserverd. If problems are found with the serial port in Rev.1.0 (or with the kernel for that matter) please submit another bug.
Comment 24 Alexandru Palalau 2012-09-26 21:52:01 UTC
Verified under master branch commit ID 807ff46bc9d94106a11a58621994cc15e80f6d14.