Bug 8718 - wic: Kernel panic with x86 and NUC
Summary: wic: Kernel panic with x86 and NUC
Status: VERIFIED NOTABUG
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 2.0
Hardware: x86 Multiple
: Medium+ major
Target Milestone: 2.1 M2
Assignee: Ed Bartosh
QA Contact: Bogdan Alexandru Voiculescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-11-23 21:37 UTC by Mariano Lopez
Modified: 2016-01-06 09:39 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mariano Lopez 2015-11-23 21:37:42 UTC
Using wic to create a x86-64 image for EFI (mkefidisk), I got a kernel panic: "No working init found". I have tried with several images (minimal, sato, lsb, lsb-sdk, full-cmdline) with the same result. This was using sysvinit. The NUC model is D54250WYK.

Steps to reproduce:

1. Set MACHINE to: "genericx86-64" or "intel-corei7-64"
2. Build core-image-minimal
3. Use wic to create an EFI image (wic create mkefidisk -e core-image-minimal)
4. Copy the image to a flash drive with dd
5. Boot the image in a NUC
Comment 1 Daniel Istrate 2015-11-27 09:53:51 UTC
Tested on master: 03f15e51998a3ef65a5b68cb7cbf724f4388c289

I tried to reproduce this bug on Ed's behalf on NUC (D54250WYA) and it successfully booted.

I had to update the mkefidisk wks (sda --> sdb)
MACHINE = "intel-corei7-64"


I tried also with this wks config:
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024

part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid

part swap --ondisk sda --size 44 --label swap1 --fstype=swap

bootloader --ptable gpt  --timeout=10  --append="rootwait rootfstype=ext4 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0"

and it worked too.


--Daniel
Comment 2 Ed Bartosh 2015-11-27 09:56:22 UTC
Mariano, can you try uuid configuration showed by Daniel with your device?
Comment 3 Mariano Lopez 2015-12-01 17:18:53 UTC
I tried to create the image adding --use-uuid and I got this error:

wic create mkefidisk -e core-image-minimal
Checking basic build environment...
Done.

Creating image(s)...

Error: exec_cmd: 'sgdisk --partition-guid=2:9987c08f-8f29-48cf-853f-e7934e063e54 /var/tmp/wic/build/mkefidisk-201512010904-sda.direct' returned '3' instead of 0


I tried in friend's laptop and had the same error, is there something that we are doing wrong?
Comment 4 Ed Bartosh 2015-12-02 10:51:10 UTC
Can you show your .wks please?

PS: This looks quite strange ans uuid-related options are tested by oe-selftest, so they should always work.
Comment 5 Mariano Lopez 2015-12-02 13:31:16 UTC
Here is the diff:

diff --git a/scripts/lib/wic/canned-wks/mkefidisk.wks b/scripts/lib/wic/canned-wks/mkefidisk.wks
index 696e94e..a774c76 100644
--- a/scripts/lib/wic/canned-wks/mkefidisk.wks
+++ b/scripts/lib/wic/canned-wks/mkefidisk.wks
@@ -4,7 +4,7 @@
 
 part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
 
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
 
 part swap --ondisk sda --size 44 --label swap1 --fstype=swap
Comment 6 Ed Bartosh 2015-12-02 15:40:46 UTC
I can't reproduce it. Which machine do you use? Can you show your bblayers.conf?

according to gfdisk manual return code 3 means that Non-GPT disk detected and no -g option. It looks like a bug, but I have to reproduce it to be able to fix.
Comment 7 Ed Bartosh 2015-12-02 15:57:00 UTC
Mariano, you should add --ptable gpt option to bootloader line in your .wks
Sorry for not noticing it before.
Comment 8 Mariano Lopez 2015-12-02 21:18:18 UTC
It booted fine with the --use-uuid option
Comment 9 Ed Bartosh 2015-12-03 08:52:43 UTC
Can you try to use sdb instead of sda in original wks(without --uurd and --ptable gpt) ? Here is a recipe to try:

part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sdb --label msdos --active --align 1024
 
part / --source rootfs --ondisk sdb --fstype=ext4 --label platform --align 1024
 
part swap --ondisk sdb --size 44 --label swap1 --fstype=swap

bootloader --timeout=10  --append="rootwait rootfstype=ext4 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0"
Comment 10 Mariano Lopez 2015-12-03 14:59:07 UTC
When seeing the output when booting I see what is the problem and is not related with wic. The NUC I'm using for testing has an SSD, and the SSD is the "sda". When booting from the USB the the kernel will look for a partition in the SSD and not in the USB. This has to do with the NUC configuration and not a problem with wic.

Closing as not a bug
Comment 11 Ed Bartosh 2015-12-04 10:17:25 UTC
Mariano, have you tried to change sda->sdb in your .wks?
Did it solve the issue, i.e. did the image boot?
Comment 12 Bogdan Alexandru Voiculescu 2016-01-06 09:39:58 UTC
Verified on above comments.