This is needed on some ARM boards where ext2 filesystem reading isn't an option,
and where verified boot isn't in use, i.e. with legacy firmware. x86 stores the
kernel here as well.
BUG=none
TEST=build_image on an arm board and check contents for vmlinuz.A and vmlinuz.uimg.A on
partition 12
Change-Id: I89b652cb6ea7ece1627b20be30492100f8db0770
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13441
This reverts commit 1d20fe6813b991899900aaa4f92b965a8f0b511d
Change-Id: I2d07c4c16e56841e397ee62d0371c5edc85c8364
Reviewed-on: https://gerrit.chromium.org/gerrit/13439
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
This is needed on some ARM boards where ext2 filesystem reading isn't an option,
and where verified boot isn't in use, i.e. with legacy firmware. x86 stores the
kernel here as well.
BUG=none
TEST=build_image on an arm board and check contents for vmlinuz.A and vmlinuz.uimg.A on
partition 12
CQ-DEPEND=I81df8471fba34e264ada8fd6f12122d87fbf22d9
Change-Id: I39541644845dde4ff6ddc288afa0ed339ab0d05b
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/12996
Race conditions could prevent /tmp/esp.* from being properly unmounted
if it was quickly mounted then unmounted. If the umount fails,
sleep briefly and then retry.
BUG=chromium-os:23442,chromium-os:23443
TEST=Ran build_image --test, saw umount failure but after script finished
saw that directory was unmounted on second attempt so no leakage
Change-Id: I5b2260f5c99fcfa66027ebcfd69b6e3d5afe4b91
Reviewed-on: https://gerrit.chromium.org/gerrit/12115
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
BUG=chromium-os:14127,chromium-os:17184
TEST=Adhoc
Build a regular image (for Alex) and boot it on a Dogfood machine (which uses
legacy boot). Check dmesg for PARTUUID. Unpack partitions, mount partition 12,
and check for root=PARTUUID= in /efi/grub/grub.cfg (it should be there instead
of root=/dev/$linuxpart).
Change-Id: Ie403632f227d514a5876f8338afa4ad80708ed55
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5668
Reviewed-by: Will Drewry <wad@chromium.org>
The problem here is that most were doing their exiting w/in a subshell;
exit within a subshell kills the subshell, not the parent. Not all scripts
were using set -e (which would pick up the failing subshell); as such
just rewriting them to remove the potential via eliminateing the subshelling.
Beyond that, removed a couple of custom (working, although non-standard)
approaches, and removed a duplicate common.sh sourc'ing w/in mk_memento_images.sh
TEST=force 'find_common_sh' to fail, note the scripts fails to exit
BUG=none
Change-Id: Ia1108a091a6399ad6aedd3cade4a107f4411686c
Reviewed-on: http://gerrit.chromium.org/gerrit/3905
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
The following pattern creates a race condition:
LOOP_DEV=$(sudo losetup -f)
...
sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}"
If two steps similar to the above run in parallel, and both steps pick up
the same free loop device, they may try to mount different images with the
same loop device and one of the two stages will get a "device is busy" error.
To fix this, we should switch to the following pattern:
LOOP_DEV=$(sudo losetup --show -f "${ROOT_FS_IMG}")
This CL implements the above.`
BUG=chromium-os:18046
TEST=Run buildbot run. Test case where we run out of loop devices and verify
logic still works.
Change-Id: Ie457701fda61e5fc3b9112c1bfef9fb9713ea265
Reviewed-on: http://gerrit.chromium.org/gerrit/4555
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
When building a VM or USB-run image the boot args come from a preset template
which does not include the cros_debug flag. If this flag is present we maintain
it in this new boot configuration. The way we do it is by replacing the string
"cros_legacy" (which originates with the template) with
"cros_legacy cros_debug".
TEST=Build VM from a developer and test image and check grep "cros_debug"
/proc/cmdline.
BUG=chromium-os:17392
Change-Id: I2cb578274cf9596bf863ec835b1c921fff252a04
Reviewed-on: http://gerrit.chromium.org/gerrit/3808
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
Using %U+1 will ensure that we avoid device enumeration issues during recovery mode
boots.
TEST=build_image+dev recovery kernel and boot to it on new cros fw / fixed enumeration problem
used build with mp recovery kernel on cr-48 -> installed then booted fine
used dev recovery kernel on a legacy machine; installed fine, booted fine
tested with cr-48, mp recovery kernel, and noenable_rootfs_verification to ensure /dev/sd%D%P still worked as normal.
Change-Id: I5b1277a47536738a78c18988fd912cc05ebddd4b
BUG=chromium-os:5470
Review URL: http://codereview.chromium.org/6549034
from within the chroot.
It also fixes a number of style issues.
It changes the meaning of cros_workon "list-all" to list all available
packages, and adds "list-live" to list all live packages.
It changes things that load chromeos-common.sh from the installer to
load it from /usr/lib/installer.
BUG=chromium-os:4230
TEST=synced, rebuilt chroot, made packages, made images, built chrome
from source, and wrote an image to a USB stick.
Review URL: http://codereview.chromium.org/6240018
Change-Id: I90c34420af1a64020402bafef8e9e77f56837c02
The update_bootloaders needs to unmount file system first for syslinux to
manipulate the raw device file, but the real "umount+losetup -d" in
cleanup stage would cause failure.
This CL remounts partition again so that cleanup can be executed
successfully.
BUG=chromium-os:9278
TEST=Manually executed ./build_image;
Before fix: seeing "umount: /tmp/esp.2q8fSn: not mounted" in last page.
After fix: no such error.
The output image is verified to be bootable successfully.
Change-Id: I19e2e062ad814e7bcd54777b5c3cee31f2b92e81
Review URL: http://codereview.chromium.org/5165001
- I looked at all of the x86 and ARM paths through out build image scripts,
these changes clean up stale comments, stale code, and unforks some small
things.
BUG=none
TEST=Built images for x86-generic, arm-generic and tegra2-seaboard, booted tegra2-seaboard image.
Review URL: http://codereview.chromium.org/3448022
Change-Id: Ibad2774ff2cbf5f15528454506542b87e43e24a2
- Build a "kernel image" which contains a uboot script and a uboot kernel
image.
- Fix some sd* assumptions.
- Remove cruft that has never done anything usefull from update_bootloaders
BUG=none
TEST=Built, booted, and updated on tegra2_dev-board
Review URL: http://codereview.chromium.org/3396011
Change-Id: I00ecf57faa5fe64c8e33dd4c042f1dbed806c10a
This change adds
- --rootfs_hash_pad to specify the MBs reserved for the pad
- the implementation of the above flag
- check if total fs size + pad size exceeds the partition size
- hash appending in make_image_bootable()
Fixes:
- a style for ROOT_FS_HASH usage
- bad mount|grep
- bad bash subst for root devices in all boot paths
- fixed a typo in the update_bootloaders table creation
- disables verified usb for now
Adding the padding argument ensures that the generated hash tree for the root filesystem is appended to the image. Assuming the rootfs is _never_ mounted read-write
again, that hash tree will be valid and vboot will be able to proceed.
BUG=chromium-os:2693
TEST=manual build_image
Review URL: http://codereview.chromium.org/3043011
Change-Id: I67d9b0f91cacdefa309c0cc2dd7fed1d2eddd7a7
Instead of playing mount and loop device games, this change adds support for
update_bootloaders.sh to directly update the EFI system partition living in the
image if a file, offset, and size is supplied.
TEST=build_image for x86-generic; booted resulting image
BUG=broken build
Change-Id: I3d891fd965df6fb4abfc63d660e314c497a4184d
Review URL: http://codereview.chromium.org/3006006
Right now, the created arm.mbr is the size of the ESP
partition. It should be truncated though to just the mbr size.
In addition, dm= doesnt do anything on arm yet so replacing use with a todo and adding a check if it isn't there.
TEST=manually ran
BUG=none
TBR=fes
Adds two helpers that are not used yet. They will be
used in the next CL to unify the bootloaders in use
in build_image.
TEST=used in the next CL but otherwise not called.
BUG=chromium-os:327
Review URL: http://codereview.chromium.org/2829039