New issue
Advanced search Search tips

Issue 714774 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

initramfs: test/test.sh is broken

Project Member Reported by jclinton@chromium.org, Apr 24 2017

Issue description

When attempting to follow the instructions for quick debugging documented in test/README.md, the build fails with a collision of a cp on "cgpt":

$ ./test.sh --board=${BOARD}
INFO    test.sh: loader_kernel: Building cpio: /mnt/host/source/src/build/initramfs/loader_kernel/ramfs.cpio.xz
make: Entering directory '/mnt/host/source/src/platform/initramfs'
make -C loader_kernel
make[1]: Entering directory '/mnt/host/source/src/platform/initramfs/loader_kernel'
rm -rf "/mnt/host/source/src/build/initramfs/loader_kernel/rootfs"
mkdir -p "/mnt/host/source/src/build/initramfs/loader_kernel/rootfs"
../common/process-layout \
        make \
        ../common/fs-layout.txt "/mnt/host/source/src/build/initramfs/loader_kernel/rootfs"
(cd /mnt/host/source/src/build/initramfs/loader_kernel/rootfs; mkdir -p bin etc lib root)
lddtree --verbose --copy-non-elfs --root="/build/pyro" \
        --copy-to-tree="/mnt/host/source/src/build/initramfs/loader_kernel/rootfs" --bindir=/bin \
        /bin/busybox /usr/sbin/kexec /usr/bin/futility /usr/bin/cgpt
/build/pyro/bin/busybox -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/bin/busybox
lddtree: warning: /build/pyro/usr/sbin/kexec: did not match any paths
/build/pyro/lib64/ld-linux-x86-64.so.2 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/ld-linux-x86-64.so.2
/build/pyro/lib64/libdl.so.2 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/libdl.so.2
/build/pyro/lib64/libz.so.1 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/libz.so.1
/build/pyro/lib64/libc.so.6 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/libc.so.6
/build/pyro/usr/lib64/libcrypto.so.1.0.0 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/usr/lib64/libcrypto.so.1.0.0
/build/pyro/usr/bin/futility -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/bin/futility
/build/pyro/lib64/ld-linux-x86-64.so.2 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/ld-linux-x86-64.so.2
/build/pyro/lib64/libc.so.6 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/libc.so.6
/build/pyro/lib64/libuuid.so.1 -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/lib64/libuuid.so.1
/build/pyro/usr/bin/cgpt -> /mnt/host/source/src/build/initramfs/loader_kernel/rootfs/bin/cgpt
make[1]: *** [../common/initramfs.mk:50: stage_init] Error 1
make[1]: Leaving directory '/mnt/host/source/src/platform/initramfs/loader_kernel'
make: *** [Makefile:12: loader_kernel] Error 2
make: Leaving directory '/mnt/host/source/src/platform/initramfs'
 
Labels: Hotlist-GoodFirstBug

Comment 2 by vapier@chromium.org, Apr 24 2017

i suspect the real error is this:
lddtree: warning: /build/pyro/usr/sbin/kexec: did not match any paths

Comment 3 by vapier@chromium.org, Apr 24 2017

Cc: vapier@chromium.org

Comment 4 by sjg@chromium.org, Apr 24 2017

Cc: sjg@chromium.org

Comment 5 by sjg@chromium.org, May 16 2017

Owner: ddavenp...@chromium.org
Drew does this look like a good next bug?
I see that sys-apps/kexec-tools is only set as a dependency if USE=loader_kernel_ramfs is set.

One of:
  factory_netboot_ramfs
  factory_shim_ramfs
  loader_kernel_ramfs
  recovery_ramfs
are required to emerge initramfs, but I'm not sure which one(s) were set when it was built through build_packages. Clearly not loader_kernel_ramfs, at any rate.

I tried:
USE="loader_kernel_ramfs" emerge-x86-generic chromeos-initramfs
and then ran test.sh again and it successfully built the four images.

I tried running the generated qemu script for each image. 
factory_netboot seemed to work
factory_shim seemed to work
loader_kernel had a kernel panic (not clear why)
recovery had a kernel panic when executing `exec >"${LOG_FILE}" 2>` in initramfs/recovery/init:main. I tried commenting that out and it got further, but died in initramfs/recovery/recovery_init.sh:verify_fw_version because the TPM device couldn't be opened (which is maybe not a surprise since it's running on an emulator).

I didn't want to dig too much deeper into the errors running these, in case they were related to me not building the images correctly.

As for getting test.sh to build correctly, is it a matter of updating the README.md to say that build_packages is not sufficient, and one must emerge chromeos-init with the appropriate USE flags first? Or is there something else that should be emerged that would have built initramfs correctly?
Is the loader_kernel_ramfs USE flag used anywhere?

Unless I'm missing something, the only places I see the USE flag referenced in code search are in .ebuild files where other dependencies are added conditionally based on whether loader_kernel_ramfs is present, but I don't see anything that actually uses it.

If it's not used anywhere, should we just remove initramfs/test/loader_kernel? What about other references to loader_kernel_ramfs? 
Additionally, sys-apps/kexec-tools fails to emerge for amd64 targets, such as amd64-generic and snappy, which further suggests to me that loader_kernel_ramfs USE flag may not get used anywhere.
Discussed offline. We'll remove loader_kernel, which is no longer being used (crbug/736054).

test.sh should then be able to build the other images.

recovery still has a kernel panic, which I suspect may be due to the recovery initramfs being built differently from test.sh than if was built through mod_image_for_recovery.sh

Comment 10 by sjg@google.com, Jul 5 2017

Labels: Team-BLD
loader_kernel has been removed, so test.sh should run to completion now. As mentioned before, factory_*_ramfs seem to be working, but recovery_ramfs does not.
Owner: ----
Status: Available (was: Untriaged)
Project Member

Comment 13 by sheriffbot@chromium.org, Sep 27

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment