feature for pxe booting

Discussions about what to change in future versions (except software request).
cm
Posts: 29
Joined: 19 Mar 2008, 10:24

feature for pxe booting

Postby cm » 13 Apr 2009, 08:22

I would like to request a feature related to PXE
booting.
nameif=ethX!BOOTIF

The ideea is .. pxelinux.0 from syslinux adds a kernel
param BOOTIF=XX-XX-XX-XX-XX-XX-XX (when IPAPPEND 2 is used), is the mac
of the net card pxe boot was done. This helps where
you have several cards and you are not booting from
first one.
Attention: is adding 01- as prefix (for ethernet at least) . Example for a boot using IPAPPEND 2

BOOTIF=01-00-18-71-ec-57-1f

cm
Posts: 29
Joined: 19 Mar 2008, 10:24

Re: feature for pxe booting

Postby cm » 12 May 2010, 12:11

Any chance for doing this? I could make a patch for 1.5.3 if you care to include it..

cm
Posts: 29
Joined: 19 Mar 2008, 10:24

Re: feature for pxe booting

Postby cm » 12 May 2010, 17:32

patch below against /init from initramfs.tgz in 1.5.3 . Btw /linuxrc is not symlink or hardlink to /init (bug ?)
to use this you need to have in pxe config line

IPAPPEND 2 and
nameif=ethX!BOOTIF
(example nameif=eth0!BOOTIF)

--- init-bak 2010-05-12 20:23:47.000000000 +0300
+++ init 2010-05-12 20:25:47.000000000 +0300
@@ -349,12 +349,23 @@
maclist="$(/sbin/ifconfig -a | grep 'HWaddr' | grep '^eth[0-9]*' | awk '{print $5}')"

# ---- get the option from the boot command line # eg: "nameif=eth0!00:11:22:33:44:55,eth1!00:22:33:44:55:aa"
+ BOOTIF=''
+ CMDLINE="$(cat /proc/cmdline)"
+ for x in ${CMDLINE}
+ do
+ if echo "${x}" | /bin/busybox grep -q -E 'BOOTIF=..-..-..-..-..-..-..'
+ then
+ BOOTIF="$(/bin/busybox echo ${x} | cut -d= -f2 | sed -e 's#^01-##;s#-#:#g')"
+ fi
+ done
+
NAMEIFOPT=''
for x in $(cat /proc/cmdline)
do
if echo "${x}" | grep -q -E 'nameif=[0-9,!:a-fA-F]*'
then
NAMEIFOPT="$(echo ${x} | cut -d= -f2 | sed -e 's!,! !g')"
+ test -z "$BOOTIF" || NAMEIFOPT="$(echo $NAMEIFOPT | sed -e 's#BOOTIF#'$BOOTIF'#g')"
fi
done

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: feature for pxe booting

Postby admin » 12 May 2010, 18:24

Thanks for your patch. Can you please check it works in SystemRescueCd-1.5.4-beta6 (released soon with that change) ?

linuxrc is the old name for that script, now it's called "init", but it's the same thing in reality.

cm
Posts: 29
Joined: 19 Mar 2008, 10:24

Re: feature for pxe booting

Postby cm » 12 May 2010, 19:50

I can test , post here when the new beta is out

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: feature for pxe booting

Postby admin » 13 May 2010, 08:36

The new beta version is ready can you test 1.5.4-beta6 ?
http://www.sysresccd.org/Beta-x86

cm
Posts: 29
Joined: 19 Mar 2008, 10:24

Re: feature for pxe booting

Postby cm » 13 May 2010, 22:14

Did some testing, the nameif=eth0!BOOTIF seems to work

But I am confused about something, while I load sysresqcd via PXE, is still trying to dhcp when I have eth0 set static from kernel cmdline

KERNEL /sysresq/rescue64
APPEND netboot=http://192.168.55.1/sysresq/sysrcd.dat initrd=/sysresq/initram.igz video=ofonly vga=0 setkmap=us docache eth0=192.168.55.200/23 gateway=192.168.55.1 dns=192.168.55.1

Can you add some param to disable this DHCP in pxe mode ?

>> Performing the network configuration...
Here are the ethernet interfaces found on your system:
* eth0: 08:11:22:33:44:55
* eth1: 08:00:27:DA:16:BE
netconfig1: found option eth0=192.168.55.200/23
netconfig1: netmask_shorttolong(23)=255.255.254.0
netconfig1: configure eth0 to 192.168.55.200/23
netconfig1: ifconfig eth0 192.168.55.200 netmask 255.255.254.0 --> 0
--- eth0: link=link-ok, mac=08:11:22:33:44:55
>> Attempting to get a DHCP address on eth0...
udhcpc (v1.15.3) started
Sending discover...
Sending select for 192.168.55.200...
Lease of 192.168.55.200 obtained, lease time 86400
set new default route: 192.168.55.1
busybox udhcpc -n -i eth0 --> 0
--- eth1: link=link-ok, mac=08:00:27:DA:16:BE
>> Attempting to get a DHCP address on eth1...
udhcpc (v1.15.3) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
busybox udhcpc -n -i eth1 --> 1
netconfig1: removing old default route
netconfig1: set new default route to 192.168.55.1
netconfig1: set nameserver to 192.168.55.1
>> Downloading sysrcd.dat from http://192.168.55.1/sysresq/sysrcd.dat

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: feature for pxe booting

Postby admin » 14 May 2010, 06:44

You have to use the ethx option literally and it will configure all interfaces with that address and also disable dhcp automatically:

Code: Select all

ethx=192.168.55.200/23


Here is an extract of the init script:

Code: Select all

                dodhcp)
                        DODHCP='1'
                        SETETHX=''
                        NETCONFIG='1'
                        NONETMGR='1'
                        ;;
                ethx\=*)
                        SETETHX=`parse_opt "${x}"`
                        DODHCP=''
                        NETCONFIG='1'
                        NONETMGR='1'
                        ;;

cm
Posts: 29
Joined: 19 Mar 2008, 10:24

Re: feature for pxe booting

Postby cm » 14 May 2010, 09:15

Understood , but sometimes we may not need same ip loaded on diff interfaces .
So I am thinking the easiest solution is to add option 'nodhcp' which will overwrite this part

# ---- force dhcp if booting via pxe and no static configuration specified
if [ "${NETCONFIG}" = '1' ] && [ -z "${SETETHX}" ]
then
DODHCP='1'
fi

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: feature for pxe booting

Postby admin » 22 May 2010, 10:52

The nodhcp option has been added to sysresccd-1.5.5-beta2

cm
Posts: 29
Joined: 19 Mar 2008, 10:24

Re: feature for pxe booting

Postby cm » 23 May 2010, 19:22

thank you

chocochoco
Posts: 1
Joined: 01 Jun 2010, 02:49
Contact:

Re: feature for pxe booting

Postby chocochoco » 01 Jun 2010, 02:54

Can you show your result now? Thank you much.


Return to “Future”

Who is online

Users browsing this forum: No registered users and 1 guest