Adding BitDefender to the Advanced Menu
-
Hey guys,
I’ve been working on add some ISOs to the advanced boot menu and I had a few question. I was able to setup DBAN and it run flawless, but I’ve having some issues with BitDefender Rescue at the moment. The ISOs are being stored at “/var/www/fog/iso/” with ownership/group belonging to www-data (Octal: 755).
Here is my current Advanced Menu layout:
:MENU menu item -- gap-- ----------- Tools and Utilities ----------- item bitdefender BitDefender Rescue CD item dban Darik's Boot and Nuke item -- gap-- ------------ Advanced Options ------------- item return Return to Main Menu item fog.local Boot from Hard Disk item reboot Reboot Computer choose --default bitdefender --timeout 10000 target && goto ${target} ############ TOOLS & UTILITIES MENU ############ :bitdefender initrd http://${fog-ip}/${fog-webroot}/iso/bitdefender.iso chain memdisk iso raw || goto MENU :dban kernel ${boot_url}/fog/dban/dban.bzi nuke="dwipe --autonuke" silent nousb vga=785 boot ############ ADVANCED OPTIONS MENU ############ :fog.local sanboot --no-describe --drive 0x80 || goto MENU boot || goto MENU :return chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} || goto MENU :reboot reboot autoboot
I moved memdisk into the ISO folder, because I saw in another post this was important.
I’m get to the BitDefender splash screen and then I get the follow error:
starting version 225 /init: line 311: awk: not found !! Invalid loop location: /rescue/livecd.squashfs !! Please export LOOP with a valid location !! or reboot and pass a proper loop=... !! kernel command line
I am assuming I need to mount the iso, but I’m sure about the config on the advanced menu for this section. I was curious if anyone else has had this issue or know how to resolve the error.
-
Have you looked through this?
https://wiki.fogproject.org/wiki/index.php?title=Include_any_ISO_in_the_FOG_BootmenuThere are examples in there for mounting ISOs as read only.
-
Thank you, I’ve been trying to follow that guide with not luck and I haven’t seen anyone else boot Bitdefender successively.
-
@Dalton-Childers said:
:bitdefender
initrd http://${fog-ip}/${fog-webroot}/iso/bitdefender.iso
chain memdisk iso raw ||
goto MENUYou can’t directly load the ISO file like that. It has to be mounted, and there is a read-only way to mount it using a loopback option. You shoul mount it in NFS, and then export this directory via NFS. Then, you would setup the iPXE boot script here to mount the NFS location. You will still need to specify any needed initrd and kernel file.
Look at the “older” parted magic example in the wiki. Also, looking at network booting from a Linux ISO might also help you see what you need to do. If you make any progress or need help, just come back here.
-
for linux based ISOs, you’d mount as read-only with loopback, and then you’d point to the kernel and init after it’s mounted via NFS. I think you will find the below articles helpful.
http://www.cyberciti.biz/tips/how-to-mount-iso-image-under-linux.html
-
And who marked the thread as solved when it’s not? I’m marking it as unsolved.
-
Now I’ve played a bit with that Bitdefender ISO… I guess there are couple of different ways to boot this live linux but here is what I found to be the “easiest” way. I am saying easy because this is how bitdefender (or lets better call it gentoo - because that’s what it really is!!) wants to be booted over network. First I looked at what is on the CD/ISO:
cd /tmp && wget http://download.bitdefender.com/rescue_cd/bitdefender-rescue-cd.iso sudo mount -o loop /tmp/bitdefender-rescue-cd.iso /mnt ls /mnt boot EFI grub.pxe grubx64.efi rescue syslinux
Ok there is syslinux (which essentially just calles grub as you can see in syslinux.cfg) and grub. Hmmm, grub.pxe sounds promising. But let’s take a look at boot/grub/grub.cfg first…
... if [ -z $net_default_ip ]; then set kopts_common="root=/dev/ram0 real_root=/dev/loop0 loop=${SQUASHFILE} cdroot_marker=${SQUASHFILE} initrd udev cdroot scandelay=10" else eval "set nfsroot=\${net_${net_default_interface}_rootpath}" ... set kopts_common="root=/dev/nfs real_root=/dev/nfs nfsroot=${nfsroot} ip=${net_default_ip} loop=${SQUASHFILE} looptype=squashfs livecd.nfsif=${net_default_mac} initrd udev cdroot" ...
Even better than I’d expected. This grub.cfg is ready for CD boot as well as PXE/NFS boot! Seams like we don’t need to put together a kernel command line by hand but just let grub do all the work. We only need to put all the things into the right place:
# assuming the ISO is still mounted sudo cp -R /mnt/grub.pxe /mnt/boot/ /tftpboot sudo mkdir /tftpboot/rescue sudo cp /mnt/rescue/bootsplash.png /tftpboot/rescue sudo chown -R fog /tftpboot sudo cp -R /mnt/rescue/ /images/dev
Then edit your iPXE menu:
:bitdefender chain tftp://${fog-ip}/grub.pxe || goto MENU
As you can see in the grub.cfg script it is using a varibale called ${…rootpath} which is set via DHCP. So as a last step you need to edit your DHCP server and add this:
... option root-path "192.168.1.1:/images/dev"; ...
Make sure to change the IP to match your FOG server IP and restart the service (
service isc-dhcp-server restart
orsystemctl restart dhcpd.service
- depending on OS you have).If you don’t want to edit your DHCP config you can simply modify /tftpboot/boot/grub/grub.cfg and statically add your NFS infos!
-
Another improvement would be to entirely toss grub and simply load the kernel and initrd (fastest via HTTP) straight from iPXE.
# assuming the ISO is mounted in /mnt sudo cp -R /mnt/rescue/ /images/dev sudo cp /mnt/boot/kernel.* /mnt/boot/initfs.* /var/www/html/fog/service/ipxe/
And here is the iPXE config:
:bitdefender kernel http://${fog-ip}/${fog-webroot}/service/ipxe/kernel.i386-pc root=/dev/nfs real_root=/dev/nfs nfsroot=${fog-ip}:/images/dev ip=${ip} loop=/rescue/livecd.squashfs looptype=squashfs livecd.nfsif=${net0/mac} initrd udev cdroot quiet splash initrd http://${fog-ip}/${fog-webroot}/service/ipxe/initfs.i386-pc boot || goto MENU
And added to the wiki
-
@Dalton-Childers I am marking this solved. Would be nice to hear if you could make it run on your system as well…
-
@Sebastian-Roth Thank you for all the details on how to make this work. I haven’t been able to work on our FOG server for the last few months so it has taken me a bit to try this out. I was able to get everything working except I get an update error. The error states “The server address is not correct.” This appears to stem from an issue where the live cd doesn’t have an IP address and can not connect to the update server. I’m looking for a solution now.