curl https://dl.hpc.market/liniti/24.04/ubuntu-base-24.04.2-base-amd64.tar.gz | tar zxf -
rm -f etc/resolv.conf
echo nameserver 119.29.29.29 > etc/resolv.conf
mount -o bind /dev dev
mount -t proc none proc
cat << 'EOF' | chroot . 
apt -y update
apt install -y iw wireless-tools wpasupplicant fdisk gdisk parted \
build-essential extlinux lvm2 extlinux e2fsprogs xfsprogs runit \
linux-headers-6.8.0-60 linux-headers-6.8.0-60-generic \
linux-image-6.8.0-60-generic linux-modules-extra-6.8.0-60-generic \
bridge-utils socat nmap htop lsof strace isc-dhcp-client \
lm-sensors openssh-server openssh-client mdadm kexec-tools \
net-tools ipmitool tmux screen wireguard-tools vim lshw \
iptables ebtables curl wget libarchive-tools cpio make \
autoconf automake cmake flex bison nfs-common ipset \
iputils-ping libelf-dev infiniband-diags nfs-kernel-server \
qemu-system-x86 libguestfs-tools cloud-guest-utils numactl
apt clean all
passwd -d root
EOF
umount proc
umount dev
rm -rf *.*merged
> root/.bash_history
find etc/systemd/ |grep grub |xargs rm
find lib/modules/6.8.0-60-generic/ -name *.zst |xargs -n 1 unzstd --rm
depmod -b . 6.8.0-60-generic
mv boot/vmlinuz-6.8.0-60-generic ..
rm -f boot/vmlinuz* boot/initrd.img*
tar cf ../rootfs.tar .
