diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-12 10:07:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-12 10:07:13 +0200 |
commit | e8e25decb32934acf967d9ff80ad870e4d62ec52 (patch) | |
tree | 7082b0e5cfe7298ad8c1e84041ad4baf3f1afebe /bootstrap | |
parent | c15d3d5be4011f9bfc7e36fb1629529c1eb2e009 (diff) |
Add ability to install extra packages, use to add lm-sensors/monitoring
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 87 |
1 files changed, 47 insertions, 40 deletions
@@ -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 <<EOF /bootstrap/setup #!/bin/bash @@ -422,6 +422,13 @@ if [ "$stage" -le "4" ]; then trap "exit 1" ERR set -x +# Install extra packages. +# +apt-get update +for p in \$(sed -e 's/,/ /g' <<<"$extra_pkgs"); do + apt-get install -y --no-install-recommends "\$p" +done + # Create the build user, /build home directory. Make a password-less sudo'er. # # Note that we force UID/GID to specific numbers to make sure they are |