aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-06-25 17:49:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-06-25 17:49:37 +0200
commit76fb46699ea35ef8bfce9c531e30ae4d031c45cb (patch)
tree4e3cf8f96abb00fc949dae3c8bc8c4e0e84bab71
parent2216352a60686fb5b79c82bc49fe2a7f621a4d0e (diff)
Upgrade to latest Debian unstable for 0.8.0 series
-rwxr-xr-xbootstrap25
-rw-r--r--bootstrap.txt10
-rw-r--r--doc/manual.cli11
-rwxr-xr-xinit13
4 files changed, 49 insertions, 10 deletions
diff --git a/bootstrap b/bootstrap
index a898be4..78dd42e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -26,7 +26,7 @@
#
usage="usage: $0"
-macaddr="de:ad:be:ef:b8:da" # @@ TMP Mmac address for testing.
+macaddr="de:ad:be:ef:b8:da" # @@ TMP mac address for testing.
id="$(id -un)"
btrfs=/btrfs
@@ -45,12 +45,14 @@ root="$btrfs/$id/buildos"
#
release="unstable"
components="main,contrib,non-free"
-mirror="https://deb.debian.org/debian/"
+mirror="http://deb.debian.org/debian/"
+#mirror="https://deb.debian.org/debian/"
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+=",lm-sensors"
base_pkgs+=",net-tools,iproute2,iptables,isc-dhcp-client"
base_pkgs+=",ifupdown,bridge-utils,dnsmasq,ntp,postfix"
@@ -65,7 +67,7 @@ base_pkgs+=",qemu-kvm,qemu-utils,socat"
base_pkgs+=",g++,make,pkg-config"
-extra_pkgs="lm-sensors"
+extra_pkgs="ca-certificates,smartmontools"
owd="$(pwd)"
trap "{ cd '$owd'; exit 1; }" ERR
@@ -242,7 +244,11 @@ mount --move /sys /tmp/sys
# Run second stage of debootstrap.
#
-/debootstrap/debootstrap --second-stage
+if ! /debootstrap/debootstrap --second-stage; then
+ cat /debootstrap/debootstrap.log 1>&2
+ bash
+ exit 1
+fi
rm -f /etc/localtime
cp /usr/share/zoneinfo/UTC /etc/localtime
@@ -364,12 +370,19 @@ set -x
#
apt-get update
apt-get install -y build-essential linux-source
+apt-get install -y bison flex
+apt-get install -y libelf-dev
+apt-get install -y libssl-dev
cd /usr/src
tar xf linux-source-*
mv linux-source-*/ linux
xzcat linux-config-*/config.amd64_none_amd64.xz >linux/.config
cd linux
+# Adjust configuration.
+#
+echo 'CONFIG_SYSTEM_TRUSTED_KEYS=""' >>.config
+
# Adjust kernel command line size limit.
#
sed -i -re 's/^(#define COMMAND_LINE_SIZE ).+\$/\1 4096/' arch/x86/include/asm/setup.h
@@ -437,6 +450,10 @@ for p in \$(sed -e 's/,/ /g' <<<"$extra_pkgs"); do
apt-get install -y --no-install-recommends "\$p"
done
+# We want the utility (smartctl) but not the daemon.
+#
+systemctl disable smartd
+
# 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
diff --git a/bootstrap.txt b/bootstrap.txt
index 18c7af2..c7f0bf1 100644
--- a/bootstrap.txt
+++ b/bootstrap.txt
@@ -15,3 +15,13 @@
diff -urw <old> <new>
We currently only use init plus udev in scripts/init-{top,bottom}
+
+* Upgrade to latest debootstrap/keyrings from unstable.
+
+* Note: as of latest attempt, bootstrap of https was still broken
+
+* Bootstrap:
+
+ ./bootstrap 2>&1 | tee bootstrap.log
+
+* Compare sizes to previous version for any abnormalities.
diff --git a/doc/manual.cli b/doc/manual.cli
index 3d9e011..5c1ba3c 100644
--- a/doc/manual.cli
+++ b/doc/manual.cli
@@ -553,13 +553,18 @@ build host.
\h#machines-login|Logging into a Machine|
A running QEMU/KVM machine (that is, one being bootstrapped or used for
-building) can be accessed with a VNC client. @@ TODO
+building) can be accessed with a VNC client. Clients based on \c{gtk-vnc},
+such as \c{vinagre}, are known to work reasonably well. For example:
\
-echo cont | ssh build@build socat - UNIX-CONNECT:/tmp/<toolchain>-monitor
+ssh -f -L 5901:127.0.0.1:5901 build@build sleep 1 && vinagre 127.0.0.1:5901
\
+If the machine has been suspended, it can be resumed using the following
+command:
+
\
-ssh -f -L 5901:127.0.0.1:5901 build@build sleep 1 && vncviewer 127.0.0.1:5901
+echo cont | ssh build@build socat - UNIX-CONNECT:/tmp/<toolchain>-monitor
\
+
"
diff --git a/init b/init
index 2910791..672c9f1 100755
--- a/init
+++ b/init
@@ -298,9 +298,6 @@ while read l || [ -n "$l" ]; do
info "mounting $d (buildos.state) on /state as $t"
- o="defaults,noatime,nodiratime"
- echo "$d /state $t $o 0 0" >>$fstab
-
# Check it.
#
if ! fsck -n -t "$t" "$d"; then
@@ -308,6 +305,9 @@ while read l || [ -n "$l" ]; do
error
fi
+ o="defaults,noatime,nodiratime"
+ echo "$d /state $t $o 0 0" >>$fstab
+
# Mount it now since we need it below.
#
mkdir -p "/state"
@@ -348,6 +348,13 @@ while read l || [ -n "$l" ]; do
info "mounting $d (buildos.$l) on $m"
+ # Check it.
+ #
+ if ! btrfs check -p "$d"; then
+ info "$d (buildos.$l) has errors; run btrfs check -p --repair $d"
+ error
+ fi
+
o="defaults,noatime,nodiratime,user_subvol_rm_allowed"
echo "$d $m btrfs $o 0 0" >>$fstab