44 Commits
Author SHA1 Message Date
easthighNerd 9b15fd5159 Condensed 3 seperate [rsync] commands into single for loop 2026-08-02 07:49:18 -04:00
easthighNerd 0c03548307 Changed how package list for [mmdebstrap] to include is created 2026-08-02 07:48:18 -04:00
easthighNerd 61b61b6445 Changed using [curl] to [wget] 2026-08-02 07:47:09 -04:00
easthighNerd 2787921679 Ensure [wget] is present on live media 2026-08-02 07:41:13 -04:00
easthighNerd cf18778af1 Ensured [linux-headers] package matches booted kernel version 2026-08-01 23:59:43 -04:00
easthighNerd c32c9abcd1 Split [zfs.sh] into multiple scripts inside a [zfs] directory, adjusted references in other files to reflect changes 2026-08-01 22:24:18 -04:00
easthighNerd c293990fa2 Split [debian.sh] into multiple scripts inside a [debian] directory, adjusted references in other files to reflect changes 2026-08-01 21:51:16 -04:00
easthighNerd cd8baf67e5 Split [debian.sh] into multiple scripts inside a [debian] directory, adjusted references in other files to reflect changes 2026-08-01 21:48:51 -04:00
easthighNerd 2ebb72620b Put 'wifiName' variable used by 'nmcli' command inside double quotes 2026-01-11 19:06:34 -05:00
easthighNerd 25afed7541 Fixed mismatched variable names 2026-01-11 19:04:57 -05:00
easthighNerd b8b5918feb Add 'sudo' to list of packages to install via mmdebstrap 2026-01-11 19:01:07 -05:00
easthighNerd fd177fa071 Have 'zpool export' export only the newly created pool instead of all pools 2026-01-02 10:49:35 -05:00
easthighNerd aaa209a056 Use 'umount -nR' regardless of OS 2026-01-02 10:48:39 -05:00
easthighNerd 38dc3ab73a Added missing mount of efivars 2026-01-02 10:43:28 -05:00
easthighNerd 3c8719450d Added spacing between mount commands 2026-01-02 10:42:58 -05:00
easthighNerd e8c745a307 Removed '-R' flag from umount command 2026-01-02 10:16:04 -05:00
easthighNerd 00324dfb5d Changed mounting script from 'rbind.sh' to 'mount.sh' 2026-01-02 10:13:31 -05:00
easthighNerd e03ff714a7 Added new 'mount.sh' script to align with ZFSBootMenu documentation 2026-01-02 10:12:54 -05:00
easthighNerd 6e1670ac6a Adjust newlines 2026-01-02 10:07:51 -05:00
easthighNerd 3e233de780 Changed maximum SWAP size from 32GiB to 16GiB 2026-01-02 08:45:01 -05:00
easthighNerd b57734ddbb Added 'ca-certificates' to the list of packages mmdebstrap installes for Debian 2026-01-02 08:40:07 -05:00
easthighNerd e78d63fee7 Removed options that are no longer relevant due to script flow and moved 'WiFi Setup' to bottom 2026-01-01 13:16:09 -05:00
easthighNerd ee2967c522 Changed unneeded 'elif' statements to simple individual 'if' statements 2026-01-01 13:13:07 -05:00
easthighNerd 023c12cb8e Removed options that are no longer relevant due to script flow and moved 'WiFi Setup' to bottom 2026-01-01 13:09:23 -05:00
easthighNerd d1bbf9889b Added check to see if '/usr/bin/os-prober' exists before trying to purge it 2026-01-01 13:08:31 -05:00
easthighNerd e3428baed2 Corrected how 'baseDir' is to be determined 2026-01-01 12:44:28 -05:00
easthighNerd 1e378f8fe1 Updated checklist to reflect current progress 2026-01-01 12:43:52 -05:00
easthighNerd 56b4fbd596 Removed unneeded bits that served no function 2026-01-01 12:43:28 -05:00
easthighNerd 7e9c59750b Updated how 'baseDir' variable is determined 2026-01-01 12:43:06 -05:00
easthighNerd f7cdd0c419 Moved last bit of Fedora specific stuff into 'fedora.sh' 2026-01-01 12:41:59 -05:00
easthighNerd 8b892d207d Changed unneeded 'elif' statements to simple individual 'if' statements 2026-01-01 12:40:03 -05:00
easthighNerd 8d3c013539 Updated checklist to reflect current progress 2026-01-01 00:06:29 -05:00
easthighNerd a6abd9e365 Removed unneeded bits that served no function 2025-12-31 23:41:09 -05:00
easthighNerd a09f66e4a7 Moved more ZFS things into 'zfs.sh' 2025-12-31 23:40:06 -05:00
easthighNerd f41eb46966 Moved dracut stuff into 'fedora.sh' 2025-12-31 23:39:14 -05:00
easthighNerd df9a67caea Broke swap related stuff into seperate script 2025-12-31 23:36:02 -05:00
easthighNerd 2b1a2f29ee Moved automatic ZFS snapshot triggered by apt into seperate script. Moved 'logrotate' and 'initramfs' functions into 'debian.sh' 2025-12-31 23:32:29 -05:00
easthighNerd 3e7a7a5788 Moved installing 'wingpanel-indicator-namarupa' into 'elementary.sh' 2025-12-31 23:25:45 -05:00
easthighNerd 9a32510698 Split off new user creation into seperate script 2025-12-31 23:23:34 -05:00
easthighNerd d186c475b0 Added boilerplate script to aide in creation of new scripts 2025-12-31 22:51:16 -05:00
easthighNerd 90fefb094e Have apt update repositories before upgrading packages 2025-12-31 22:50:35 -05:00
easthighNerd dff8209e31 Added instalation of app indicator dropdown for Wing Panel 2025-12-31 22:49:59 -05:00
easthighNerd a4f6ea6f9c Specified exactly which version of Flatpaks were being installed to better automate their installation 2025-12-31 18:32:10 -05:00
easthighNerd 86e9244590 Fixed '10-globally-managed-devices.conf' not being created under '/mnt' 2025-12-31 18:31:33 -05:00
38 changed files with 915 additions and 750 deletions
+7 -7
View File
@@ -6,13 +6,13 @@ The purpose of this branch is to modularize as many functions of the scripts as
## Checklist ## Checklist
[X] Rename all `base-` scripts to remove `base-` [X] Rename all `base-` scripts to remove `base-`
[ ] Move (at least almost) all Debian related commands and tasks to `debian.sh` [X] Move (at least almost) all Debian related commands and tasks to `debian.sh`
[ ] Move (at least almost) all Fedora related commands and tasks to `fedora.sh` [X] Move (at least almost) all Fedora related commands and tasks to `fedora.sh`
[ ] Move (at least almost) all elementary OS related commands and tasks to `elementary.sh` [X] Move (at least almost) all elementary OS related commands and tasks to `elementary.sh`
[ ] Rename flags in all distro specific scripts from numbered (i.e. `-1`, `-2`) to descriptive (i.e. `--mmdebstrap`, `--network-interfaces`) [X] Rename flags in all distro specific scripts from numbered (i.e. `-1`, `-2`) to descriptive (i.e. `--mmdebstrap`, `--network-interfaces`)
[X] Move all EFI related commands and tasks to a new `efi.sh` script [X] Move all EFI related commands and tasks to a new `efi.sh` script
[X] Rename `mkfs.zfs.sh` to `zfs.sh` [X] Rename `mkfs.zfs.sh` to `zfs.sh`
[ ] Point any distro-specific commands/tasks that are shared with Debian to use `debian.sh` to avoid any unnecessary duplication [X] Point any distro-specific commands/tasks that are shared with Debian to use `debian.sh` to avoid any unnecessary duplication
[ ] Rewrite `README.md` [ ] Rewrite `README.md`
[ ] Rename all script-specific variables to lowercase with singular capital letters to seperate words in variable name [X] Rename all script-specific variables to lowercase with singular capital letters to seperate words in variable name
[ ] Update how `baseDir` is set using `realpath $(basedir "${0}")` [X] Update how `baseDir` is set using `realpath $(dirname "${0}")`
Executable
+52
View File
@@ -0,0 +1,52 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
source \
/etc/os-release
source \
"${baseDir}/system.conf"
printf \
'Adding user account...\n'
adduser ${username}
if [[ "${ID}" == 'fedora' ]]; then
printf \
'\033[?47h\033[2J\033[H'
cat << EOF
Enter a password for the new user account:
EOF
passwd \
${username}
printf \
'\033[?47l'
usermod \
-a \
-G \
audio,cdrom,dip,floppy,wheel,video,dialout \
${username}
else
if [[ -z "$(cat /etc/group | grep 'lpadmin')" ]]; then
groupadd --gid 108 lpadmin
fi
groups='audio,cdrom,dip,floppy,plugdev,sudo,video,dialout,lpadmin'
if [[ "${ID}" == 'debian' ]]; then
groups+=',netdev'
fi
usermod \
-a \
-G \
${groups} \
${username}
fi
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -euo pipefail
cat << EOF | tee /usr/bin/zfs-system-snapshot-apt &> /dev/null
#!/bin/bash
set -euo pipefail
TIMESTAMP="\$(date +%Y_%m_%d-%H_%M_%S)"
if [[ -z "\$(zfs list -t snapshot | grep 'apt-\${TIMESTAMP}')" ]]; then
zfs snapshot \$(zfs mount | grep 'ROOT' | sed 's| .*||')@apt-\${TIMESTAMP} && printf "\n- Snapshot taken\n\n"
fi
EOF
chmod \
+x \
/usr/bin/zfs-system-snapshot-apt
printf \
'DPkg::Pre-Install-Pkgs {"/usr/bin/zfs-system-snapshot-apt";};\n' | \
tee /etc/apt/apt.conf.d/90-zfs_system-snapshot &> /dev/null
printf \
'DPkg::Post-Invoke {"apt moo";};\n' | \
tee /etc/apt/apt.conf.d/99-apt_moo &> /dev/null
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
printf "Enter name of new script (without file extension):\n${baseDir}/"
read -r newScript
cat << EOF | tee "${baseDir}/${newScript}.sh" &> /dev/null
#!/bin/bash
set -euo pipefail
baseDir="\$(realpath "\$(dirname "\${0}")")"
source \\
/etc/os-release
source \\
"\${baseDir}/system.conf"
EOF
chmod +x "${baseDir}/${newScript}.sh"
-181
View File
@@ -1,181 +0,0 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
source \
/etc/os-release
source \
"${baseDir}/system.conf"
if [[ "${1}" == '--live' ]]; then
if [[ "${ID}" == 'debian' ]] && [[ ! "$(hostname)" == "debian-live" ]]; then
cat << EOF | tee /etc/apt/sources.list.d/contrib.sources 1> /dev/null
Enabled: yes
Types: deb
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}
Components: contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
fi
apt \
--update \
install \
--yes \
mmdebstrap \
gdisk \
linux-headers-generic \
systemd-timesyncd \
whois \
zfsutils-linux
elif [[ "${1}" == '--mmdebstrap' ]]; then
packages=(\
console-setup \
cryptsetup \
curl \
dosfstools \
dpkg-dev \
efibootmgr \
ethtool \
firmware-{ast,atheros,bnx{2,2x},brcm80211,iwlwifi,libertas,linux,realtek,zd1211} \
flatpak \
keyboard-configuration \
linux-{headers,image}-amd64 \
locales \
nano \
network-manager \
openssh-{client,server} \
popularity-contest \
printer-driver-all \
rsync \
systemd-timesyncd \
tasksel \
zfs-initramfs \
zstd\
)
include="--include=${packages[0]}"
for ((i=1;i<${#packages[@]};i++)); do
include+=" --include=${packages[${i}]}"
done
mmdebstrap \
--skip=check/empty \
--components=main,non-free-firmware,contrib \
--mode=root \
--format=directory \
${include} \
"${VERSION_CODENAME}" \
/mnt
elif [[ "${1}" == '--network-interfaces' ]]; then
networkInterface=($(ip -br addr show | sed 's| .*$||g' | grep -v '^lo' | grep -v 'tailscale' | grep -v '^wg'))
shopt -s extglob
for ((i = 0; i < ${#networkInterface[@]}; i++)); do
cat << EOF | tee /mnt/etc/network/interfaces.d/${networkInterface[$i]} &> /dev/null
allow-hotplug ${networkInterface[$i]}
iface ${networkInterface[$i]} inet dhcp
EOF
done
elif [[ "${1}" == '--sources' ]]; then
cat << EOF | tee /mnt/etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^}
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# ${VERSION_CODENAME^} Security
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian-security/
Suites: ${VERSION_CODENAME}-security
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# ${VERSION_CODENAME^} Updates
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}-updates
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
rm /mnt/etc/apt/sources.list
elif [[ "${1}" == '--dpkg-reconfigure' ]]; then
cat << EOF
Regardless of the language(s) you choose, be sure to enable 'en_US.UTF-8'!
Press any key to continue...
EOF
read -srn 1
dpkg-reconfigure \
locales \
tzdata \
keyboard-configuration \
console-setup
elif [[ "${1}" == '--purge-os-prober' ]]; then
apt \
purge \
--yes \
os-prober
elif [[ "${1}" == '--network-manager' ]]; then
cp \
/etc/NetworkManager/NetworkManager.conf \
/etc/NetworkManager/NetworkManager.conf.orig
cat \
/etc/NetworkManager/NetworkManager.conf.orig | \
sed 's|managed=false|managed=true|' | \
tee /etc/NetworkManager/NetworkManager.conf &> /dev/null
elif [[ "${1}" == '--contrib' ]]; then
cat << EOF | tee --append /etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^} Backports
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}-backports
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
cat << EOF | tee /etc/apt/preferences.d/backports.pref &> /dev/null
Package: *
Pin: release n=${VERSION_CODENAME}*
Pin-Priority: 990
Package: linux-*
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
if [[ "${VERSION_CODENAME}" == 'bookworm' ]]; then
cat << EOF | tee --append /etc/apt/preferences.d/backports.pref &> /dev/null
Package: /wayland/
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
fi
elif [[ "${1}" == '--tasksel' ]]; then
if [[ ! -f /usr/bin/tasksel ]]; then
apt \
--update \
install \
--yes \
tasksel
fi
tasksel \
--new-install
fi
Vendored Executable
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
set -euo pipefail
source \
/etc/os-release
cat << EOF | tee --append /etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^} Backports
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}-backports
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
cat << EOF | tee /etc/apt/preferences.d/backports.pref &> /dev/null
Package: *
Pin: release n=${VERSION_CODENAME}*
Pin-Priority: 990
Package: linux-*
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
if [[ "${VERSION_CODENAME}" == 'bookworm' ]]; then
cat << EOF | tee --append /etc/apt/preferences.d/backports.pref &> /dev/null
Package: /wayland/
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
fi
Vendored Executable
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
cat << EOF
Regardless of the language(s) you choose, be sure to enable 'en_US.UTF-8'!
Press any key to continue...
EOF
read -srn 1
dpkg-reconfigure \
locales \
tzdata \
keyboard-configuration \
console-setup
Vendored Executable
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
printf \
"UMASK=0077\n" | \
tee /etc/initramfs-tools/conf.d/umask.conf &> /dev/null
update-initramfs \
-c \
-k all
Vendored Executable
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
set -euo pipefail
source \
/etc/os-release
if [[ "${ID}" == 'debian' ]] && [[ ! "$(hostname)" == "debian-live" ]]; then
cat << EOF | tee /etc/apt/sources.list.d/contrib.sources 1> /dev/null
Enabled: yes
Types: deb
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}
Components: contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
fi
apt \
--update \
install \
--yes \
mmdebstrap \
gdisk \
linux-headers-$(uname -r) \
systemd-timesyncd \
wget \
whois \
zfsutils-linux
Vendored Executable
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail
for file in /etc/logrotate.d/* ; do
if grep -Eq "(^|[^#y])compress" "$file" ; then
sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file"
fi
done
Vendored Executable
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
set -euo pipefail
source \
/etc/os-release
packages=( \
ca-certificates \
console-setup \
cryptsetup \
dosfstools \
dpkg-dev \
efibootmgr \
ethtool \
firmware-{ast,atheros,bnx{2,2x},brcm80211,iwlwifi,libertas,linux,realtek,zd1211} \
flatpak \
keyboard-configuration \
linux-{headers,image}-amd64 \
locales \
nano \
network-manager \
openssh-{client,server} \
popularity-contest \
printer-driver-all \
rsync \
sudo \
systemd-timesyncd \
tasksel \
wget \
zfs-initramfs \
zstd \
)
include="${packages[0]}"
for ((i=1;i<${#packages[@]};i++)); do
include+=",${packages[${i}]}"
done
mmdebstrap \
--skip=check/empty \
--components=main,non-free-firmware,contrib \
--mode=root \
--format=directory \
--include="${include}" \
"${VERSION_CODENAME}" \
/mnt
Vendored Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail
networkInterface=($(ip -br addr show | awk '!/^lo/&&!/tailscale/&&!/^wg/{print$1}'))
shopt -s extglob
for ((i = 0; i < ${#networkInterface[@]}; i++)); do
cat << EOF | tee /mnt/etc/network/interfaces.d/${networkInterface[$i]} &> /dev/null
allow-hotplug ${networkInterface[$i]}
iface ${networkInterface[$i]} inet dhcp
EOF
done
Vendored Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
cp \
/etc/NetworkManager/NetworkManager.conf \
/etc/NetworkManager/NetworkManager.conf.orig
cat \
/etc/NetworkManager/NetworkManager.conf.orig | \
sed 's|managed=false|managed=true|' | \
tee /etc/NetworkManager/NetworkManager.conf &> /dev/null
Vendored Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
apt \
purge \
--yes \
os-prober
Vendored Executable
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
set -euo pipefail
source \
/etc/os-release
cat << EOF | tee /mnt/etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^}
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# ${VERSION_CODENAME^} Security
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian-security/
Suites: ${VERSION_CODENAME}-security
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# ${VERSION_CODENAME^} Updates
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}-updates
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
if [[ -f '/mnt/etc/apt/sources.list' ]]; then
rm \
/mnt/etc/apt/sources.list
fi
Vendored Executable
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
systemctl \
enable \
zfs.target
systemctl \
enable \
zfs-import-cache
systemctl \
enable \
zfs-mount
systemctl \
enable \
zfs-import.target
Vendored Executable
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail
if [[ ! -f /usr/bin/tasksel ]]; then
apt \
--update \
install \
--yes \
tasksel
fi
tasksel \
--new-install
+5 -20
View File
@@ -17,34 +17,19 @@ mkdir \
-p \ -p \
/boot/efi/EFI/BOOT /boot/efi/EFI/BOOT
curl \ wget \
--progress-bar \ --output-document \
--show-error \
--output \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \ /boot/efi/EFI/ZBM/VMLINUZ.EFI \
--location \
https://get.zfsbootmenu.org/efi https://get.zfsbootmenu.org/efi
for file in {ZBM/VMLINUZ-BACKUP,BOOT/{BOOTX64,shellx64}}; do
rsync \ rsync \
-pogAXtlHrDx \ -pogAXtlHrDx \
--stats \ --stats \
--info=progress2 \ --info=progress2 \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \ /boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI /boot/efi/EFI/${file}.EFI
done
rsync \
-pogAXtlHrDx \
--stats \
--info=progress2 \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/BOOT/BOOTX64.EFI
rsync \
-pogAXtlHrDx \
--stats \
--info=progress2 \
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
/boot/efi/EFI/BOOT/shellx64.efi
efibootmgr \ efibootmgr \
-c \ -c \
+54 -14
View File
@@ -13,7 +13,6 @@ if [[ "${1}" == '--mmdebstrap' ]]; then
packages=(\ packages=(\
console-setup \ console-setup \
cryptsetup \ cryptsetup \
curl \
dosfstools \ dosfstools \
dpkg-dev \ dpkg-dev \
efibootmgr \ efibootmgr \
@@ -27,14 +26,15 @@ network-manager \
openssh-{client,server} \ openssh-{client,server} \
popularity-contest \ popularity-contest \
rsync \ rsync \
wget \
zfs-initramfs \ zfs-initramfs \
zstd\ zstd\
) )
include="--include=${packages[0]}" include="${packages[0]}"
for ((i=1;i<${#packages[@]};i++)); do for ((i=1;i<${#packages[@]};i++)); do
include+=" --include=${packages[${i}]}" include+=",${packages[${i}]}"
done done
mmdebstrap \ mmdebstrap \
@@ -42,10 +42,12 @@ zstd\
--components=main,restricted,universe,multiverse \ --components=main,restricted,universe,multiverse \
--mode=root \ --mode=root \
--format=directory \ --format=directory \
${include} \ --include=${include} \
"${UBUNTU_VERSION_CODENAME}" \ "${UBUNTU_VERSION_CODENAME}" \
/mnt /mnt
elif [[ "${1}" == '--sources' ]]; then fi
if [[ "${1}" == '--sources' ]]; then
cat <<EOF >/mnt/etc/apt/sources.list.d/${UBUNTU_VERSION_CODENAME}.sources cat <<EOF >/mnt/etc/apt/sources.list.d/${UBUNTU_VERSION_CODENAME}.sources
# ${UBUNTU_VERSION_CODENAME^} # ${UBUNTU_VERSION_CODENAME^}
Enabled: yes Enabled: yes
@@ -91,11 +93,15 @@ Signed-By: /etc/apt/trusted.gpg.d/patches.key.asc
EOF EOF
rm /mnt/etc/apt/sources.list rm /mnt/etc/apt/sources.list
elif [[ "${1}" == '--skel' ]]; then fi
if [[ "${1}" == '--skel' ]]; then
rsync -pogAXtlHrDx \ rsync -pogAXtlHrDx \
/etc/skel \ /etc/skel \
/mnt/etc /mnt/etc
elif [[ "${1}" == '--elementary' ]]; then fi
if [[ "${1}" == '--elementary' ]]; then
cp \ cp \
/etc/os-release \ /etc/os-release \
/mnt/etc /mnt/etc
@@ -103,7 +109,9 @@ elif [[ "${1}" == '--elementary' ]]; then
cp \ cp \
/etc/apt/trusted.gpg.d/{elementary,patches}.key.asc \ /etc/apt/trusted.gpg.d/{elementary,patches}.key.asc \
/mnt/etc/apt/trusted.gpg.d/ /mnt/etc/apt/trusted.gpg.d/
elif [[ "${1}" == '--network' ]]; then fi
if [[ "${1}" == '--network' ]]; then
mkdir \ mkdir \
-p \ -p \
/mnt/run/systemd/resolve/ /mnt/run/systemd/resolve/
@@ -114,8 +122,10 @@ elif [[ "${1}" == '--network' ]]; then
/mnt/run/systemd/resolve/ /mnt/run/systemd/resolve/
touch \ touch \
/etc/NetworkManager/conf.d/10-globally-managed-devices.conf /mnt/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
elif [[ "${1}" == '--apps' ]]; then fi
if [[ "${1}" == '--apps' ]]; then
app=(\ app=(\
io.elementary.calculator \ io.elementary.calculator \
io.elementary.camera \ io.elementary.camera \
@@ -130,10 +140,10 @@ org.gnome.FileRoller \
org.gnome.font-viewer\ org.gnome.font-viewer\
) )
apps="app/${app[0]}" apps="app/${app[0]}/x86_64/stable"
for ((i=1;i<${#app[@]};i++)); do for ((i=1;i<${#app[@]};i++)); do
apps+=" app/${app[${i}]}" apps+=" app/${app[${i}]}/x86_64/stable"
done done
flatpak \ flatpak \
@@ -141,16 +151,46 @@ org.gnome.font-viewer\
appcenter \ appcenter \
-y \ -y \
${apps} ${apps}
elif [[ "${1}" == '--purge' ]]; then fi
if [[ "${1}" == '--purge' ]]; then
apt \ apt \
purge \ purge \
--yes \ --yes \
--autoremove \ --autoremove \
gnome-software \ gnome-software \
snapd snapd
elif [[ "${1}" == '--desktop' ]]; then fi
if [[ "${1}" == '--desktop' ]]; then
apt \ apt \
install \ install \
--yes \ --yes \
elementary-desktop elementary-desktop
fi fi
if [[ "${1}" == '--namarupa' ]]; then
wget \
--continue \
--directory-prefix '/tmp' \
'https://github.com/lenemter/wingpanel-indicator-namarupa/raw/main/com.github.lenemter.wingpanel-indicator-namarupa.deb'
apt \
--update \
install \
--yes \
'/tmp/com.github.lenemter.wingpanel-indicator-namarupa.deb'
mkdir \
-p \
/home/${username}/.config/autostart
cp \
/etc/xdg/autostart/indicator-application.desktop \
/home/${username}/.config/autostart/
sed \
-i \
's/^OnlyShowIn.*/OnlyShowIn=Unity;GNOME;Pantheon;/' \
/home/${username}/.config/autostart/indicator-application.desktop
fi
+70 -4
View File
@@ -35,7 +35,9 @@ if [[ "${1}" == '--live' ]]; then
modprobe \ modprobe \
zfs zfs
elif [[ "${1}" == '--rsync' ]]; then fi
if [[ "${1}" == '--rsync' ]]; then
mkdir -p /run/install mkdir -p /run/install
if [[ "${VERSION_ID}" -lt '41' ]]; then if [[ "${VERSION_ID}" -lt '41' ]]; then
@@ -50,13 +52,77 @@ elif [[ "${1}" == '--rsync' ]]; then
--exclude=/etc/machine-id \ --exclude=/etc/machine-id \
--info=progress2 \ --info=progress2 \
/run/install/ /mnt /run/install/ /mnt
elif [[ "${1}" == '--resolv-conf' ]]; then fi
if [[ "${1}" == '--resolv-conf' ]]; then
mv /mnt/etc/resolv.conf \ mv /mnt/etc/resolv.conf \
/mnt/etc/resolv.conf.orig /mnt/etc/resolv.conf.orig
cp -L \ cp -L \
/etc/resolv.conf \ /etc/resolv.conf \
/mnt/etc /mnt/etc
elif [[ "${1}" == '-3' ]]; then fi
#
if [[ "${1}" == '--dracut' ]]; then
dracut \
--force \
--regenerate-all
fi
if [[ "${1}" == '--zfs-install' ]]; then
if [[ "${encryption}" == 'yes' ]]; then
cat << EOF | tee /etc/dracut.conf.d/zol.conf &> /dev/null
nofsck="yes"
add_dracutmodules+=" zfs "
omit_dracutmodules+=" btrfs "
install_items+=" /etc/zfs/keys/${hostname,,}.key "
EOF
else
cat <<EOF >/etc/dracut.conf.d/zol.conf
nofsck="yes"
add_dracutmodules+=" zfs "
omit_dracutmodules+=" btrfs "
EOF
fi
if [[ "${VERSION_ID}" -lt '41' ]]; then
dnf \
config-manager \
--disable \
updates
else
dnf \
config-manager \
setopt \
updates.enabled=0
fi
dnf \
install \
-y \
https://dl.fedoraproject.org/pub/fedora/linux/releases/${VERSION_ID}/Everything/x86_64/os/Packages/k/kernel-devel-$(uname -r).rpm
dnf \
--releasever=${VERSION_ID} \
install \
-y \
https://zfsonlinux.org/fedora/zfs-release-${ZOL_FEDORA_VER}$(rpm --eval "%{dist}").noarch.rpm
dnf \
install \
-y \
zfs \
zfs-dracut
if [[ "${VERSION_ID}" -lt '41' ]]; then
dnf \
config-manager \
--enable \
updates
else
dnf \
config-manager \
setopt \
updates.enabled=1
fi
fi fi
+13 -124
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
baseDir="$(dirname "${0}" | sed "s|^\.|${PWD}|")" baseDir="$(realpath "$(dirname "${0}")")"
printf \ printf \
'\033[?47l\012' '\033[?47l\012'
@@ -29,99 +29,25 @@ source \
source \ source \
"${baseDir}/system.conf" "${baseDir}/system.conf"
if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then
if [[ "${disk}" == **/dev/nvme** ]]; then
part2='p2'
else
part2='2'
fi
else
part2='-part2'
fi
if [[ ! -f "/etc/mtab" ]]; then if [[ ! -f "/etc/mtab" ]]; then
"${baseDir}/mtab.sh" "${baseDir}/mtab.sh"
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
apt \
update
fi
if [[ "${ID}" == 'fedora' ]]; then if [[ "${ID}" == 'fedora' ]]; then
if [[ "${encryption}" == 'yes' ]]; then "${baseDir}/fedora.sh" --zfs-install
cat << EOF | tee /etc/dracut.conf.d/zol.conf &> /dev/null
nofsck="yes"
add_dracutmodules+=" zfs "
omit_dracutmodules+=" btrfs "
install_items+=" /etc/zfs/keys/${hostname,,}.key "
EOF
else
cat <<EOF >/etc/dracut.conf.d/zol.conf
nofsck="yes"
add_dracutmodules+=" zfs "
omit_dracutmodules+=" btrfs "
EOF
fi
if [[ "${VERSION_ID}" -lt '41' ]]; then
dnf \
config-manager \
--disable \
updates
else
dnf \
config-manager \
setopt \
updates.enabled=0
fi
dnf \
install \
-y \
https://dl.fedoraproject.org/pub/fedora/linux/releases/${VERSION_ID}/Everything/x86_64/os/Packages/k/kernel-devel-$(uname -r).rpm
dnf \
--releasever=${VERSION_ID} \
install \
-y \
https://zfsonlinux.org/fedora/zfs-release-${ZOL_FEDORA_VER}$(rpm --eval "%{dist}").noarch.rpm
dnf \
install \
-y \
zfs \
zfs-dracut
if [[ "${VERSION_ID}" -lt '41' ]]; then
dnf \
config-manager \
--enable \
updates
else
dnf \
config-manager \
setopt \
updates.enabled=1
fi
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --dpkg-reconfigure "${baseDir}/debian/dpkg-reconfigure.sh"
fi fi
# if [[ "${ID}" == 'debian' ]]; then
# printf \
# 'REMAKE_INITRD=yes\n' | \
# tee /etc/dkms/zfs.conf &> /dev/null
# fi
if [[ ! "${*}" = *--no-part* ]]; then
"${baseDir}/partition.sh" --efi "${baseDir}/partition.sh" --efi
fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --purge-os-prober if [[ -e '/usr/bin/os-prober' ]]; then
"${baseDir}/debian/purge-os-prober.sh"
fi
fi fi
if [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'elementary' ]]; then
@@ -145,65 +71,28 @@ passwd
printf \ printf \
'\033[?47l' '\033[?47l'
if [[ "${enableSwap}" == "yes" ]]; then "${baseDir}/swap.sh"
printf \
"swap\t${disk}${part2}\t/dev/random\tswap,cipher=aes-xts-plain64,size=512\n" | \
tee /etc/crypttab &> /dev/null
printf \
'dev/mapper/swap\tnone\tswap\tsw\t0\t0\n' | \
tee --append /etc/fstab &> /dev/null
fi
if [[ "${ID}" == 'debian' ]]; then if [[ "${ID}" == 'debian' ]]; then
"${baseDir}/debian.sh" --network-manager "${baseDir}/debian/network-manager.sh"
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
printf \ "${baseDir}/debian/initramfs.sh"
"UMASK=0077\n" | \
tee /etc/initramfs-tools/conf.d/umask.conf &> /dev/null
update-initramfs \
-c \
-k all
elif [[ "${ID}" == 'fedora' ]]; then elif [[ "${ID}" == 'fedora' ]]; then
dracut \ "${baseDir}/fedora.sh" --dracut
--force \
--regenerate-all
fi fi
zfs \ "${baseDir}/zfs/splash.sh"
set \
org.zfsbootmenu:commandline='quiet splash rhgb noresume' \
${hostname,,}/ROOT/${ID}
if [[ ! "${*}" = *--no-part* ]]; then
if [[ ! -z "$(zfs list | grep 'keystore')" ]]; then if [[ ! -z "$(zfs list | grep 'keystore')" ]]; then
zfs \ "${baseDir}/zfs/keystore.sh"
set \
org.zfsbootmenu:keysource=${hostname,,}/keystore \
${hostname,,}
fi
fi fi
if [[ ! "${*}" = *--no-part* ]]; then
"${baseDir}/efi.sh" "${baseDir}/efi.sh"
fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
systemctl \ "${baseDir}/debian/systemctl-enable.sh"
enable \
zfs.target
systemctl \
enable \
zfs-import-cache
systemctl \
enable \
zfs-mount
systemctl \
enable \
zfs-import.target
fi fi
zfs \ zfs \
+3 -3
View File
@@ -5,9 +5,9 @@ set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")" baseDir="$(realpath "$(dirname "${0}")")"
disksById="$(ls -Ago /dev/disk/by-id/ | grep -v 'sr' | grep -v 'dm-' | grep -v 'nvme-eui.' | grep -v '\-part' | grep -v 'wwn-' | grep -v '_[1-9] -> ' | grep -v 'total' | sed -e 's|^.*\:[0-5][0-9] ||g')" disksById="$(ls -Ago /dev/disk/by-id/ | awk '!/sr/&&!/dm-/&&!/nvme-eui\./&&!/\-part/&&!/wwn-/&&!/_[1-9] -> /&&NR!=1{print$7" -> "$9}')"
disks="$(lsblk -do name | grep -v 'loop' | grep -v 'sr' | grep -v 'zram' | grep -v 'NAME')" disks="$(lsblk -do name | awk 'NR!=1&&!/loop/&&!/sr/&&!/zram/')"
networkInterfaces="$(ip -br addr show | sed -e 's| .*$||g' | grep -v '^lo' | grep -v 'tailscale' | grep -v '^wg')" networkInterfaces="$(ip -br addr show | awk '!/^lo/&&!/tailscale/&&!/^wg/{print$1}')"
cat << EOF cat << EOF
+5 -9
View File
@@ -26,10 +26,10 @@ while [[ ! "${option}" == 'Exit' ]]; do
################# #################
EOF EOF
select option in 'List' 'Configure' 'Pre Install' 'Install' 'WiFi Setup' 'Post Install' 'Finalize' 'Exit' select option in 'List' 'Configure' 'Install' 'Finalize' 'WiFi Setup' 'Exit'
do do
case "${option}" in case "${option}" in
'List'|'Configure'|'Pre Install'|'Install'|'WiFi Setup'|'Post Install'|'Finalize'|'Exit') 'List'|'Configure'|'Install'|'Finalize'|'WiFi Setup'|'Exit')
break break
;; ;;
*) *)
@@ -44,16 +44,12 @@ EOF
"${baseDir}/list.sh" "${baseDir}/list.sh"
elif [[ "${option}" == 'Configure' ]]; then elif [[ "${option}" == 'Configure' ]]; then
"${baseDir}/configure.sh" "${baseDir}/configure.sh"
elif [[ "${option}" == 'Pre Install' ]]; then
"${baseDir}/pre-inst.sh"
elif [[ "${option}" == 'Install' ]]; then elif [[ "${option}" == 'Install' ]]; then
"${baseDir}/install.sh" "${baseDir}/pre-inst.sh"
elif [[ "${option}" == 'WiFi Setup' ]]; then
"${baseDir}/wifi.sh"
elif [[ "${option}" == 'Post Install' ]]; then
"${baseDir}/post-inst.sh"
elif [[ "${option}" == 'Finalize' ]]; then elif [[ "${option}" == 'Finalize' ]]; then
"${baseDir}/finalize.sh" "${baseDir}/finalize.sh"
elif [[ "${option}" == 'WiFi Setup' ]]; then
"${baseDir}/wifi.sh"
fi fi
printf '\033[?47h\033[2J\033[H' printf '\033[?47h\033[2J\033[H'
Executable
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -euo pipefail
mount \
--types proc \
proc \
/mnt/proc
mount \
--types sysfs \
sys \
/mnt/sys
mount \
--bind \
/dev \
/mnt/dev
mount \
--types devpts \
pts \
/mnt/dev/pts
mount \
--types efivarfs \
efivarfs \
/mnt/sys/firmware/efi/efivars
+5 -3
View File
@@ -46,8 +46,8 @@ if [[ "${1}" == '--disk' ]]; then
if [[ "${enableSwap}" == "yes" ]]; then if [[ "${enableSwap}" == "yes" ]]; then
swapSize="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))" swapSize="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))"
if [[ "${swapSize#}" -gt '32' ]]; then if [[ "${swapSize#}" -gt '16' ]]; then
swapSize='32' swapSize='16'
fi fi
sgdisk \ sgdisk \
@@ -62,7 +62,9 @@ if [[ "${1}" == '--disk' ]]; then
-t3:BF00 \ -t3:BF00 \
-c3:${ID} \ -c3:${ID} \
${disk} ${disk}
elif [[ "${1}" == '--efi' ]]; then fi
if [[ "${1}" == '--efi' ]]; then
if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then
if [[ "${disk}" == **/dev/nvme** ]]; then if [[ "${disk}" == **/dev/nvme** ]]; then
part1='p1' part1='p1'
+8 -122
View File
@@ -33,148 +33,34 @@ cat << EOF
EOF EOF
source \ "${baseDir}/zfs/home.sh"
/etc/os-release
source \ "${baseDir}/adduser.sh"
"${baseDir}/system.conf"
# if [[ ! "${*}" = *--no-part* ]]; then
zfs create\
${hostname,,}/home/${username}
zfs create\
${hostname,,}/home/${username}/.config
zfs create\
-o canmount=off\
${hostname,,}/home/${username}/.var
zfs create\
${hostname,,}/home/${username}/.var/app
zfs create\
-o canmount=off\
${hostname,,}/home/${username}/.local
zfs create\
-o canmount=off\
${hostname,,}/home/${username}/.local/share
zfs create\
${hostname,,}/home/${username}/.local/share/flatpak
printf \
'Adding user account...\n'
adduser ${username}
# else
# adduser --no-create-home ${username}
# fi
if [[ "${ID}" == 'fedora' ]]; then
printf \
'\033[?47h\033[2J\033[H'
cat << EOF
Enter a password for the new user account:
EOF
passwd \
${username}
printf \
'\033[?47l'
usermod \
-a \
-G \
audio,cdrom,dip,floppy,wheel,video,dialout \
${username}
else
if [[ -z "$(cat /etc/group | grep 'lpadmin')" ]]; then
groupadd --gid 108 lpadmin
fi
groups='audio,cdrom,dip,floppy,plugdev,sudo,video,dialout,lpadmin'
if [[ "${ID}" == 'debian' ]]; then
groups+=',netdev'
fi
usermod \
-a \
-G \
${groups} \
${username}
fi
if [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'elementary' ]]; then
cat << EOF > /etc/apt/sources.list.d/backports.list "${baseDir}/elementary.sh" --namarupa
deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME}-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME}-backports main restricted universe multiverse
EOF
cat << EOF > /etc/apt/preferences.d/backports.pref
Package: *
Pin: release n=${UBUNTU_VERSION_CODENAME}*
Pin-Priority: 990
Package: linux* /wayland/
Pin: release n=${UBUNTU_VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
elif [[ "${ID}" == 'debian' ]]; then elif [[ "${ID}" == 'debian' ]]; then
"${baseDir}/debian.sh" --contrib "${baseDir}/debian/contrib.sh"
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
apt \ apt \
--update \
dist-upgrade \ dist-upgrade \
--yes --yes
fi fi
if [[ "${ID}" = 'debian' ]]; then if [[ "${ID}" = 'debian' ]]; then
"${baseDir}/debian.sh" --tasksel "${baseDir}/debian/tasksel.sh"
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
for file in /etc/logrotate.d/* ; do "${baseDir}/debian/logrotate.sh"
if grep -Eq "(^|[^#y])compress" "$file" ; then
sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file"
fi
done
cat << EOF | tee /usr/bin/zfs-system-snapshot-apt &> /dev/null "${baseDir}/apt-snapshot.sh"
#!/bin/bash
set -euo pipefail
TIMESTAMP="\$(date +%Y_%m_%d-%H_%M_%S)"
if [[ -z "\$(zfs list -t snapshot | grep 'apt-\${TIMESTAMP}')" ]]; then
zfs snapshot \$(zfs mount | grep 'ROOT' | sed 's| .*||')@apt-\${TIMESTAMP} && printf "\n- Snapshot taken\n\n"
fi
EOF
chmod \
+x \
/usr/bin/zfs-system-snapshot-apt
printf \
'DPkg::Pre-Install-Pkgs {"/usr/bin/zfs-system-snapshot-apt";};\n' | \
tee /etc/apt/apt.conf.d/90-zfs_system-snapshot &> /dev/null
printf \
'DPkg::Post-Invoke {"apt moo";};\n' | \
tee /etc/apt/apt.conf.d/99-apt_moo &> /dev/null
fi fi
# if [[ ! "${*}" = *--no-part* ]]; then
"${baseDir}/home-fix-setup.sh" "${baseDir}/home-fix-setup.sh"
# fi
if [[ ! -f '/usr/bin/shutdown' ]]; then if [[ ! -f '/usr/bin/shutdown' ]]; then
ln -s /sbin/shutdown /usr/bin/shutdown ln -s /sbin/shutdown /usr/bin/shutdown
+10 -12
View File
@@ -40,7 +40,7 @@ if [[ -f '/usr/bin/gsettings' ]]; then
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/debian.sh" --live "${baseDir}/debian/live.sh"
elif [[ "${ID}" == 'fedora' ]]; then elif [[ "${ID}" == 'fedora' ]]; then
"${baseDir}/fedora.sh" --live "${baseDir}/fedora.sh" --live
fi fi
@@ -48,7 +48,7 @@ fi
timedatectl timedatectl
if [[ ! "$(hostname)" == "debian-live" ]]; then if [[ ! "$(hostname)" == "debian-live" ]]; then
"${baseDir}/zfs.sh" --host-id "${baseDir}/zfs/host-id.sh"
fi fi
@@ -56,16 +56,16 @@ fi
sleep 5 sleep 5
"${baseDir}/zfs.sh" --format "${baseDir}/zfs/format.sh"
"${baseDir}/zfs.sh" --create "${baseDir}/zfs/create.sh"
"${baseDir}/mkdir-tmpfs.sh" "${baseDir}/mkdir-tmpfs.sh"
if [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/elementary.sh" --mmdebstrap "${baseDir}/elementary.sh" --mmdebstrap
elif [[ "${ID}" == 'debian' ]]; then elif [[ "${ID}" == 'debian' ]]; then
"${baseDir}/debian.sh" --mmdebstrap "${baseDir}/debian/mmdebstrap.sh"
elif [[ "${ID}" == 'fedora' ]]; then elif [[ "${ID}" == 'fedora' ]]; then
"${baseDir}/fedora.sh" --rsync "${baseDir}/fedora.sh" --rsync
fi fi
@@ -73,7 +73,7 @@ fi
"${baseDir}/hostname.sh" "${baseDir}/hostname.sh"
if [[ "${ID}" == 'debian' ]]; then if [[ "${ID}" == 'debian' ]]; then
"${baseDir}/debian.sh" --network-interfaces "${baseDir}/debian/network-interfaces.sh"
elif [[ "${ID}" == 'elementary' ]]; then elif [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/elementary.sh" --network "${baseDir}/elementary.sh" --network
fi fi
@@ -81,10 +81,10 @@ fi
if [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/elementary.sh" --sources "${baseDir}/elementary.sh" --sources
elif [[ "${ID}" == 'debian' ]]; then elif [[ "${ID}" == 'debian' ]]; then
"${baseDir}/debian.sh" --sources "${baseDir}/debian/sources.sh"
fi fi
"${baseDir}/rbind.sh" "${baseDir}/mount.sh"
"${baseDir}/host-id.sh" "${baseDir}/host-id.sh"
@@ -98,11 +98,9 @@ if [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/elementary.sh" --skel "${baseDir}/elementary.sh" --skel
fi fi
# if [[ ! "${*}" = *--no-part* ]]; then
if [[ -f "/etc/zfs/keys/${hostname,,}.key" ]]; then if [[ -f "/etc/zfs/keys/${hostname,,}.key" ]]; then
"${baseDir}/zfs.sh" --key "${baseDir}/zfs/key.sh"
fi fi
# fi
if [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'elementary' ]]; then
"${baseDir}/elementary.sh" --elementary "${baseDir}/elementary.sh" --elementary
@@ -110,7 +108,7 @@ fi
"${baseDir}/chroot.sh" --continue "${baseDir}/chroot.sh" --continue
"${baseDir}/zfs.sh" --unmount "${baseDir}/zfs/unmount.sh"
printf \ printf \
'\033[?47h\033[2J\033[H' '\033[?47h\033[2J\033[H'
Executable
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
source \
"${baseDir}/system.conf"
if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then
if [[ "${disk}" == **/dev/nvme** ]]; then
part2='p2'
else
part2='2'
fi
else
part2='-part2'
fi
if [[ "${enableSwap}" == "yes" ]]; then
printf \
"swap\t${disk}${part2}\t/dev/random\tswap,cipher=aes-xts-plain64,size=512\n" | \
tee /etc/crypttab &> /dev/null
printf \
'dev/mapper/swap\tnone\tswap\tsw\t0\t0\n' | \
tee --append /etc/fstab &> /dev/null
fi
+2 -2
View File
@@ -35,9 +35,9 @@ nmcli radio wifi on
nmcli device wifi list nmcli device wifi list
printf "Enter the SSID of the WiFi network you wish to connect to:\n" printf "Enter the SSID of the WiFi network you wish to connect to:\n"
read -r WIFI_NAME read -r wifiName
nmcli --ask device wifi connect ${wifiName} nmcli --ask device wifi connect "${wifiName}"
cat << EOF cat << EOF
-238
View File
@@ -1,238 +0,0 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
source \
/etc/os-release
source \
"${baseDir}/system.conf"
if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then
if [[ "${disk}" == **/dev/nvme** ]]; then
part3='p3'
else
part3='3'
fi
else
part3='-part3'
fi
if [[ "${1}" == '--format' ]]; then
if [[ "${encryption}" == 'yes' ]]; then
zpoolPassword='A'
zpoolPasswordVerify='B'
printf \
'\033[?47h\033[2J\033[H'
while [[ ! "${zpoolPassword}" == "${zpoolPasswordVerify}" ]] || [[ -z "${zpoolPassword}" ]] || [[ "${#zpoolPassword}" -lt '8' ]]; do
printf \
"\nEnter a password to encrypt your root pool (minimum 8 characters):\n"
read \
-r \
-s \
zpoolPassword
printf \
"\nVerify the password to encrypt your root pool:\n"
read \
-r \
-s \
zpoolPasswordVerify
if [[ ! "${zpoolPassword}" == "${zpoolPasswordVerify}" ]]; then
printf \
"ERROR:\tPasswords do not match!\n"
elif [[ -z "${zpoolPassword}" ]]; then
printf \
"ERROR:\tPassword is empty!\n"
elif [[ "${#zpoolPassword}" -lt '8' ]]; then
printf \
"ERROR:\tPassword is too short!\n"
fi
done
printf \
'\033[?47l'
mkdir \
-p \
/etc/zfs/keys/
printf \
"${zpoolPassword}\n" | tee /etc/zfs/keys/${hostname,,}.key &> /dev/null
chmod \
000 \
/etc/zfs/keys/${hostname,,}.key
zpool create \
-o ashift=12 \
-o autotrim=on \
-o compatibility=openzfs-2.1-linux \
-O encryption=on \
-O keylocation=file:///etc/zfs/keys/${hostname,,}.key \
-O keyformat=passphrase \
-O acltype=posixacl \
-O xattr=sa \
-O dnodesize=auto \
-O compression=zstd-3 \
-O normalization=formD \
-O relatime=on \
-O canmount=off \
-O mountpoint=/ \
-R /mnt \
${hostname,,} \
${disk}${part3}
else
zpool create \
-o ashift=12 \
-o autotrim=on \
-o compatibility=openzfs-2.1-linux \
-O encryption=off \
-O acltype=posixacl \
-O xattr=sa \
-O dnodesize=auto \
-O compression=zstd-3 \
-O normalization=formD \
-O relatime=on \
-O canmount=off \
-O mountpoint=/ \
-R /mnt \
${hostname,,} \
${disk}${part3}
fi
fi
if [[ "${1}" == '--create' ]]; then
zfs create \
-o canmount=off \
-o mountpoint=none \
${hostname,,}/ROOT
zfs create \
-o canmount=noauto \
-o mountpoint=/ \
${hostname,,}/ROOT/${ID}
zfs mount \
${hostname,,}/ROOT/${ID}
zfs create \
${hostname,,}/home
zfs create \
-o mountpoint=/root \
${hostname,,}/home/root
chmod \
700 \
/mnt/root
zfs create \
-o canmount=off \
-o mountpoint=/var \
${hostname,,}/var
zfs create \
-o canmount=off \
${hostname,,}/var/lib
zfs create \
${hostname,,}/var/log
zfs create \
${hostname,,}/var/spool
zfs create \
-o com.sun:auto-snapshot=false \
${hostname,,}/var/cache
zfs create \
-o com.sun:auto-snapshot=false \
${hostname,,}/var/lib/nfs
zfs create \
-o com.sun:auto-snapshot=false \
${hostname,,}/var/tmp
chmod \
1777 \
/mnt/var/tmp
zfs create \
-o mountpoint=/srv \
${hostname,,}/srv
zfs create \
-o canmount=off \
-o mountpoint=/usr \
${hostname,,}/usr
zfs create \
${hostname,,}/usr/local
zfs create \
${hostname,,}/var/games
zfs create \
${hostname,,}/var/lib/AccountsService
zfs create \
${hostname,,}/var/lib/NetworkManager
zfs create \
${hostname,,}/var/www
zfs create \
-o com.sun:auto-snapshot=false \
-o mountpoint=/tmp \
${hostname,,}/tmp
if [[ "${encryption}" == 'yes' ]]; then
zfs create \
-o com.sun:auto-snapshot=false \
-o mountpoint=/etc/zfs/keys \
${hostname,,}/keystore
fi
zpool set \
bootfs=${hostname,,}/ROOT/${ID} \
${hostname,,}
if [[ "${ID}" == 'fedora' ]]; then
"${baseDir}/fedora.sh" --rsync
fi
zfs create \
${hostname,,}/var/mail
chmod \
1777 \
/mnt/tmp
fi
if [[ "${1}" == '--key' ]]; then
cp \
/etc/zfs/keys/${hostname,,}.key \
/mnt/etc/zfs/keys/
elif [[ "${1}" == '--unmount' ]]; then
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -I {} umount -Rlf {}
if [[ "${ID}" == 'fedora' ]]; then
umount \
-nR \
/mnt
fi
zpool \
export \
-a
elif [[ "${1}" == '--host-id' ]]; then
zgenhostid \
-f \
0x00bab10c
fi
Executable
+116
View File
@@ -0,0 +1,116 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
/etc/os-release
source \
"${baseDir}/system.conf"
zfs create \
-o canmount=off \
-o mountpoint=none \
${hostname,,}/ROOT
zfs create \
-o canmount=noauto \
-o mountpoint=/ \
${hostname,,}/ROOT/${ID}
zfs mount \
${hostname,,}/ROOT/${ID}
zfs create \
${hostname,,}/home
zfs create \
-o mountpoint=/root \
${hostname,,}/home/root
chmod \
700 \
/mnt/root
zfs create \
-o canmount=off \
-o mountpoint=/var \
${hostname,,}/var
zfs create \
-o canmount=off \
${hostname,,}/var/lib
zfs create \
${hostname,,}/var/log
zfs create \
${hostname,,}/var/spool
zfs create \
-o com.sun:auto-snapshot=false \
${hostname,,}/var/cache
zfs create \
-o com.sun:auto-snapshot=false \
${hostname,,}/var/lib/nfs
zfs create \
-o com.sun:auto-snapshot=false \
${hostname,,}/var/tmp
chmod \
1777 \
/mnt/var/tmp
zfs create \
-o mountpoint=/srv \
${hostname,,}/srv
zfs create \
-o canmount=off \
-o mountpoint=/usr \
${hostname,,}/usr
zfs create \
${hostname,,}/usr/local
zfs create \
${hostname,,}/var/games
zfs create \
${hostname,,}/var/lib/AccountsService
zfs create \
${hostname,,}/var/lib/NetworkManager
zfs create \
${hostname,,}/var/www
zfs create \
-o com.sun:auto-snapshot=false \
-o mountpoint=/tmp \
${hostname,,}/tmp
if [[ "${encryption}" == 'yes' ]]; then
zfs create \
-o com.sun:auto-snapshot=false \
-o mountpoint=/etc/zfs/keys \
${hostname,,}/keystore
fi
zpool set \
bootfs=${hostname,,}/ROOT/${ID} \
${hostname,,}
if [[ "${ID}" == 'fedora' ]]; then
"${baseDir}/fedora.sh" --rsync
fi
zfs create \
${hostname,,}/var/mail
chmod \
1777 \
/mnt/tmp
Executable
+102
View File
@@ -0,0 +1,102 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
"${baseDir}/system.conf"
if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then
if [[ "${disk}" == **/dev/nvme** ]]; then
part3='p3'
else
part3='3'
fi
else
part3='-part3'
fi
if [[ "${encryption}" == 'yes' ]]; then
zpoolPassword='A'
zpoolPasswordVerify='B'
printf \
'\033[?47h\033[2J\033[H'
while [[ ! "${zpoolPassword}" == "${zpoolPasswordVerify}" ]] || [[ -z "${zpoolPassword}" ]] || [[ "${#zpoolPassword}" -lt '8' ]]; do
printf \
"Enter a password to encrypt your root pool (minimum 8 characters):\n"
read \
-r \
-s \
zpoolPassword
printf \
"Verify the password to encrypt your root pool:\n"
read \
-r \
-s \
zpoolPasswordVerify
if [[ ! "${zpoolPassword}" == "${zpoolPasswordVerify}" ]]; then
printf \
"ERROR:\tPasswords do not match!\n\n"
elif [[ -z "${zpoolPassword}" ]]; then
printf \
"ERROR:\tPassword is empty!\n\n"
elif [[ "${#zpoolPassword}" -lt '8' ]]; then
printf \
"ERROR:\tPassword is too short!\n\n"
fi
done
printf \
'\033[?47l'
mkdir \
-p \
/etc/zfs/keys/
printf \
"${zpoolPassword}\n" | tee /etc/zfs/keys/${hostname,,}.key &> /dev/null
chmod \
000 \
/etc/zfs/keys/${hostname,,}.key
zpool create \
-o ashift=12 \
-o autotrim=on \
-o compatibility=openzfs-2.1-linux \
-O encryption=on \
-O keylocation=file:///etc/zfs/keys/${hostname,,}.key \
-O keyformat=passphrase \
-O acltype=posixacl \
-O xattr=sa \
-O dnodesize=auto \
-O compression=zstd-3 \
-O normalization=formD \
-O relatime=on \
-O canmount=off \
-O mountpoint=/ \
-R /mnt \
${hostname,,} \
${disk}${part3}
else
zpool create \
-o ashift=12 \
-o autotrim=on \
-o compatibility=openzfs-2.1-linux \
-O encryption=off \
-O acltype=posixacl \
-O xattr=sa \
-O dnodesize=auto \
-O compression=zstd-3 \
-O normalization=formD \
-O relatime=on \
-O canmount=off \
-O mountpoint=/ \
-R /mnt \
${hostname,,} \
${disk}${part3}
fi
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
"${baseDir}/system.conf"
zfs create\
${hostname,,}/home/${username}
zfs create\
${hostname,,}/home/${username}/.config
zfs create\
-o canmount=off\
${hostname,,}/home/${username}/.var
zfs create\
${hostname,,}/home/${username}/.var/app
zfs create\
-o canmount=off\
${hostname,,}/home/${username}/.local
zfs create\
-o canmount=off\
${hostname,,}/home/${username}/.local/share
zfs create\
${hostname,,}/home/${username}/.local/share/flatpak
Executable
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
zgenhostid \
-f \
0x00bab10c
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
"${baseDir}/system.conf"
cp \
/etc/zfs/keys/${hostname,,}.key \
/mnt/etc/zfs/keys/
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
"${baseDir}/system.conf"
zfs \
set \
org.zfsbootmenu:keysource=${hostname,,}/keystore \
${hostname,,}
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
/etc/os-release
source \
"${baseDir}/system.conf"
zfs \
set \
org.zfsbootmenu:commandline='quiet splash rhgb noresume' \
${hostname,,}/ROOT/${ID}
Executable
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")/../")"
source \
"${baseDir}/system.conf"
umount \
-nR \
/mnt
zpool \
export \
${hostname,,}