diff options
author | Pierre Labatut <plabatut@google.com> | 2023-10-30 19:14:02 +0100 |
---|---|---|
committer | Pierre Labatut <plabatut@google.com> | 2023-10-31 11:25:22 +0100 |
commit | 8b8282a578b244a704da194351d17e195d789078 (patch) | |
tree | 49431af510291c6609f0ab8a633bb3abfc47d9ae | |
parent | 57593be157047b681088d55ab940002c9e307315 (diff) | |
download | cuttlefish_vmm-8b8282a578b244a704da194351d17e195d789078.tar.gz |
Change the qemu dir layout to match host pacakge.
Now the binary is in ./bin
The firmware are still in ./usr/share
Bug: b/296286524
Change-Id: Ic602a7b83ec5db6931ebdeda45ab4bc9f4c62762
-rwxr-xr-x | qemu/scripts/rebuild.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/qemu/scripts/rebuild.py b/qemu/scripts/rebuild.py index 4892316..276ab8f 100755 --- a/qemu/scripts/rebuild.py +++ b/qemu/scripts/rebuild.py @@ -912,6 +912,18 @@ def build_task_for_qemu(build: BuildConfig): "--prefix=/usr", "--target-list=%s" % ",".join(target_list), "--disable-plugins", + # Cuttlefish is packaged in host archives that are assembled in + # `$ANDROID_BUILD_TOP/out/host/linux-x86`. + # Binaries are in `./bin` and resources are in `./usr/share` which is + # different from QEMU default expectations. Details in b/296286524. + + # Move the binary directory up by one. This path is relative to + # `--prefix` above. + "-Dbindir=../bin", + # Because the canonicalized `bindir` is `/bin` and does not start + # with the `--prefix` the `qemu_firmwarepath` is interpreded differently. + # Hence we have to rewrite it to work as expected. + "-Dqemu_firmwarepath=../usr/share/qemu", # `gfxstream` is is only capable to output a dynamic library for now # `libgfxstream_backend.so` # "--static", @@ -931,7 +943,7 @@ def build_task_for_qemu_portable(build: BuildConfig): build.run_make_install( build.build_dir / "qemu", use_DESTDIR=True, dest_dir=package_dir ) - bin_dir = package_dir / "usr" / "bin" + bin_dir = package_dir / "bin" files = [ "dest-install/usr/lib/libz.so.1", "dest-install/usr/lib/librutabaga_gfx_ffi.so.0", @@ -953,9 +965,11 @@ def build_task_for_qemu_portable(build: BuildConfig): raise FileNotFoundError(f"None of the paths exist: {either_or}") build.run(["cp", "-t", bin_dir] + files) + build.run(["chmod", "a+rx"] + list(bin_dir.glob("*"))) build.run(["patchelf", "--set-rpath", "$ORIGIN"] + list(bin_dir.glob("*"))) build.run( - ["tar", "-czvf", "qemu-portable.tar.gz", "qemu-portable"], build.build_dir + ["tar", "-czvf", "qemu-portable.tar.gz", "-C", "qemu-portable", "."], + build.build_dir, ) |