ubuntu-22.04.2-amd64/
├── build.sh
├── rootfs.tar.xz
├── singularity-ce_3.11.4-jammy_amd64.deb
└── ubuntu-base-22.04.2-base-amd64.tar.gz
magnet:?xt=urn:btih:003cfd64f035174bc5b9235db87143123e0c6b03&dn=ubuntu-22.04.2-amd64&tr=http%3A%2F%2Fbt.ezhpc.com%3A7788%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=http%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce
#! /bin/bash
ROOTFS=m
mkdir -p $ROOTFS
tar xf ubuntu-base-22.04.2-base-amd64.tar.gz -C $ROOTFS
rm -f $ROOTFS/etc/resolv.conf
echo nameserver 114.114.114.114 > $ROOTFS/etc/resolv.conf
mount -o bind /dev $ROOTFS/dev
mount -t proc none $ROOTFS/proc
cp *.deb $ROOTFS/tmp/
cat <<EOT | chroot $ROOTFS
apt update
apt -y install \
bash openssh-server openssh-client \
locales less flex bison tmux screen \
ntfs-3g xfsprogs gdisk parted curl socat nfs-common \
pciutils htop perl python3 psmisc strace lsof \
rdma-core infiniband-diags iproute2 net-tools \
traceroute inetutils-ping busybox rsyslog vim \
bridge-utils build-essential ipmitool \
isc-dhcp-client dstat fdisk gawk lshw \
linux-image-5.15.0-75-generic \
linux-headers-5.15.0-75 \
linux-headers-5.15.0-75-generic \
linux-modules-extra-5.15.0-75-generic
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
update-locale "LANG=en_US.UTF-8"
locale-gen --purge "en_US.UTF-8"
dpkg-reconfigure --frontend noninteractive locales
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends tzdata
DEBIAN_FRONTEND=noninteractive apt -y install /tmp/*.deb
apt clean all
passwd -d root
EOT
umount $ROOTFS/dev
umount $ROOTFS/proc
echo -n > $ROOTFS/root/.bash_history
rm -rf $ROOTFS/tmp/*