├── bin └── pxelinux.0 ├── images ├── boot.png ├── ipxe.png ├── login.png ├── menu.png └── initial.png ├── .idea ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── deployment.xml ├── webServers.xml ├── compiler.xml └── misc.xml ├── pxelinux.cfg ├── hdt.cfg ├── memtest86plus.cfg └── default ├── config.php ├── hdt.php ├── acronis.php ├── esxihp.php ├── esxifujitsu.php ├── memtest86plus.php ├── acronisdd11.php ├── auth.php ├── wdscapture.php ├── wdsdeploy.php ├── gparted.php ├── params.php ├── win7pe.php ├── acronisbr115.php ├── win7pe_reboot_pro.php ├── centos7live.php ├── iPXE.iml ├── submenu_acronis.php ├── wimboot.php ├── clonezilla.php ├── install_ubuntu.php ├── globals.php ├── install_centos6.php ├── lspci.php ├── menu.php ├── boot.php ├── functions.php └── README.md /bin/pxelinux.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybesttools/macos-netboot-ipxe/HEAD/bin/pxelinux.0 -------------------------------------------------------------------------------- /images/boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybesttools/macos-netboot-ipxe/HEAD/images/boot.png -------------------------------------------------------------------------------- /images/ipxe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybesttools/macos-netboot-ipxe/HEAD/images/ipxe.png -------------------------------------------------------------------------------- /images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybesttools/macos-netboot-ipxe/HEAD/images/login.png -------------------------------------------------------------------------------- /images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybesttools/macos-netboot-ipxe/HEAD/images/menu.png -------------------------------------------------------------------------------- /images/initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mybesttools/macos-netboot-ipxe/HEAD/images/initial.png -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /pxelinux.cfg/hdt.cfg: -------------------------------------------------------------------------------- 1 | default hdt 2 | menu title hdt 3 | timeout 0 4 | 5 | label hdt 6 | menu label hdt 7 | kernel bin/hdt/hdt.c32 8 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | 'm', # user1 4 | 'admin:admin' => 'a', # user2 5 | ); 6 | 7 | ?> 8 | -------------------------------------------------------------------------------- /hdt.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /esxihp.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /pxelinux.cfg/memtest86plus.cfg: -------------------------------------------------------------------------------- 1 | default memtest86+ 2 | menu title memtest86+ 3 | timeout 0 4 | 5 | label memtest86+ 6 | menu label memtest86+ 7 | kernel bin/memtest86plus/memtest86+-5.01 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /esxifujitsu.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /memtest86plus.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /acronisdd11.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /auth.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /wdscapture.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /wdsdeploy.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /gparted.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /params.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /win7pe.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /acronisbr115.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /win7pe_reboot_pro.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /centos7live.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /iPXE.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /submenu_acronis.php: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /.idea/deployment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pxelinux.cfg/default: -------------------------------------------------------------------------------- 1 | default menu.c32 2 | prompt 0 3 | timeout 100 4 | ONTIMEOUT local 5 | 6 | LABEL local 7 | MENU LABEL Boot local hard drive 8 | LOCALBOOT 0 9 | 10 | LABEL chainlocal 11 | MENU LABEL Chain boot to local hard drive 12 | KERNEL chain.c32 13 | APPEND hd0 14 | 15 | LABEL hirens_netboot 16 | MENU LABEL Boot Hirens 17 | KERNEL memdisk 18 | APPEND images/hirens/Hirens.BootCD.15.2.iso 19 | -------------------------------------------------------------------------------- /wimboot.php: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /clonezilla.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /install_ubuntu.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /globals.php: -------------------------------------------------------------------------------- 1 | 'IP address', 28 | 'netmask' => 'Netmask', 29 | 'gateway' => 'Gateway', 30 | 'dns' => 'DNS', 31 | ); 32 | 33 | $ks_cfg = array( 34 | 'ks_ipaddr' => 'IP address', 35 | 'ks_netmask' => 'Netmask', 36 | 'ks_gateway' => 'Gateway', 37 | 'ks_dns' => 'DNS', 38 | 'ks_hostname' => 'Hostname', 39 | 'ks_file' => 'Kickstart file', 40 | ); 41 | 42 | ?> 43 | -------------------------------------------------------------------------------- /install_centos6.php: -------------------------------------------------------------------------------- 1 | $v) { 19 | echo "item --gap iPXE {$v}" . str_repeat(".", ($offset - 1 - strlen($v))) . ks_get_value($k) . "\n"; 20 | } 21 | echo "item --gap\n"; 22 | 23 | item("...", "up", "menu.php", "p"); 24 | foreach ($ks_cfg as $k => $v) { 25 | item_ks(ks_name_offset($v, $k), $k, "echo -n Set {$v}: \${} && read {$k} && goto submenu", "p"); 26 | $isset .= "isset \${{$k}} && "; 27 | } 28 | echo "item --gap\n"; 29 | item_ks("Start Installation", "install_centos6", "{$isset} goto install || goto submenu", "p"); 30 | 31 | echo $default; 32 | 33 | foreach ($entries as $i) { 34 | echo "{$i}\n"; 35 | } 36 | 37 | echo ":install\n"; 38 | echo $chain; 39 | 40 | ?> 41 | -------------------------------------------------------------------------------- /lspci.php: -------------------------------------------------------------------------------- 1 | 53 | -------------------------------------------------------------------------------- /boot.php: -------------------------------------------------------------------------------- 1 | 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |   2 | 3 |   4 | 5 | ### Netbooting into iPXE from a MacOS X Netboot Server 6 | 7 | I spent the last few days trying to figure out how NetBooting works on a Mac 8 | which is different from traditional PXE netbooting. The goal was, to be able to 9 | boot from a number of recovery boot images like acronis, clonezilla etc. I 10 | started by using a bootable iso created with 11 | [rom-o-matic](https://rom-o-matic.eu) on a virtual machine for testing. The menu 12 | settings are coming from a http-server, and are built from php logic. 13 | 14 | I tested the setup to be working on any type of computer, by putting a boot 15 | image on a normal PXE server as well. After a NetBoot on my macbook, I 16 | discovered the keyboard does not work when you’re in the menu. That s\#ck\$! 17 | 18 | For now I just put in a workaround. The boot logic in PHP detects the vendor, 19 | and boots directly to a specific boot image when booting a Mac. Too bad this 20 | isn’t working correctly on a mac. Maybe in the future…I hope. 21 | 22 | 23 | 24 | [​](​)Special thanx go out to [Andreas Fink](http://www.fink.org/), as he provided 25 | an almost perfect script for building the nbi image, which I adapted and edited 26 | to a working state, and [skunkie](https://github.com/skunkie/ipxe-phpmenu), for 27 | a wonderful PHP-to-ipxe menu system for ease of management. 28 | 29 |   30 | 31 | #### Step 1: you need a NetBoot Server. 32 | 33 | I use a MacOS X Server which is next to it. You can also 34 | use [BSDPy](https://bitbucket.org/bruienne/bsdpy) under Linux. 35 | 36 | Also very useful tended to be [Deploy Studio](http://www.deploystudio.com/) as 37 | it allowed me to boot into a mini OS X and then remote control the Mac via 38 | RemoteDesktop to set up a startup volume or do things like partitioning etc. 39 | 40 |   41 | 42 | #### Step 2: download IPXE sources 43 | 44 | You should do this on a Linux machine as the current version of IPXE doesnt 45 | build under OS X due to some GCC compiler flags which make the OS X compiler 46 | spill out errors. 47 | 48 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | git clone git://git.ipxe.org/ipxe.git 50 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | 52 |   53 | 54 | #### Step 3: Edit the build configuration 55 | 56 | To use ipxe-phpmenu, uncomment these options in the header files: 57 | 58 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | config/general.h 60 | #define IMAGE_PNG /* PNG image support */ 61 | #define PARAM_CMD /* Form parameter commands */ 62 | #define CONSOLE_CMD /* Console command */ 63 | config/console.h: 64 | #define CONSOLE_FRAMEBUFFER /* Graphical framebuffer console */ 65 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | 67 |   68 | 69 | #### Step 4:Install dependencies 70 | 71 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | Debian/Ubuntu: 73 | apt-get install binutils-dev curl libiberty-dev zip 74 | 75 | under Fedora/Redhat/CentOS it's probably something like 76 | yum install binutils-devel curl libiberty-devel zip 77 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 | 79 |   80 | 81 | #### Step 6:Install PHP menu 82 | 83 | Save the contents of this repository to a subfolder **iPXE** on your webserver, 84 | so 85 | the boot url will be something like **http://192.168.2.100/iPXE/boot.php** 86 | 87 | I changed the PHP logic to be working from a subfolder. 88 | 89 |   90 | 91 | #### Step 5: Download and run my build script and run it 92 | 93 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 94 | cd ipxe/src 95 | wget https://raw.githubusercontent.com/mikesmth/macos-netboot-ipxe/master/build/build_ipxe_nbi.sh 96 | #bash ./build_ipxe_nbi.sh 97 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 98 | 99 | This would build the 64bit ipxe efi binary and bundle it with the needed files 100 | to make up a netbootable nbi folder as OS X Server requires it, however, we want 101 | to build a IPXE booter which automatically loads an URL and executes the IPXE 102 | script there, so we pass it on the command like like this: 103 | 104 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 105 | bash ./build_ipxe_nbi.sh http://bootserver/boot.php 106 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | 108 | The output you get is now a ipxe.nbi.zip which you can copy on to your OS X 109 | server, unpack it there and put it into /Library/NetBoot/NetBootSP0/ 110 | 111 |   112 | 113 | ipxe-phpmenu 114 | ============ 115 | 116 | This is a PHP based iPXE menu with submenus and with authentication and access 117 | restriction. 118 | 119 | Set the *067 Bootfile Name* option in the DHCP *Server Options* to the file 120 | *boot.php*, e.g. `http://ipxe.domain.corp/boot.php`. More information about 121 | configuring the DHCP Server Options can be found at 122 | http://ipxe.org/howto/chainloading. 123 | 124 | ### Features of ipxe-phpmenu 125 | 126 | - Authentication menu 127 | 128 | - iPXE main menu and its submenus are easily generated by PHP 129 | 130 | - Users see only those menu items that they have access to (set by a character 131 | marker-sequence) 132 | 133 | - Kickstart file installation of CentOS 6 with configurable network settings 134 | and hostname 135 | 136 |   137 | 138 | ### Users and access groups 139 | 140 | Users and access groups are set in the file *config.php*. 141 | 142 |   143 | 144 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | 'm', # user1 148 | 'admin:admin' => 'a', # user2 149 | ); 150 | # 151 | # to allow a user to see a menu item, it would be specified as: 152 | # 153 | # title("Disk Utilities", "ma"); 154 | # item("GNOME Partition Editor (GParted)", "gparted", "gparted.php", "ma"); 155 | # item("Clonezilla", "clonezilla", "clonezilla.php", "a"); 156 | # item("Acronis ...", "acronis", "submenu_acronis.php", "a"); 157 | # in above example the Disk Utilities title will be visible to user and admin 158 | # user will see just the first menu item 159 | 160 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 161 | 162 | 163 | --------------------------------------------------------------------------------