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:
parent
588a55f0a6
commit
13c8c08d29
10
scripts_archlinux/00_prepare.sh
Executable file
10
scripts_archlinux/00_prepare.sh
Executable 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
|
23
scripts_archlinux/01_install_core.sh
Executable file
23
scripts_archlinux/01_install_core.sh
Executable 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
|
11
scripts_archlinux/02_install_groups.sh
Executable file
11
scripts_archlinux/02_install_groups.sh
Executable 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
|
28
scripts_archlinux/04_install_qubes.sh
Executable file
28
scripts_archlinux/04_install_qubes.sh
Executable 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
24
scripts_archlinux/09_cleanup.sh
Executable 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
|
BIN
scripts_archlinux/clean-volatile.img.tar
Normal file
BIN
scripts_archlinux/clean-volatile.img.tar
Normal file
Binary file not shown.
1
scripts_archlinux/network
Normal file
1
scripts_archlinux/network
Normal file
@ -0,0 +1 @@
|
|||||||
|
NETWORKING=yes
|
18
scripts_archlinux/packages.list
Normal file
18
scripts_archlinux/packages.list
Normal 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
BIN
scripts_archlinux/part.bin
Normal file
Binary file not shown.
1
scripts_archlinux/resolv.conf
Normal file
1
scripts_archlinux/resolv.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
# This file intentionally left blank
|
Loading…
Reference in New Issue
Block a user