menuentry 'FreeBSD 11.1-RELEASE-p1' {
insmod zfs
insmod part_gpt
search --no-floppy --fs-uuid [B]--set=root cd397a8f11725bf3[/B]
kfreebsd /ROOT/freebsd-root/@/boot/kernel/kernel -v
kfreebsd_loadenv /ROOT/freebsd-root/@/boot/device.hints
kfreebsd_module /ROOT/freebsd-root/@/boot/zfs/zpool.cache -type /boot/zfs/zpool.cache
kfreebsd_module /ROOT/freebsd-root/@/boot/entropy -type /boot/entropy
kfreebsd_module_elf /ROOT/freebsd-root/@/boot/kernel/opensolaris.ko
kfreebsd_module_elf /ROOT/freebsd-root/@/boot/kernel/zfs.ko
kfreebsd_module_elf /ROOT/freebsd-root/@/boot/kernel/linux_common.ko
kfreebsd_module_elf /ROOT/freebsd-root/@/boot/kernel/linux.ko
kfreebsd_module_elf /ROOT/freebsd-root@/boot/kernel/drm2.ko
kfreebsd_module_elf /ROOT/freebsd-root@/boot/kernel/iicbus.ko
kfreebsd_module_elf /ROOT/freebsd-root@/boot/kernel/iicbb.ko
kfreebsd_module_elf /ROOT/freebsd-root@/boot/kernel/iic.ko
kfreebsd_module_elf /ROOT/freebsd-root@/boot/kernel/i915kms.ko
set kFreeBSD.kern.vty=vt
set kFreeBSD.vfs.root.mountfrom=zfs:mypool/ROOT/freebsd-root
set kFreeBSD.vfs.root.mountfrom.options=rw
set kFreeBSD.sem_load=NO
}
Note that this may NOT be possible because not every ISO has the ability to be booted in such way. You need to loop mount the ISO and check the grub.cfg file (or syslinux.conf for that matter) to see the way it boots, then try adding those kernel parameters to the GRUB boot command. Then you will see if the ISO can be booted that way at all, which depends on whether or not it creates /dev/loop at boot time, among other things.I would prefer to add Arch Linux to my FreeBSD-based grub.cfg to boot from ISO but can't stumble across the required parameters...
Note that this may NOT be possible because not every ISO has the ability to be booted in such way. You need to loop mount the ISO and check the grub.cfg file (or syslinux.conf for that matter) to see the way it boots, then try adding those kernel parameters to the GRUB boot command. Then you will see if the ISO can be booted that way at all, which depends on whether or not it creates /dev/loop at boot time, among other things.
menuentry '[loopback]archlinux-2014.11-1-archboot' {
set isofile='/boot/iso/archlinux-2014.11-1-archboot.iso'
loopback loop $isofile
linux (loop)/boot/vmlinuz_x86_64 iso_loop_dev=$imgdevpath iso_loop_path=$isofile
initrd (loop)/boot/initramfs_x86_64.img
}
Have you tried the value found under /dev/disk/by-label or /dev/disk/by-uuid in your Arch installation? If youset imgdevpath="/dev/disk/by-label/label_value"
or
set imgdevpath="/dev/disk/by-uuid/label_value"
ls -l /dev/disk/by-uuid
, you will see which disk it is in "standard" notation. Use that for you GRUB installed under Linux.# grub-probe --target=fs_uuid -d /dev/adaX
The problem is I don't know how to interpret $imgdevpath...
Has anyone added a Grub menuentry for FreeBSD to an existing Arch Linux installation?
I've added Grub2 entries in Debian/Slackware for OpenBSD/NetBSD and if you use a UFS based filesystem, chainloading the bootblock is the easiest. I've seen alternative grub entries where an initrd, with the appropriate file system module, has to be be generated. Not clear from the OP what FreeBSD file system is being used.
error: unknown filesystem.
kfreebsd /boot/loader
may need to be modified to suit the environment. In case you have GPT partitions it would not be just /boot/loader|zfsloader, but kfreebsd /boot/gptloader
or /boot/zfsgptloader . kfreebsd $loader
GRUB command doesn't need that. Which is useful if you did the installation in a non-standard way and omitted the bootblock installation...This post can give a good idea as to what's understood to be $imgdevpath. As seems clear from the name itself, it's path to the device where ISO is located.
:: running early hook [udev]
starting version 232
:: running early hook [archiso_pxe_nbd]
:: running hook [udev]
:: Triggering uevents...
:: running hook [memdisk]
:: running hook [archiso]
:: running hook [archiso_loop_mnt]
:: running hook [archiso_pxe_common]
:: running hook [archiso_pxe_nbd]
:: running hook [archiso_pxe_http]
:: running hook [archiso_pxe_nfs
:: Mounting '/dev/loop0' to '/run/archiso/bootmnt'
mount: you must specify the filesystem type
ERROR: failed to mount '/dev/loop0'
Falling back to interactive prompt
You can try to fix the problem manually, log ou when you are finished
sh: can't access tty; job control turned off
[rootfs ]#
uname -a
I get Linux (none) 4.10.6.-1-ARCH #1 SMP PREEMPT Mon Mar 27 08:28:22 CEST 2017 x86_64 GNU/Linux
mount -t c9660 /dev/loop0 /run/archiso/bootmnt
, as the prompt suggests. If it mounts all right, then you can exit the shell and see if it will boot normally.