• I am going to give my clients the possibility to choose the OS via rEFInd
    is it possible to load the theme from the fog server?
    I installed it like on local installations in the same folder like refind.conf (/var/www/fog/service/ipxe/themes/) and configured an “include” for the theme.conf into the refind.conf
    But it seems like ipxe.efi does not load the themes folder or the refind.conf is not able to load the folder.

    Any ideas? maybe set the path to the themesfolder as url?


  • @george1421 said in rEFInd - themes:

    Also something to try is because the error references “themes\theme.conf” we might want to use the dos path separator instead of the unix one. \ vs / in the --name key value.

    I did this as the first project, this is much mor work than i thought… it has to be made by hand, no search and replace…
    But there is some success:

    imgfetch <somename> <uri> **<somename>** 
    

    this second somename made a change and I even saw for a second the backgroundimage before it fell back to textmode! So the syntax and the path works ina way
    but this fallback to textmode led only to another problem:
    “Icons directory doesn’t exist; setting back textonly =TRUE”

    Also in your imgfetch, I don’t see you actually sending “themes\theme.conf” to iPXE. Maybe that is why its throwing the error. Again I’m doing a lot of educated guessing here because I’ve never needed this method. So its going to be some trial and error here.

    it is there 🙂 in the first row - and after adding the second “somename” on the end it works…

    @thomgee Can you change the configuration file to look for the icons and images in the same path where the refind.efi and refind.conf? I really don’t know how the directory structure works within this ipxe vhd . The concerns is that its a simple directory structure where sub dirs are not supported.

    Maybe I don’t need this in the moment, as it is reading the themes/theme.conf and the huge amount of files.
    the Icon-dir is my problem, as refind needs is obviously somehow.
    I guess it needs the default icon-folder refind ships - but I feel horrified to fetch every single file…

  • Moderator

    @george1421 There is also another clue. In my tutorial for pxe booting windows.
    consider this imgfetch command. And the example from this document.

    imgfetch --name boot.wim ${pe-path}/boot.wim boot.wim
    

    And the example from this document. https://ipxe.org/cmd/imgfetch

      #!ipxe
      kernel /boot/vmlinuz-2.6.31 initrd=initrd.magic
      initrd initrd.img
      initrd /modules/2.6.31/e1000.ko /lib/modules/e1000.ko
      boot
    

    specifically this line

    initrd /modules/2.6.31/e1000.ko /lib/modules/e1000.ko
    

    Just for clarity initrd and imgfetch are the same exact function. The differences helps describe the intent of what they are transferring not its function.

    So if you look at the command reference link they are downloading the file /modules/2.6.31/e1000.ko and storing it in the VHD as /lib/modules/e1000.ko

    So in my reference I’m downloading ${pe-path}/boot.wim and storing it as boot.wim Somewhere I found a reference for UEFI needed the --name parameter. That is how I ended up duplicating the bios component with the --name making"
    imgfetch --name boot.wim ${pe-path}/boot.wim boot.wim

    meaning that we might need to use both --name keyword and path along with the trailing storage path as in the command reference page.

    BUT lets see if we can solve the missing themes conf file because the --name might override the trailing path. My method I got to work and never testing beyond it worked and then I moved onto the next issue.

    EDIT: Ah now I see where I got that from: https://ipxe.org/appnote/wimboot_architecture
    Specifically:

    This will fetch the file given by <uri> and make it available with the virtual filename <somename> in the CPIO archive supplied to wimboot. Multiple imgfetch commands can be used, one after another. The seemingly redundant <somename> statements are used to provide compatibility with both UEFI mode (–name <name>) and legacy BIOS mode (<name> as the first argument) at the same time.

    NOTE: The virtual filename <somename> must be a flat filename without subdirectory components.

  • Moderator

    @thomgee Can you change the configuration file to look for the icons and images in the same path where the refind.efi and refind.conf? I really don’t know how the directory structure works within this ipxe vhd . The concerns is that its a simple directory structure where sub dirs are not supported.

    Also something to try is because the error references “themes\theme.conf” we might want to use the dos path separator instead of the unix one. \ vs / in the --name key value.

    Also in your imgfetch, I don’t see you actually sending “themes\theme.conf” to iPXE. Maybe that is why its throwing the error. Again I’m doing a lot of educated guessing here because I’ve never needed this method. So its going to be some trial and error here.


  • @george1421 OK. I am on scratch

    Thanx for the fast reply

    I did as you said - hopefully I didn’t miss anything

    i show you the code i used in the Menu:

    imgfetch --name themes/theme.conf ${boot-url}/service/ipxe/themes/theme.conf
    imgfetch --name themes/icons/vol_optical.png ${boot-url}/service/ipxe/themes/vol_optical.png
    imgfetch --name themes/icons/vol_net.png ${boot-url}/service/ipxe/themes/vol_net.png
    imgfetch --name themes/icons/vol_internal.png ${boot-url}/service/ipxe/themes/vol_internal.png
    imgfetch --name themes/icons/vol_external.png ${boot-url}/service/ipxe/themes/vol_external.png
    imgfetch --name themes/icons/tool_windows_rescue.png ${boot-url}/service/ipxe/themes/tool_windows_rescue.png
    imgfetch --name themes/icons/tool_shell.png ${boot-url}/service/ipxe/themes/tool_shell.png
    imgfetch --name themes/icons/tool_rescue.png ${boot-url}/service/ipxe/themes/tool_rescue.png
    imgfetch --name themes/icons/tool_part.png ${boot-url}/service/ipxe/themes/tool_part.png
    imgfetch --name themes/icons/tool_netboot.png ${boot-url}/service/ipxe/themes/tool_netboot.png
    imgfetch --name themes/icons/tool_mok_tool.png ${boot-url}/service/ipxe/themes/tool_mok_tool.png
    imgfetch --name themes/icons/tool_memtest.png ${boot-url}/service/ipxe/themes/tool_memtest.png
    imgfetch --name themes/icons/tool_fwupdate.png ${boot-url}/service/ipxe/themes/tool_fwupdate.png
    imgfetch --name themes/icons/tool_apple_rescue.png ${boot-url}/service/ipxe/themes/tool_apple_rescue.png
    imgfetch --name themes/icons/os_windows.png ${boot-url}/service/ipxe/themes/os_windows.png
    imgfetch --name themes/icons/os_win.png ${boot-url}/service/ipxe/themes/os_win.png
    imgfetch --name themes/icons/os_unknown.png ${boot-url}/service/ipxe/themes/os_unknown.png
    imgfetch --name themes/icons/os_ubuntu.png ${boot-url}/service/ipxe/themes/os_ubuntu.png
    imgfetch --name themes/icons/func_shutdown.png ${boot-url}/service/ipxe/themes/func_shutdown.png
    imgfetch --name themes/icons/func_reset.png ${boot-url}/service/ipxe/themes/func_reset.png
    imgfetch --name themes/icons/func_csr_rotate.png ${boot-url}/service/ipxe/themes/func_csr_rotate.png
    imgfetch --name themes/icons/func_exit.png ${boot-url}/service/ipxe/themes/func_exit.png
    imgfetch --name themes/icons/func_firmware.png ${boot-url}/service/ipxe/themes/func_firmware.png
    imgfetch --name themes/icons/func_hidden.png ${boot-url}/service/ipxe/themes/func_hidden.png
    imgfetch --name themes/icons/func_about.png ${boot-url}/service/ipxe/themes/func_about.png
    imgfetch --name themes/icons/arrow_right.png ${boot-url}/service/ipxe/themes/arrow_right.png
    imgfetch --name themes/icons/arrow_left.png ${boot-url}/service/ipxe/themes/arrow_left.png
    imgfetch --name themes/background-bio.png ${boot-url}/service/ipxe/themes/background-bio.png
    imgfetch --name themes/selection-big.png ${boot-url}/service/ipxe/themes/selection-big.png
    imgfetch --name themes/selection-small.png ${boot-url}/service/ipxe/themes/selection-small.png
    imgfetch --name themes/source-code-pro-extralight-14.png ${boot-url}/service/ipxe/themes/source-code-pro-extralight-14.png
    imgfetch ${boot-url}/service/ipxe/refind.conf
    chain -ar ${boot-url}/service/ipxe/refind_x64.efi || goto MENU
    

    I copied the files accordingly into folders in ipxe.
    When I start the menu i looks promissing
    All imgfetches run with an ok! It is slow this way, but this seems to work
    but refind keeps falling back in to textmode.
    when I refresh, it sais:

    • Configuration file “themes\theme.conf” missing
    • Icons directory doesn’t exist: setting textonly = TRUE
    • Icons directory doesn’t exist: setting textonly = TRUE
    • Warning: unable to scale icon from 1 x 0 to 32 x 32 from “.VolumeBadge.png”
    • and about 8 similar warnings…

    I made sure refind is in graphical mode (textonly 0) and the path is right
    The files for the theme are 870 kB alltogether

    Ana idea, why it doesn’t find the neither the themes.conf nor icon-folder?

  • Moderator

    @thomgee You will need to do some testing first. If you can get refind to do what you want, I think we can get iPXE to do what you want but we will need to test this idea first.

    The general concept that we are going to follow is from this document. https://forums.fogproject.org/topic/10944/using-fog-to-pxe-boot-into-your-favorite-installer-images/16?_=1669214513607

    In the nonexact terms, when iPXE boots, it allocates a bit of memory to function as a virtual hard drive. You load stuff into that virtual hard drive using the imgfetch command.

    So if you look at the FOG defined exit mode for uefi it is this:

    imgfetch ${boot-url}/service/ipxe/refind.conf
    chain -ar ${boot-url}/service/ipxe/refind_x64.efi || goto MENU
    

    You see here that it loads the refind.conf file into that virtual hard drive and then with the chain command it transfers the kernel “refind_x64.efi” to the virtual hard drive and attempts to boot it.

    If you want to preload additional configuration files into this virtual hard drive so that refind.efi can find it in the same directory just issue the imgfetch command. Understand that the files you want to load must be in /var/www/html/fog/service/ipxe directory to begin with. Now if you have a series of files its a bit more complex since this virtual hard drive is a bit limited in size. Its best not to have sub directories but I think that can be worked around too with the --name directive for image fetch. Something like imgfetch --name themes/theme1.bin ${boot-url}/service/ipxe/themes/theme1.bin but I’ve never tried that before.

    imgfetch  --name themes/theme1.bin ${boot-url}/service/ipxe/themes/theme1.bin
    imgfetch ${boot-url}/service/ipxe/refind.conf
    chain -ar ${boot-url}/service/ipxe/refind_x64.efi || goto MENU
    

    So what I’m proposing as a step 1 test build a custom iPXE menu using the FOG Configuration -> iPXE menus tool. Following the overall structure provided in the post from above in step 6. Get it working there as you want then we can work on tweaking FOG’s default programming to give you want you need.

303
Online

10.1k
Users

16.3k
Topics

149.5k
Posts