qubes-linux-template-builder/scripts_archlinux/00_prepare.sh
Marek Marczykowski d13a4eff88 archlinux: do not use additional sudo inside scripts_archlinux/*
The whole build process is started as root (check Makefile), so there is
no need for additional sudo. This makes some things much simpler
(for example appending to some files).
2013-04-28 22:50:18 +02:00

25 lines
875 B
Bash
Executable File

#!/bin/sh
ISO_VERSION=2013.02.01
mkdir -p $CACHEDIR
echo "Downloading Archlinux dvd..."
wget -N -P $CACHEDIR "http://mir.archlinux.fr/iso/$ISO_VERSION/archlinux-$ISO_VERSION-dual.iso"
echo "Verifying dvd..."
gpg --import "$SCRIPTSDIR/archlinux-master-keys.asc"
gpg --verify "$SCRIPTSDIR/archlinux-$ISO_VERSION-dual.iso.sig" "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" || exit
if [ "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" -nt $CACHEDIR/root-image.fs ]; then
echo "Extracting squash filesystem from DVD..."
mkdir mnt_archlinux_dvd
mount -o loop "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" mnt_archlinux_dvd
cp mnt_archlinux_dvd/arch/x86_64/root-image.fs.sfs $CACHEDIR/
umount mnt_archlinux_dvd
mount -o loop $CACHEDIR/root-image.fs.sfs mnt_archlinux_dvd
cp mnt_archlinux_dvd/root-image.fs $CACHEDIR/
umount mnt_archlinux_dvd
rm $CACHEDIR/root-image.fs.sfs
fi