'ubuntu-installer-custom','Text/Safe Mode'=>'ubuntu-installer'); $checkfiles=array('boot-screens/vesamenu.c32',$str_pxelinux.'/default','linux','initrd.lz'); $root_path_netinstall='/var/www/ipxeboot/pxe-ltsp/netinstall'; $relative_webserver_path='pxe-ltsp/netinstall'; $menu_entries=array(); foreach ($archs as $a){ foreach($modes as $mk=>$mv){ $do=true; foreach ($checkfiles as $file){ if (! file_exists("$root_path_netinstall/$mv/$a/$file")){ // echo "skipping $root_path_netinstall/$mv/$a/$file\n"; $do=false; } } if($do){ $menu=array(); $menu['#']='Netinst: Install Menu'; $menu['LABEL']=$label_generic; $menu['MENU LABEL']=$label_menu_generic." $a ($mk)"; $menu['KERNEL']="$relative_webserver_path/$mv/$a/boot-screens/vesamenu.c32"; $menu['CONFIG']="$relative_webserver_path/$mv/$a/$str_pxelinux/default $relative_webserver_path/"; $menu_entries[]=$menu; } } } $text=''; foreach ($menu_entries as $entry){ $text.="\n"; foreach($entry as $kme => $vme){ $text.="$kme $vme\n"; } $text.="\n"; } return $text; } $mirror_var="/var/lib/n4d/variables-dir/LLIUREXMIRROR"; if (is_file($mirror_var) ) $mirror_installed=True; else $mirror_installed=False; $string = file_get_contents("/etc/ltsp/bootopts/netinstall.json"); $json=json_decode($string,true); if (strtolower($json["netinstall_boot"])=="true"&&$mirror_installed==True){ $MenuEntryList=array(); $MenuEntry=new stdClass(); $MenuEntry->id="netinstall"; $MenuEntry->label="Instal·la LliureX en aquest ordinador"; $str_pxelinux=""; if (strtolower($json["netinstall_stats"])=="true"){ $str_pxelinux="pxelinux-stats.cfg"; }else{ $str_pxelinux="pxelinux.cfg"; } /* $MenuEntry->menuString="\n# Netinst: Install Menu LABEL Instal.la LliureX en aquest ordinador MENU LABEL Instal.la LliureX x32 (Graphical Mode) KERNEL pxe-ltsp/netinstall/ubuntu-installer-custom/i386/boot-screens/vesamenu.c32 CONFIG pxe-ltsp/netinstall/ubuntu-installer-custom/i386/pxelinux.cfg/default pxe-ltsp/netinstall/\n"; $MenuEntry->menuString.="\n# Netinst: Install Menu LABEL Instal.la LliureX en aquest ordinador MENU LABEL Instal.la LliureX x64 (Graphical Mode) KERNEL pxe-ltsp/netinstall/ubuntu-installer-custom/amd64/boot-screens/vesamenu.c32 CONFIG pxe-ltsp/netinstall/ubuntu-installer-custom/amd64/pxelinux.cfg/default pxe-ltsp/netinstall/\n"; $MenuEntry->menuString.="\n# Netinst: Install Menu LABEL Instal.la LliureX en aquest ordinador MENU LABEL Instal.la LliureX x32 (Text/Safe Mode) KERNEL pxe-ltsp/netinstall/ubuntu-installer/i386/boot-screens/vesamenu.c32 CONFIG pxe-ltsp/netinstall/ubuntu-installer/i386/pxelinux.cfg/default pxe-ltsp/netinstall/\n"; $MenuEntry->menuString.="\n# Netinst: Install Menu LABEL Instal.la LliureX en aquest ordinador MENU LABEL Instal.la LliureX x64 (Text/Safe Mode) KERNEL pxe-ltsp/netinstall/ubuntu-installer/amd64/boot-screens/vesamenu.c32 CONFIG pxe-ltsp/netinstall/ubuntu-installer/amd64/pxelinux.cfg/default pxe-ltsp/netinstall/\n"; */ $MenuEntry->menuString=entries_netinstall($str_pxelinux); array_push($MenuEntryList, $MenuEntry); $MenuEntryListObject=$MenuEntryList; /*echo "# Netinst: Install Menu\n"; echo "LABEL Instal.la LliureX en aquest ordinador\n"; echo "MENU LABEL Instal.la LliureX en aquest ordinador\n"; echo "KERNEL pxe/netinstall/ubuntu-installer/i386/boot-screens/vesamenu.c32\n"; echo "CONFIG pxe/netinstall/ubuntu-installer/i386/pxelinux.cfg/default pxe/netinstall/\n";*/ } ?>