diff options
author | Sertonix <sertonix@posteo.net> | 2024-08-05 12:32:42 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2024-09-06 12:19:56 +0000 |
commit | 619b636a4e50c73561352e24f4fe660f661c030c (patch) | |
tree | b8b3bc0c1fcaf4237130db0989268ad2c7f4b9b1 | |
parent | 5147450891cc9db4c2615b7c0ac4b978bd3797c8 (diff) | |
download | aports-619b636a4e50c73561352e24f4fe660f661c030c.zip |
scripts/mkimage.sh: simplify for loops
-rwxr-xr-x | scripts/mkimg.base.sh | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/scripts/mkimg.base.sh b/scripts/mkimg.base.sh index 681806d9868..66e3c8c5e7d 100755 --- a/scripts/mkimg.base.sh +++ b/scripts/mkimg.base.sh @@ -17,11 +17,9 @@ build_kernel() { --repositories-file "$APKROOT/etc/apk/repositories" \ "$DESTDIR" \ || return 1 - if [ -n "$boot_addons" ]; then - for _add in $boot_addons; do - apk fetch --root "$APKROOT" --quiet --stdout $_add | tar -C "${DESTDIR}" -zx boot/ - done - fi + for _add in $boot_addons; do + apk fetch --root "$APKROOT" --quiet --stdout $_add | tar -C "${DESTDIR}" -zx boot/ + done } section_kernels() { @@ -107,11 +105,9 @@ syslinux_gen_config() { for _f in $kernel_flavors; do if [ -z "${xen_params+set}" ]; then _initrd="/boot/initramfs-$_f" - if [ -n "$initrd_ucode" ]; then - for _p in $initrd_ucode; do - _initrd="$_p,$_initrd" - done - fi + for _p in $initrd_ucode; do + _initrd="$_p,$_initrd" + done cat <<- EOF @@ -140,11 +136,9 @@ grub_gen_config() { for _f in $kernel_flavors; do if [ -z "${xen_params+set}" ]; then _initrd="/boot/initramfs-$_f" - if [ -n "$initrd_ucode" ]; then - for _p in $initrd_ucode; do - _initrd="$_p $_initrd" - done - fi + for _p in $initrd_ucode; do + _initrd="$_p $_initrd" + done cat <<- EOF |