<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.fogproject.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Create_Custom_Fog_Registration_menu</id>
		<title>Create Custom Fog Registration menu - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.fogproject.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Create_Custom_Fog_Registration_menu"/>
		<link rel="alternate" type="text/html" href="https://wiki.fogproject.org/wiki/index.php?title=Create_Custom_Fog_Registration_menu&amp;action=history"/>
		<updated>2026-04-17T08:44:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.fogproject.org/wiki/index.php?title=Create_Custom_Fog_Registration_menu&amp;diff=3237&amp;oldid=prev</id>
		<title>Ben at 06:02, 13 May 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.fogproject.org/wiki/index.php?title=Create_Custom_Fog_Registration_menu&amp;diff=3237&amp;oldid=prev"/>
				<updated>2011-05-13T06:02:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In this example we will be using the Fog manual (Full Host Registration) process as a template, but slightly customizing it so that it only prompts for PC name Image ID and also automatically assigns the PC to the Windows 7 OS ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly we will need to edit the Init.gz image ([[Modifying_the_Init_Image]])&lt;br /&gt;
&lt;br /&gt;
open a terminal and enter the following&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;cd /tftpboot/fog/images&lt;br /&gt;
gunzip init.gz&lt;br /&gt;
mkdir initmountdir&lt;br /&gt;
mount -o loop init initmountdir&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Navigate to /tftboot/fog/images/initmountdir/bin&lt;br /&gt;
&lt;br /&gt;
Make a copy fog.man.reg&lt;br /&gt;
&lt;br /&gt;
Rename the copy to fog.custom.reg&lt;br /&gt;
&lt;br /&gt;
Open fog.custom.reg&lt;br /&gt;
&lt;br /&gt;
Make the following changes (&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red = Remove code&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Blue = Add code&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
''Lines 73-81''&lt;br /&gt;
 host=&amp;quot;&amp;quot;;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;ip=&amp;quot;&amp;quot;;&amp;lt;/span&amp;gt;&lt;br /&gt;
 imageid=&amp;quot;&amp;quot;;&lt;br /&gt;
 osid=&amp;quot;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;NQ==&amp;lt;/span&amp;gt;&amp;quot;;   &lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;primaryuser=&amp;quot;&amp;quot;;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;other1=&amp;quot;&amp;quot;;&amp;lt;/span&amp;gt;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;other2=&amp;quot;&amp;quot;;&amp;lt;/span&amp;gt;&lt;br /&gt;
 blImage=&amp;quot;&amp;quot;;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;blDoAD=&amp;quot;&amp;quot;;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(note &amp;quot;NQ==&amp;quot; is the number 5 'Windows 7' encoded in base64)&lt;br /&gt;
&lt;br /&gt;
Delete the following code to remove the prompt for IP address&lt;br /&gt;
&lt;br /&gt;
''Lines 88-91'' &lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
 echo&lt;br /&gt;
 echo -n &amp;quot;    Enter the ip for this computer: &amp;quot;;&lt;br /&gt;
 read ip;&lt;br /&gt;
 ip=`echo $ip | base64`;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Delete the following code to remove the prompt for OS ID&lt;br /&gt;
&lt;br /&gt;
''Lines 109-123''&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
 while [ &amp;quot;$osid&amp;quot; = &amp;quot;&amp;quot; ] &lt;br /&gt;
 do&lt;br /&gt;
 echo&lt;br /&gt;
 echo -n &amp;quot;    Enter the OS ID for this computer (? for listing): &amp;quot;;&lt;br /&gt;
 ....&lt;br /&gt;
 ....&lt;br /&gt;
 osid=`echo $osid | base64`;		&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Delete the following code to remove the prompt for adding to Active directory&lt;br /&gt;
&lt;br /&gt;
''Lines 125-140''&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
 if [ &amp;quot;$blDoAD&amp;quot; = &amp;quot;&amp;quot; ] &lt;br /&gt;
 then&lt;br /&gt;
 echo&lt;br /&gt;
 ....&lt;br /&gt;
 ....&lt;br /&gt;
 esac&lt;br /&gt;
 fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Delete the following code to remove the prompts for Primary User, Tag 1 and Tag 2&lt;br /&gt;
&lt;br /&gt;
''Lines 142-155''&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
 echo&lt;br /&gt;
 echo -n &amp;quot;    Enter the primary user for this computer: &amp;quot;;&lt;br /&gt;
 read primaryuser;		&lt;br /&gt;
 primaryuser=`echo $primaryuser | base64`;		&lt;br /&gt;
		&lt;br /&gt;
 echo&lt;br /&gt;
 echo -n &amp;quot;    Enter the other tag #1 for this computer: &amp;quot;;&lt;br /&gt;
 read other1;	&lt;br /&gt;
 other1=`echo $other1 | base64`;&lt;br /&gt;
		&lt;br /&gt;
 echo&lt;br /&gt;
 echo -n &amp;quot;    Enter the other tag #2 for this computer: &amp;quot;;&lt;br /&gt;
 read other2;		&lt;br /&gt;
 other2=`echo $other2 | base64`;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes to so only the fields we have data for is sent back to the fog server&lt;br /&gt;
&lt;br /&gt;
''Lines 202-204''&lt;br /&gt;
&lt;br /&gt;
 res=`wget -O - --post-data=&amp;quot;mac=${mac}&amp;amp;advanced=1&amp;amp;host=${host}&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;amp;ip=${ip}&amp;lt;/span&amp;gt;&amp;amp;imageid=${imageid}&amp;amp;osid=${osid}&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;amp;primaryuser=${primaryuser}&amp;amp;other1=${other1}&amp;amp;other2=${other2}&amp;lt;/span&amp;gt;&amp;amp;doimage=${realdoimage}&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;amp;doad=${blDoAD}&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now save this document as fog.custom.reg&lt;br /&gt;
&lt;br /&gt;
Navigate to /tftboot/fog/images/initmountdir/etc/init.d&lt;br /&gt;
&lt;br /&gt;
Open S99Fog and add the following lines&lt;br /&gt;
&lt;br /&gt;
 elif [ &amp;quot;$mode&amp;quot; == &amp;quot;clamav&amp;quot; ]; then&lt;br /&gt;
 run=&amp;quot;/bin/fog.av&amp;quot;;&lt;br /&gt;
 after=$afterActionTerm;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;elif [ &amp;quot;$mode&amp;quot; == &amp;quot;customreg&amp;quot; ]; then&lt;br /&gt;
 run=&amp;quot;/bin/fog.custom.reg&amp;quot;;&lt;br /&gt;
 after=$afterActionTerm;&amp;lt;/span&amp;gt;&lt;br /&gt;
 elif [ &amp;quot;$mode&amp;quot; == &amp;quot;autoreg&amp;quot; ]; then&lt;br /&gt;
 run=&amp;quot;/bin/fog.auto.reg&amp;quot;;&lt;br /&gt;
 after=$afterActionTerm;&lt;br /&gt;
&lt;br /&gt;
Save this document&lt;br /&gt;
&lt;br /&gt;
We now need to recreate the init.gz file with these new settings&lt;br /&gt;
open a terminal window and type&lt;br /&gt;
 cd /tftpboot/fog/images&lt;br /&gt;
 umount initmountdir/&lt;br /&gt;
 rmdir initmountdir&lt;br /&gt;
 gzip init&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally we can add another menu option in the PXE boot menu so we can boot into our custom Registration process&lt;br /&gt;
&lt;br /&gt;
navigate to /tftpboot/pxelinux.cfg&lt;br /&gt;
&lt;br /&gt;
Open the file named default and add the following code (where you add this will depend on where in the menu you would like it to appear)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 LABEL fog.customreg&lt;br /&gt;
 kernel fog/kernel/bzImage&lt;br /&gt;
 append initrd=fog/images/init.gz  root=/dev/ram0 rw ramdisk_size=127000 ip=dhcp dns=*.*.*.* mode=customreg web=*.*.*.*/fog/ quiet&lt;br /&gt;
 MENU LABEL Custom Host Registration and Inventory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE the * should be replaced with your DNS and Fog Server IP addresses (check what the fog.reg and fog.reginput entries are and use the same)&lt;br /&gt;
&lt;br /&gt;
Thats it. Now when you boot your PC your PXE menu should have a new menu option called &amp;quot;Custom Host Registration&amp;quot;&lt;br /&gt;
If you select this option you will go through the Fog registration and you will only be prompted for the PC name, The Image ID and whether or not you want to image the PC Now, by default the PC will have the Windows 7 OS ID&lt;/div&gt;</summary>
		<author><name>Ben</name></author>	</entry>

	</feed>