summaryrefslogtreecommitdiff
path: root/build-arch-iso
blob: 188100d30049a7acdc8b0f24ed0f4885e84ded7a (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash

set -e

if [ "$(whoami)" != "root" ]; then
  sudo "$0" "$@"
  exit $?
fi

pacman -Syu

if [ "$(pacman -Q 'linux' | cut -d' ' -f2)-ARCH" != "$(uname -r)" ]; then
  >&2 echo 'installed and running kernel versions differ'
  exit 1
fi

destination="$(mktemp -d)"
trap "rm -rf --one-file-system '${destination}'" EXIT

systemctl stop boinc

echo 'build i686-iso ...'

"${0%/*}/build-iso" 32

echo '... done.'

cp /usr/share/archiso/configs/releng/out/archlinux-*.iso "${destination}/"

echo 'build dual-iso ...'

"${0%/*}/build-iso" dual

echo '... done.'

cp /usr/share/archiso/configs/releng/out/archlinux-*.iso "${destination}/"

(
  cd "${destination}/"
  sha512sum *.iso > sha512sums
  md5sum *.iso > md5sum
  for s in *.iso; do
    if [ -n "${SUDO_USER}" ]; then
      chown -R "${SUDO_USER}" .
      sudo -u "${SUDO_USER}" gpg --detach-sign "$s"
    else
      gpg --detach-sign "$s"
    fi
  done
)

rsync -v "${destination}/"* /mnt/archlinux32/archisos/testing/

rm -rf --one-file-system "${destination}"

systemctl start boinc