[Udpcast] Creating files within dhcp.script

Alain Knaff alain at knaff.lu
Wed Sep 2 00:02:33 CEST 2009


Jens Breuer wrote:
> Hello List,
> hello Alain,
> 
> I am playing around with the "udpcast image generator" and I need to
> store the next-server address in the filesystem for later processing.
> I am using kernel-udpcast_2.6.30-rc5_all.deb and
> udpcast-mkimage_20081213_all.deb.
> 
> This is what my dhcp.script looks like:
> === snip ===
> #!/bin/sh
> 
> [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
> [ -n "$subnet" ] && NETMASK="netmask $subnet"
> case "$1" in
>         deconfig)
>                 /sbin/ifconfig $interface 0.0.0.0
>                 ;;
>         renew|bound)
>                 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
>                 /sbin/echo $siaddr > /etc/server.ip
> 		;;
> esac
> === snap ===
> 
> This works as expected when generating cd-images.
> If I generate a initrd and boot via PXE, the file /etc/server.ip never
> gets created.
> I tried to create the file in many places (/tmp, /sbin, etc.) but it
> doesn't work.
> 
> Is there something important that I am missing?
> I thought that there is no difference between a cd-image and a plain
> initrd (besides syslinux/pxelinux and the kernel being separate).

Exactly. PXE and CD initrd's are the same. Only the floppy initrd is
different (in order to fit into a smaller size).

In which directory do you put the script on CD?

> Additionally FYI, when using the latest kernel and mkimage I get some
> weird behaviour.
> I use VirtualBox 2.2 for testing purposes and both cd-image and initrd
> crash the VM when trying to write to the filesystem from within
> dhcp.script.

Personally, I use kvm, and it works like a charm!

> Any help/suggestion is much appreciated.
> 
> Thanks in advance.
> 
> Regards
> Jens

Regards,

Alain




More information about the Udpcast mailing list