|
|
|
@ -147,6 +147,20 @@ for nic in `echo "$nics"`; do
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo "Done."
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
echo "Setting up bpoo import service"
|
|
|
|
|
|
|
|
echo "[Unit]\n DefaultDependencies=no" > /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo " Before=zfs-import-scan.service" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo " Before=zfs-import-cache.service" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo "" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo "[Service]" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo " Type=oneshot" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo " RemainAfterExit=yes" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo " ExecStart=/sbin/zpool import -N -o cachefile=none bpool" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo "[Install]" >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo " WantedBy=zfs-import.target " >> /mnt/etc/systemd/system/zfs-import-bpool.Service
|
|
|
|
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Mounting chroot mounts..."
|
|
|
|
echo "Mounting chroot mounts..."
|
|
|
|
mount --rbind /dev /mnt/dev
|
|
|
|
mount --rbind /dev /mnt/dev
|
|
|
|
@ -166,7 +180,7 @@ echo "apt update" >> /mnt/setup-chroot.sh
|
|
|
|
#echo "errors=`apt update 2>&1 1>/dev/null`" >> /mnt/setup-chroot.sh
|
|
|
|
#echo "errors=`apt update 2>&1 1>/dev/null`" >> /mnt/setup-chroot.sh
|
|
|
|
echo 'if ! [ "$?" = "0" ]; then '>> /mnt/setup-chroot.sh
|
|
|
|
echo 'if ! [ "$?" = "0" ]; then '>> /mnt/setup-chroot.sh
|
|
|
|
echo " echo \"Failed to update apt repositories inside chroot - \$errors\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo " echo \"Failed to update apt repositories inside chroot - \$errors\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo " exit 1">> /mnt/setup-chroot.sh
|
|
|
|
#echo " exit 1">> /mnt/setup-chroot.sh
|
|
|
|
echo "fi">> /mnt/setup-chroot.sh
|
|
|
|
echo "fi">> /mnt/setup-chroot.sh
|
|
|
|
echo "echo \"Done.\"">> /mnt/setup-chroot.sh
|
|
|
|
echo "echo \"Done.\"">> /mnt/setup-chroot.sh
|
|
|
|
echo "echo \"\"">> /mnt/setup-chroot.sh
|
|
|
|
echo "echo \"\"">> /mnt/setup-chroot.sh
|
|
|
|
@ -177,7 +191,6 @@ echo "locale-gen en_US.UTF-8" >> /mnt/setup-chroot.sh
|
|
|
|
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "cp /usr/share/zoneinfo/$timezone /etc/localtime" >> /mnt/setup-chroot.sh
|
|
|
|
echo "cp /usr/share/zoneinfo/$timezone /etc/localtime" >> /mnt/setup-chroot.sh
|
|
|
|
echo "apt install -y --no-install-recommends linux-image-generic" >> /mnt/setup-chroot.sh
|
|
|
|
echo "apt install -y --no-install-recommends linux-image-generic" >> /mnt/setup-chroot.sh
|
|
|
|
echo "apt-add-repository universe && apt update" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
echo "apt install -y vim bash screen tmux zfs-initramfs dosfstools openssh-server">> /mnt/setup-chroot.sh
|
|
|
|
echo "apt install -y vim bash screen tmux zfs-initramfs dosfstools openssh-server">> /mnt/setup-chroot.sh
|
|
|
|
echo "i=\"0\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "i=\"0\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "for disk in \"\$disks\"; do" >> /mnt/setup-chroot.sh
|
|
|
|
echo "for disk in \"\$disks\"; do" >> /mnt/setup-chroot.sh
|
|
|
|
@ -189,10 +202,13 @@ echo " i=$((i + 1))" >> /mnt/setup-chroot.sh
|
|
|
|
echo "done" >> /mnt/setup-chroot.sh
|
|
|
|
echo "done" >> /mnt/setup-chroot.sh
|
|
|
|
echo "apt install -y grub-efi-amd64-signed shim-signed" >> /mnt/setup-chroot.sh
|
|
|
|
echo "apt install -y grub-efi-amd64-signed shim-signed" >> /mnt/setup-chroot.sh
|
|
|
|
echo "echo 'root:${rootpassword}' | chpasswd" >> /mnt/setup-chroot.sh
|
|
|
|
echo "echo 'root:${rootpassword}' | chpasswd" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "systemctl enable zfs-import-bpool.Service" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "exit 0" >> /mnt/setup-chroot.sh
|
|
|
|
echo "exit 0" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
#echo "[Unit]\n DefaultDependencies=no\n Before=zfs-import-scan.service\n Before=zfs-import-cache.service\n \n [Service]\n Type=oneshot\n RemainAfterExit=yes\n ExecStart=/sbin/zpool import -N -o cachefile=none bpool\n [Install]\n WantedBy=zfs-import.target " > /etc/systemd/system/zfs-import-bpool.Service"
|
|
|
|
|
|
|
|
#systemctl enable zfs-import-bpool.Service
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#cp /usr/sharesystemd/tmp.mount /etc/systemd/system/
|
|
|
|
#cp /usr/sharesystemd/tmp.mount /etc/systemd/system/
|
|
|
|
#systemctl enable tmp.mount
|
|
|
|
#systemctl enable tmp.mount
|
|
|
|
|