forked from lubiland/hardware-setup
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
960 B
Bash
47 lines
960 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
|
|
apt-get -y install lvm2 mdadm cryptsetup debootstrap btrfs-progs
|
|
|
|
# returns /dev/md0 as root device
|
|
# returns "$boot" as boot device
|
|
"./hardware/${1}/parted.sh" "$2"
|
|
root="hardware/${1}/root"
|
|
boot="hardware/${1}/boot"
|
|
esp="hardware/${1}/esp"
|
|
|
|
# format
|
|
chroot=/mnt/root-unlocked
|
|
"./hardware/${1}/mkfs.sh" "$chroot"
|
|
|
|
|
|
# debootstrap
|
|
|
|
debootstrap --variant=minbase --arch=amd64 trixie "$chroot" https://deb.debian.org/debian/
|
|
|
|
mount -t proc none "$chroot/proc"
|
|
mount -t sysfs none "$chroot/sys"
|
|
mount --bind /dev "$chroot/dev"
|
|
mount --bind /run "$chroot/run"
|
|
|
|
|
|
# set hostname
|
|
echo "$2" > "$chroot/etc/hostname"
|
|
hostname "$2"
|
|
|
|
|
|
# create hardware-setup copy for post-debootstrap
|
|
mkdir "$chroot/hardware-setup"
|
|
cp -a * "$chroot/hardware-setup"
|
|
|
|
chroot "$chroot" /hardware-setup/post-debootstrap-installer.sh "$1"
|
|
|
|
rm -r "$chroot/hardware-setup"
|
|
|
|
echo "Don't forget to set a password with passwd ;-)"
|
|
echo
|
|
ls authorized_keys
|
|
echo
|
|
chroot "$chroot"
|