Hi vader95,
I found this thread while looking for solutions of kiwi-problems. Is this still of interest for you?
I have the feeling that I’m just doing what you are asking for in your original posting, with the exception that my root filesystem is served via nbd (network block device) instead of nfs. So if this is of any help for you or anyone else stumbling across this thread: This is how I create and boot pxe images for/of openSUSE 11.4:
You need kiwi installed to create a boot image, so do
zypper in kiwi kiwi-desc-netboot syslinux atftp
Maybe you need more, I have these packages
kiwi kiwi-{config-openSUSE,desc-{net,iso,usb}boot,doc,instsource{,-plugins-openSUSE-11-{1,2,3}},tools}
installed.
Create /tmp/kiwi/descr/config.xml with this content (change the package list according to your needs):
<?xml version='1.0' encoding='utf-8'?>
<image name="yarny" schemaversion="5.2">
<description type="system">
<author />
<contact />
<specification />
</description>
<preferences>
<type boot="isoboot/suse-11.4" flags="clic" hybrid="true" image="iso" />
<type boot="netboot/suse-11.4" filesystem="clicfs" image="pxe" />
<rpm-check-signatures>false</rpm-check-signatures>
<timezone>UTC</timezone>
<packagemanager>zypper</packagemanager>
<version>0.0.0</version>
<rpm-force>true</rpm-force>
</preferences>
<users group="root">
<user home="/root" name="root" pwd="" />
</users>
<users group="users">
<user home="/home/tux" name="tux" pwd="" />
</users>
<repository type="yast2">
<source path="opensuse://11.4/repo/oss/">
</repository>
<packages patternType="plusRecommended" type="image">
<!-- These packages might be important for system operation -->
<package name="procinfo" />
<package name="grub" />
<package name="iputils" />
<package name="vim" />
<package name="sysconfig" />
<package name="file" />
<package name="netcfg" />
<package name="syslinux" />
<package name="kernel-default" />
<package name="ifplugd" />
<package name="dbus-1" />
<package name="pam-config" />
<package name="python" />
<package name="gawk" />
<package name="virtualbox-guest-kmp-default" />
<package name="virtualbox-guest-x11" />
<package name="sysfsutils" />
<package name="dhcpcd" />
<package name="ConsoleKit" />
<package name="module-init-tools" />
<package name="binutils" />
<opensusePattern name="enhanced_base" />
<!-- These packages I need for maintenance -->
<!--
<package name="NetworkManager-openvpn"/>
<package name="NetworkManager-pptp"/>
<package name="cnetworkmanager"/>
<package name="atftp"/>
<package name="btrfsprogs"/>
<package name="cabextract"/>
<package name="lighttpd"/>
<package name="curlftpfs"/>
<package name="dhcp-server"/>
<package name="ipw-firmware"/>
<package name="kiwi-desc-isoboot"/>
<package name="kiwi-desc-netboot"/>
<package name="kiwi-desc-usbboot"/>
<package name="kiwi-instsource-plugins-openSUSE-11-3"/>
<package name="memtest86+"/>
<package name="lynx"/>
<package name="nano"/>
<package name="nbd"/>
<package name="nfs-kernel-server"/>
<package name="openvpn"/>
<package name="screen"/>
<package name="smpppd"/>
<package name="socat"/>
<package name="sshfs"/>
<package name="vim-data"/>
<package name="vsftpd"/>
<opensusePattern name="console" />
-->
<!-- Some space wasting graphical desktop environments -->
<!--
<opensusePattern name="x11" />
<package name="icewm-default"/>
<opensusePattern name="xfce" />
<package name="NetworkManager-openvpn-gnome"/>
<package name="NetworkManager-pptp-gnome"/>
<opensusePattern name="kde4_basis" />
<opensusePattern name="kde4" />
-->
</packages>
<packages type="bootstrap">
<package name="filesystem" />
<package name="glibc-locale" />
</packages>
</image>
Create /tmp/kiwi/descr/config.sh:
#!/bin/sh
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
baseStripDocs
baseStripInfos
#baseStripLocales
baseStripMans
# Setup baseproduct link
suseSetupProduct
# Activate services
suseActivateDefaultServices
suseInsertService boot.device-mapper # From kiwi iso example
suseInsertService xdm
baseSetRunlevel 3
# Remove cached packages
find /var/cache -iname '*.rpm' -type f -print0 | xargs --null rm --force
# Lift some access restrictions
sed -i -e "s/ALL ALL=(ALL) ALL/ALL ALL=(ALL) NOPASSWD: ALL/" /etc/sudoers
chmod 0440 /etc/sudoers
for k in $(ls /home) root
do
passwd -d $k # Empty passwords for all users with a homedir
done
pam-config -a --nullok # Empty passwords are ok
echo 'tty7' >> /etc/securetty # Root may use xdm
# Set correct ownership of home directories
for k in $(ls /home)
do
chown $k: -R /home/$k
done
# Fix hosts
cat >> /etc/init.d/boot.local << eof
echo "127.0.0.2 linux linux.site" >> /etc/hosts
eof
# Enable root login in xdm
if -f /etc/X11/Xresources ]
then
cat >> /etc/X11/xdm/Xresources << eof
xlogin*login.allowNullPasswd: true
xlogin*login.allowRootLogin: true
eof
fi
# SuSEconfig
if -f /usr/bin/kdm ]
then
dm=kdm
else
dm=xdm
fi
if -f /usr/bin/startxfce4 ]
then
wm=startxfce4
elif -f /usr/bin/icewm ]
then
wm=icewm-session
else
wm=twm
fi
baseUpdateSysConfig /etc/sysconfig/windowmanager DEFAULT_WM $wm
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER $dm
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER_ROOT_LOGIN_LOCAL yes
baseUpdateSysConfig /etc/sysconfig/network/config WAIT_FOR_INTERFACES ""
baseUpdateSysConfig /etc/sysconfig/network/config NETWORKMANAGER no
baseUpdateSysConfig /etc/sysconfig/clock HWCLOCK -u
baseUpdateSysConfig /etc/sysconfig/sysctl ENABLE_SYSRQ 1
# Final SuSEconfig, unmount root tree
suseConfig
baseCleanMount
exit 0
Credit where credit is due: I plugged this script together from some of the scripts that come with the kiwi-doc examples.
From now on you will have to work as root. Do
$ kiwi --prepare /tmp/kiwi/descr --root /tmp/kiwi/root
$ mkdir /tmp/kiwi/pxe-dest
$ kiwi --create /tmp/kiwi/root --type pxe --destdir /tmp/kiwi/pxe-dest
Congratulations: Your pxe boot image is ready.
Create the directory /tmp/kiwi/atftproot and create these directories/symlinks in there:
KIWI/
initrd -> /tmp/kiwi/pxe-dest/*.gz
linux -> /tmp/kiwi/pxe-dest/*.kernel
pxelinux.0 -> /usr/share/syslinux/pxelinux.0
pxelinux.cfg/
Pick the right files for *.gz and *.kernel: There is only one .kernel file, for the .gz, don’t link to the splash.gz file!
Also edit KIWI/config.default:
NBDROOT=10.250.0.10;4024;/dev/nbd0
UNIONFS_CONFIG=/dev/ram1;/dev/nbd0;clicfs
and pxelinux.cfg/default
Label kiwi
Linux linux
Initrd initrd
Append splash=off vga=normal kiwiserver=10.250.0.10
Also create /tmp/kiwi/dchpd.conf:
pid-file-name "/tmp/kiwi/dhcpd.pid";
lease-file-name "/tmp/kiwi/dhcpd.leases";
ddns-updates off;
default-lease-time 60;
option subnet-mask 255.255.255.192;
subnet 10.250.0.0 netmask 255.255.255.192 {
range dynamic-bootp 10.250.0.11 10.250.0.42;
next-server 10.250.0.10;
filename "pxelinux.0";
}
We’re almost done! Connect your machines to each other, switch off all firewalls and other stuff that might block the network, best you switch off networkmanager (“service network stop”) and set your network settings manually with the ip tool:
ip link set eth0 up
ip addr set 10.250.0.10/26 dev eth0
touch /tmp/kiwi/dhcpd.leases
chmod -R a+rX /tmp/kiwi
dhcpd -4 -cf /tmp/kiwi/dhcpd.conf eth0
atftpd --daemon --no-multicast --bind-address 10.250.0.10
nbd-server 10.250.0.10:4024 /tmp/kiwi/pxe-dest/*.clicfs -r -l /tmp/kiwi/nbd.allow -p /tmp/kiwi/nbd.pid
…and try booting the client.