Skip to content

Commit

Permalink
updated wih testing
Browse files Browse the repository at this point in the history
  • Loading branch information
terem42 committed Oct 4, 2023
1 parent 3adefbf commit b0c58cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 7 additions & 9 deletions hetzner-debian12-zfs-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,8 @@ zfs create -o canmount=noauto -o mountpoint=/boot "$v_bpool_name/BOOT/debian"
zfs mount "$v_bpool_name/BOOT/debian"

zfs create "$v_rpool_name/home"
zfs create -o mountpoint=/root "$v_rpool_name/home/root"
#zfs create -o mountpoint=/root "$v_rpool_name/home/root"
zfs create -o canmount=off "$v_rpool_name/var"
zfs create -o canmount=off "$v_rpool_name/var/lib"
zfs create "$v_rpool_name/var/log"
zfs create "$v_rpool_name/var/spool"

Expand Down Expand Up @@ -800,8 +799,13 @@ export LS_OPTIONS='--color=auto -h'
eval "\$(dircolors)"
CONF

echo "========running packages upgrade==========="
echo "========= add root pubkey for login via SSH"
mkdir -p "$c_zfs_mount_dir/root/.ssh/"
cp /root/.ssh/authorized_keys "$c_zfs_mount_dir/root/.ssh/authorized_keys"

echo "========running packages upgrade and autoremove==========="
chroot_execute "apt upgrade --yes"
chroot_execute "apt autoremove --yes"

echo "===========add static route to initramfs via hook to add default routes for Hetzner due to Debian/Ubuntu initramfs DHCP bug ========="
mkdir -p "$c_zfs_mount_dir/usr/share/initramfs-tools/scripts/init-premount"
Expand Down Expand Up @@ -866,12 +870,6 @@ fi

chroot_execute "echo RESUME=none > /etc/initramfs-tools/conf.d/resume"

echo "========= add root pubkey for login via SSH"
mkdir -p "$c_zfs_mount_dir/root/.ssh/"
cp /root/.ssh/authorized_keys "$c_zfs_mount_dir/root/.ssh/authorized_keys"
echo "========= show root auth key ==========="
cat "$c_zfs_mount_dir/root/.ssh/authorized_keys"

echo "======= unmounting filesystems and zfs pools =========="
unmount_and_export_fs

Expand Down
3 changes: 1 addition & 2 deletions hetzner-ubuntu22-zfs-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,8 @@ zfs create -o canmount=noauto -o mountpoint=/boot "$v_bpool_name/BOOT/ubuntu"
zfs mount "$v_bpool_name/BOOT/ubuntu"

zfs create "$v_rpool_name/home"
zfs create -o mountpoint=/root "$v_rpool_name/home/root"
#zfs create -o mountpoint=/root "$v_rpool_name/home/root"
zfs create -o canmount=off "$v_rpool_name/var"
zfs create -o canmount=off "$v_rpool_name/var/lib"
zfs create "$v_rpool_name/var/log"
zfs create "$v_rpool_name/var/spool"

Expand Down

0 comments on commit b0c58cb

Please sign in to comment.