From e8e25decb32934acf967d9ff80ad870e4d62ec52 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Oct 2017 10:07:13 +0200 Subject: Add ability to install extra packages, use to add lm-sensors/monitoring --- bootstrap | 87 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 40 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap b/bootstrap index 380ae5e..4c2834f 100755 --- a/bootstrap +++ b/bootstrap @@ -26,13 +26,46 @@ # usage="usage: $0" +macaddr="de:ad:be:ef:b8:da" # @@ TMP Mmac address for testing. + id="$(id -un)" btrfs=/btrfs +root="$btrfs/$id/buildos" + +# Source distribution and packages. Base packages are installed on stage 1 via +# debootstrap. Extra packages are added on stage 4 via apt-get install. The +# idea is to be able to add extra packages without upgrading the base system. +# When we do upgrade the base system we normally move the extras to base. +# +# Notes: +# +# - some packages (such as CPU microcode updates) are in non-free. +# - systemd-container seems to be required by host systemd-nspawn. +# - not installing linux-image-amd64 since building custom below +# release="unstable" +components="main,contrib,non-free" mirror="https://deb.debian.org/debian/" -macaddr="de:ad:be:ef:b8:da" # Mac address for testing. -root="$btrfs/$id/buildos" +base_pkgs="locales,klibc-utils,sudo,systemd-container,udev" +base_pkgs+=",kmod,linux-base,firmware-linux-free,irqbalance,pciutils,usbutils" +base_pkgs+=",intel-microcode,amd64-microcode" +base_pkgs+=",hdparm,btrfs-progs" + +base_pkgs+=",net-tools,iproute2,iptables,isc-dhcp-client" +base_pkgs+=",ifupdown,bridge-utils,dnsmasq,ntp,postfix" +base_pkgs+=",iputils-ping,wget,curl" +base_pkgs+=",openssh-client,openssh-server" +base_pkgs+=",tftp-hpa,tftpd-hpa" + +base_pkgs+=",bzip2,xz-utils" +base_pkgs+=",less,nano" + +base_pkgs+=",qemu-kvm,qemu-utils,socat" + +base_pkgs+=",g++,make,pkg-config" + +extra_pkgs="lm-sensors" owd="$(pwd)" trap "{ cd '$owd'; exit 1; }" ERR @@ -149,46 +182,13 @@ if [ "$stage" -eq "1" ]; then subvol_create "$root" - # Notes: - # - # - some packages (such as CPU microcode updates) are in non-free. - # - # - systemd-container seems to be required by host systemd-nspawn. - # - # - no linux-image-amd64 since building custom below - # - comps="main,contrib,non-free" - - pkgs="locales,klibc-utils,sudo,systemd-container,udev" - - pkgs+=",kmod,linux-base,firmware-linux-free,irqbalance,pciutils,usbutils" - - pkgs+=",intel-microcode,amd64-microcode" - - #pkgs+=",lsof,auditd" - - pkgs+=",hdparm,btrfs-progs" - - pkgs+=",net-tools,iproute2,iptables,isc-dhcp-client" - pkgs+=",ifupdown,bridge-utils,dnsmasq,ntp,postfix" - pkgs+=",iputils-ping,wget,curl" - pkgs+=",openssh-client,openssh-server" - pkgs+=",tftp-hpa,tftpd-hpa" - - pkgs+=",bzip2,xz-utils" - pkgs+=",less,nano" - - pkgs+=",qemu-kvm,qemu-utils,socat" - - pkgs+=",g++,make,pkg-config" - sudo debootstrap \ --foreign \ --arch=amd64 \ --merged-usr \ --variant=minbase \ - --components="$comps" \ - --include="$pkgs" \ + --components="$components" \ + --include="$base_pkgs" \ "$release" "$root" "$mirror" # Post-phase 1 fixups. @@ -364,7 +364,7 @@ cd linux # Adjust kernel command line size limit. # -sed -i -re 's/^(#define COMMAND_LINE_SIZE ).+$/\1 4096/' arch/x86/include/asm/setup.h +sed -i -re 's/^(#define COMMAND_LINE_SIZE ).+\$/\1 4096/' arch/x86/include/asm/setup.h make oldconfig scripts/config --disable DEBUG_INFO @@ -413,8 +413,8 @@ fi # if [ "$stage" -le "4" ]; then - # Write the setup script (the service is already there from stage 3) that - # will finish the setup. + # Write the setup script that will finish the setup (the service is already + # there from stage 3). # write <