diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2023-01-26 11:20:42 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2023-01-26 11:26:43 +0000 |
commit | c5820072a92b4d43d75af40260b2e36c3c7bd68d (patch) | |
tree | 966afad61ea8354cbcc7707043415012efb41717 | |
parent | a7fb778415a264a0f40e7580217cbd5616fb0cfe (diff) | |
download | alpine-conf-c5820072a92b4d43d75af40260b2e36c3c7bd68d.zip |
setup-disk: support BOOTLOADER=none
Allow disable bootloader install
fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10526
-rw-r--r-- | setup-disk.in | 4 | ||||
-rwxr-xr-x | tests/setup_disk_test | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/setup-disk.in b/setup-disk.in index 258a494..53ccee6 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -669,6 +669,7 @@ install_mounted_root() { rm -f "$mnt"/var/lib/apk/installed "$mnt"/lib/apk/db/installed echo "Installing system on $rootdev:" case "$BOOTLOADER" in + none) ;; grub) setup_grub "$mnt" "$root" "$modules" "$kernel_opts" "$bootdev" $disks ;; syslinux) setup_syslinux "$mnt" "$root" "$modules" "$kernel_opts" "$bootdev" ;; zipl) setup_zipl "$mnt" "$root" "$modules" "$kernel_opts" ;; @@ -825,6 +826,9 @@ stop_all_raid() { } select_bootloader_pkg() { + if [ "$BOOTLOADER" = none ]; then + return + fi local bootloader="$BOOTLOADER" if [ "$ARCH" = "ppc64le" ]; then bootloader=grub-ieee1275 diff --git a/tests/setup_disk_test b/tests/setup_disk_test index 5fcb535..0331700 100755 --- a/tests/setup_disk_test +++ b/tests/setup_disk_test @@ -12,7 +12,8 @@ init_tests \ setup_disk_func_uuid_or_device \ setup_disk_non_existing_block_dev \ setup_disk_install_mounted_root_nvme \ - setup_disk_install_mounted_root_efi_boot + setup_disk_install_mounted_root_efi_boot \ + setup_disk_install_mounted_root_bootloader_none setup_disk_usage_body() { test_usage setup-disk @@ -268,7 +269,6 @@ setup_disk_install_mounted_root_efi_boot_body() { mkdir -p target/boot \ sys/firmware/efi - # simulate nvme0n1p2 being mounted fake_mount "/dev/vda2 $PWD/target ext4 rw,noatime,data=ordered 0 0" fake_mount "/dev/vda1 $PWD/target/boot vfat rw,relatime,fmask=0022 0 0" @@ -286,3 +286,20 @@ setup_disk_install_mounted_root_efi_boot_body() { atf_check -o match:"GRUB_CMDLINE_LINUX_DEFAULT=.*ext4" \ cat target/etc/default/grub } + +setup_disk_install_mounted_root_bootloader_none_body() { + init_env + mkdir -p target/boot \ + sys/firmware/efi + + fake_mount "/dev/vda2 $PWD/target ext4 rw,noatime,data=ordered 0 0" + fake_mount "/dev/vda1 $PWD/target/boot vfat rw,relatime,fmask=0022 0 0" + + BOOTLOADER=none atf_check -s exit:0 \ + -o not-match:"grub" \ + setup-disk -v target + + if [ -f target/etc/default/grub ]; then + atf_fail "etc/default/grub should not exist" + fi +} |