2013-01-25 08:07:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-04-19 00:20:29 +00:00
|
|
|
set -e
|
|
|
|
|
2013-02-16 16:17:42 +00:00
|
|
|
echo "Mounting archlinux install system into mnt_archlinux_dvd..."
|
2013-04-19 00:20:53 +00:00
|
|
|
mkdir -p mnt_archlinux_dvd
|
2013-04-28 20:50:18 +00:00
|
|
|
mount $CACHEDIR/root-image.fs mnt_archlinux_dvd
|
2013-01-25 08:07:01 +00:00
|
|
|
|
|
|
|
# Note: Enable x86 repos
|
|
|
|
su -c "echo '[multilib]' >> $INSTALLDIR/etc/pacman.conf"
|
|
|
|
su -c "echo 'SigLevel = PackageRequired' >> $INSTALLDIR/etc/pacman.conf"
|
|
|
|
su -c "echo 'Include = /etc/pacman.d/mirrorlist' >> $INSTALLDIR/etc/pacman.conf"
|
2013-04-18 16:34:39 +00:00
|
|
|
|
|
|
|
echo "--> Registering Qubes custom repository"
|
|
|
|
|
2013-04-28 20:50:18 +00:00
|
|
|
cat >> $INSTALLDIR/etc/pacman.conf <<EOF
|
2014-02-16 15:20:28 +00:00
|
|
|
[qubes] # QubesTMP
|
|
|
|
SigLevel = Optional TrustAll # QubesTMP
|
|
|
|
Server = file:///mnt/qubes-rpms-mirror-repo/pkgs # QubesTMP
|
2013-04-18 16:34:39 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
export CUSTOMREPO=$PWD/yum_repo_qubes/archlinux
|
2013-04-28 20:50:18 +00:00
|
|
|
mkdir -p $INSTALLDIR/mnt/qubes-rpms-mirror-repo
|
|
|
|
mount --bind $CUSTOMREPO $INSTALLDIR/mnt/qubes-rpms-mirror-repo
|
2013-04-18 16:34:39 +00:00
|
|
|
|
2013-04-28 20:50:18 +00:00
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "cd /mnt/qubes-rpms-mirror-repo/;repo-add pkgs/qubes.db.tar.gz pkgs/*.pkg.tar.xz"
|
2013-04-18 16:34:39 +00:00
|
|
|
|
2013-04-28 20:36:51 +00:00
|
|
|
chown -R --reference=$CUSTOMREPO $CUSTOMREPO
|
|
|
|
|
2013-04-28 20:50:18 +00:00
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "pacman -Sy"
|
2013-01-25 08:07:01 +00:00
|
|
|
|
2013-04-18 16:34:39 +00:00
|
|
|
echo "--> Installing qubes-packages..."
|
2014-02-16 16:28:55 +00:00
|
|
|
# Install xinit first to allow qubes-vm-core to fix potential bugs in xinit (xinit is a dep of qubes-vm-gui)
|
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "pacman -S --noconfirm --asdeps xorg-xinit"
|
2013-04-28 20:50:18 +00:00
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "pacman -S --noconfirm qubes-vm-xen"
|
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "pacman -S --noconfirm qubes-vm-core"
|
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "pacman -S --noconfirm qubes-vm-gui"
|
2013-02-08 14:32:38 +00:00
|
|
|
|
|
|
|
echo "--> Updating template fstab file..."
|
2013-04-28 20:50:18 +00:00
|
|
|
cat >> $INSTALLDIR/etc/fstab <<EOF
|
|
|
|
/dev/mapper/dmroot / ext4 defaults,noatime 1 1
|
|
|
|
/dev/xvdb /rw ext4 defaults,noatime 1 2
|
|
|
|
/dev/xvdc1 swap swap defaults 0 0
|
|
|
|
/rw/home /home none noauto,bind,defaults 0 0
|
|
|
|
EOF
|
2013-01-25 08:07:01 +00:00
|
|
|
|
2014-02-16 15:20:28 +00:00
|
|
|
echo "--> Configuring system to our preferences"
|
|
|
|
# Name network devices using simple names (ethX)
|
|
|
|
ln -s /dev/null $INSTALLDIR/etc/udev/rules.d/80-net-name-slot.rules
|
|
|
|
# Initialize encoding to qubes standards
|
|
|
|
ln -s /etc/sysconfig/i18n $INSTALLDIR/etc/locale.conf
|
|
|
|
# Enable some locales (incl. UTF-8
|
|
|
|
sed 's/#en_US/en_US/g' -i $INSTALLDIR/etc/locale.gen
|
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "locale-gen"
|
|
|
|
|
2013-12-15 04:39:02 +00:00
|
|
|
mkdir -p $INSTALLDIR/lib/modules
|
2014-02-01 17:45:05 +00:00
|
|
|
# Creating a random file in /lib/modules to ensure that the directory in never deleted when packages are removed
|
|
|
|
touch $INSTALLDIR/lib/modules/QUBES
|
2013-12-15 04:39:02 +00:00
|
|
|
|
2013-04-18 16:34:39 +00:00
|
|
|
echo "--> Cleaning up..."
|
2013-04-28 20:50:18 +00:00
|
|
|
umount $INSTALLDIR/mnt/qubes-rpms-mirror-repo
|
|
|
|
umount mnt_archlinux_dvd
|