Commit Graph

26 Commits

Author SHA1 Message Date
Krzesimir Nowak
f143645215 generate_au_zip: Remove useless line 2021-08-24 16:08:15 +02:00
Krzesimir Nowak
3f9c073b4b build_library: Fix some typos 2021-08-18 19:03:11 +02:00
Krzesimir Nowak
ea0f478cfa build_library: Fix some string vs bytes issues
This is some fallout from converting scripts from python2 to
python3. Output received from the functions in subprocess module now
return bytearrays, but we operate on them as if they were a text. So
decode the bytearrays to strings. Otherwise we are either getting some
junk values passed to the command line utilities (for example:
`b'/dev/loop2'` instead of `/dev/loop2`), or exceptions are thrown,
because a function expected a string.
2021-08-18 18:58:16 +02:00
Krzesimir Nowak
336a967941 build_library: Convert python2 scripts to python3
This is just a conversion done by 2to3 with a manual updates of
shebangs to mention python3 explicitly. The fixups for bytearray vs
string issues will follow up.
2021-08-18 18:56:48 +02:00
Dongsu Park
04d9fea0c1 build_library: fix docstring issues
Fix several docstring issues, so that the docstrings could match with
the actual code.
2021-08-16 10:39:26 +02:00
Dongsu Park
34cb6d305a build_library: support multi-arch in generate_au_zip
To be able to support arm64 native SDK without cross builds, we should
make generate_au_zip support both architectures, amd64 and arm64.
Without doing that, `build_image` fails with `ERROR : Required
WHITE_LIST items ld-linux-x86-64.so.2 not found!!!`, because the
script recognizes only amd64 libs in WHITE_LIST.

We should first determine the architecture in build_image, before
running generate_au_zip, and pass the architecture, either amd64 or
arm64. Also add allow_list and ld_linux parameters to necessary
functions.
2021-08-13 10:03:33 +02:00
Dongsu Park
a7f251da44 build_library: use proper vocabulary in generate_au_zip
Replace black list with deny list, white list with allow list.
2021-08-13 09:30:53 +02:00
Nick Owens
8c76ea6ea4 build_library: core_promote is gone, do not copy it 2016-04-28 16:46:22 -07:00
Michael Marineau
fcd55e0171 generate_au_zip: improve error reporting of missing files 2015-07-02 13:51:39 -07:00
Michael Marineau
f6bc2908d4 rename references to updatectl, it is now updateservicectl 2014-08-20 16:27:44 -07:00
Michael Marineau
27e00285d5 updates: include updatectl in update tools zip 2014-06-30 15:40:42 -07:00
Michael Marineau
82e2461ddf build_image: refresh scripts bundled into the update zip. 2014-06-24 13:34:54 -07:00
Michael Marineau
6d165f8a7c maint(generate_au_zip): Drop old update service uploader 2014-05-05 15:14:46 -07:00
Brandon Philips
42770b6c00 feat(core_roller_upload): initial commit
TODO: get rollerctl releases installed in here too.
2014-03-26 05:55:26 -07:00
Michael Marineau
c5c9ea0b9b fix(common.sh): New variables for .cache and .repo/manfests
A number of places refer to these paths and that number is going to
grow. Since the standard pattern is to use environment variables for
commonly used paths it is time to add ones for these:
REPO_CACHE_DIR
REPO_MANIFESTS_DIR
2013-11-22 16:13:49 -08:00
Michael Marineau
ef7aea86a9 fix(generate_au_zip): Add core-admin to au-generator.zip
Forgot to add this in previous commits, so here it is!
2013-07-08 21:54:57 -07:00
Michael Marineau
c9a6956f6f fix(core_upload_update): Add to au-generator.zip, move some operations.
Add core_upload_update to au-generator.zip which requires some extra
logic to make it runnable anywhere it may be. To organize the code a
little better all the delta_generator calls have been moved to
cros_generate_update_payload. core_upload_update is now just a wrapper
around cros_generate_update_payload and core-admin.
2013-07-08 21:39:05 -07:00
Michael Marineau
12935743b6 fix(common.sh): Fallback to loading version.txt from current directory.
This makes version handling continue to work normally with
au-generator.zip
2013-07-08 21:39:04 -07:00
Michael Marineau
12149d8421 fix(generate_au_zip): Remove unused scripts from au-generator.zip
We have no need to ship convert_recovery_to_ssd.sh with builds.
2013-07-08 21:39:04 -07:00
Don Garrett
048b3cecdf Update generate_au_zip.py location for cgpt.
Cgpt was moved and a symlink based wrapper was added. That wrapper will
be improved soon, when when that's true we'll need to change this back.

A specific note... cgpt is currently statically linked. If that wrapper does
not remain statically linked, then a simple revert won't be enough.

BUG=chromium-os:39814
TEST=Manual au-generate.zip creation.

Change-Id: I2705b1eddd8ef28c7eb099512513daf80f586218
Reviewed-on: https://gerrit.chromium.org/gerrit/45128
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
2013-07-08 21:35:36 -07:00
Mike Frysinger
baae8eb628 common.sh: convert to bash
We don't need to support POSIX shell, so convert to bash.

BUG=None
TEST=`cbuildbot {amd64,x86,arm}-generic-full chromiumos-sdk daisy-release` worked

Change-Id: I33ad25d2310c593f3e346d955e3aa27da41091fc
Reviewed-on: https://gerrit.chromium.org/gerrit/41271
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-01-16 13:59:21 -08:00
Don Garrett
d54aa70d57 Fix delta generation to work with updated glibc version.
The new glibc caused a series of problems with Paygen based delta generation.

First, the new glibc is newer than what is used in workstations, or on
the Paygen servers. Since libc wasn't one of the libraries bundled up
by generate_au_zip.py, the executables bundled up (including delta_generator)
would fail because of unstatisfied library requirements at startup.

When the new libc was included by generate_au_zip.py, the delta_generator
executable started causing the dynamic loader to segfault during startup,
presumably because it was linked for a newer version. This means that
the new loader needs to be bundled and explicitly used when invoking
the new executables (thanks David James for figuring this out!).

Next, after including all of the new libraries, bash would crash at startup
with these libraries at the start of LD_LIBRARY_PATH. Since Paygen which
set LD_LIBRARY_PATH before invoking a shell script which invokes the delta
generator, this means delta generation would crash before it started.

If I modified Paygen to not set LD_LIBRARY_PATH, then older au_generator.zip
files could not be properly handled (and we do so regularly).

This change moves the required dynamic libraries into a subdir of the zip
file which will not be in Paygens LD_LIBRARY_PATH which allows bash to
operate correctly.

It also renames each dynamically linked executable from xxx to xxx.wrapped
and creates a shell script named xxx which invokes xxx.wrapped with the
new LD_LIBRARY_PATH and using ld-linux-x86-64.so.2 to do so.

This change also moves a number of constants from inline in various
functions to constants at the top of the script, and introduces a WHITE_LIST
to cause a build failure if ld-linux-x86-64.so.2 isn't present.
(Fixing chromium-os:32550 would help with that)

BUG=chromium-os:32542
TEST=Generated au_generator.zip by hand, extracted files in a test directory,
and generated a delta using Paygen's command line:

LD_LIBRARY_PATH=. PATH=.:$PATH ./cros_generate_update_payload --image ../chromiumos_test_image.bin --output fuzzy --outside_chroot

Change-Id: I90d18a6d17a8f9824b19a6ce480048e388832b56
Reviewed-on: https://gerrit.chromium.org/gerrit/27443
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-07-15 16:23:23 -07:00
Don Garrett
c8e3cb091e Generate_au_zip blacklisting was blacklisting * not nothing.
Fix the blacklisting logic, and re-add the magic library linux-vdso.so.

BUG=chromium-os:32542
TEST=Run by hand, .zip contents examined by hand.

Change-Id: I94d99bf62e5eb011ac70428d7cebeaa852519a78
Reviewed-on: https://gerrit.chromium.org/gerrit/27398
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-07-13 18:28:27 -07:00
Don Garrett
540284316d Bundle up ALL dependant libraries for the delta generator.
We were blacklisting some dependant libraries for the delta generator when
we bundle them all up together. When glibc in the chroot was update to be
newer than glibc on our workstations, this broke payload generation.

The real fix is to link delta_generator statically so we don't have to do
this goofy library bundling business (chromium-os:32544). In the mean time,
bundle everything up to get us working again.

BUG=chromium-os:32544
TEST=Trybot run, but not fully verified.

Change-Id: I7b7d247f4edd8ecbab772807f6d2c4e7fdfd414a
Reviewed-on: https://gerrit.chromium.org/gerrit/27327
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
2012-07-12 16:16:15 -07:00
Don Garrett
48df416640 Include libstdc++ in the libraries bundled with delta generator.
We have updated the toolchain in the chroot to use a newer version of
libstdc++ than what is installed on our workstations. This means
this additional library is required to generate deltas outside of the
chroot.

BUG=chromium-os:25277
TEST=Generated zip file, and ran contents outside of chroot on my workstation.

Change-Id: I5a90ee355aabd4849a9186a9a66e3dc9b1c51d52
Reviewed-on: https://gerrit.chromium.org/gerrit/14597
Reviewed-by: Eric M. Blake <eblake@google.com>
Reviewed-by: Eric Blake <eblake@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-01-20 20:05:28 -08:00
J. Richard Barnette
f2206118f3 Isolate scripts and files that are used only in build_image
A modest number of different scripts and files have a usage
restricted to build_image.  Move those files to build_library,
to prevent them accumulating unwanted clients.

BUG=chromium-os:17390
TEST=build_image
TEST=grep relevant sources for references to all the files

Change-Id: I3e9f6447ec34c09ea2d61f29ac343386a1e122b9
Reviewed-on: http://gerrit.chromium.org/gerrit/4762
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-27 08:46:01 -07:00