Working with a custom host registration form

  • I was reading up at this forum post and the wiki article it linked. I put together a file using this link provided by @george1421, but I got confused from there. I know the forum post and linked comments mention that the wiki is outdated in some areas, and I think it was suggesting I wouldn’t have to do some of the extra steps that were previously required.

    It suggests putting the file into /bin, but there isn’t already an existing file there - is that normal? The wiki also mentions the /tftboot/fog/ directory (and sub-directories) a few times, which I don’t have this one on my FOG server. Should I create it, or am I misunderstanding something?

    I seem to remember reading that I have to add the custom entry to the list of the PXE items, but I can’t seem to find how to do that, which I think is the last step I’m missing.

  • So following the link in list item #1, I ran into some issues. I created the file as directed, copying the quoted text into the file and chmod’ing it to 755. Your step 4 mentions editing fog.postinit, which is a file I don’t have. I wondered if you were missing a step that indicated to run the patch script, so I ran it with # ./ and got the following output:

    ./ line 12: /usr/share/fog/lib/ No such file or directory
    Testing path for our fixed file at
    ./ line 15: debugPause: command not found
    Failed to find file [] sorry. Copy Failed
    ./ line 26: debugPause: command not found

    I am thinking that my issue is possibly advice in this forum thread, which suggests that it’s safe to delete the contents of /images/dev/. The thread is from 2016, so perhaps dev gained more purpose than a temporary dumping ground for in-progress captures? I arrived at that thread some time ago, for the same reason as the OP - I was running out of disk space and found out it was because of occasionally-failing captures. Deleted the contents of the folder and everything was good again.

    Following the link to list item #2, “Using scripts” was a non-starter. I have /opt/fog, but don’t have utils within that directory. Instead, I have log, service, and snapins. I ran find -iname *image* and didn’t find in the results.

    I followed the instructions in the “By Hand” section for Version 1.0.0 and up. I had trouble running mount -o loop init{,_32} initmountdir as CentOS didn’t like that command, so I made the assumption that it was trying to mount two directories within initmountdir (init & init_32). I ran that command as such:

    mount -o loop init initmountdir/init
    mount -o loop init_32 initmountdir/init_32

    I then navigated to initmountdir/init{,_32}/bin and changed each to the file I had created. It sort of worked after I packed everything up, in that things did change, but the registration didn’t act as expected. I entered a hostname as requested, left image ID blank and hit Enter, then it went to a blank line. I waited, but eventually hit Enter again, which then asked if I wanted to associate with groups. After that, when I hit Enter, it dropped to a new blank line, but didn’t continue the form. I possibly have a malformed file (I had a few errors along the way, fixed based on my knowledge of what was wrong). If you’d like, I can attach it. Any thoughts on some of the other issues above?

    Also, I was wondering, how would I create a new menu entry, so that my tests show up as a separate item from the primary full registration?

  • Moderator

    There are two ways to go about adding an updated file to the running FOS image.

    1. I wrote a tutorial on how to dynamically patch this file using a postinit script. Post init scripts are scripts that are run on the FOS Linux engine just after the engine has been initialized and before the main command script is called. These post init scripts can initialize hardware or “patch” files in the FOS Linux engine (like

    2. The other way is to unpack the inits, modify the files and then repack the inits:

    The main fog applications on FOS Linux are in /bin (inside the init.xz file).

Log in to reply