@ -37,6 +37,8 @@ hostname=""; while [ -z "$hostname" ]; do hostname=`dialog --no-cancel --inputbo
nicdevices = "" ; for nic in $( ip -o link show | awk -F': ' '{print $2}' | grep -v '^lo' ) ; do nicdevices = " $nicdevices $nic off " ; done
nicdevices = "" ; for nic in $( ip -o link show | awk -F': ' '{print $2}' | grep -v '^lo' ) ; do nicdevices = " $nicdevices $nic off " ; done
nics = ` dialog --separate-output --no-cancel --no-items --title "Network devices for bridge" --checklist "Select the network devices to be bridged" $height $width ${ window } $nicdevices 2>& 1 1>/dev/tty`
nics = ` dialog --separate-output --no-cancel --no-items --title "Network devices for bridge" --checklist "Select the network devices to be bridged" $height $width ${ window } $nicdevices 2>& 1 1>/dev/tty`
rootpassword = ` dialog --no-cancel -title "Root password" --passwordbox "Enter root password" $height $width 2>& 1 1>/dev/tty`
for disk in ` echo " $disks " ` ; do
for disk in ` echo " $disks " ` ; do
# remove echo for testing
# remove echo for testing
@ -193,8 +195,8 @@ echo "echo 'LANG=\"en_US.UTF-8\"' > /etc/default/locale" >> /mnt/setup-chroot.sh
echo "echo 'LANGUAGE=\"en_US:en\"' >> /etc/default/locale" >> /mnt/setup-chroot.sh
echo "echo 'LANGUAGE=\"en_US:en\"' >> /etc/default/locale" >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
#dpkg-reconfigure tzdata
#dpkg-reconfigure tzdata
# apt install -y --no-install-recommends linux-image-generic
echo " apt install -y --no-install-recommends linux-image-generic" >> /mnt/setup-chroot.sh
# apt install -y vim bash screen tmux zfs-initramfs dosfstools openssh-server
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
echo " echo \"mkdosfs -F 32 -s 1 -n EFI /dev/disk/by-id/ ${ disk } -part2\" " >> /mnt/setup-chroot.sh
echo " echo \"mkdosfs -F 32 -s 1 -n EFI /dev/disk/by-id/ ${ disk } -part2\" " >> /mnt/setup-chroot.sh
@ -204,9 +206,8 @@ echo " echo \"mount /boot/efi${i}\"" >> /mnt/setup-chroot.sh
echo " i= $(( i + 1 )) " >> /mnt/setup-chroot.sh
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 \"ubuntu\" | passwd --stdin " >> /mnt/setup-chroot.sh
echo " echo 'root: $rootpassword ' | chpasswd " >> /mnt/setup-chroot.sh
echo "exit 0" >> /mnt/setup-chroot.sh
echo "exit 0" >> /mnt/setup-chroot.sh
#passwd
#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"
#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
#systemctl enable zfs-import-bpool.Service
@ -217,30 +218,30 @@ echo "exit 0" >> /mnt/setup-chroot.sh
#addgroup --system sambashare
#addgroup --system sambashare
#zfscheck=`grub-probe /boot`
#zfscheck=`grub-probe /boot`
#update-initramfs -u -k all
echo "update-initramfs -u -k all" >> /mnt/setup-chroot.sh
# you need sed to do this right!
# you need sed to do this right!
# GRUB_CMDLINE_LINUX="root=ZFS=rpool/ROOT/ubuntu" <--- replace this
# GRUB_CMDLINE_LINUX="root=ZFS=rpool/ROOT/ubuntu" <--- replace this
#update-grub
echo "update-grub" >> /mnt/setup-chroot.sh
#i="0"
echo "i=\"0\"" >> /mnt/setup-chroot.sh
#for f in "$disks"; do
echo " for f in \" $disks \"; do " >> /mnt/setup-chroot.sh
#echo " grub-install --target=x86_64-efi --efi-directory=/boot/efi${i} --botloader-id=ubuntu --recheck --no-floppy"
echo " grub-install --target=x86_64-efi --efi-directory=/boot/efi ${ i } --botloader-id=ubuntu --recheck --no-floppy " >> /mnt/setup-chroot.sh
#echo "umount /boot/efi${i}"
echo " umount /boot/efi ${ i } " >> /mnt/setup-chroot.sh
#i=$((i + 1))
echo " i= $(( i + 1 )) " >> /mnt/setup-chroot.sh
#done
echo "done" >> /mnt/setup-chroot.sh
#zfs set mountpoint=legacy bpool/BOOT/ubuntu
echo "zfs set mountpoint=legacy bpool/BOOT/ubuntu" >> /mnt/setup-chroot.sh
#echo bpool/BOOT/ubuntu /boot zfs nodev,relatime,x-systemd.requires=zfs-import-bpool.service 0 0 >> /etc/fstab
echo "echo \" bpool/BOOT/ubuntu /boot zfs nodev,relatime,x-systemd.requires=zfs-import-bpool.service 0 0\" >> /etc/fstab" >> /mnt/setup-chroot.sh
#zfs set mountpoint=legacy rpool/var/log
echo "zfs set mountpoint=legacy rpool/var/log" >> /mnt/setup-chroot.sh
#echo rpool/var/log /var/log zfs nodev,relatime 0 0 >> /etc/fstab
echo "echo \"rpool/var/log /var/log zfs nodev,relatime 0 0\" >> /etc/fstab" >> /mnt/setup-chroot.sh
#zfs set mountpoint=legacy rpool/var/spool
echo "zfs set mountpoint=legacy rpool/var/spool" >> /mnt/setup-chroot.sh
#echo rpool/var/spool /var/spool zfs nodev,relatime 0 0 >> /etc/fstab
echo "echo \"rpool/var/spool /var/spool zfs nodev,relatime 0 0\" >> /etc/fstab" >> /mnt/setup-chroot.sh
#zfs set mountpoint=legacy rpool/var/tmp
echo "zfs set mountpoint=legacy rpool/var/tmp" >> /mnt/setup-chroot.sh
#echo rpool/var/tmp /var/tmp zfs nodev,relatime 0 0 >> /etc/fstab
echo "echo \"rpool/var/tmp /var/tmp zfs nodev,relatime 0 0\" >> /etc/fstab" >> /mnt/setup-chroot.sh
#zfs set mountpoint=legacy rpool/tmp
echo "zfs set mountpoint=legacy rpool/tmp" >> /mnt/setup-chroot.sh
#echo rpool/tmp /tmp zfs nodev,relatime 0 0 >> /etc/fstab
echo "echo \"rpool/tmp /tmp zfs nodev,relatime 0 0\" >> /etc/fstab" >> /mnt/setup-chroot.sh
#systemctl enable openssh-server
echo "systemctl enable ssh" >> /mnt/setup-chroot.sh