meson: Use the check_header function
[mesa.git] / .gitlab-ci / create-rootfs.sh
index 04441ee50d15b9fc8f05669adb0129e2e2be23ed..6399a88ce3ee42d6e2d8bc4e2f83554af0e4aec1 100644 (file)
@@ -2,14 +2,8 @@
 
 set -ex
 
-LLVM=libllvm8
-
-# LLVMPipe on armhf is broken with LLVM 8
-if [ `dpkg --print-architecture` = "armhf" ]; then
-        LLVM=libllvm7
-fi
-
 apt-get -y install --no-install-recommends \
+    ca-certificates \
     initramfs-tools \
     libpng16-16 \
     strace \
@@ -17,7 +11,10 @@ apt-get -y install --no-install-recommends \
     libexpat1 \
     libdrm2 \
     libdrm-nouveau2 \
-    $LLVM
+    firmware-qcom-media \
+    netcat-openbsd \
+    wget \
+    xz-utils
 passwd root -d
 chsh -s /bin/sh
 
@@ -28,10 +25,20 @@ exec sh
 EOF
 chmod +x  /init
 
+mkdir -p /lib/firmware/rtl_nic
+wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/rtl8153a-3.fw -O /lib/firmware/rtl_nic/rtl8153a-3.fw
+
 #######################################################################
 # Strip the image to a small minimal system without removing the debian
 # toolchain.
 
+# xz compress firmware so it doesn't waste RAM at runtime.  Except db820c's
+# GPU firmware, due to using a precompiled kernel without compression support.
+find /lib/firmware -type f -print0 | \
+    grep -vz a530 | \
+    xargs -0r -P4 -n4 xz -T1 -C crc32
+ln -s /lib/firmware/qcom/a530* /lib/firmware/
+
 # Copy timezone file and remove tzdata package
 rm -rf /etc/localtime
 cp /usr/share/zoneinfo/Etc/UTC /etc/localtime
@@ -89,8 +96,8 @@ rm -rf usr/share/misc/usb.ids
 # IMPORTANT: The Debian system is not longer functional at this point,
 # for example, apt and dpkg will stop working
 
-UNNEEDED_PACKAGES="apt libapt-pkg5.0 "\
-"ncurses-bin ncurses-base libncursesw5 libncurses5 "\
+UNNEEDED_PACKAGES="apt libapt-pkg6.0 "\
+"ncurses-bin ncurses-base libncursesw6 libncurses6 "\
 "perl-base "\
 "debconf libdebconfclient0 "\
 "e2fsprogs e2fslibs libfdisk1 "\
@@ -99,10 +106,10 @@ UNNEEDED_PACKAGES="apt libapt-pkg5.0 "\
 "init-system-helpers "\
 "bash "\
 "cpio "\
+"xz-utils "\
 "passwd "\
 "libsemanage1 libsemanage-common "\
 "libsepol1 "\
-"gzip "\
 "gpgv "\
 "hostname "\
 "adduser "\
@@ -160,10 +167,10 @@ rm -rf usr/lib/xtables
 rm -rf usr/lib/locale/*
 
 # partition helpers
-rm usr/sbin/*fdisk
+rm -rf usr/sbin/*fdisk
 
 # local compiler
-rm usr/bin/localedef
+rm -rf usr/bin/localedef
 
 # Systemd dns resolver
 find usr etc -name '*systemd-resolve*' -prune -exec rm -r {} \;
@@ -184,18 +191,16 @@ find usr etc -name '*fuse*' -prune -exec rm -r {} \;
 rm -rf usr/lib/lsb
 
 # Only needed when adding libraries
-rm usr/sbin/ldconfig*
+rm -rf usr/sbin/ldconfig*
 
 # Games, unused
 rmdir usr/games
 
 # Remove pam module to authenticate against a DB
 # plus libdb-5.3.so that is only used by this pam module
-rm usr/lib/*/security/pam_userdb.so
-rm usr/lib/*/libdb-5.3.so
+rm -rf usr/lib/*/security/pam_userdb.so
+rm -rf usr/lib/*/libdb-5.3.so
 
 # remove NSS support for nis, nisplus and hesiod
-rm usr/lib/*/libnss_hesiod*
-rm usr/lib/*/libnss_nis*
-
-rm bin/tar
+rm -rf usr/lib/*/libnss_hesiod*
+rm -rf usr/lib/*/libnss_nis*