You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a noob when it comes to Linux but I know for a fact that it's possible to bootstrap any Linux OS from any other Linux OS.
I just hate the preseeding method that Debian offers with the straight useless documentation they have and the only way I can automate my Debian installation is through bootstraping (using bootstrap), which is nice and all, but having a put-together script is not like the method that ArchInstall does which by using a config file.
Even though the "Arch BTW" still won't die, I know that the best and easy OS installer ever is ArchInstall and I'd love to use to install Debian for my mini servers at home.
I just want to provide urls form ArchInstall for each of my one of machines and just watch it set them up while doing something else. This would make Arch also carry Debian users for the installation and not just their internal tools troubleshooting 😆
Also if there is a tool that does this, please point me in that direction.
I've already tinkered with the debootstrap tool as I said, I don't know how much help would be to write this small script but here it is:
#!/bin/bashprintGreen() {
printf'\033[1;32m> %s\033[0m\n'"$@">&2# bold Green
}
printRed() {
printf'\033[1;31m> %s\033[0m\n'"$@">&2# bold Red
}
[[ $(whoami)='root' ]] || printRed "Err -> you have to run the script as root"&&exit 1
mountPath=/mnt
mirror=http://ftp.es.debian.org/debian/
distribution=bookworm # 2nd half of 2025, trixi would be used here
arch=amd64
partTableType='msdos'functionsetup() {
printGreen "Pick a device:"
lsblk -dno name,size,type,mountpoint | awk '{print NR, ") ", $0}'echo""read -p 'Device number: ' deviceNumber
chosenDevice=$(lsblk -dno name,size,type,mountpoint | sed -n ${deviceNumber}p | awk '{print "/dev/" $1}')echo""
printGreen "Are you sure you want to format the device ${chosenDevice}? (y/N)"read -p "[n] : " isContinue
if [[ !$isContinue="y" ]];thenexit 0
fi
mountedPath=$(mount | grep $mountPath)if [[ -n$mountedPath ]];then
printGreen "${mountPath} is being used to mount some device; unmount it first"exit 1
fi
printGreen "removing potential old GPT label"
dd if=/dev/zero of=$chosenDevice bs=1M count=2
printGreen "Partitioning and formatting"
parted "$chosenDevice" --script mklabel "$partTableType"
parted "$chosenDevice" --script mkpart primary ext4 1MB 100%
parted "$chosenDevice" --script set 1 boot on
yes | mkfs.ext4 -L 'ROOT'"${chosenDevice}1"
mkdir -p $mountPath
printGreen "Mounting ${chosenDevice}1 to ${mountPath}"
mount "${chosenDevice}1"$mountPath# Installing debootstrap
which debootstrap
if [[ $?!= 0 ]];thenecho"debootstrap not found. Installing..."
apt-get update -y
apt-get install debootstrap -y
fi
printGreen "debootstraping..."
debootstrap --cache-dir=/home/venego/.debootstrap-cache --arch="$arch""$distribution""$mountPath""$mirror"
}
functionchrooting(){
printGreen "Setting up bindings"
mount --make-rslave --rbind /dev $mountPath/dev
mount --make-rslave --rbind /proc $mountPath/proc
mount --make-rslave --rbind /sys $mountPath/sys
mount --make-rslave --rbind /run $mountPath/run
printRed "--------- Changing rootfs to ${mountPath}"# printGreen "Adding non-free and contrib repos"# chroot $mountPath /bin/bash -c "echo 'deb http://ftp.es.debian.org/debian ${distribution} main contrib non-free-firmware' > /etc/apt/sources.list && apt update -y"
printGreen "Installing kernel and grub packages"
chroot $mountPath /bin/bash -c "apt install linux-image-amd64 firmware-linux-free network-manager grub2 -y"
printGreen "Installing grub"
chroot $mountPath /bin/bash -c "grub-install ${chosenDevice} && update-grub"
printGreen "setting password for root"# literlly repeating the password twice using echo :)
chroot $mountPath /bin/bash -c "printf "root\nroot\n" | passwd root"
printGreen "Unounting ${chosenDevice}"
umount -R $mountPath
}
functiontesting(){
testing in a VM
printGreen "Booting ${chosenDevice} in Qemu"
qemu-system-x85_64 -machine accel=kvm:tcg -m 512 -hda $chosenDevice
}
setup
chrooting
# testing
The text was updated successfully, but these errors were encountered:
describe the request
I'm a noob when it comes to Linux but I know for a fact that it's possible to bootstrap any Linux OS from any other Linux OS.
I just hate the preseeding method that Debian offers with the straight useless documentation they have and the only way I can automate my Debian installation is through bootstraping (using bootstrap), which is nice and all, but having a put-together script is not like the method that ArchInstall does which by using a config file.
Even though the "Arch BTW" still won't die, I know that the best and easy OS installer ever is ArchInstall and I'd love to use to install Debian for my mini servers at home.
I just want to provide urls form ArchInstall for each of my one of machines and just watch it set them up while doing something else. This would make Arch also carry Debian users for the installation and not just their internal tools troubleshooting 😆
Also if there is a tool that does this, please point me in that direction.
I've already tinkered with the
debootstrap
tool as I said, I don't know how much help would be to write this small script but here it is:The text was updated successfully, but these errors were encountered: