• Hi,
    Wondering if its possible to use graphic refind while using fog, I tried to use a theme but graphic doesn’t even appear

    menuentry “CentOS” {
    icon /EFI/refind/themes/rEFInd-minimal-drunkcj/icons/os_linux.png
    volume 713a361c-ac6f-4434-b1aa-6aa4f823cda3
    initrd /EFI/centos/grub.cfg
    loader /EFI/centos/grubx64.efi
    include themes/rEFInd-minimal-drunkcj/theme.conf

    This is an example, do i have to install refind on the computer ? or from the refind.conf of fog i can do something like that

  • Moderator

    @george1421 So the second part of this is; I would create a custom FOG iPXE menu item to test this next bit. Since refind exists in the http path we can use the http protocol to grab the files you need.

    I would start out by cloning the FOG provided refind.conf file to… for this example refind2.conf. Place any files you want to load in the http path on the fog server but not in the fog file path because an upgrade will delete your custom files. For this example lets create a new directory with
    mkdir /var/www/html/crefind place your cloned refind2.conf file in there plus any other files you want to load onto the refind vhd.

    set http-path http://${fog-ip}
    set custrefind-path ${http-path}/crefind
    set refind-path ${http-path}/forg/service/ipxe
    kernel ${refind-path}/refind_x64.efi
    imgfetch --name refind.conf ${custrefind-path}/refind2.conf refind.conf
    imgfetch --name os_linux.png ${custrefind-path}/os_linux.png os_linux.png
    imgfetch --name theme.conf ${custrefind-path}/theme.conf theme.conf
    boot || goto MENU

    Understand I did not debug this menu at all, I just glued the bits together. So it might work or might now. But the idea is correct. Remember in your refind2.conf file the ipxe vhd has no paths so everything is stored in the root of the vhd. So this config file stanza
    icon /EFI/refind/themes/rEFInd-minimal-drunkcj/icons/os_linux.png
    Needs to be rewritten as
    icon os_linux.png

  • Moderator

    @koni Its not possible with the default refind exit mode. But you could either hack a solution or make your own custom exit mode.

    So what is happening here (this is not 100% true, but for this explanation lets say it is) is that ipxe is loading refind.efi and the refind.conf onto a virtual hard drive and then executing it. This vhd is a very simple one that has no directories and can only access it self normally.

    If we look at this example where we are wimbooting a winpe environment. You see we are loading multiple files that winpe needs to boot into memory and then calling wimboot (the boot loader) to start winpe. https://forums.fogproject.org/post/103331

    set tftp-path tftp://${fog-ip}
    set pe-path ${tftp-path}/os/winpe
    kernel ${tftp-path}/wimboot gui
    imgfetch --name BCD ${pe-path}/BCD BCD
    imgfetch --name boot.sdi ${pe-path}/boot.sdi boot.sdi
    imgfetch --name boot.wim ${pe-path}/boot.wim boot.wim
    boot || goto MENU

    You can see the imgfetch commands load additional files into the vhd before boot is called. I don’t have time at the moment to finish explaing this but above is the general concept of what needs to be done. Any additional files need to be loaded after with the imgfetch command. So refind.efi will be the kernel and the config file and any additional files you need for the refind menu need to be loaded with imgfetch.