I have downloaded the latest SmartOS image (20140904T175324Z) suitable for PXE booting.
Unpacking such file, platform-20140904T175324Z.tgz, and following the steps like the ones described here, http://wiki.smartos.org/display/DOC/PXE+Booting+SmartOS, I stumbled in an error that prevent the server to boot. This problem had never happened with previous releases.
Operation not permitted (http://ipxe.org/410c613c)
Could not boot image: Operation not permitted (http://ipxe.org/410c613c)
Visiting the proposed link, and looking at Apache log file (I've configured iPXE to download the images via HTTP) I found where the problem was.
[Wed Sep 10 xx:xx:xx 2014] [error] [client 192.168.56.123] (13)Permission denied: file permissions deny server access: /srv/tftp/images/smartos/20140904T175324Z/platform/i86pc/amd64/boot_archive
Untarring the image file, the permission on the boot_archive file was 600 and not 644 as expected, and as it has been up to now.
Showing posts with label ipxe. Show all posts
Showing posts with label ipxe. Show all posts
Wednesday, September 10, 2014
Thursday, March 14, 2013
iPxe server (on CentOS) to serve SmartOS
This document talks about how I set up an iPXE server on CentOS 6 mainly to serve SmartOS.
Although I've not understood some things (like undionly or the fact that there are many dhcp requests from the pxe client) the following procedure works for me
Optional.
Useful to get some network modules if the client uses gPxe (like KVM one) that is unable to work with iPxe
There are 2 files of importance, the kernel ("unix") and the boot archive ("boot_archive"). The paths to these files are significant and should not be omitted. They should be:
So:
Please note: change 20130111T010112Z with the current version
Although I've not understood some things (like undionly or the fact that there are many dhcp requests from the pxe client) the following procedure works for me
Links
- iPXE server using Ubuntu http://blog.alainodea.com/en/ipxe-smartos
- SmartOS wiki http://wiki.smartos.org/display/DOC/PXE+Booting+SmartOS
- The iPXE site http://boot.ipxe.org
- Take a look to http://networkboot.org/
Install dhcp and tftp services
yum install dhcp.x86_64 yum install tftp-server.x86_64
Get iPXE undionly
cd /var/lib/tftpboot/curl http://cuddletech.com/IPXE-100612_undionly.kpxe > undionly.kpxe
curl http://boot.ipxe.org/undionly.kpxe > undionly.kpxe
Download iPxe
cd /root mkdir git cd git/ git clone git://git.ipxe.org/ipxe.git cd ipxe/src make make bin/ipxe.pxe cp bin/ipxe.pxe /var/lib/tftpboot/
DHCP Configuration
It is useful to configure the DHCP server to provide IP addresses only to known MAC addresses. I think it is also useful to link MAC addresses with IP addresses. So a server always get the usual IP.
Note: 192.168.56.10 is the TFTP server (may be the same server as DHCP)
vi /etc/dhcp/dhcpd.conf |
ddns-update-style none;
option domain-name "my.domain";
option routers 192.168.56.1;
option domain-name-servers 192.168.56.2, 192.168.56.3;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.56.0 netmask 255.255.255.0 {
deny unknown-clients;
next-server 192.168.56.10;
host hcn2 {
hardware ethernet 00:19:99:e0:87:30;
fixed-address 192.168.56.20;
if exists user-class and option user-class = "iPXE" {
filename = "menu.ipxe";
} else {
filename = "undionly.kpxe";
}
}
}
|
Configuring iPXE
vi /var/lib/tftpboot/menu.ipxe |
#!ipxe
######## MAIN MENU ###################
:start
menu Welcome to iPXE's Boot Menu
item
item --gap -- ------------------------- Operating systems ---------------
item smartos Boot SmartOS (platform-20121228T011955Z)
item --gap -- ------------------------------ Utilities ------------------
item shell Enter iPXE shell
item reboot Reboot
item
item exit Exit (boot local disk)
choose --default smartos --timeout 30000 target && goto ${target}
########## UTILITY ITEMS ####################
:shell
echo Type exit to get the back to the menu
shell
set menu-timeout 0
goto start
:failed
echo Booting failed, dropping to shell
goto shell
:reboot
reboot
:exit
exit
########## MENU ITEMS #######################
:smartos
set base-url ${boot-url}/images/smartos/20130111T010112Z/platform/i86pc
kernel ${base-url}/kernel/amd64/unix -v -B console=text,smartos=true
module ${base-url}/amd64/boot_archive
boot || goto failed
goto start
|
Preparing the SmartOS image
From the SmartOS wiki:There are 2 files of importance, the kernel ("unix") and the boot archive ("boot_archive"). The paths to these files are significant and should not be omitted. They should be:
- (prefix)/platform/i86pc/kernel/amd64/unix
- (prefix)/platform/i86pc/amd64/boot_archive
So:
cd /var/lib/tftpboot/ mkdir images cd images/ mkdir smartos cd smartos curl https://download.joyent.com/pub/iso/platform-latest.tgz > /tmp/platform-latest.tgz cat /tmp/platform-latest.tgz | tar xz ls | grep platform- | sort | tail -n1 platform-20130111T010112Z mv platform-20130111T010112Z 20130111T010112Z cd 20130111T010112Z/ mkdir platform mv i86pc/ platform/
Please note: change 20130111T010112Z with the current version
Configuring iptables
To allow DHCPvi /etc/sysconfig/iptables-config |
IPTABLES_MODULES="ip_conntrack_tftp" |
vi /etc/sysconfig/iptables |
-A INPUT -m udp -p udp --dport 67:68 --sport 67:68 -j ACCEPT -A INPUT -m tcp -p tcp --dport 69 -j ACCEPT -A INPUT -m udp -p udp --dport 69 -j ACCEPT |
/sbin/service iptables restart
Configuring xinetd
To enable TFTPvi /etc/xinetd.d/tftp |
...
disable = no
...
|
/etc/init.d/xinetd restart
Friday, January 11, 2013
today useful links
Trying to chainload iPXE with full feature set from a lesser
featured one, whilst still being able to boot non-supported cards with
UNDI
https://gist.github.com/4008017Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)
https://gist.github.com/2234639
Subscribe to:
Posts (Atom)
