Bug 4859 - Build Appliance does not boot in vmWare Player
Summary: Build Appliance does not boot in vmWare Player
Status: VERIFIED FIXED
Alias: None
Product: Runtime
Classification: Build System, Metadata & Runtime
Component: build-appliance (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: High major
Target Milestone: 1.5 M3
Assignee: Jonathan Liu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-07-17 12:42 UTC by Cristian Iorga
Modified: 2013-10-17 14:51 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
Build Appliance does not boot (28.31 KB, image/png)
2013-07-17 12:42 UTC, Cristian Iorga
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cristian Iorga 2013-07-17 12:42:54 UTC
Created attachment 1335 [details]
Build Appliance does not boot

Build Appliance does not boot in vmWare Player

vmWare Player reports:
"Missing operating system" at the beginning of the boot process.

Version: master, commit 3dee534f1e25109e0bdb681de0746c336f4b8840.
Comment 1 Cristian Iorga 2013-07-18 09:16:36 UTC
The issue is triggered by commit:
boot-directdisk: allow specifying custom MBR disk signature
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b52d2bb46ed7c893077ccf9e5a83dc7f11c7f61b

Doing a revert of this commit allows Build Appliance to boot correctly.

A fix is in the work.
Comment 2 Cristian Iorga 2013-07-18 09:16:57 UTC
Designing a fix.
Comment 3 Jonathan Liu 2013-07-18 15:20:17 UTC
The commit is only supposed to change the 4 bytes from offset 440 which corresponds to the disk signature. I tested by converting existing hdddirect image to vmdk using: qemu-img convert -O vmdk image.hdddirect image.vmdk. Syslinux and kernel seems to boot for my custom image.

GNU Parted creates a disk signature already even without the commit but it's not really unique (based on current time).
Comment 4 Jonathan Liu 2013-07-18 15:21:44 UTC
You can test changes to image generation by running bitbake -C bootdirectdisk image-recipe which will only regenerate the image file leaving the filesystem and partition data the same.
Comment 5 Jonathan Liu 2013-07-19 12:19:28 UTC
Could you provide the MBR disk signature hex code that was generated in the image that could not boot so I can check this further?
Comment 6 Cristian Iorga 2013-07-19 12:23:09 UTC
Hello Jonathan,

The disk signature is a different one every time a new BA image is generated.
And the BA image does not boot under vmWare Player with any of BA images.

Regards,
Cristian
Comment 7 Jonathan Liu 2013-07-19 13:08:06 UTC
If you run the following:
dd if=/dev/zero of=test.img bs=512 count=1
echo -ne "$(echo 78563412 | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')" | dd of=test.img bs=1 seek=440 conv=notrunc
md5sum test.img

Do you get md5sum of 77c7d4f6b9bde10c8ab685979bca7145?
Comment 8 Jonathan Liu 2013-07-19 13:23:15 UTC
Please provide your build configuration information, host architecture, distribution name/version, version of VMware Player.
Comment 9 Cristian Iorga 2013-07-19 13:28:33 UTC
MD5 sum is 77c7d4f6b9bde10c8ab685979bca7145.
Comment 10 Cristian Iorga 2013-07-19 13:32:39 UTC
Poky head is 3dee534f1e25109e0bdb681de0746c336f4b8840.
bitbake build-appliance-image
VmWare Player is 5.0.2 build-1031769 on Linux; latest one available.
Linux host is Ubuntu 12.10 x86-64.
Comment 11 Jonathan Liu 2013-07-20 05:54:25 UTC
I cannot reproduce the issue with the following configuration.

Build Configuration:
BB_VERSION        = "1.19.1"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "arch-rolling"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.4+snapshot-20130720"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta
meta-yocto
meta-yocto-bsp    = "master:94029c477e8bc06088f6dcd98adca49dc94e3feb"

I am using fresh clone of poky 31e6eee860b5f9f4ac9ef0889bcff5648de6e3f9 master branch with http://patchwork.openembedded.org/patch/54067/ applied.

Build Host: Arch Linux x86_64
VMware Player: 5.0.2 build-1031769
VMware Player OS: Windows 7 Ultimate, 64-bit 6.1.7601, Service Pack 1

Changes in local.conf from default:
BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 8"
MACHINE = "qemux86"
DL_DIR ?= "${TOPDIR}/../downloads"
SSTATE_DIR ?= "${TOPDIR}/../sstate-cache"
PACKAGE_CLASSES ?= "package_ipk"
IMAGE_FEATURES_append = " package-management"
GCCVERSION = "4.7%"

Using GCC 4.7 due to https://bugzilla.yoctoproject.org/show_bug.cgi?id=4789
Comment 12 Jonathan Liu 2013-07-20 10:42:18 UTC
I can reproduce with Ubuntu 12.10 x86-64 and poky master 31e6eee860b5f9f4ac9ef0889bcff5648de6e3f9 using default GCC 4.8.1 toolchain.
Comment 13 Jonathan Liu 2013-07-20 10:55:57 UTC
I found the issue. The echo command doesn't support -n and -e under dash, so it is echoing the the arguments passed literally:

$ hexdump -Cs 440 -n 112 tmp/deploy/images/build-appliance-image-qemux86.hdddirect
000001b8  2d 6e 65 20 5c 78 32 31  5c 78 37 33 5c 78 61 64  |-ne \x21\x73\xad|
000001c8  5c 78 39 32 0a 00 00 02  42 58 83 03 e0 ff 41 ac  |\x92....BX....A.|
000001d8  00 00 20 f8 50 05 00 00  00 00 00 00 00 00 00 00  |.. .P...........|
000001e8  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f8  00 00 00 00 00 00 55 aa  eb 58 90 53 59 53 4c 49  |......U..X.SYSLI|
00000208  4e 55 58 00 02 04 01 00  02 00 02 40 ac f8 2b 00  |NUX........@..+.|
00000218  20 00 40 00 00 00 00 00  00 00 00 00 80 00 29 67  | .@...........)g|
00000228

Notice "-ne \x21\x73\xad\x92" being written to the image which corrupts the partition table.
Comment 14 Cristian Iorga 2013-07-23 16:22:28 UTC
Fix submitted for review.
Comment 16 Alexandru Georgescu 2013-10-17 14:51:23 UTC
This is fixed.