Add installation scripts - #2
Conversation
| @@ -0,0 +1,23 @@ | |||
| #!/usr/bin/bash | |||
|
|
|||
| if [[ ! -d /sys/firmware/efi/ ]] || [[ $# < 3 ]]; then | |||
There was a problem hiding this comment.
lets use two separate if statements if possible, because each condition check different semantic things
| #!/usr/bin/bash | ||
|
|
||
| if [[ ! -d /sys/firmware/efi/ ]] || [[ $# < 3 ]]; then | ||
| exit 0 |
There was a problem hiding this comment.
is this consider an error? if yes, let's exit with non-zero
|
|
||
| FROM_DIR=/usr/lib/${PKG}/${VER}/${ARCH}/EFI/${DISTRO} | ||
| EFI_DIR=/boot/efi/EFI/${DISTRO} | ||
| if [[ -d ${EFI_DIR}/b ]]; then |
There was a problem hiding this comment.
folder 'b' looks suspicious (the name), or is it a typo?
| EFI_DIR=${EFI_DIR}/b | ||
| fi | ||
|
|
||
| cp ${FROM_DIR}/* ${EFI_DIR}/. |
There was a problem hiding this comment.
shellcheck is complaining on several lines on this script including this one
install_bootloader 3 43 error SC2071 < is for string comparisons. Use -lt instead. (sh-shellcheck)
install_bootloader 13 10 error SC2071 > is for string comparisons. Use -gt instead. (sh-shellcheck)
install_bootloader 23 4 info SC2086 Double quote to prevent globbing and word splitting. (sh-shellcheck)
install_bootloader 23 18 info SC2086 Double quote to prevent globbing and word splitting. (sh-shellcheck)
| @@ -0,0 +1,23 @@ | |||
| #!/usr/bin/bash | |||
|
|
|||
There was a problem hiding this comment.
please include the following bash settings
set -eu
set -o pipefail
| @@ -0,0 +1,29 @@ | |||
| #!/usr/bin/bash | |||
|
|
|||
There was a problem hiding this comment.
please include the following bash settings
set -eu
set -o pipefail
There was a problem hiding this comment.
Also several warnings/infos when running shellcheck, so lets fix all or most of them
| @@ -0,0 +1,29 @@ | |||
| #!/usr/bin/bash | |||
|
|
|||
| if [[ ! -f /sys/firmware/efi/ ]]; then | |||
| AR=x64 | ||
| if [[ $arch = aarch64 ]]; then | ||
| AR=aa64; | ||
| fi |
There was a problem hiding this comment.
I believe no other archs are considered at this time
| if [[ -f /etc/kernel/cmdline ]]; then | ||
| BOOT_OPTIONS="$(tr -s ' ' < /etc/kernel/cmdline)" | ||
| else | ||
| BOOT_OPTIONS="$(tr -s '\n' < /proc/cmdline | sed -e 's/BOOT_IMAGE=[^ ]*//')" |
There was a problem hiding this comment.
I think this would lead a leading space
|
|
||
| Source0: nmbl-builder-%{VERSION}.tar.xz | ||
| Source1: make_efi_entries | ||
| Source2: install_bootloader |
There was a problem hiding this comment.
at some point [1], grub would install a similar script on the same place so perhaps we should rename this one ?
[1] https://src.fedoraproject.org/rpms/grub2/pull-request/170
Add two scripts that:
Installation script will later be part of bootupd8r and will be installed by it instead.