FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 10-28-2009, 10:36 AM
Gabor Gombas
 
Default Bug#535008: configure_networking: support BOOTIF variable set by pxelinux

Hi,

<aol>Mee too!</aol> It'd be really nice to have this integrated.

To add something constructive, mdadm, and lvm2 scripts already use sed
without checking for it or making sure that it is available, so the use
of sed should not be a problem. cryptsetup also uses sed but it at least
forces "BUSYBOX=y". IMHO it should be enough to document that "BOOT=nfs"
requires "BUSYBOX=y".

Gabor

--
---------------------------------------------------------
MTA SZTAKI Computer and Automation Research Institute
Hungarian Academy of Sciences
---------------------------------------------------------



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-02-2009, 10:37 PM
Christoph Bussenius
 
Default Bug#535008: configure_networking: support BOOTIF variable set by pxelinux

Package: initramfs-tools
Version: 0.85i
Followup-For: Bug #535008

Hi,

you may use the following script as a temporary fix.

Depending on your initrd, you have to put the script (which I call
"pxedev") into one of the following places (putting it in both does not
seem to hurt):

* /etc/initramfs-tools/scripts/nfs-top/pxedev
* /etc/initramfs-tools/scripts/live-premount/pxedev

and then re-generate the initrd.

(Excuse the anachronistic shell-scripting style; this has to work with
minimal Bourne shell clones.)

Regards,
Christoph



#!/bin/sh

case $1 in
prereqs) exit 0;;
esac


. /conf/initramfs.conf


echo '************************************************* ******************'
echo '* pxedev auto-detection: *'
echo "* DEVICE is ${DEVICE:-not set}."

# The BOOTIF parameter will be set by pxelinux if the line "ipappend 2"
# is in pxelinux.cfg

BOOTIF=
for bootparam in $(cat /proc/cmdline); do
case $bootparam in
BOOTIF=*)
BOOTIF=${bootparam#BOOTIF=}
BOOTIF=${BOOTIF#01-}
BOOTIF=$(echo "$BOOTIF" | tr '.-' '.:')
echo "* pxelinux tells us, BOOTIF=$BOOTIF"
;;
esac
done

if [ -z "$BOOTIF" ]; then
echo '* pxelinux did not give us a mac address'
else

bootdevname=

for devpath in /sys/class/net/*; do
dev=${devpath##*/}
addr=$(cat "$devpath/address")
echo -n "* $dev has address $addr"
if [ "x$BOOTIF" = "x$addr" ]; then
echo -n ' [AHA!]'
bootdevname=$dev
fi
echo
done

if [ "x$bootdevname" = x ]; then
echo '* No matching device found '
elif [ "x$DEVICE" = "x$bootdevname" ]; then
echo '* DEVICE already matches BOOTIF, leaving it as it is'
else
echo "* Setting DEVICE to $bootdevname"
echo "DEVICE=$bootdevname" >> /conf/param.conf
fi
fi

echo '************************************************* ******************'



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-04-2010, 05:48 AM
Vagrant Cascadian
 
Default Bug#535008: configure_networking: support BOOTIF variable set by pxelinux

updated patch against current master, using only shell, and with a cleaner
method to convert BOOTF to a typical mac address.

diff --git a/scripts/functions b/scripts/functions
index 77de8f3..cb6cf08 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -258,6 +258,42 @@ parse_numeric() {

configure_networking()
{
+ if [ -n "${BOOTIF}" ]; then
+ # pxelinux sets BOOTIF to a value based on the mac address of the
+ # network card used to PXE boot, so use this value for DEVICE rather
+ # than a hard-coded device name from initramfs.conf. this facilitates
+ # network booting when machines may have multiple network cards.
+ # pxelinux sets BOOTIF to 01-$mac_address
+
+ # strip off the leading "01-", which isn't part of the mac
+ # address
+ temp_mac=${BOOTIF#*-}
+
+ # convert to typical mac address format by replacing "-" with ":"
+ bootif_mac=""
+ IFS='-'
+ for x in $temp_mac ; do
+ if [ -z "$bootif_mac" ]; then
+ bootif_mac="$x"
+ else
+ bootif_mac="$x:$bootif_mac"
+ fi
+ done
+ unset IFS
+
+ # look for devices with matching mac address, and set DEVICE to
+ # appropriate value if match is found.
+ for device in /sys/class/net/* ; do
+ if [ -f "$device/address" ]; then
+ current_mac=$(cat "$device/address")
+ if [ "$bootif_mac" = "$current_mac" ]; then
+ DEVICE=${device##*/}
+ break
+ fi
+ fi
+ done
+ fi
+
# networking already configured thus bail out
[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0


it may need special handling to make sure BOOTIF is exported, such as if run
from the scripts/*-top/*.

since it's a whole block of code, maybe it could go into it's own function.

please consider applying this patch for squeeze.

live well,
vagrant



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-24-2010, 04:16 PM
maximilian attems
 
Default Bug#535008: configure_networking: support BOOTIF variable set by pxelinux

hello vagrant,

pushing backlog out, finaly. thanks for your patience.

On Wed, 03 Feb 2010, Vagrant Cascadian wrote:

> updated patch against current master, using only shell, and with a cleaner
> method to convert BOOTF to a typical mac address.

cool, thanks.
applied
http://git.debian.org/?p=kernel/initramfs-tools.git;a=summary

> it may need special handling to make sure BOOTIF is exported, such as if run
> from the scripts/*-top/*.

hmmm ?? don't get that part, do you want an
export BOOTIF= in init?

> since it's a whole block of code, maybe it could go into it's own function.

we don't need to be to pendantic..

> please consider applying this patch for squeeze.

done and thank you! hope you are all well, happy to read you!

greetings
maks



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100224171645.GD11859@stro.at">http://lists.debian.org/20100224171645.GD11859@stro.at
 
Old 02-26-2010, 05:42 PM
Vagrant Cascadian
 
Default Bug#535008: configure_networking: support BOOTIF variable set by pxelinux

On Wed, Feb 24, 2010 at 06:16:45PM +0100, maximilian attems wrote:
> > it may need special handling to make sure BOOTIF is exported, such as if run
> > from the scripts/*-top/*.
>
> hmmm ?? don't get that part, do you want an
> export BOOTIF= in init?

i *think* that would be required, but i'm not sure. it would need the BOOTIF
variable available in some scripts such as the NBD support, which calls
configure_networking from scripts/local-top/nbd-client.

thanks!

live well,
vagrant



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100226184239.GJ8032@claws.fglan">http://lists.debian.org/20100226184239.GJ8032@claws.fglan
 
Old 02-28-2010, 12:01 PM
maximilian attems
 
Default Bug#535008: configure_networking: support BOOTIF variable set by pxelinux

On Fri, 26 Feb 2010, Vagrant Cascadian wrote:

>
> i *think* that would be required, but i'm not sure. it would need the BOOTIF
> variable available in some scripts such as the NBD support, which calls
> configure_networking from scripts/local-top/nbd-client.
>
> thanks!
>
> live well,
> vagrant

thanks added!

--
maks



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100228130114.GA18514@stro.at">http://lists.debian.org/20100228130114.GA18514@stro.at
 

Thread Tools




All times are GMT. The time now is 10:55 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org