Imaging through the menu
I would like to start image upload/download through the fog boot menu without creating tasks on the web frontend.
I found this config snippet on a previous thread:
APPEND initrd=fog/images/init.gz root=/dev/ram0 rw ramdisk_size=127000 ip=dhcp dns=10.10.10.1 mac=00:1e:ec:e3:dd:1b ftp=10.0.7.1 storage=10.0.7.1:/data/fogstorage/images/dev/ storageip=10.0.7.1 web=10.0.7.1/fog/ osid=5 loglevel=4 consoleblank=0 irqpoll chkdsk=0 img=win7activatedsysprepgen imgType=n imgid=6 PIGZ_COMP=-9 hostname=testname pct=5 ignorepg=1 type=up
MENU LABEL Image Upload
Upload Image to server.
APPEND initrd=fog/images/init.gz root=/dev/ram0 rw ramdisk_size=127000 ip=dhcp dns=10.10.10.1 mac=00:1e:ec:e3:dd:1b ftp=10.0.7.1 storage=10.0.7.1:/data/fogstorage/images/dev/ storageip=10.0.7.1 web=10.0.7.1/fog/ osid=5 loglevel=4 consoleblank=0 irqpoll chkdsk=0 img=win7activatedsysprepgen imgType=n imgid=6 PIGZ_COMP=-9 hostname=testname pct=5 ignorepg=1 type=down
MENU LABEL Image Download
Download image from Server to host.
The upload does work even if the mac address is a word like HOST1 then the image will go under /images/dev/HOST1 although at the end of the imaging process the script cannot move the folder to it’s place and continue hanging.
The download (restore image) process however does not work because it tries to query the web frontend to see if there is a TASK for the specific mac also validates the mac address.
Which script do I need to modify in the original initrd to get rid of this check?
Tom Elliott last edited by
There are a couple of place’s you’d need to edit whether you choose to edit the init.gz, or edit the php file.
Editing the init.gz would work, but is more difficult as it requires unzipping, then mounting, editing, then unmounting, then rezipping all to check if your edit’s worked. If you made a mistake, you have redo the same steps over again. Repeat until all is working as expected. All of these steps would also require rebooting the system to check that the changes work as otherwise they’ll have the previous iteration of the init.gz loaded.
Editing the service scripts is probably easier, as you don’t have reboot the client to test, and they’res no unzipping, mounting, etc…
The easiest recommendation I could give for you to successfully do this is kind of two stepped.
First, manually create a false task entry in the database with something along the lines of:
[code]INSERT INTO fog.tasks (taskHostID,taskStateID) VALUES (‘1999’,‘1’);[/code]
Create a false Host entry using the fake ID you’ve set in tasks:
[code]INSERT INTO fog.hosts (hostID,hostMAC) VALUES(‘1999’,‘00:00:00:00:00:00’);[/code]
Then edit the Post_Stage2, Post_Stage3 and Pre_Stage1 files to leave the tasking alone if the host ID equals 1999 (or whatever false host you’ve given.
Then edit your default file to use the MAC Address 00:00:00:00:00:00 mac address.
I’m not giving specific instructions on editing the Post_Stage2, Post_Stage3, and Pre_Stage1 files because I don’t know what version of FOG you’re using, so I can’t provide an direct assistance.
That all said, while this all looks like a lot to have to do, it’s ultimately much simpler than editiing the init.gz. You didn’t want to have to create a task all the time, and with this you wouldn’t have to, just forcibly create the one task, and use that task as the “controller” for those extra entries.