Move EFI related commands/tasks into dedicated script
This commit is contained in:
@@ -10,7 +10,7 @@ The purpose of this branch is to modularize as many functions of the scripts as
|
|||||||
[ ] Move (at least almost) all Fedora related commands and tasks to `fedora.sh`
|
[ ] 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`
|
[ ] 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`)
|
[ ] Rename flags in all distro specific scripts from numbered (i.e. `-1`, `-2`) to descriptive (i.e. `--mmdebstrap`, `--network-interfaces`)
|
||||||
[ ] 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
|
[ ] 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`
|
||||||
|
|||||||
61
efi.sh
Normal file
61
efi.sh
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
baseDir="$(realpath "$(basename "${0}")")"
|
||||||
|
|
||||||
|
|
||||||
|
source \
|
||||||
|
"${baseDir}/system.conf"
|
||||||
|
|
||||||
|
|
||||||
|
mkdir \
|
||||||
|
-p \
|
||||||
|
/boot/efi/EFI/ZBM
|
||||||
|
|
||||||
|
mkdir \
|
||||||
|
-p \
|
||||||
|
/boot/efi/EFI/BOOT
|
||||||
|
|
||||||
|
curl \
|
||||||
|
--progress-bar \
|
||||||
|
--show-error \
|
||||||
|
--output \
|
||||||
|
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
|
||||||
|
--location \
|
||||||
|
https://get.zfsbootmenu.org/efi
|
||||||
|
|
||||||
|
rsync \
|
||||||
|
-pogAXtlHrDx \
|
||||||
|
--stats \
|
||||||
|
--info=progress2 \
|
||||||
|
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
|
||||||
|
/boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI
|
||||||
|
|
||||||
|
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 \
|
||||||
|
-c \
|
||||||
|
-d "${disk}" \
|
||||||
|
-p '1' \
|
||||||
|
-L 'ZFSBootMenu (Backup)' \
|
||||||
|
-l '\EFI\ZBM\VMLINUZ-BACKUP.EFI'
|
||||||
|
|
||||||
|
efibootmgr \
|
||||||
|
-c \
|
||||||
|
-d "${disk}" \
|
||||||
|
-p '1' \
|
||||||
|
-L 'ZFSBootMenu' \
|
||||||
|
-l '\EFI\ZBM\VMLINUZ.EFI'
|
||||||
50
install.sh
50
install.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
baseDir="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
||||||
|
|
||||||
printf \
|
printf \
|
||||||
'\033[?47l\012'
|
'\033[?47l\012'
|
||||||
@@ -9,7 +9,7 @@ printf \
|
|||||||
cat << EOF
|
cat << EOF
|
||||||
#######################################
|
#######################################
|
||||||
## ##
|
## ##
|
||||||
## $(cat "${BASEDIR}/title") Script ##
|
## $(cat "${baseDir}/title") Script ##
|
||||||
## ##
|
## ##
|
||||||
## Jean <jean@easthighnerd.net> ##
|
## Jean <jean@easthighnerd.net> ##
|
||||||
## ##
|
## ##
|
||||||
@@ -27,7 +27,7 @@ EOF
|
|||||||
source \
|
source \
|
||||||
/etc/os-release
|
/etc/os-release
|
||||||
source \
|
source \
|
||||||
"${BASEDIR}/system.conf"
|
"${baseDir}/system.conf"
|
||||||
|
|
||||||
if [[ ! "${DISK}" == **/dev/disk/by-id/** ]]; then
|
if [[ ! "${DISK}" == **/dev/disk/by-id/** ]]; then
|
||||||
if [[ "${DISK}" == **/dev/nvme** ]]; then
|
if [[ "${DISK}" == **/dev/nvme** ]]; then
|
||||||
@@ -227,47 +227,7 @@ if [[ ! "${*}" = *--no-part* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! "${*}" = *--no-part* ]]; then
|
if [[ ! "${*}" = *--no-part* ]]; then
|
||||||
mkdir \
|
"${baseDir}/efi.sh"
|
||||||
-p \
|
|
||||||
/boot/efi/EFI/ZBM
|
|
||||||
|
|
||||||
mkdir \
|
|
||||||
-p \
|
|
||||||
/boot/efi/EFI/BOOT
|
|
||||||
|
|
||||||
curl \
|
|
||||||
--progress-bar \
|
|
||||||
--show-error \
|
|
||||||
--output \
|
|
||||||
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
|
|
||||||
--location \
|
|
||||||
https://get.zfsbootmenu.org/efi
|
|
||||||
|
|
||||||
cp \
|
|
||||||
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
|
|
||||||
/boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI
|
|
||||||
|
|
||||||
cp \
|
|
||||||
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
|
|
||||||
/boot/efi/EFI/BOOT/BOOTX64.EFI
|
|
||||||
|
|
||||||
cp \
|
|
||||||
/boot/efi/EFI/ZBM/VMLINUZ.EFI \
|
|
||||||
/boot/efi/EFI/BOOT/shellx64.efi
|
|
||||||
|
|
||||||
efibootmgr \
|
|
||||||
-c \
|
|
||||||
-d "${DISK}" \
|
|
||||||
-p '1' \
|
|
||||||
-L 'ZFSBootMenu (Backup)' \
|
|
||||||
-l '\EFI\ZBM\VMLINUZ-BACKUP.EFI'
|
|
||||||
|
|
||||||
efibootmgr \
|
|
||||||
-c \
|
|
||||||
-d "${DISK}" \
|
|
||||||
-p '1' \
|
|
||||||
-L 'ZFSBootMenu' \
|
|
||||||
-l '\EFI\ZBM\VMLINUZ.EFI'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
@@ -289,4 +249,4 @@ zfs \
|
|||||||
snapshot \
|
snapshot \
|
||||||
${HOSTNAME,,}/ROOT/${ID}@install
|
${HOSTNAME,,}/ROOT/${ID}@install
|
||||||
|
|
||||||
"${BASEDIR}/post-inst.sh"
|
"${baseDir}/post-inst.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user