• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

How to Change FOG PXE Boot Host Registration Options

Scheduled Pinned Locked Moved Solved
FOG Problems
3
10
3.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    InternStarz
    last edited by Aug 27, 2015, 12:03 PM

    Hello, I am looking to find out how I can change the default selections when registering a device into FOG. I am doing the full host registration and inventory, and a few of the options are set to (y,N) by default and I want to change them to (Y,n). The two are the options to Join to AD after image, and to Image after inventory is complete. I figured there is a configuration file on the FOG server somewhere for this, but I am not exactly sure where to find it. Any help would be greatly appreciated!

    Thanks!

    ~Intern

    C 1 Reply Last reply Aug 27, 2015, 12:28 PM Reply Quote 0
    • C
      ch3i Moderator
      last edited by Aug 27, 2015, 12:24 PM

      hi, not sure but I think it’s in the init.xz.

      1 Reply Last reply Reply Quote 1
      • C
        ch3i Moderator @InternStarz
        last edited by ch3i Aug 27, 2015, 6:29 AM Aug 27, 2015, 12:28 PM

        @InternStarz said:

        Hello, I am looking to find out how I can change the default selections when registering a device into FOG. I am doing the full host registration and inventory, and a few of the options are set to (y,N) by default and I want to change them to (Y,n). The two are the options to Join to AD after image, and to Image after inventory is complete. I figured there is a configuration file on the FOG server somewhere for this, but I am not exactly sure where to find it. Any help would be greatly appreciated!

        Thanks!

        ~Intern

        Ok, it’s sure now… it’s in the init.xz.

        You have to modify the file “fog.man.reg” in the /bin folder of you init.xz and init_32.xz.
        To mount and modify this file you have to read that : https://wiki.fogproject.org/wiki/index.php/Modifying_the_Init_Image

        1 Reply Last reply Reply Quote 1
        • I
          InternStarz
          last edited by Aug 27, 2015, 12:52 PM

          I’m attempting to run the command:

          cd /var/www/{html,}/fog/service/ipxe/
          xz -d init{,_32}.xz
          mkdir initmountdir
          mount -o loop init{,_32} initmountdir

          but once I get to the xz -d init{,_32}.xz command, it says xz: init.xz: No such file or directory. Same thins with init_32.xz.

          Any suggestions? I am also using sudo before trying to command. I have already done the cd command to navigate to the folder.

          C 1 Reply Last reply Aug 27, 2015, 12:57 PM Reply Quote 0
          • C
            ch3i Moderator @InternStarz
            last edited by Aug 27, 2015, 12:57 PM

            @InternStarz

            cd /var/www/fog/service/ipxe/
            
            1 Reply Last reply Reply Quote 0
            • I
              InternStarz
              last edited by InternStarz Aug 27, 2015, 7:27 AM Aug 27, 2015, 1:01 PM

              @ch3i

              Ok, now we are getting a little further. I ran the same xz -d init{,_32}.xz command, and now I’m getting

              xz: init.xz: File format not recognized. Same with init_32.xz.

              C T 2 Replies Last reply Aug 27, 2015, 2:37 PM Reply Quote 0
              • C
                ch3i Moderator @InternStarz
                last edited by Aug 27, 2015, 2:37 PM

                @InternStarz which version of software are you using ?

                1 Reply Last reply Reply Quote 0
                • I
                  InternStarz
                  last edited by Aug 27, 2015, 3:15 PM

                  @ch3i I am running Ubuntu 14.04 LTS & FOG 1.2.0. Just installed it about a month ago.

                  1 Reply Last reply Reply Quote 0
                  • T
                    Tom Elliott @InternStarz
                    last edited by Aug 27, 2015, 11:04 PM

                    @InternStarz Try this:

                    cd /var/www/fog/service/ipxe;xz -d init{,_32}.xz

                    My only guess, for right now, is the files were extracted, but inappropriately, or they were already extracted.

                    Here’s a script I use to do this. This is specific to trunk so things that don’t necessarily require a complete rebuild of the inits, it just opens the files, gets my changes, and recompresses them:

                    #!/bin/bash
                     # Check for webroot
                     if [ -n "$1" -a -e "$1" ]; then
                         webroot="$1";
                     elif [ -e "/var/www/html/fog" ]; then
                         webroot="/var/www/html/fog";
                     elif [ -e "/var/www/fog" ]; then
                         webroot="/var/www/fog";
                     fi
                     if [ ! -e "$webroot/service" ]; then
                         echo "No service directory to work from"
                         exit 1
                     fi
                     if [ ! -e "$webroot/service/ipxe" ]; then
                         echo "No ipxe directory to work from"
                         exit 1
                     fi
                     ipxeroot="$webroot/service/ipxe"
                     currDirectory=`pwd`
                     init64=''
                     init32=''
                     if [ ! -f "$ipxeroot/init.xz" -a ! -f "$ipxeroot/init" ]; then
                         echo "No 64 bit init to process"
                         init64='no'
                     fi
                     if [ ! -f "$ipxeroot/init_32.xz" -a ! -f "$ipxeroot/init_32" ]; then
                         echo "No 32 bit init to process"
                         init32='no'
                     fi
                     if [ -n "$init64" -a -n "$init32" ]; then
                         echo "No init files to process"
                         exit 1
                     fi
                     if [ ! -e "$ipxeroot/tmp" ]; then
                         mkdir $ipxeroot/tmp >/dev/null 2>&1
                     fi
                     copyTrunkFiles() {
                         svn up /root/trunk/ >/dev/null 2>&1
                         cp -r /root/trunk/src/buildroot/package/fog/scripts/bin/* $ipxeroot/tmp/bin/ >/dev/null   2>&1 
                         cp -r /root/trunk/src/buildroot/package/fog/scripts/usr/* $ipxeroot/tmp/usr/ >/dev/null   2>&1
                         cp -r /root/trunk/src/buildroot/package/fog/scripts/etc/* $ipxeroot/tmp/etc/ >/dev/null   2>&1
                         cp -r /root/trunk/src/buildroot/system/skeleton/etc/* $ipxeroot/tmp/etc/ >/dev/null 2>&1
                         errorStat $?
                     }
                     mountTmpFolder() {
                         mount -o loop $ipxeroot/$1 $ipxeroot/tmp >/dev/null 2>&1
                         if [ -z "$2" ]; then
                             errorStat $?
                         elif [ "$?" != "0" -a -f "$ipxeroot/$1" ]; then
                             unmountTmpFolder "true"
                             mountTmpFolder "$1"
                         fi
                     }
                     unmountTmpFolder() {
                         umount $ipxeroot/tmp >/dev/null 2>&1
                         if [ -z "$1" ]; then
                             errorStat $?
                         fi
                     }
                    initFSCheck() {
                         fsck.ext2 -a $ipxeroot/$1 >/dev/null 2>&1
                         errorStat $?
                     }
                     recompressInit() {
                         xz -9 -C crc32 >/dev/null 2>&1 < $ipxeroot/$1 > $ipxeroot/${1}.xz
                         errorStat $?
                     }
                     decompressInit() {
                         xz -d >/dev/null 2>&1 < $ipxeroot/${1}.xz > $ipxeroot/$1
                         errorStat $?
                     }
                     errorStat() {
                         if [ "$1" != "0" ]; then
                             echo "Failed"
                             exit 1
                         fi
                         echo "OK"
                     }
                     if [ -z "$init64" ]; then
                         if [ -f "$ipxeroot/init.xz" -a ! -f "$ipxeroot/init" ]; then
                             echo -n " * Decompressing 64 bit init..."
                             decompressInit "init"
                         else
                             echo " * 64 bit init already extracted"
                         fi
                         echo -n " * Mounting 64 bit init..."
                         mountTmpFolder "init" "yes"
                         echo -n " * Copying trunk files..."
                         copyTrunkFiles
                         echo -n " * Unmounting init..."
                         unmountTmpFolder
                         echo -n " * Checking ext2 filesystem..."
                         initFSCheck "init"
                         echo -n " * Recompressing 64 bit Init..."
                         recompressInit "init"
                     fi
                     if [ -z "$init_32" ]; then
                         if [ -f "$ipxeroot/init_32.xz" -a ! -f "$ipxeroot/init_32" ]; then
                             echo -n " * Decompressing 32 bit init..."
                             decompressInit "init_32"
                         else
                             echo " * 32 bit init already extracted"
                         fi
                         echo -n " * Mounting 32 bit init..."
                         mountTmpFolder "init_32" "yes"
                         echo -n " * Copying trunk files..."
                         copyTrunkFiles
                         echo -n " * Unmounting init..."
                         unmountTmpFolder
                         echo -n " * Checking ext2 filesystem..."
                         initFSCheck "init_32"
                         echo -n " * Recompressing 32 bit Init..."
                         recompressInit "init_32"
                     fi
                    

                    I realize this is extremely over complicated for what you need. But you could see what areas you want and need I suppose.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    I 1 Reply Last reply Aug 28, 2015, 1:21 PM Reply Quote 0
                    • I
                      InternStarz @Tom Elliott
                      last edited by Aug 28, 2015, 1:21 PM

                      @Tom-Elliott Phew, you weren’t wrong when you said it was a bit overkill. I’m a bit apprehensive about doing anything that I can’t understand what is happening to the FOG server. For example, if something breaks with this script, I don’t know exactly where to fix it.

                      I also still don’t have a bare metal backup of my FOG server yet, and I can’t afford to have it down, especially at the beginning of the school year (I work for a Public School). Possibly once I have a backup of it, and when school is out for a break or something, I’ll return to this and attempt it.

                      Unless you’ve got an easier idea to change those defaults, I’ll just put it on the back burner until further notice.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      1 / 1
                      • First post
                        1/10
                        Last post

                      226

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project