Skip to content

add grub_run_no_partition option to generate correct grub.conf#100

Open
biancalana wants to merge 1 commit intofreebsd:masterfrom
biancalana:feature/grub-run-no-partition
Open

add grub_run_no_partition option to generate correct grub.conf#100
biancalana wants to merge 1 commit intofreebsd:masterfrom
biancalana:feature/grub-run-no-partition

Conversation

@biancalana
Copy link
Copy Markdown

Its common cloud images provide unpartitioned disks.
This add an option that generate grub.conf that allow boot using unpartitioned disks.

and allow boot using unpartitioned disks common on cloud images
@metalefty
Copy link
Copy Markdown
Member

@biancalana Could you let me know an example of unpartitioned cloud images? I'll test it with it.

@biancalana
Copy link
Copy Markdown
Author

@metalefty
Copy link
Copy Markdown
Member

The Alpine image successfully booted with the following additional configuration.

grub_run_no_partition="yes"
grub_run0="linux /boot/vmlinuz-virt root=/dev/vda rootfstype=ext4 rw"
grub_run1="initrd /boot/initramfs-virt"

Copy link
Copy Markdown
Member

@metalefty metalefty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also reflect changes on man pages, edit vm.8.

# generate right grub.conf when the disk does not use any partition
# like some cloud images
config::get "_grub_opt" "grub_run_no_partition"
if [ -n "${_grub_opt}" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ -n "${_grub_opt}" ]; then
if [ config::yesno "grub_run_no_partition" ]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config:yesno might be better because it can handle on/true/yes/1|off/false/no/0.
The current code interprets grun_run_no_partition=no as "yes". It could mislead.

[ -n "${_grub_opt}" ] && _root="hd0,${_grub_opt}"
# generate right grub.conf when the disk does not use any partition
# like some cloud images
config::get "_grub_opt" "grub_run_no_partition"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config::get "_grub_opt" "grub_run_no_partition"

@metalefty
Copy link
Copy Markdown
Member

@michael-o Do you have any opinions?

@metalefty metalefty requested a review from michael-o March 9, 2026 09:13
@michael-o
Copy link
Copy Markdown
Member

@michael-o Do you have any opinions?

No opinion, but would to know whether these images can also boot via UEFI?

@metalefty
Copy link
Copy Markdown
Member

It actually doesn't boot with UEFI, but images for UEFI are also available. BIOS versions seem to support only BIOS+GRUB.

@michael-o
Copy link
Copy Markdown
Member

It actually doesn't boot with UEFI, but images for UEFI are also available. BIOS versions seem to support only BIOS+GRUB.

I see, ok. Then this makes sense, I guess.

@metalefty
Copy link
Copy Markdown
Member

@biancalana This one can be merged once the comments are addressed.

@michael-o michael-o removed their request for review March 22, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants