archcraft-os/documentation

[Enhancement] Boot Archcraft with GRUB

Closed this issue · 2 comments

About Config Content

According your config,

menuentry "Archcraft Live ISO" --class archcraft {
	set root='(hd0,X)'
	set isofile="/path/to/archcraft.iso"
	set dri="free"
	search --no-floppy -f --set=root $isofile
	probe -u $root --set=abc
	set pqr="/dev/disk/by-uuid/$abc"
	loopback loop $isofile
	linux  (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$pqr img_loop=$isofile driver=$dri quiet splash vt.global_cursor_default=0 loglevel=2 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 cow_spacesize=2G
	initrd  (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

I adjust it for enhancement.

menuentry "Archcraft 2021.10.05 ISO" --class Archcraft {
	set use_driver="free"
	set iso_file="/opt/iso/archcraft/21.10/archcraft-2021.10.05-x86_64.iso"
	search --no-floppy -f --set=iso_partition $iso_file
	probe -u $iso_partition --set=iso_partition_uuid
	set img_dev="/dev/disk/by-uuid/$iso_partition_uuid"
	loopback loop ($iso_partition)$iso_file
	set boot_option="quiet splash vt.global_cursor_default=0 loglevel=2 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 cow_spacesize=2G"
	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$img_dev img_loop=$iso_file driver=$use_driver $boot_option
	initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

only two place to raplace, path and title.

no needed to assign partition, it would be auto detected.

path

replace the path /opt/iso/archcraft/21.10/archcraft-2021.10.05-x86_64.iso

set iso_file="/opt/iso/archcraft/21.10/archcraft-2021.10.05-x86_64.iso"

title

replace the title Archcraft 2021.10.05 ISO

menuentry "Archcraft 2021.10.05 ISO" --class Archcraft {

About Config File Path

two place to put grub custom config

Path Note
/boot/grub/custom.cfg no needed to run sudo update-grub after chang config
/etc/grub.d/40_custom have to run sudo update-grub after chang config

I wrote some example, to share it with you.

explore

howto find /boot/grub/custom.cfg

run

cat /etc/grub.d/41_custom

show

#!/bin/sh
cat <<EOF
if [ -f  \${config_directory}/custom.cfg ]; then
  source \${config_directory}/custom.cfg
elif [ -z "\${config_directory}" -a -f  \$prefix/custom.cfg ]; then
  source \$prefix/custom.cfg
fi
EOF

The current grub menu-entry is generic and won't require to be updated on each release.
Putting date on menu entry is stupid, and not everyone put their ISOs in /opt.

Yes. I know what you mean.

But i just share this for template, it just example.

menuentry "Archcraft 2021.10.05 ISO" --class Archcraft {
	set use_driver="free"
	set iso_file="/opt/iso/archcraft/21.10/archcraft-2021.10.05-x86_64.iso"
	search --no-floppy -f --set=iso_partition $iso_file
	probe -u $iso_partition --set=iso_partition_uuid
	set img_dev="/dev/disk/by-uuid/$iso_partition_uuid"
	loopback loop ($iso_partition)$iso_file
	set boot_option="quiet splash vt.global_cursor_default=0 loglevel=2 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 cow_spacesize=2G"
	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$img_dev img_loop=$iso_file driver=$use_driver $boot_option
	initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

anyone should adjuest it

menuentry "Replace Your Title" --class Archcraft {
	set use_driver="free"
	set iso_file="Replace Your Iso File Path"
	search --no-floppy -f --set=iso_partition $iso_file
	probe -u $iso_partition --set=iso_partition_uuid
	set img_dev="/dev/disk/by-uuid/$iso_partition_uuid"
	loopback loop ($iso_partition)$iso_file
	set boot_option="quiet splash vt.global_cursor_default=0 loglevel=2 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 cow_spacesize=2G"
	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$img_dev img_loop=$iso_file driver=$use_driver $boot_option
	initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

========================================

or

menuentry "Archcraft Live ISO" --class Archcraft {
	set use_driver="free"
	set iso_file="/path/to/archcraft.iso"
	search --no-floppy -f --set=iso_partition $iso_file
	probe -u $iso_partition --set=iso_partition_uuid
	set img_dev="/dev/disk/by-uuid/$iso_partition_uuid"
	loopback loop ($iso_partition)$iso_file
	set boot_option="quiet splash vt.global_cursor_default=0 loglevel=2 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 cow_spacesize=2G"
	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$img_dev img_loop=$iso_file driver=$use_driver $boot_option
	initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

anyone should repace the /path/to/archcraft.iso with your Archcraft ISO path.

it works on my environment! not invalid!

========================================

or

menuentry "Archcraft Live ISO" --class Archcraft {
	set use_driver="free"
	set iso_file="/opt/iso/archcraft.iso"
	search --no-floppy -f --set=iso_partition $iso_file
	probe -u $iso_partition --set=iso_partition_uuid
	set img_dev="/dev/disk/by-uuid/$iso_partition_uuid"
	loopback loop ($iso_partition)$iso_file
	set boot_option="quiet splash vt.global_cursor_default=0 loglevel=2 rd.systemd.show_status=false rd.udev.log-priority=3 sysrq_always_enabled=1 cow_spacesize=2G"
	linux (loop)/arch/boot/x86_64/vmlinuz-linux img_dev=$img_dev img_loop=$iso_file driver=$use_driver $boot_option
	initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img
}

anyone just put the iso file to fixed path. for example: /opt/iso/archcraft.iso .

no needed to change the config anymore.

:-)