template-builder: creation of script for archlinux template building.

Note: the template build successfully but has not been tested.

Note: the livecd should be verified before building the template (Checksum/PGP)
This commit is contained in:
Olivier Medoc 2013-01-25 09:07:01 +01:00 committed by Marek Marczykowski
parent 588a55f0a6
commit 13c8c08d29
10 changed files with 116 additions and 0 deletions

10
scripts_archlinux/00_prepare.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
echo "Downloading Archlinux dvd..."
wget -O "archlinux.iso" "http://mir.archlinux.fr/iso/latest/arch/x86_64/root-image.fs.sfs" --continue
echo "Extracting squash filesystem from DVD..."
mkdir archlinux_dvd
sudo mount -o loop archlinux.iso archlinux_dvd
cp archlinux_dvd/root-image.fs .
sudo umount archlinux_dvd

View File

@ -0,0 +1,23 @@
#!/bin/sh
echo "Mounting archlinux install system into archlinux_dvd..."
sudo mount root-image.fs archlinux_dvd
echo "Creating chroot bootstrap environment"
sudo mount --bind $INSTALLDIR archlinux_dvd/mnt
sudo cp /etc/resolv.conf archlinux_dvd/etc
echo "-> Initializing pacman keychain"
sudo ./archlinux_dvd/usr/bin/arch-chroot archlinux_dvd/ pacman-key --init
sudo ./archlinux_dvd/usr/bin/arch-chroot archlinux_dvd/ pacman-key --populate
echo "-> Installing core pacman packages..."
sudo ./archlinux_dvd/usr/bin/arch-chroot archlinux_dvd/ sh -c 'pacstrap /mnt base'
echo "-> Cleaning up bootstrap environment"
sudo umount archlinux_dvd/mnt
sudo umount archlinux_dvd
cp scripts_"${DIST}"/resolv.conf $INSTALLDIR/etc

View File

@ -0,0 +1,11 @@
#!/bin/sh
echo "Mounting archlinux install system into archlinux_dvd..."
sudo mount root-image.fs archlinux_dvd
echo "-> Installing archlinux package groups..."
echo "-> Selected packages:"
echo "$PKGGROUPS"
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --needed --noconfirm -S $PKGGROUPS
sudo umount archlinux_dvd

View File

@ -0,0 +1,28 @@
#!/bin/sh
echo "Mounting archlinux install system into archlinux_dvd..."
sudo mount root-image.fs archlinux_dvd
echo $INSTALLDIR
echo "--> Installing yaourt..."
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c 'cd tmp && wget https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz && tar xzvf package-query.tar.gz && cd package-query && makepkg --asroot && pacman --noconfirm -U package-query-*.pkg.tar.xz'
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c 'cd tmp && wget https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz && tar xzvf yaourt.tar.gz && cd yaourt && makepkg --asroot && pacman --noconfirm -U yaourt-*.pkg.tar.xz'
echo "--> Preparing build environment inside the chroot..."
# Notes for qubes-vm-xen
# Note: we need more ram for /tmp (at least 700M of disk space for compiling XEN because of the sources...)
sudo sed 's:-t tmpfs -o mode=1777,strictatime,nodev,:-t tmpfs -o size=700M,mode=1777,strictatime,nodev,:' -i ./archlinux_dvd/usr/bin/arch-chroot
# 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"
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "pacman -Sy"
echo "--> Compiling and installing qubes-packages..."
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "yaourt --noconfirm -S qubes-vm-xen"
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "yaourt --noconfirm -S qubes-vm-core"
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR sh -c "yaourt --noconfirm -S qubes-vm-gui"
sudo umount archlinux_dvd

24
scripts_archlinux/09_cleanup.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
echo "Mounting archlinux install system into archlinux_dvd..."
sudo mount root-image.fs archlinux_dvd
echo "--> Starting cleanup actions"
# Remove unused packages and their dependencies (make dependencies)
cleanuppkgs=`sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman -Qdt | cut -d " " -f 1`
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Rsc $cleanuppkgs
# Remove yaourt dependencies
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Rsc binutils yajl gcc make
# Clean pacman cache
sudo ./archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Scc
sudo umount archlinux_dvd
#rm -f $INSTALLDIR/var/lib/rpm/__db.00* $INSTALLDIR/var/lib/rpm/.rpm.lock
#yum -c $PWD/yum.conf $YUM_OPTS clean packages --installroot=$INSTALLDIR
# Make sure that rpm database has right format (for rpm version in template, not host)
#echo "--> Rebuilding rpm database..."
#chroot `pwd`/mnt /bin/rpm --rebuilddb 2> /dev/null

Binary file not shown.

View File

@ -0,0 +1 @@
NETWORKING=yes

View File

@ -0,0 +1,18 @@
xorg
xterm
python2
artwiz-fonts
ethtool
font-bitstream-speedo
jdk7-openjdk
leafpad
net-tools
sudo
ttf-dejavu
ttf-freefont
wget
zsh
binutils
yajl
gcc
make

BIN
scripts_archlinux/part.bin Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
# This file intentionally left blank