mirror of
https://github.com/terem42/zfs-hetzner-vm.git
synced 2025-12-23 15:28:33 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75cfc601d8 |
@@ -450,7 +450,6 @@ function unmount_and_export_fs {
|
|||||||
|
|
||||||
#################### MAIN ################################
|
#################### MAIN ################################
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
export NCURSES_NO_UTF8_ACS=1
|
|
||||||
|
|
||||||
check_prerequisites
|
check_prerequisites
|
||||||
|
|
||||||
@@ -492,19 +491,10 @@ done
|
|||||||
|
|
||||||
echo "======= installing zfs on rescue system =========="
|
echo "======= installing zfs on rescue system =========="
|
||||||
echo "zfs-dkms zfs-dkms/note-incompatible-licenses note true" | debconf-set-selections
|
echo "zfs-dkms zfs-dkms/note-incompatible-licenses note true" | debconf-set-selections
|
||||||
cd "$(mktemp -d)"
|
|
||||||
wget "$(curl -Ls https://api.github.com/repos/openzfs/zfs/releases/latest| grep "browser_download_url.*tar.gz"|grep -E "tar.gz\"$"| cut -d '"' -f 4)"
|
|
||||||
apt update
|
|
||||||
apt install libssl-dev uuid-dev zlib1g-dev libblkid-dev -y
|
|
||||||
tar xfv zfs*.tar.gz
|
|
||||||
rm *.tar.gz
|
|
||||||
cd zfs*
|
|
||||||
./configure
|
|
||||||
make -j "$(nproc)"
|
|
||||||
make install
|
|
||||||
ldconfig
|
|
||||||
modprobe zfs
|
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install --yes -t buster-backports libelf-dev zfs-dkms
|
||||||
|
modprobe zfs
|
||||||
zfs --version
|
zfs --version
|
||||||
|
|
||||||
echo "======= partitioning the disk =========="
|
echo "======= partitioning the disk =========="
|
||||||
@@ -794,6 +784,18 @@ if [[ $v_encrypt_rpool == "1" ]]; then
|
|||||||
rm -rf "$c_zfs_mount_dir/etc/dropbear-initramfs/dropbear_dss_host_key"
|
rm -rf "$c_zfs_mount_dir/etc/dropbear-initramfs/dropbear_dss_host_key"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#cd "$c_zfs_mount_dir/root"
|
||||||
|
#wget http://ftp.de.debian.org/debian/pool/main/libt/libtommath/libtommath1_1.1.0-3_amd64.deb
|
||||||
|
#wget http://ftp.de.debian.org/debian/pool/main/d/dropbear/dropbear-bin_2018.76-5_amd64.deb
|
||||||
|
#wget http://ftp.de.debian.org/debian/pool/main/d/dropbear/dropbear-initramfs_2018.76-5_all.deb
|
||||||
|
|
||||||
|
#chroot_execute "dpkg -i /root/libtommath1_1.1.0-3_amd64.deb"
|
||||||
|
#chroot_execute "dpkg -i /root/dropbear-bin_2018.76-5_amd64.deb"
|
||||||
|
#chroot_execute "dpkg -i /root/dropbear-initramfs_2018.76-5_all.deb"
|
||||||
|
|
||||||
|
#rm $c_zfs_mount_dir/root/*.deb
|
||||||
|
#cd /root
|
||||||
|
|
||||||
echo "============setup root prompt============"
|
echo "============setup root prompt============"
|
||||||
cat > "$c_zfs_mount_dir/root/.bashrc" <<CONF
|
cat > "$c_zfs_mount_dir/root/.bashrc" <<CONF
|
||||||
export PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;32m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
|
export PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;32m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
|
||||||
@@ -805,31 +807,8 @@ CONF
|
|||||||
echo "========running packages upgrade==========="
|
echo "========running packages upgrade==========="
|
||||||
chroot_execute "apt upgrade --yes"
|
chroot_execute "apt upgrade --yes"
|
||||||
|
|
||||||
echo "===========add static route to initramfs via hook to add default routes for Hetzner due to Debian/Ubuntu initramfs DHCP bug ========="
|
#echo "===========add static route to initramfs via hook to add default routes due to initramfs DHCP bug ========="
|
||||||
mkdir -p "$c_zfs_mount_dir/usr/share/initramfs-tools/scripts/init-premount"
|
# removed
|
||||||
cat > "$c_zfs_mount_dir/usr/share/initramfs-tools/scripts/init-premount/static-route" <<'CONF'
|
|
||||||
#!/bin/sh
|
|
||||||
PREREQ=""
|
|
||||||
prereqs()
|
|
||||||
{
|
|
||||||
echo "$PREREQ"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. /scripts/functions
|
|
||||||
# Begin real processing below this line
|
|
||||||
|
|
||||||
configure_networking
|
|
||||||
|
|
||||||
ip route add 172.31.1.1/255.255.255.255 dev ens3
|
|
||||||
ip route add default via 172.31.1.1 dev ens3
|
|
||||||
CONF
|
|
||||||
|
|
||||||
echo "======= update initramfs =========="
|
echo "======= update initramfs =========="
|
||||||
chroot_execute "update-initramfs -u -k all"
|
chroot_execute "update-initramfs -u -k all"
|
||||||
|
|||||||
@@ -491,18 +491,28 @@ for kver in $(find /lib/modules/* -maxdepth 0 -type d | grep -v "$(uname -r)" |
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "======= installing zfs on rescue system =========="
|
echo "======= installing zfs on rescue system =========="
|
||||||
cd "$(mktemp -d)"
|
echo "zfs-dkms zfs-dkms/note-incompatible-licenses note true" | debconf-set-selections
|
||||||
wget "$(curl -Ls https://api.github.com/repos/openzfs/zfs/releases/latest| grep "browser_download_url.*tar.gz"|grep -E "tar.gz\"$"| cut -d '"' -f 4)"
|
if [[ $v_zfs_experimental == "1" ]]; then
|
||||||
apt update
|
apt install --yes man wget curl software-properties-common nano htop gnupg
|
||||||
apt install libssl-dev uuid-dev zlib1g-dev libblkid-dev -y
|
wget -O - https://terem42.github.io/zfs-debian/apt_pub.gpg | apt-key add -
|
||||||
tar xfv zfs*.tar.gz
|
add-apt-repository 'deb https://terem42.github.io/zfs-debian/public zfs-debian-experimental main'
|
||||||
rm *.tar.gz
|
apt update
|
||||||
cd zfs*
|
apt install --yes libelf-dev
|
||||||
./configure
|
apt install -t zfs-debian-experimental --yes zfs-dkms zfsutils-linux
|
||||||
make -j "$(nproc)"
|
else
|
||||||
make install
|
cd "$(mktemp -d)"
|
||||||
ldconfig
|
wget "$(curl -Ls https://api.github.com/repos/openzfs/zfs/releases/latest| grep "browser_download_url.*tar.gz"|grep -E "tar.gz\"$"| cut -d '"' -f 4)"
|
||||||
modprobe zfs
|
apt update
|
||||||
|
apt install libssl-dev uuid-dev zlib1g-dev libblkid-dev -y
|
||||||
|
tar xfv zfs*.tar.gz
|
||||||
|
rm *.tar.gz
|
||||||
|
cd zfs*
|
||||||
|
./configure
|
||||||
|
make -j "$(nproc)"
|
||||||
|
make install
|
||||||
|
ldconfig
|
||||||
|
modprobe zfs
|
||||||
|
fi
|
||||||
zfs --version
|
zfs --version
|
||||||
|
|
||||||
echo "======= partitioning the disk =========="
|
echo "======= partitioning the disk =========="
|
||||||
|
|||||||
2
ubuntu_keys_add.sh
Normal file
2
ubuntu_keys_add.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
|
||||||
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC9
|
||||||
Reference in New Issue
Block a user