From 860b1892a0e9c3b8f33c1428c6f38546995e5d11 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 13 Sep 2022 08:05:54 +0200 Subject: WIP --- .gitignore | 6 +++--- bootstrap | 27 +++++++++++++++++++++------ bootstrap.txt | 10 ++++++++-- buildos | 6 +++++- upload-os | 24 ++++++++++++++++++++++-- 5 files changed, 59 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 0158dea..46a102d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.cpio.gz -buildos-buildid -buildos-initrd -buildos-image +buildos-buildid-* +buildos-initrd-* +buildos-image-* bootstrap*.log diff --git a/bootstrap b/bootstrap index 2b6230a..b32a931 100755 --- a/bootstrap +++ b/bootstrap @@ -281,9 +281,18 @@ rm /etc/localtime # Both nspawn and debootstrap try to mount /proc /sys (Debian bug#840372). # -mkdir /tmp/proc /tmp/sys -mount --move /proc /tmp/proc -mount --move /sys /tmp/sys +# @@ TMP this now causes issues with newer systemd. +# +#mkdir /tmp/proc /tmp/sys +#mount --move /proc /tmp/proc +#mount --move /sys /tmp/sys + +# systemd-nspawn "helpfully" creates a /lib64 symlink that then trips +# up is-usr-merged package (Debain bug #1019575). +# +if [ $arch = aarch64 ]; then + rm /lib64 +fi # Run second stage of debootstrap. # @@ -474,6 +483,12 @@ scripts/config --disable INIT_STACK_ALL_ZERO scripts/config --enable DEBUG_INFO_NONE scripts/config --disable DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT +# aarch64/5.19 additions: +# +scripts/config --disable KCOV +scripts/config --disable SHADOW_CALL_STACK +scripts/config --disable VIDEO_ADV7511 + # Disable sound subsystem/drivers. # sed -i -re '/^CONFIG_SND_.+/d' .config @@ -685,12 +700,12 @@ etc/systemd/system/multi-user.target.wants/buildos.service EOF cd "$owd" - cat buildos-rootfs.cpio.gz buildos-init.cpio.gz >buildos-initrd + cat buildos-rootfs.cpio.gz buildos-init.cpio.gz >"buildos-initrd-$arch" # Copy the kernel image next to the initramfs for convenience. # - cp "$root/vmlinuz" buildos-image - echo "$buildid" >buildos-buildid + cp "$root/vmlinuz" "buildos-image-$arch" + echo "$buildid" >"buildos-buildid-$arch" subvol_snapshot -r "$root" "$root-6" fi diff --git a/bootstrap.txt b/bootstrap.txt index 5489a72..e9963fa 100644 --- a/bootstrap.txt +++ b/bootstrap.txt @@ -4,7 +4,7 @@ - systemd - qemu-system-x86 - - linux-image-amd64 + - linux-image-amd64 & btrfs-progs - g++ If some of them are very recent (and thus likely to still have issues) @@ -31,7 +31,10 @@ not to conflate failures. * Upgrade to latest debootstrap and debian-archive-keyring from unstable - (or testing). + (or testing). Other required host packages: + + uuid-runtime (uuidgen) + systemd-container (systemd-nspawn) * Note: as of latest attempt, bootstrap over https was still broken. @@ -52,3 +55,6 @@ * Compare sizes to previous version for any abnormalities (if a lot larger, check if GCC executables are stripped). + +* After deployment, test VM upload/removal scripts (there are often issues + after upgrading to new btrfs-progs). diff --git a/buildos b/buildos index 2d8d043..221e781 100755 --- a/buildos +++ b/buildos @@ -29,6 +29,8 @@ function error () exit 1 } +arch="$(uname -m)" + # Network timeouts: 60 seconds to connect, 10 minutes to complete, 4 retries # (5 attempts total). These are similar to bbot timeouts. Note that the # toolchain archives can be quite sizable. @@ -122,7 +124,9 @@ function restart () sudo systemctl reboot } -if [ -z "$buildid_url" ]; then +if [ -n "$buildid_url" ]; then + buildid_url="$buildid_url-$arch" +else info "no buildos.buildid_url specified, not monitoring for new os builds" fi diff --git a/upload-os b/upload-os index b573806..dcf295f 100755 --- a/upload-os +++ b/upload-os @@ -5,7 +5,7 @@ # If the tftp server host is not specified, then build@build-cache is # assumed. The images are uploaded to /var/lib/tftpboot/buildos-devel/. # -usage="usage: $0 [@]" +usage="usage: $0 [-a ] [@]" owd="$(pwd)" trap "{ cd '$owd'; exit 1; }" ERR @@ -14,6 +14,26 @@ set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } +arch= + +while [ "$#" -gt 0 ]; do + case "$1" in + -a) + shift + arch="$1" + shift + break + ;; + *) + break + ;; + esac +done + +if [ -z "$arch" ]; then + arch="$(uname -m)" +fi + if [ -z "$1" ]; then host="build@build-cache" else @@ -25,5 +45,5 @@ fi # is a bit more disk space used to temporarily hold copies. # rsync -v --progress -lpt -c --copy-unsafe-links --delay-updates \ - buildos-image buildos-initrd buildos-buildid \ + "buildos-image-$arch" "buildos-initrd-$arch" "buildos-buildid-$arch" \ $host:/var/lib/tftpboot/buildos-devel/ -- cgit v1.1