Bug 10485 - wic images on SD card do not boot with meta-intel (USB drives boot fine)
Summary: wic images on SD card do not boot with meta-intel (USB drives boot fine)
Status: VERIFIED FIXED
Alias: None
Product: Installation
Classification: Runtime
Component: Installation (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.3 M1
Assignee: Ed Bartosh
QA Contact: oscar lopez arandas
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-10-21 22:23 UTC by Benjamin Esquivel
Modified: 2017-05-25 20:52 UTC (History)
5 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 Benjamin Esquivel 2016-10-21 22:23:01 UTC
This was first spotted on joule but later tests in minnowboard confirm that the latest Wic images cannot boot if burnt to an SD card, but if transferred to a USB drive, it will boot fine.

with:


poky: 4b94b49
meta-intel: 8dbd551

1. build a core image minimal with meta intel's machine intel-corei7-64
2. burn the wic image to an sd card using dd
3. try to boot it
4. instead of booting you will see this message:
   Waiting for root device /dev/sda2...
Comment 1 Ed Bartosh 2016-10-24 08:21:58 UTC
From the first look it looks like you're trying to boot non-efi image. If you want that you should probably put proper device name to your wks file. However, it's better to build efi image.

Just booted my MinnowBoard MAX from genericx86-64 image flashed to sd card:
root@genericx86-64:~# cat /proc/cmdline 
BOOT_IMAGE=/bzImage root=PARTUUID=f7952252-f409-4f5d-b448-1828b714b1b5 rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0
root@genericx86-64:~# ls -la /dev/disk/by-partuuid/f7952252-f409-4f5d-b448-1828b714b1b5 
lrwxrwxrwx    1 root     root            15 Aug  3 00:00 /dev/disk/by-partuuid/f7952252-f409-4f5d-b448-1828b714b1b5 -> ../../mmcblk1p2

Will try to build intel-corei7-64 image and boot it too.
Comment 2 Ed Bartosh 2016-10-24 09:37:24 UTC
Minnow MAX doesn't boot with intel-corei7-64 EFI image. After running bootloader manually it showed message "Reboot Into Firmware Interface". It looks like bootloader issue to me.
Comment 3 Ed Bartosh 2016-10-24 09:53:25 UTC
intel-corei7-64 wic images booted just fine after I've changed efi provider to grub-efi. Here is what I've added to my conf/local.conf to make it working:
WKS_FILE = "mkefidisk.wks"
IMAGE_FSTYPES += " wic"
EFI_PROVIDER = "grub-efi"

Here is a login promt on device:
...
Poky (Yocto Project Reference Distro) 2.2 intel-corei7-64 /dev/ttyS0

intel-corei7-64 login:

To sum it up:

Original problem with non-efi image was that directdisk.wks was used to produce an image. It configured to use 'sda' device. Changing it to mmcblk1 should make it working. However, I wouldn't recommend this way. It's better to use EFI images as they should work on any device.

The problem with EFI image was in mismatch between efi provider used for the machine(rmc-systemd-boot) and the one used in .wks file(grub-efi). Changing efi provider to grub-efi in conf/local.conf solved this.
Comment 4 Ed Bartosh 2016-10-24 13:10:06 UTC
The image booted on Joule after changing bootloader to gummiboot:

diff --git a/scripts/lib/wic/canned-wks/mkgummidisk.wks b/scripts/lib/wic/canned-wks/mkgummidisk.wks
index f3ae090..7623e8f 100644
--- a/scripts/lib/wic/canned-wks/mkgummidisk.wks
+++ b/scripts/lib/wic/canned-wks/mkgummidisk.wks
@@ -4,8 +4,8 @@
 
 part /boot --source bootimg-efi --sourceparams="loader=gummiboot" --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
 
-bootloader --ptable gpt --timeout=5  --append="rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0"
+bootloader --ptable gpt --timeout=5  --append="rootwait rootfstype=ext4 console=ttyS2,115200 console=tty0"

and these lines in conf/local.conf:
WKS_FILE = "mkgummidisk.wks"
IMAGE_FSTYPES += " wic"
EFI_PROVIDER = "gummiboot"
Comment 5 Ed Bartosh 2016-10-24 14:35:53 UTC
Fixed it by adding --use-uuid to systemd-bootdisk.wks: http://lists.openembedded.org/pipermail/openembedded-core/2016-October/127948.html

With this change MinnowBoard MAX booted core-image-minimal-intel-corei7-64.wic to shell from MicroSD card with no other changes needed.
Comment 6 Benjamin Esquivel 2016-10-24 16:07:12 UTC
This change worked just fine, I tried it both in Minnowboard and Joule and both boot to login prompt.
Comment 7 Ed Bartosh 2016-11-23 13:53:33 UTC
The fix has been accepted to poky master.
Comment 8 oscar lopez arandas 2017-05-25 20:52:59 UTC
wic image on SD card boot with success meta-intel

Build Configuration:
BB_VERSION        = "1.34.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "universal"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "intel-corei7-64"
DISTRO            = "poky"
DISTRO_VERSION    = "2.3"
TUNE_FEATURES     = "m64 corei7"
meta-yocto-bsp    = "HEAD:e5aa1ac23669a45491de9ecffac491c01e70203f"
meta-intel        = "master:7e8f98aa326f16edd679a95f7bb2daf4256479f3"

1. build a core image minimal with meta intel's machine intel-corei7-64
2. burn the wic image to an sd card using: sudo dd if=core-image-minimal-intel-corei7-64.wic of=/dev/mmcblk0
3. try to boot it
4. The image boot successfully.