aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap63
1 files changed, 29 insertions, 34 deletions
diff --git a/bootstrap b/bootstrap
index a691245..e7aaf15 100755
--- a/bootstrap
+++ b/bootstrap
@@ -28,8 +28,6 @@
#
usage="usage: $0"
-macaddr="de:ad:be:ef:b8:da" # @@ TMP mac address for testing.
-
id="$(id -un)"
btrfs=/btrfs
root="$btrfs/$id/buildos"
@@ -431,6 +429,7 @@ cd linux
#
# Note that SECURITY_LOCKDOWN_LSM forces MODULE_SIG ('selects' in Kconfig).
#
+scripts/config --disable KCSAN
scripts/config --disable SECURITY_LOCKDOWN_LSM
scripts/config --disable MODULE_SIG
scripts/config --set-str BUILD_SALT ''
@@ -438,7 +437,27 @@ scripts/config --set-str SYSTEM_TRUSTED_KEYS ''
# 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
+sed -i -re 's/^(#define COMMAND_LINE_SIZE).+\$/\1 4096/' arch/arm64/include/uapi/asm/setup.h
+
+# Change certain network diagnostics from pr_info() to pr_debug() (otherwise
+# to drowns out any useful diagnostics).
+#
+patch net/core/dev.c <<EOP
+@@ -0 +0 @@
+- pr_info("device %s %s promiscuous mode\n",
++ pr_debug("device %s %s promiscuous mode\n",
+EOP
+patch net/bridge/br_stp.c <<EOP
+@@ -0 +0 @@
+- br_info(p->br, "port %u(%s) entered %s state\n",
++ br_debug(p->br, "port %u(%s) entered %s state\n",
+EOP
+patch net/ipv6/addrconf.c <<EOP
+@@ -0 +0 @@
+- pr_info("ADDRCONF(NETDEV_CHANGE): %s: link becomes ready\n",
++ pr_debug("ADDRCONF(NETDEV_CHANGE): %s: link becomes ready\n",
+EOP
#bash
make oldconfig
@@ -446,7 +465,7 @@ make oldconfig
scripts/config --disable DEBUG_INFO
make clean
-make deb-pkg LOCALVERSION=-buildos KDEB_PKGVERSION=1 -j 8
+make deb-pkg LOCALVERSION=-buildos KDEB_PKGVERSION=1-1 -j 8
# Clean up and shutdown.
#
@@ -525,9 +544,14 @@ echo "build ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/build
echo "Defaults:build !syslog" >>/etc/sudoers.d/build
chmod 0440 /etc/sudoers.d/build
-# Clean up package cache.
+# Clean up package cache and fetched repository information.
#
apt-get clean
+rm -rf /var/lib/apt/lists
+
+# Strip GCC executables (Debian bug #998841).
+#
+strip \$(find /usr/lib/gcc -type f -executable)
# Clean up /bootstrap.
#
@@ -614,32 +638,3 @@ EOF
subvol_snapshot -r "$root" "$root-6"
fi
-
-exit 0
-
-# Test.
-#
-if [ ! -e /tmp/buildos-state ]; then
- qemu-img create -f raw /tmp/buildos-state 20M
-fi
-
-if [ ! -e /tmp/buildos-machines ]; then
- qemu-img create -f raw /tmp/buildos-machines 100M
-fi
-
-# To test PXE boot, replace -kernel/-initrd/-append with '-boot n'.
-#
-sudo kvm \
- -m 16G \
- -cpu host -smp "sockets=1,cores=4,threads=2" \
- -device "e1000,netdev=net0,mac=$macaddr" \
- -netdev "tap,id=net0,script=./qemu-ifup" \
- -device "virtio-scsi-pci,id=scsi" \
- -device "scsi-hd,drive=disk1" \
- -drive "if=none,id=disk1,file=/tmp/buildos-state,format=raw" \
- -device "scsi-hd,drive=disk2" \
- -drive "if=none,id=disk2,file=/tmp/buildos-machines,format=raw" \
- -boot n
-
-# -kernel buildos-image -initrd buildos-initrd \
-# -append "buildos.smtp_relay=build2.org buildos.admin_email=admin@build2.org"