From 1e2003e867e66467fe6f9f64b16e9da6b0365544 Mon Sep 17 00:00:00 2001 From: Andrew Rynhard Date: Sat, 12 Oct 2019 18:18:03 +0000 Subject: [PATCH] chore: move common steps into base Signed-off-by: Andrew Rynhard --- base/pkg.yaml | 25 +++++++------- containerd/pkg.yaml | 6 ---- dosfstools/pkg.yaml | 58 +++++++++++++++------------------ eudev/pkg.yaml | 79 +++++++++++++++++++++------------------------ iptables/pkg.yaml | 68 ++++++++++++++++++-------------------- kmod/pkg.yaml | 6 ---- libressl/pkg.yaml | 48 ++++++++++++--------------- libseccomp/pkg.yaml | 58 +++++++++++++++------------------ runc/pkg.yaml | 76 ++++++++++++++++++++----------------------- socat/pkg.yaml | 52 +++++++++++++---------------- syslinux/pkg.yaml | 6 ---- util-linux/pkg.yaml | 6 ---- xfsprogs/pkg.yaml | 5 --- 13 files changed, 212 insertions(+), 281 deletions(-) diff --git a/base/pkg.yaml b/base/pkg.yaml index 3e138b7db..b151a95c7 100644 --- a/base/pkg.yaml +++ b/base/pkg.yaml @@ -2,19 +2,20 @@ name: base variant: scratch shell: /toolchain/bin/bash dependencies: -- image: docker.io/autonomy/tools:b4e3778 -- stage: musl + - image: docker.io/autonomy/tools:b4e3778 + - stage: musl steps: -- prepare: - - | - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib + - prepare: + - | + cp -R /toolchain/lib/gcc /lib + cp -R /toolchain/lib/libgcc* /lib - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh + mkdir /bin + ln -sv /toolchain/bin/bash /bin/bash + ln -sv /toolchain/bin/bash /bin/sh + ln -sv /toolchain/bin/pwd /bin/pwd - adjust.sh + adjust.sh finalize: -- from: /toolchain - to: /toolchain + - from: / + to: / diff --git a/containerd/pkg.yaml b/containerd/pkg.yaml index dbe48c4ca..90feaa03a 100644 --- a/containerd/pkg.yaml +++ b/containerd/pkg.yaml @@ -17,12 +17,6 @@ steps: export GOPATH=/go mkdir -p ${GOPATH}/src/github.com/containerd/containerd tar -xzf containerd.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/containerd/containerd - - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib build: - | export PKG_CONFIG_PATH=/usr/lib/pkgconfig diff --git a/dosfstools/pkg.yaml b/dosfstools/pkg.yaml index f4068ba59..c5275d7dc 100644 --- a/dosfstools/pkg.yaml +++ b/dosfstools/pkg.yaml @@ -2,39 +2,33 @@ name: dosfstools variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates + - stage: base + - stage: musl + - stage: ca-certificates steps: -- sources: - - url: https://github.com/dosfstools/dosfstools/releases/download/v4.1/dosfstools-4.1.tar.xz - destination: dosfstools.tar.xz - sha256: e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173 - sha512: e7a8aab34255d15e6865a7b031971352af1255134fab83389673bcc3cbd6ba255241bd2429070aeb4b927f8d7d73ccf1aeafe94566b133e88e7586897c317b78 - prepare: - - | - tar -xJf dosfstools.tar.xz --strip-components=1 + - sources: + - url: https://github.com/dosfstools/dosfstools/releases/download/v4.1/dosfstools-4.1.tar.xz + destination: dosfstools.tar.xz + sha256: e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173 + sha512: e7a8aab34255d15e6865a7b031971352af1255134fab83389673bcc3cbd6ba255241bd2429070aeb4b927f8d7d73ccf1aeafe94566b133e88e7586897c317b78 + prepare: + - | + tar -xJf dosfstools.tar.xz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib + mkdir build + cd build - mkdir build - cd build - - ../configure \ - --prefix=/ \ - --enable-compat-symlinks - build: - - | - cd build - make -j $(nproc) - install: - - | - cd build - make install DESTDIR=/rootfs + ../configure \ + --prefix=/ \ + --enable-compat-symlinks + build: + - | + cd build + make -j $(nproc) + install: + - | + cd build + make install DESTDIR=/rootfs finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/eudev/pkg.yaml b/eudev/pkg.yaml index 5299586e0..64db96df2 100644 --- a/eudev/pkg.yaml +++ b/eudev/pkg.yaml @@ -2,51 +2,46 @@ name: eudev variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates + - stage: base + - stage: musl + - stage: ca-certificates steps: -- sources: - - url: https://dev.gentoo.org/~blueness/eudev/eudev-3.2.8.tar.gz - destination: eudev.tar.gz - sha256: 61e4948e9e51271c3cce2bb5311a30b206dd03ef011062e6c627fb007e43f6b8 - sha512: 13221e6f9696a8630d867eb7d73f3bf5dd1bc2dfd80d62af00342be4cbf39a862e644ea3776fa4d91463e594ca50c5deecbeb7e05d161097e889ea58a66ccc42 - prepare: - - | - tar -xzf eudev.tar.gz --strip-components=1 + - sources: + - url: https://dev.gentoo.org/~blueness/eudev/eudev-3.2.8.tar.gz + destination: eudev.tar.gz + sha256: 61e4948e9e51271c3cce2bb5311a30b206dd03ef011062e6c627fb007e43f6b8 + sha512: 13221e6f9696a8630d867eb7d73f3bf5dd1bc2dfd80d62af00342be4cbf39a862e644ea3776fa4d91463e594ca50c5deecbeb7e05d161097e889ea58a66ccc42 + prepare: + - | + tar -xzf eudev.tar.gz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib - # Required by gperf. - cp /toolchain/lib/libstdc++* /lib + # Required by gperf. + cp /toolchain/lib/libstdc++* /lib - cat > config.cache << "EOF" - HAVE_BLKID=1 - BLKID_LIBS="-lblkid" - BLKID_CFLAGS="-I${TOOLCHAIN}/include" - EOF + cat > config.cache << "EOF" + HAVE_BLKID=1 + BLKID_LIBS="-lblkid" + BLKID_CFLAGS="-I${TOOLCHAIN}/include" + EOF - mkdir build - cd build + mkdir build + cd build - ../configure \ - --prefix=/usr \ - --libexecdir=/usr/libexec \ - --sbindir=/sbin \ - --disable-manpages \ - --enable-hwdb \ - --disable-static - build: - - | - cd build - make -j $(nproc) - install: - - | - cd build - make install DESTDIR=/rootfs + ../configure \ + --prefix=/usr \ + --libexecdir=/usr/libexec \ + --sbindir=/sbin \ + --disable-manpages \ + --enable-hwdb \ + --disable-static + build: + - | + cd build + make -j $(nproc) + install: + - | + cd build + make install DESTDIR=/rootfs finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/iptables/pkg.yaml b/iptables/pkg.yaml index 67525e1c3..e0d801f47 100644 --- a/iptables/pkg.yaml +++ b/iptables/pkg.yaml @@ -2,44 +2,38 @@ name: iptables variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates + - stage: base + - stage: musl + - stage: ca-certificates steps: -- sources: - - url: http://www.netfilter.org/projects/iptables/files/iptables-1.8.2.tar.bz2 - destination: iptables.tar.bz2 - sha256: a3778b50ed1a3256f9ca975de82c2204e508001fc2471238c8c97f3d1c4c12af - sha512: 8cf0f515764e1dc6e03284581d682d1949b33e8f25fea29c27ae856f1089fe8ca7b1814524b85f4378fd1fc7c7c7d002f06557b257ae2bbc945f8555bad0dc76 - prepare: - - | - tar -xjf iptables.tar.bz2 --strip-components=1 + - sources: + - url: http://www.netfilter.org/projects/iptables/files/iptables-1.8.2.tar.bz2 + destination: iptables.tar.bz2 + sha256: a3778b50ed1a3256f9ca975de82c2204e508001fc2471238c8c97f3d1c4c12af + sha512: 8cf0f515764e1dc6e03284581d682d1949b33e8f25fea29c27ae856f1089fe8ca7b1814524b85f4378fd1fc7c7c7d002f06557b257ae2bbc945f8555bad0dc76 + prepare: + - | + tar -xjf iptables.tar.bz2 --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib + mkdir build + cd build - mkdir build - cd build - - ../configure \ - --prefix=/usr \ - --libexecdir=/usr/libexec \ - --disable-static \ - --sbindir=/sbin \ - --disable-nftables \ - --enable-libipq \ - --with-xtlibdir=/lib/xtables - build: - - | - cd build - make -j $(nproc) - install: - - | - cd build - make install DESTDIR=/rootfs + ../configure \ + --prefix=/usr \ + --libexecdir=/usr/libexec \ + --disable-static \ + --sbindir=/sbin \ + --disable-nftables \ + --enable-libipq \ + --with-xtlibdir=/lib/xtables + build: + - | + cd build + make -j $(nproc) + install: + - | + cd build + make install DESTDIR=/rootfs finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/kmod/pkg.yaml b/kmod/pkg.yaml index bf0a91d6e..947d881b6 100644 --- a/kmod/pkg.yaml +++ b/kmod/pkg.yaml @@ -15,12 +15,6 @@ steps: - | tar -xJf kmod.tar.xz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib - mkdir build cd build ../configure \ diff --git a/libressl/pkg.yaml b/libressl/pkg.yaml index af87a1bf8..ce1231ca5 100644 --- a/libressl/pkg.yaml +++ b/libressl/pkg.yaml @@ -2,33 +2,27 @@ name: libressl variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates + - stage: base + - stage: musl + - stage: ca-certificates steps: -- sources: - - url: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.9.0.tar.gz - destination: libressl.tar.gz - sha256: eb5f298408b723f11a0ca0192c122ecb79b4855bfdf7eea183a6264296a13cf4 - sha512: db7fec664bef8d76204ca691c11df236abce3c85b2a51011eec5bd302e273b62fa3cfce0430980915c3f3ce34176d5ef9c187902f0b39d7fc151e69e552b499c - prepare: - - | - tar -xzf libressl.tar.gz --strip-components=1 + - sources: + - url: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.9.0.tar.gz + destination: libressl.tar.gz + sha256: eb5f298408b723f11a0ca0192c122ecb79b4855bfdf7eea183a6264296a13cf4 + sha512: db7fec664bef8d76204ca691c11df236abce3c85b2a51011eec5bd302e273b62fa3cfce0430980915c3f3ce34176d5ef9c187902f0b39d7fc151e69e552b499c + prepare: + - | + tar -xzf libressl.tar.gz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib - - ./configure \ - --prefix=/usr - build: - - | - make -j $(nproc) - install: - - | - make install DESTDIR=/rootfs + ./configure \ + --prefix=/usr + build: + - | + make -j $(nproc) + install: + - | + make install DESTDIR=/rootfs finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/libseccomp/pkg.yaml b/libseccomp/pkg.yaml index c6490e9b2..356c299f5 100644 --- a/libseccomp/pkg.yaml +++ b/libseccomp/pkg.yaml @@ -2,39 +2,33 @@ name: libseccomp variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates + - stage: base + - stage: musl + - stage: ca-certificates steps: -- sources: - - url: https://github.com/seccomp/libseccomp/releases/download/v2.3.3/libseccomp-2.3.3.tar.gz - destination: libseccomp.tar.gz - sha256: 7fc28f4294cc72e61c529bedf97e705c3acf9c479a8f1a3028d4cd2ca9f3b155 - sha512: 845c7e0e916b5f5ad74da446ceff3250148b745c909185f6d5059e807d1b42fa6b74f356cce2a396bff0d4c7a3120e7cdad98d490a97d549327c7693fe1918be - prepare: - - | - tar -xzf libseccomp.tar.gz --strip-components=1 + - sources: + - url: https://github.com/seccomp/libseccomp/releases/download/v2.3.3/libseccomp-2.3.3.tar.gz + destination: libseccomp.tar.gz + sha256: 7fc28f4294cc72e61c529bedf97e705c3acf9c479a8f1a3028d4cd2ca9f3b155 + sha512: 845c7e0e916b5f5ad74da446ceff3250148b745c909185f6d5059e807d1b42fa6b74f356cce2a396bff0d4c7a3120e7cdad98d490a97d549327c7693fe1918be + prepare: + - | + tar -xzf libseccomp.tar.gz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib + mkdir build + cd build - mkdir build - cd build - - ../configure \ - --prefix=/usr \ - --disable-static - build: - - | - cd build - make -j $(nproc) - install: - - | - cd build - make install DESTDIR=/rootfs + ../configure \ + --prefix=/usr \ + --disable-static + build: + - | + cd build + make -j $(nproc) + install: + - | + cd build + make install DESTDIR=/rootfs finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/runc/pkg.yaml b/runc/pkg.yaml index 41a222d91..019be600d 100644 --- a/runc/pkg.yaml +++ b/runc/pkg.yaml @@ -2,49 +2,43 @@ name: runc variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates -- stage: libseccomp + - stage: base + - stage: musl + - stage: ca-certificates + - stage: libseccomp steps: -- sources: - - url: https://github.com/opencontainers/runc/releases/download/v1.0.0-rc8/runc.tar.xz - destination: runc.tar.xz - sha256: 5d46f01bca203ae226f107f8e3351211f492d43038af19b8337acffab6c4f576 - sha512: 132cf58dd8533e87c31a93a68b33a2705070458504f689a52696a110091ef5e9ca0ccb6ad127239a545e8d070ebbc08507fbf4c121b2528d36d88d26a3936ded - prepare: - - | - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib + - sources: + - url: https://github.com/opencontainers/runc/releases/download/v1.0.0-rc8/runc.tar.xz + destination: runc.tar.xz + sha256: 5d46f01bca203ae226f107f8e3351211f492d43038af19b8337acffab6c4f576 + sha512: 132cf58dd8533e87c31a93a68b33a2705070458504f689a52696a110091ef5e9ca0ccb6ad127239a545e8d070ebbc08507fbf4c121b2528d36d88d26a3936ded + prepare: + - | + export GOPATH=/go + mkdir -p ${GOPATH}/src/github.com/opencontainers/runc - export GOPATH=/go - mkdir -p ${GOPATH}/src/github.com/opencontainers/runc + tar -xJf runc.tar.xz --strip-components=1 -C ${GOPATH}/src/github.com/opencontainers/runc + build: + - | + export GOPATH=/go + cd ${GOPATH}/src/github.com/opencontainers/runc - tar -xJf runc.tar.xz --strip-components=1 -C ${GOPATH}/src/github.com/opencontainers/runc - build: - - | - export GOPATH=/go - cd ${GOPATH}/src/github.com/opencontainers/runc + export PATH=${PATH}:/${TOOLCHAIN}/go/bin + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + export CC=/toolchain/bin/cc + export CGO_CFLAGS="-L/usr/lib -I/usr/include" + export CGO_LDFLAGS="-L/usr/lib -I/usr/include" + # This is required due to "loadinternal: cannot find runtime/cgo". + export CGO_ENABLED=1 + make EXTRA_LDFLAGS="-w -s" BUILDTAGS="seccomp" COMMIT=ccb5efd37fb7c86364786e9137e22948751de7ed runc + install: + - | + export GOPATH=/go + cd ${GOPATH}/src/github.com/opencontainers/runc - export PATH=${PATH}:/${TOOLCHAIN}/go/bin - export PKG_CONFIG_PATH=/usr/lib/pkgconfig - export CC=/toolchain/bin/cc - export CGO_CFLAGS="-L/usr/lib -I/usr/include" - export CGO_LDFLAGS="-L/usr/lib -I/usr/include" - # This is required due to "loadinternal: cannot find runtime/cgo". - export CGO_ENABLED=1 - make EXTRA_LDFLAGS="-w -s" BUILDTAGS="seccomp" COMMIT=ccb5efd37fb7c86364786e9137e22948751de7ed runc - install: - - | - export GOPATH=/go - cd ${GOPATH}/src/github.com/opencontainers/runc - - mkdir -p /rootfs/bin - mv runc /rootfs/bin/runc - chmod +x /rootfs/bin/runc + mkdir -p /rootfs/bin + mv runc /rootfs/bin/runc + chmod +x /rootfs/bin/runc finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/socat/pkg.yaml b/socat/pkg.yaml index 974e94512..816747b65 100644 --- a/socat/pkg.yaml +++ b/socat/pkg.yaml @@ -2,35 +2,29 @@ name: socat variant: scratch shell: /toolchain/bin/bash dependencies: -- stage: base -- stage: musl -- stage: ca-certificates -- stage: libressl + - stage: base + - stage: musl + - stage: ca-certificates + - stage: libressl steps: -- sources: - - url: http://www.dest-unreach.org/socat/download/socat-1.7.3.3.tar.gz - destination: socat.tar.gz - sha256: 8cc0eaee73e646001c64adaab3e496ed20d4d729aaaf939df2a761e99c674372 - sha512: b3ea4cb6081f7778a0281a3ec36ea7e5daf07dc19f2e0de08f767417112776e96e1bcac7962ebb6dd8b960ad91fc4a452f0da8327736d50e215e4ab43947ff78 - prepare: - - | - tar -xzf socat.tar.gz --strip-components=1 + - sources: + - url: http://www.dest-unreach.org/socat/download/socat-1.7.3.3.tar.gz + destination: socat.tar.gz + sha256: 8cc0eaee73e646001c64adaab3e496ed20d4d729aaaf939df2a761e99c674372 + sha512: b3ea4cb6081f7778a0281a3ec36ea7e5daf07dc19f2e0de08f767417112776e96e1bcac7962ebb6dd8b960ad91fc4a452f0da8327736d50e215e4ab43947ff78 + prepare: + - | + tar -xzf socat.tar.gz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib - - ./configure \ - --prefix=/usr \ - LIBS="-L/usr/lib" - build: - - | - make -j $(nproc) - install: - - | - make install DESTDIR=/rootfs + ./configure \ + --prefix=/usr \ + LIBS="-L/usr/lib" + build: + - | + make -j $(nproc) + install: + - | + make install DESTDIR=/rootfs finalize: -- from: /rootfs - to: / + - from: /rootfs + to: / diff --git a/syslinux/pkg.yaml b/syslinux/pkg.yaml index 410cccd85..fc2ad34d5 100644 --- a/syslinux/pkg.yaml +++ b/syslinux/pkg.yaml @@ -15,12 +15,6 @@ steps: prepare: - | tar -xJf syslinux.tar.xz --strip-components=1 - - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - ln -sv /toolchain/bin/pwd /bin/pwd - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib build: - | make -j $(nproc) installer diff --git a/util-linux/pkg.yaml b/util-linux/pkg.yaml index ab2921514..556ac3371 100644 --- a/util-linux/pkg.yaml +++ b/util-linux/pkg.yaml @@ -15,12 +15,6 @@ steps: - | tar -xJf util-linux.tar.xz --strip-components=1 - mkdir /bin - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib - mkdir build cd build ../configure \ diff --git a/xfsprogs/pkg.yaml b/xfsprogs/pkg.yaml index 11fb32e20..207a3924c 100644 --- a/xfsprogs/pkg.yaml +++ b/xfsprogs/pkg.yaml @@ -16,11 +16,6 @@ steps: - | tar -xJf xfsprogs.tar.xz --strip-components=1 - ln -sv /toolchain/bin/bash /bin/bash - ln -sv /toolchain/bin/bash /bin/sh - cp -R /toolchain/lib/gcc /lib - cp -R /toolchain/lib/libgcc* /lib - ./configure \ --prefix=/ \ --enable-gettext=no