Busybox tftpd has this bug.
http://git.busybox.net/busybox/commit/?id=4e3beb2e1db3d4739a5a924e003938a9815f98e5
This is finally the answer, why my Slitaz based PXE-server doesn't work as other PXE-servers (tested Windows and openSUSE here).
Busybox tftpd has this bug.
http://git.busybox.net/busybox/commit/?id=4e3beb2e1db3d4739a5a924e003938a9815f98e5
This is finally the answer, why my Slitaz based PXE-server doesn't work as other PXE-servers (tested Windows and openSUSE here).
I have just rechecked the current rolling distribution and this bug still persists. But I was able to replace tftpd functionality with http://freecode.com/projects/tftp-hpa .
See the attached local.sh and pxesrv.gz. The latter contains /usr/sbin/in.tftpd and /lib/libwarp.so.0. As the method shown in booting the 4in1 iso, pxesrv.gz just needs to be added to the comma-separated initrd-list.
example:
KERNEL /images/slitaz/bzImage
APPEND initrd=/images/slitaz/rootfs4.gz,/images/slitaz/rootfs3.gz,/images/slitaz/pxesrv.gz lang=de_DE kmap=de-latin1 rw root=/dev/null vga=normal autologin
The server is configured with a static IP of 192.168.0.6 and it can make use (but also works without) a router and DNS-server on 192.168.0.1. As of now I hardcoded everything in /etc/init.d/local.sh, also a drive label name and a specific folder structure on the boot-media. Please edit local.sh to fit your needs.
edit: Didn't know in advance, that these attachements where prohibited. So I uploaded the files to a filehoster:
http://www.filehosting.at/file/details/320439/pxesrv.gz
http://www.filehosting.at/file/details/320441/local.sh
Check hg.slitaz.org/wok
Bellard reads the forum,responds with commits,but doesn't always reply.
Commit: http://hg.slitaz.org/wok/rev/30e1308b918c
Cook log: http://cook.slitaz.org/cooker.cgi?pkg=busybox
Download: http://mirror.clarkson.edu/slitaz/packages/cooking/busybox-1.18.4.tazpkg
or
#tazpkg -cc
#tazpkg recharge
#tazpkg -gi busybox --forced
Don Manuel, can you please elaborate how you were able to replace tftpd's functionality with tftp-hpa?
I would also like to do the same. Thank you.
Hmm, sorry that this filehoster isn't working any more.
I needed this functionality for the next release of my project OmniBoot. So I have again continued to modify this solution with tftp-hpa. I checked the Slitaz way with the busybox based internal solution frequently with the cooking version and also RC3, but until now still only tftp-hpa works for me.
So how does it work?
Slitaz has a file local.sh in its directory /etc/init.d. This script is processed during start-up and allows adding modification to the boot. I edited it as follows:
/etc/init.d/local.sh
#!/bin/sh
# /etc/init.d/local.sh - Local startup commands.
#
# All commands here will be executed at boot time.
#
. /etc/init.d/rc.functions
echo "Starting local startup commands... "
export PLABEL="OMNIBOOT"
SIGFILE="autorun.inf"
mkdir /media/$PLABEL
mkdir /boot
mountob(){
mount /media/$PLABEL/boot/make/gpxe_root /boot
mount /media/$PLABEL/images /boot/images
mount /media/$PLABEL/boot /boot/boot
sh /boot/images/slitaz/srv_start
}
mount /dev/cdrom /media/$PLABEL
if [ -e /media/$PLABEL/$SIGFILE ]; then
mountob
else
mount /dev/disk/by-label/$PLABEL /media/$PLABEL
if [ -e /media/$PLABEL/$SIGFILE ]; then
mountob
else exit
fi
fi
Note the chosen preconditions which you need to adapt to your needs.
The variable PLABEL refers to the label of the CD/DVD, the USB-Stick or USB-HDD from which you boot.
SIGFILE refers to a file which is in the root of that medium as checked a few lines later to confirm the detection.
Also the mount directories /boot/make/gpxe_root (containing the folder pxelinux.cfg and the bootfile gpxelinux.0), /boot and /images are hardcoded folders to be found in the root of the bootmedium.
If all is found and mounted finally the script srv_start is run. srv_start can be found in the set folder, as you see I chose /images/slitaz which gets mounted at /boot/images/slitaz.
srv_start
#!/bin/sh
# configs go here
omniboot_server_ip="192.168.0.6"
omniboot_server_netmask="255.255.255.0"
omniboot_dhcp_start_ip="192.168.0.20"
omniboot_dhcp_end_ip="192.168.0.254"
dns_server_ip="192.168.0.1"
router_ip="192.168.0.1"
# end of configs
for opt in cat /proc/cmdline
; do
case $opt in
mount-ntfs)
DEVICES_LIST=fdisk -l | sed '/NTFS/!d;s/ .*//'
for device in $DEVICES_LIST; do
name=${device#/dev/}
if ! mount | grep ^$device >/dev/null; then
mkdir /mnt/$name
ntfs-3g $device /mnt/$name
fi
done
;;
*)
;;
esac
done
rm /var/www/index.html
ln -s /media/$PLABEL/docu/* /var/www
ln -s /media /var/www
ln -s /mnt/* /var/www/media
sed -i "s/firewall httpd/firewall httpd inetd udhcpd/" /etc/rcS.conf
sed -i "s,/usr/bin/tftpd,/usr/sbin/in.tftpd,; s,-r /boot,-4 -s /boot," /etc/inetd.conf
sed -i '/start/d; /end/d' /etc/udhcpd.conf
echo "start $omniboot_dhcp_start_ip" >> /etc/udhcpd.conf
echo "end $omniboot_dhcp_end_ip" >> /etc/udhcpd.conf
echo "opt dns $dns_server_ip" >> /etc/udhcpd.conf
echo "opt router $router_ip" >> /etc/udhcpd.conf
echo "boot_file gpxelinux.0" >> /etc/udhcpd.conf
echo "siaddr $omniboot_server_ip" >> /etc/udhcpd.conf
echo "127.0.0.1" >> /etc/udhcpd.conf
sed -i '/IP=/d; /NETMASK=/d; /GATEWAY=/d; /DNS_SERVER=/d; s/DHCP="yes"/DHCP="no"/; s/STATIC="no"/STATIC="yes"/' /etc/network.conf
echo -e "IP=\"$omniboot_server_ip\"" >> /etc/network.conf
echo -e "NETMASK=\"$omniboot_server_netmask\"" >> /etc/network.conf
echo -e "GATEWAY=\"$router_ip\"" >> /etc/network.conf
echo -e "DNS_SERVER=\"$dns_server_ip\"" >> /etc/network.conf
sh /etc/init.d/network.sh restart
As you see I added a kernel parameter which will automount all found NTFS drives, as there is yet a kernel parameter which does the same with ext drives.
Since OmniBoot has an info-web in a folder named /docu this gets linked to the Slitaz web-root - again an option and not essential for what you look for.
Now before the script finally restarts networking a lot of editing of conf-files happens. We only need to restart networking, since all other services that we need are started after the execution of local.sh.
Please also read my previous posting in this thread again and this thread
http://forum.slitaz.org/topic/how-to-implement-a-new-kernel-parameter-for-live-version-to-boot-a-pxe-server-by-default
to understand how everything is now put together.
If you still have problems getting it running I decided to upload a beta-version of the base-version of the upcoming v0.4 of OmniBoot which contains everything I am explaining here.
http://sourceforge.net/projects/omniboot/files/future/OmniBoot%20v0.4beta%20base.iso/download
(Please be patient if the download doesn't work yet immediately, I really just uploaded right now)
You must log in to post.