This repository has been archived by the owner on Feb 16, 2019. It is now read-only.
forked from archimg/archlinux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild
executable file
·43 lines (35 loc) · 1.64 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash -ex
ORGA=lopsided
TAR_DATE=${TAR_DATE:-$(date +'%Y.%m')}
ARCH=armv6h
ARCHLINUX_MIRR=http://os.archlinuxarm.org/os/rpi
[ $UID -ne 0 ] && echo "This script should get executed as root. Otherwise file special permissions are not set correctly." >&2
mkdir -p Dockerfiles/basement/arch-rootfs
mkdir -p tarballs/${TAR_DATE}
# Download tarball, signature and sha1sums.txt
# Verify sha1sum for tarball
(
cd tarballs/${TAR_DATE} \
&& wget -q --no-cookies \
${ARCHLINUX_MIRR}/ArchLinuxARM-${TAR_DATE}-rpi-rootfs.tar.gz{,.sig,.md5} \
&& md5sum --check ArchLinuxARM-${TAR_DATE}-rpi-rootfs.tar.gz.md5
)
# Verify the data by its gpg-signature
# https://wiki.archlinux.org/index.php/Category:Getting_and_installing_Arch
gpg --keyserver-options auto-key-retrieve \
--verify tarballs/${TAR_DATE}/ArchLinuxARM-${TAR_DATE}-rpi-rootfs.tar.gz.sig
tar xz \
--warning=none \
-f tarballs/${TAR_DATE}/ArchLinuxARM-${TAR_DATE}-rpi-rootfs.tar.gz \
--strip-components=1 \
--directory=./Dockerfiles/basement/arch-rootfs
cp /usr/bin/qemu-arm-static ./Dockerfiles/basement/arch-rootfs/usr/bin/qemu-arm-static
for repo in archlinux-${ARCH}::squash archlinux-${ARCH}:full:squash archlinux-${ARCH}:devel:nosquash; do
IFS=: read repo tag opt <<< $repo
docker build -f ./Dockerfiles/basement/Dockerfile${tag:+.$tag} -t ${ORGA}/${repo}:${tag:+$tag-}${TAR_DATE} ./Dockerfiles/basement
if [ "${opt}" == "squash" ]; then
docker-squash ${ORGA}/${repo}:${tag:+$tag-}${TAR_DATE}
fi
# alias the image with name currenttar instead of actual date to get referenced by static dockerfiles
docker tag ${ORGA}/${repo}:${tag:+$tag-}${TAR_DATE} ${ORGA}/${repo}:${tag:+$tag-}currenttar
done