From c855187d6dbf7749a91d1b96aa16aee64aa08d4d Mon Sep 17 00:00:00 2001 From: weishu Date: Fri, 10 Jun 2022 13:49:01 +0800 Subject: [PATCH 1/2] updade default debian distro to bullseye: https://wiki.debian.org/DebianReleases --- androdeb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/androdeb b/androdeb index a2ee65b..50b1e96 100755 --- a/androdeb +++ b/androdeb @@ -12,7 +12,7 @@ source $spath/utils/banners source $spath/utils/remote # Set default vars -DISTRO=buster; ARCH=arm64 +DISTRO=bullseye; ARCH=arm64 ADB="adb" REMOTE="adb" FULL=0 # Default to a minimal install @@ -63,6 +63,7 @@ case $key in --sshpass) SSHPASS="sshpass -p$2"; shift || true; shift || true; ;; --build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; DOWNLOAD=0; shift || true; shift || true; ;; --debug) set -x; shift || true; ;; + --distro) DISTRO="$2"; shift || true; shift || true; ;; *) c_error "Unknown option ($1)"; usage; ;; esac done From 099709b1b969533e1871a844ef1f2641846bbb31 Mon Sep 17 00:00:00 2001 From: weishu Date: Fri, 10 Jun 2022 14:02:44 +0800 Subject: [PATCH 2/2] support mirror config --- androdeb | 4 +++- buildstrap | 3 ++- utils/banners | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/androdeb b/androdeb index 50b1e96..4bfe676 100755 --- a/androdeb +++ b/androdeb @@ -19,6 +19,7 @@ FULL=0 # Default to a minimal install DOWNLOAD=1 # Default to downloading from web SKIP_DEVICE=0 # Skip device preparation INSTALL_BCC=0 # Decide if BCC is to be installed +DEBIAN_URL=http://ftp.us.debian.org/debian/ # Default packages PACKAGES="" @@ -64,6 +65,7 @@ case $key in --build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; DOWNLOAD=0; shift || true; shift || true; ;; --debug) set -x; shift || true; ;; --distro) DISTRO="$2"; shift || true; shift || true; ;; + --mirror) DEBIAN_URL="$2"; shift || true; shift || true; ;; *) c_error "Unknown option ($1)"; usage; ;; esac done @@ -238,7 +240,7 @@ ex_files=$(mktemp); echo $EXTRA_FILES > $ex_files sudo $spath/buildstrap $ARCH $DISTRO $TDIR $OUT_TMP \ "$(make_csv "$PACKAGES")"\ - $ex_files $INSTALL_BCC $SKIP_DEVICE + $ex_files $INSTALL_BCC $SKIP_DEVICE $DEBIAN_URL rm $ex_files # If we only wanted to prepare a rootfs and don't have diff --git a/buildstrap b/buildstrap index bdbc554..c040b0b 100755 --- a/buildstrap +++ b/buildstrap @@ -13,9 +13,10 @@ EXTRA_FILES="$(cat $6)" INSTALL_BCC=$7 SKIP_DEVICE=$8 # Skip any device-specific stages VARIANT="--variant=minbase" +REPO_URL=$9 time qemu-debootstrap --arch $ARCH --include=$PACKAGES $VARIANT \ - $DISTRO $OUT_TMP http://ftp.us.debian.org/debian/ + $DISTRO $OUT_TMP $REPO_URL # Some reason debootstrap leaves these mounted umount $OUT_TMP/proc/sys/fs/binfmt_misc || true diff --git a/utils/banners b/utils/banners index 861799f..b3ef563 100755 --- a/utils/banners +++ b/utils/banners @@ -34,6 +34,8 @@ usage() { c_info "" c_info " --build-image Build an ext4 .img with the base image and BCC (useful for Qemu)" c_info "" + c_info " --mirror Specific the mirror for downloading debian images" + c_info "" c_info " ** Folowing are misc build options **" c_info " --tempdir Use a specific temporary directory for build operation" c_info " --arch Specify an ARCH to build for (default arm64)"