summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2022-03-03 11:03:17 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-03 11:03:17 +0000
commit0b02bfa6c48a314918b5967dbb568ea9951a3210 (patch)
treeb12c8c69720eeade15ace2cd98b56d9a55dcdefd
parent17b2494fcbe0883f29ffd219a5cb77dceed7c9ba (diff)
parent53682ab9d04bb23d0d7682477644cb1687a3a47b (diff)
downloadtests-0b02bfa6c48a314918b5967dbb568ea9951a3210.tar.gz
build_rootfs.sh: Avoid out of space issues in stage2 am: 82627b72bb am: 2faa496280 am: 5caa7419a2 am: 53682ab9d0
Original change: https://android-review.googlesource.com/c/kernel/tests/+/2004903 Change-Id: I6b14a973279d5f3f20b1e313a850f713fcf3c5cf
-rw-r--r--net/test/rootfs/bullseye-common.sh16
-rwxr-xr-xnet/test/rootfs/bullseye-cuttlefish.sh7
-rwxr-xr-xnet/test/rootfs/bullseye-rockpi.sh8
3 files changed, 16 insertions, 15 deletions
diff --git a/net/test/rootfs/bullseye-common.sh b/net/test/rootfs/bullseye-common.sh
index 3bf0b1c..39f31d9 100644
--- a/net/test/rootfs/bullseye-common.sh
+++ b/net/test/rootfs/bullseye-common.sh
@@ -22,6 +22,8 @@ debian_iptables=1.8.7-1
cuttlefish=android-cuttlefish
setup_and_build_iptables() {
+ get_installed_packages >/root/originally-installed
+
# Install everything needed from bullseye to build iptables
apt-get install -y \
build-essential \
@@ -68,6 +70,10 @@ setup_and_build_iptables() {
# Build debian packages from the integrated iptables source
dpkg-buildpackage -F -d -us -uc
cd -
+
+ get_installed_packages >/root/installed
+ remove_installed_packages /root/originally-installed /root/installed
+ apt-get clean
}
install_and_cleanup_iptables() {
@@ -91,6 +97,8 @@ install_and_cleanup_iptables() {
}
setup_and_build_cuttlefish() {
+ get_installed_packages >/root/originally-installed
+
# Install everything needed from bullseye to build cuttlefish-common
apt-get install -y \
cdbs \
@@ -100,11 +108,19 @@ setup_and_build_cuttlefish() {
git \
golang
+ if [ "$(uname -m)" = "arm64" ]; then
+ apt-get install -y libc6-dev:amd64
+ fi
+
# Fetch cuttlefish and build it for cuttlefish-common
git clone https://github.com/google/android-cuttlefish.git /usr/src/$cuttlefish
cd /usr/src/$cuttlefish
dpkg-buildpackage -d -uc -us
cd -
+
+ get_installed_packages >/root/installed
+ remove_installed_packages /root/originally-installed /root/installed
+ apt-get clean
}
install_and_cleanup_cuttlefish() {
diff --git a/net/test/rootfs/bullseye-cuttlefish.sh b/net/test/rootfs/bullseye-cuttlefish.sh
index 0771ac1..4ac5248 100755
--- a/net/test/rootfs/bullseye-cuttlefish.sh
+++ b/net/test/rootfs/bullseye-cuttlefish.sh
@@ -28,18 +28,11 @@ update_apt_sources bullseye
setup_cuttlefish_user
-get_installed_packages >/root/originally-installed
-
setup_and_build_cuttlefish
setup_and_build_iptables
-get_installed_packages >/root/installed
-
-remove_installed_packages /root/originally-installed /root/installed
-
install_and_cleanup_cuttlefish
sed -i "s,^#\(bridge_interface=\),\1br0," /etc/default/cuttlefish-common
-
install_and_cleanup_iptables
create_systemd_getty_symlinks ttyS0 hvc1
diff --git a/net/test/rootfs/bullseye-rockpi.sh b/net/test/rootfs/bullseye-rockpi.sh
index e8188c3..6974099 100755
--- a/net/test/rootfs/bullseye-rockpi.sh
+++ b/net/test/rootfs/bullseye-rockpi.sh
@@ -370,17 +370,9 @@ update_apt_sources bullseye
setup_cuttlefish_user
-get_installed_packages >/root/originally-installed
-
-apt-get install -y libc6-dev:amd64
-
setup_and_build_cuttlefish
setup_and_build_iptables
-get_installed_packages >/root/installed
-
-remove_installed_packages /root/originally-installed /root/installed
-
install_and_cleanup_cuttlefish
install_and_cleanup_iptables