Merge pull request #221 from saveriomiroddi/fix_debian_in_new_procedure

Add support for Debian to new procedure
This commit is contained in:
Saverio Miroddi 2021-06-14 20:37:53 +02:00 committed by GitHub
commit 7441a2bfa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1663 deletions

View File

@ -2,7 +2,7 @@
# zfs-installer
ZFS installer is a shell script program that fully prepares ZFS on a system, and allows an effortless installation of several Ubuntu-based operating systems using their standard installer (or debootstrap, or any custom script).
ZFS installer is a shell script program that fully prepares ZFS on a system, and allows an effortless installation of several Debian-based operating systems using their standard installer (or debootstrap, or any custom script).
- [Requirements and functionality](#requirements-and-functionality)
- [Comparison with Ubuntu built-in installer](#comparison-with-ubuntu-built-in-installer)
@ -23,6 +23,7 @@ The program currently supports:
- Ubuntu Desktop 18.04.x/20.04 Live
- Ubuntu Server 18.04.x/20.04 Live
- Linux Mint 19.x, 20
- Debian 10.x Live (desktop environment required)
- ElementaryOS 5.1
The ZFS version installed is 0.8 (optionally, 2.x), which supports native encryption and trimming (among the other improvements over 0.7). The required repositories are automatically added to the destination system.
@ -31,7 +32,7 @@ EFI boot is required (any modern (2011+) system will do); legacy boot is current
All the ZFS RAID types are supported, with any arbitrary number of disks. An EFI partition is created on each disk, for redundancy purposes.
It's fairly easy to extend the program to support other Ubuntu-based operating systems - the project is open to feature requests.
It's fairly easy to extend the program to support other Debian-based operating systems (e.g. older/newer Ubuntu's, etc.) - the project is (very) open to feature requests.
## Comparison with Ubuntu built-in installer

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@ v_free_tail_space= # integer
# Variables set during execution
v_linux_distribution= # Ubuntu, LinuxMint, ... WATCH OUT: not necessarily from `lsb_release` (ie. UbuntuServer)
v_linux_distribution= # Debian, Ubuntu, ... WATCH OUT: not necessarily from `lsb_release` (ie. UbuntuServer)
v_use_ppa= # 1=true, false otherwise (applies only to Ubuntu-based).
v_temp_volume_device= # /dev/zdN; scope: setup_partitions -> sync_os_temp_installation_dir_to_rpool
v_suitable_disks=() # (/dev/by-id/disk_id, ...); scope: find_suitable_disks -> select_disk
@ -118,7 +118,7 @@ USERDATA/%P mountpoint=/home/%P canmount=on com.ubuntu.zsys:b
'
c_zfs_mount_dir=/mnt
c_installed_os_mount_dir=/target
declare -A c_supported_linux_distributions=([Ubuntu]="18.04 20.04" [UbuntuServer]="18.04 20.04" [LinuxMint]="19.1 19.2 19.3" [Linuxmint]="20 20.1" [elementary]=5.1)
declare -A c_supported_linux_distributions=([Debian]=10 [Ubuntu]="18.04 20.04" [UbuntuServer]="18.04 20.04" [LinuxMint]="19.1 19.2 19.3" [Linuxmint]="20 20.1" [elementary]=5.1)
c_temporary_volume_size=12 # gigabytes; large enough - Debian, for example, takes ~8 GiB.
c_passphrase_named_pipe=$(dirname "$(mktemp)")/zfs-installer.pp.fifo
@ -1431,6 +1431,15 @@ function configure_and_update_grub {
chroot_execute "update-grub"
}
function configure_and_update_grub_Debian {
zfs_root_fs=$(chroot_execute 'zfs list / | awk "NR==2 {print \$1}"')
zfs_boot_fs=$(chroot_execute 'zfs list /boot | awk "NR==2 {print \$1}"')
chroot_execute "perl -i -pe 's|GRUB_CMDLINE_LINUX=\"\K|root=ZFS=$zfs_root_fs bootfs=$zfs_boot_fs |' /etc/default/grub"
configure_and_update_grub
}
function sync_efi_partitions {
for ((i = 1; i < ${#v_selected_disks[@]}; i++)); do
local synced_efi_partition_path="/boot/efi$((i + 1))"