From 79b3dbd5c747d3b7f3512d57b93a4fc97def5206 Mon Sep 17 00:00:00 2001 From: fithwum Date: Mon, 7 Jul 2025 18:10:51 -0700 Subject: [PATCH] test --- .gitea/workflows/base-build.yml | 58 ++++++++++++++++++++------------- .gitea/workflows/file.txt | 30 +++++++++++++++++ 2 files changed, 65 insertions(+), 23 deletions(-) create mode 100644 .gitea/workflows/file.txt diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index f72e5d8..995206e 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -44,33 +44,45 @@ jobs: docker run --rm --privileged \ -v "$(pwd)":/output \ fithwum/debian-$version-base \ - bash base-image-script/debian-${version}-pt1.sh + bash -euxc " + DEBIAN_RELEASE='$version' + ROOTFS_DIR='debian-${version}' - TARBALL="debian-${version}.tar.bz2" - if [ -f "$TARBALL" ]; then - mkdir -p "./$version" - mv "$TARBALL" "./$version/" - echo "[INFO] Moved $TARBALL to $version/" - else - echo "[ERROR] Expected tarball not found at ./$TARBALL" - exit 1 - fi + echo '[INFO] Bootstrapping Debian $DEBIAN_RELEASE rootfs...' + apt-get update + apt-get install -y --no-install-recommends debootstrap bzip2 - echo "[DEBUG] Checking host output dir: ./$version" - ls -lh "./$version" || echo "[WARN] No folder or files in ./$version" - done + debootstrap --verbose --variant=minbase --components=main,contrib,non-free --include=apt,ca-certificates --arch=amd64 \"\$DEBIAN_RELEASE\" \"\$ROOTFS_DIR\" http://deb.debian.org/debian/ - # for version in "${versions[@]}"; do - # docker build --build-arg VERSION=$version -t fithwum/debian-$version-base . - - # docker run --rm --privileged \ - # -v "$(pwd)":/output \ - # fithwum/debian-$version-base \ - # bash base-image-script/debian-${version}_pt1.sh + for dir in dev dev/pts proc sys; do + mount --bind \"/\$dir\" \"\$ROOTFS_DIR/\$dir\" + done - # echo "[DEBUG] Checking host output dir: ./$version" - # ls -lh "./$version" || echo "[WARN] No folder or files in ./$version" - # done + echo '[CHROOT] Configuring Debian system...' + chroot \"\$ROOTFS_DIR\" /bin/bash -c \" + echo 'APT::Get::Assume-Yes \\\"true\\\";' > /etc/apt/apt.conf.d/10-assume_yes + apt-get update + apt-get upgrade + apt-get install --no-install-recommends software-properties-common bash wget curl nano locales + echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen + locale-gen + update-locale LANG=en_US.UTF-8 + apt-get remove --purge --allow-remove-essential pinentry-curses whiptail kmod iptables iproute2 dmidecode || true + apt-get clean + apt-get install -f + find /var/lib/apt/lists/ -type f -delete + \" + + echo '[INFO] Unmounting system directories (ignore errors)...' + for dir in sys proc dev/pts dev; do + umount -lf \"\$ROOTFS_DIR/\$dir\" 2>/dev/null || true + done + + echo '[INFO] Creating compressed base image...' + TARBALL=\"/output/debian-\$DEBIAN_RELEASE.tar.bz2\" + tar -cjf \"\$TARBALL\" -C \"\$ROOTFS_DIR\" . + echo '[INFO] Tarball ready for CI to upload: \$TARBALL' + " - name: List output archives run: | diff --git a/.gitea/workflows/file.txt b/.gitea/workflows/file.txt new file mode 100644 index 0000000..3338ad4 --- /dev/null +++ b/.gitea/workflows/file.txt @@ -0,0 +1,30 @@ + # docker run --rm --privileged \ + # -v "$(pwd)":/output \ + # fithwum/debian-$version-base \ + # bash base-image-script/debian-${version}-pt1.sh + + # TARBALL="debian-${version}.tar.bz2" + # if [ -f "$TARBALL" ]; then + # mkdir -p "./$version" + # mv "$TARBALL" "./$version/" + # echo "[INFO] Moved $TARBALL to $version/" + # else + # echo "[ERROR] Expected tarball not found at ./$TARBALL" + # exit 1 + # fi + + # echo "[DEBUG] Checking host output dir: ./$version" + # ls -lh "./$version" || echo "[WARN] No folder or files in ./$version" + # done + + # for version in "${versions[@]}"; do + # docker build --build-arg VERSION=$version -t fithwum/debian-$version-base . + + # docker run --rm --privileged \ + # -v "$(pwd)":/output \ + # fithwum/debian-$version-base \ + # bash base-image-script/debian-${version}_pt1.sh + + # echo "[DEBUG] Checking host output dir: ./$version" + # ls -lh "./$version" || echo "[WARN] No folder or files in ./$version" + # done \ No newline at end of file