2013-01-25 08:07:01 +00:00
|
|
|
#!/bin/sh
|
2013-02-08 14:31:19 +00:00
|
|
|
ISO_VERSION=2013.02.01
|
|
|
|
|
2013-02-16 16:17:42 +00:00
|
|
|
mkdir -p $CACHEDIR
|
2013-01-25 08:07:01 +00:00
|
|
|
|
|
|
|
echo "Downloading Archlinux dvd..."
|
2013-02-16 16:17:42 +00:00
|
|
|
wget -N -P $CACHEDIR "http://mir.archlinux.fr/iso/$ISO_VERSION/archlinux-$ISO_VERSION-dual.iso"
|
2013-02-08 14:31:19 +00:00
|
|
|
|
|
|
|
echo "Verifying dvd..."
|
|
|
|
echo "If verification fails, ensure that you imported and verified the archlinux key"
|
|
|
|
echo "eg: gpg --recv-keys 9741E8AC"
|
|
|
|
|
2013-02-16 16:17:42 +00:00
|
|
|
gpg --verify "$SCRIPTSDIR/archlinux-$ISO_VERSION-dual.iso.sig" "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" || exit
|
2013-01-25 08:07:01 +00:00
|
|
|
|
2013-02-16 16:17:42 +00:00
|
|
|
if [ "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" -nt $CACHEDIR/root-image.fs ]; then
|
|
|
|
echo "Extracting squash filesystem from DVD..."
|
|
|
|
mkdir mnt_archlinux_dvd
|
|
|
|
sudo mount -o loop "cache_$DIST/archlinux-$ISO_VERSION-dual.iso" mnt_archlinux_dvd
|
|
|
|
cp mnt_archlinux_dvd/arch/x86_64/root-image.fs.sfs $CACHEDIR/
|
|
|
|
sudo umount mnt_archlinux_dvd
|
|
|
|
sudo mount -o loop cache_$DIST/root-image.fs.sfs mnt_archlinux_dvd
|
|
|
|
cp mnt_archlinux_dvd/root-image.fs $CACHEDIR/
|
|
|
|
sudo umount mnt_archlinux_dvd
|
|
|
|
rm $CACHEDIR/root-image.fs.sfs
|
|
|
|
fi
|