2013-01-25 08:07:01 +00:00
|
|
|
#!/bin/sh
|
2014-11-08 14:13:07 +00:00
|
|
|
ISO_VERSION=`date +%Y.%m`.01
|
2013-02-08 14:31:19 +00:00
|
|
|
|
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-12-13 03:26:44 +00:00
|
|
|
wget -N -P $CACHEDIR "http://mir.archlinux.fr/iso/$ISO_VERSION/archlinux-$ISO_VERSION-dual.iso.sig"
|
2013-02-08 14:31:19 +00:00
|
|
|
|
|
|
|
echo "Verifying dvd..."
|
2013-03-28 06:54:12 +00:00
|
|
|
gpg --import "$SCRIPTSDIR/archlinux-master-keys.asc"
|
2013-02-08 14:31:19 +00:00
|
|
|
|
2013-12-13 03:26:44 +00:00
|
|
|
gpg --verify "$CACHEDIR/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
|
2015-01-13 06:44:35 +00:00
|
|
|
mount -o loop "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" mnt_archlinux_dvd || echo "!!Error mounting iso to mnt_archlinux_dvd"
|
|
|
|
cp mnt_archlinux_dvd/arch/x86_64/airootfs.sfs $CACHEDIR/ || echo "!!Error copying root sfs file to \$CACHEDIR"
|
2013-04-28 20:50:18 +00:00
|
|
|
umount mnt_archlinux_dvd
|
2015-01-13 06:44:35 +00:00
|
|
|
mount -o loop $CACHEDIR/airootfs.sfs mnt_archlinux_dvd || echo "!!Error mounting root sfs"
|
|
|
|
cp mnt_archlinux_dvd/airootfs.img $CACHEDIR/ || echo "!!Error copying root fs file"
|
2013-04-28 20:50:18 +00:00
|
|
|
umount mnt_archlinux_dvd
|
2015-01-13 06:44:35 +00:00
|
|
|
rm $CACHEDIR/airootfs.sfs
|
2013-02-16 16:17:42 +00:00
|
|
|
fi
|