summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2013-05-14 09:41:47 +0200
committerAndreas Baumann <abaumann@yahoo.com>2013-05-14 09:41:47 +0200
commit3072a476604c7484073091da88b55caad68c8076 (patch)
treec3fcad4096d2806cf31290192c6eeb9b1ece4b05
parentc280c6d26cb73350be95ccb6a0110b01e3f6ff5e (diff)
downloadarchauto-3072a476604c7484073091da88b55caad68c8076.tar.gz
archauto-3072a476604c7484073091da88b55caad68c8076.tar.bz2
trying to reduce size in pacstrap
small fixes around systemd
-rw-r--r--TODOS1
-rwxr-xr-xarchauto.sh53
-rw-r--r--clean.sh7
3 files changed, 34 insertions, 27 deletions
diff --git a/TODOS b/TODOS
index cad6494..7e7ac56 100644
--- a/TODOS
+++ b/TODOS
@@ -6,4 +6,5 @@
=> libvirt needs too many packages, this is ok, if used for
a host, but not if used for an applicance, so we should have
the cfengine packages in different flavours
+- minimal installed, not pacstrap
diff --git a/archauto.sh b/archauto.sh
index 4bca008..4ef0962 100755
--- a/archauto.sh
+++ b/archauto.sh
@@ -37,50 +37,53 @@ mount ${INSTALL_DRIVE}${PARTITION_ROOT} ${MOUNT_PATH}
export http_proxy=http://192.168.1.12:3128
-pacstrap ${MOUNT_PATH} base
+pacstrap ${MOUNT_PATH} filesystem grep findutils coreutils glibc bash pacman mkinitcpio kernel26
-arch-chroot /mnt pacman --noconfirm -S grub-bios
-arch-chroot /mnt grub-install --target=i386-pc --recheck ${INSTALL_DRIVE}
-cp /mnt/usr/share/locale/en@quot/LC_MESSAGES/grub.mo /mnt/boot/grub/locale/en.mo
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="modprobe.blacklist=cirrus"/g' /mnt/etc/default/grub
-sed -i 's/GRUB_GFXMODE=auto/GRUB_GFXMODE=text/g' /mnt/etc/default/grub
-sed -i 's/#GRUB_TERMINAL_OUTPUT=console/GRUB_TERMINAL_OUTPUT=console/g' /mnt/etc/default/grub
+arch-chroot ${MOUNT_PATH} pacman --noconfirm -S grub-bios
+arch-chroot ${MOUNT_PATH} grub-install --target=i386-pc --recheck ${INSTALL_DRIVE}
+cp ${MOUNT_PATH}/usr/share/locale/en@quot/LC_MESSAGES/grub.mo ${MOUNT_PATH}/boot/grub/locale/en.mo
+# disable quiet mode, set text mode instead of graphical mode
+# also ban cirrus KVM
+# set correct path of systemd binary (symlink /sbin/init has gone)
+sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="modprobe.blacklist=cirrus init=\/usr\/lib\/systemd\/systemd"/g' ${MOUNT_PATH}/etc/default/grub
+sed -i 's/GRUB_GFXMODE=auto/GRUB_GFXMODE=text/g' ${MOUNT_PATH}/etc/default/grub
+sed -i 's/#GRUB_TERMINAL_OUTPUT=console/GRUB_TERMINAL_OUTPUT=console/g' ${MOUNT_PATH}/etc/default/grub
-arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
+arch-chroot ${MOUNT_PATH} grub-mkconfig -o /boot/grub/grub.cfg
-genfstab -p /mnt >> /mnt/etc/fstab
+genfstab -p ${MOUNT_PATH} >> ${MOUNT_PATH}/etc/fstab
-sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /mnt/etc/locale.gen
-arch-chroot /mnt locale-gen
-echo LANG=en_US.UTF-8 > /mnt/etc/locale.conf
+sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' ${MOUNT_PATH}/etc/locale.gen
+arch-chroot ${MOUNT_PATH} locale-gen
+echo LANG=en_US.UTF-8 > ${MOUNT_PATH}/etc/locale.conf
-ln -s /usr/share/zoneinfo/Europe/Zurich /mnt/etc/localtime
-arch-chroot /mnt hwclock --systohc --utc
+ln -s /usr/share/zoneinfo/Europe/Zurich ${MOUNT_PATH}/etc/localtime
+arch-chroot ${MOUNT_PATH} hwclock --systohc --utc
-echo "archiso" > /mnt/etc/hostname
+echo "archiso" > ${MOUNT_PATH}/etc/hostname
-arch-chroot /mnt systemctl enable dhcpcd@ens3.service
+arch-chroot ${MOUNT_PATH} systemctl enable dhcpcd@ens3.service
-arch-chroot /mnt sh -c "echo 'root:xx' | chpasswd"
+arch-chroot ${MOUNT_PATH} sh -c "echo 'root:xx' | chpasswd"
# switch off signature for now
-arch-chroot /mnt sed -i 's/^SigLevel.*/SigLevel = Never/g' /etc/pacman.conf
+arch-chroot ${MOUNT_PATH} sed -i 's/^SigLevel.*/SigLevel = Never/g' /etc/pacman.conf
# monitord needs netstat
-arch-chroot /mnt pacman --noconfirm -S net-tools
+arch-chroot ${MOUNT_PATH} pacman --noconfirm -S net-tools
# we use 'git' to manage our promises
-arch-chroot /mnt pacman --noconfirm -S git-core
+arch-chroot ${MOUNT_PATH} pacman --noconfirm -S git-core
-arch-chroot /mnt pacman --noconfirm -U http://10.0.2.2:8080/qdbm-1.8.78-1-x86_64.pkg.tar.xz
-arch-chroot /mnt pacman --noconfirm -U http://10.0.2.2:8080/cfengine-3.4.2-3-x86_64.pkg.tar.xz
+arch-chroot ${MOUNT_PATH} pacman --noconfirm -U http://10.0.2.2:8080/qdbm-1.8.78-1-x86_64.pkg.tar.xz
+arch-chroot ${MOUNT_PATH} pacman --noconfirm -U http://10.0.2.2:8080/cfengine-3.4.2-3-x86_64.pkg.tar.xz
# install rules for the machine from git
# enable cfengine
-arch-chroot /mnt systemctl enable cf-execd
-arch-chroot /mnt systemctl enable cf-monitord
-arch-chroot /mnt systemctl enable cf-serverd
+arch-chroot ${MOUNT_PATH} systemctl enable cf-execd
+arch-chroot ${MOUNT_PATH} systemctl enable cf-monitord
+arch-chroot ${MOUNT_PATH} systemctl enable cf-serverd
echo "Done."
diff --git a/clean.sh b/clean.sh
index b77cf1f..96da67a 100644
--- a/clean.sh
+++ b/clean.sh
@@ -1,11 +1,12 @@
# pacstrap ${MOUNT_PATH} base
# leaves us with 111 packages, 715 MB
-# 130M package cache, not needed, /var/cache/pacman/pkg/
+# 173M package cache, not needed, /var/cache/pacman/pkg/
pacman --noconfirm -Scc
+rm -rf /var/cache/pacman/pkg/*.tar.xz
# note, those things may be needed, I personally don't need them.
-pacman -Rs \
+pacman --noconfirm -Rs \
man-pages libpipeline groff man-db \
jfsutils reiserfsprogs xfsprogs \
cryptsetup lvm2
@@ -14,6 +15,8 @@ pacman -Rs \
# big dirs
#
+# 72612 /usr/lib/python2.7 (libvirt again)
+#
# locales, we don't need them on a server
# 48208 ./locale
# problematic, as we remove files belonging to a package