provide a method to use a specified MAC-address as the installation device

Bug #56679 reported by Timo Aaltonen
38
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Server papercuts
Invalid
Undecided
Unassigned
checkbox-satellite
New
Undecided
Unassigned
kickseed (Ubuntu)
Invalid
Undecided
Unassigned
Lucid
Invalid
Undecided
Unassigned
Natty
Invalid
Undecided
Unassigned
Oneiric
Invalid
Undecided
Unassigned
netcfg (Debian)
Fix Released
Unknown
netcfg (Ubuntu)
Fix Released
Wishlist
Colin Watson
Lucid
Fix Released
Medium
Colin Watson
Natty
Won't Fix
Wishlist
Unassigned
Oneiric
Fix Released
High
Colin Watson

Bug Description

My Thinkpad T23 has e100 and orinoco -devices, and I need to netboot install from wired network, but the device-names are assigned randomly making it problematic.. Could udev make wired network devices always have a higher priority to populate eth0->?

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

oh, the wlan-card is a mini-pci one so taking it out before installing isn't an option :)

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

No, udev has no way of telling whether the device is wired or not.

Use /etc/iftab to force devices to have particular names: add lines like

 eth0 mac xx:xx:xx:xx:xx:xx arp 1
 eth1 mac xx:xx:xx:xx:xx:xx arp 1

These are written by the installer by default for the cards present when you install.

Changed in udev:
status: Unconfirmed → Rejected
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

yes, well.. the better way would be to tell the installer to use a specified MAC-address, not a eth-dev.. I'll reassign this for netcfg

Changed in udev:
status: Rejected → Unconfirmed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

so, now it is possible to preseed netcfg/choose_interface, but it's pretty useless since it is impossible to know which device gets which interface.. It should be possible to preseed netcfg/choose_mac or similar, and netcfg would then check which device has that MAC-address and use it.

Colin Watson (cjwatson)
Changed in netcfg:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Revision history for this message
Andrew Glen-Young (aglenyoung) wrote :

While reading the PXELINUX documentation I came across an option which may be of use [1]. Adding 'ipappend 2' to the host's pxelinux config file makes PXELINUX append the mac address of that interface to the kernel options.

Example:

BOOTIF=01-AA-BB-CC-DD-EE-FF

This allows the initrd to access to the mac address of the interface which PXE booted and is probably the interface we want to use for DHCP.

Obviously, this allows someone to set this kernel option without the need for PXE booting (which is an added bonus).

I have written a script (attached) which I'm executing from the debian-installer-startup.d directory of the initrd. The script reads the value of the 'BOOTIF' kernel option and looks to see if there is an interface name with this mac address. It then uses 'debconf-set' to change the 'netcfg/choose_interface' option to this interface name.

The script may be a little rough around the edges, and specific to PXELINUX, but seems to work when tested on a variety of hardware running Hardy (8.04.2).

Example

/var/lib/tftpboot/pxelinux.cfg/default:

LABEL install
        kernel hardy-amd64
        ipappend 2
        append interface=auto [the rest of your options]

[1]: http://syslinux.zytor.com/wiki/index.php/SYSLINUX#IPAPPEND_flag_val_.5BPXELINUX_only.5D

Revision history for this message
macros (jasonc-simpleideas) wrote :

This bug makes preseed a little painful. I can confirm that Andrew's workaround works well.

Revision history for this message
Thierry Carrez (ttx) wrote :

Installer issue, refused as a server papercut during 20100217 meeting.

Changed in server-papercuts:
status: New → Invalid
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Nominating for Natty, marking Triaged. This supports our cloud-server-n-install-service blueprint. Linking against that blueprint too. Are there any objections to me sponsoring this for Natty?

Changed in netcfg (Ubuntu Natty):
status: Confirmed → Triaged
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Colin Watson (cjwatson) wrote :

I asked by e-mail that this be forwarded to Debian and agreed there before we apply it.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm changing the assignee now to Dave Walker, who has agreed to send this proposal to Debian.

Changed in netcfg (Ubuntu Natty):
assignee: Dustin Kirkland (kirkland) → Dave Walker (davewalker)
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm attaching an updated revision of agy's script.

This one has:
 * some documentation in the header (still probably needs a copyright/license)
 * quoted $var's
 * sourcing of debconf/confmodule
 * use of db_set
 * commented out the echo > log debug
 * exit's 0 instead of break (maybe unnecessary?)

tags: added: patch
Revision history for this message
Colin Watson (cjwatson) wrote :

Please ignore the bogus kickseed task. I created it thinking that ksdevice should be changed to use the new preseeding facility, but actually this patch doesn't introduce a new preseeding facility and ksdevice should probably just do the same thing, so I'll leave that as bug 708908.

Changed in kickseed (Ubuntu Natty):
status: New → Invalid
Revision history for this message
Andrew Glen-Young (aglenyoung) wrote :

Apologies in advance for bike-shedding.

Perhaps we should check if netcfg/choose_interface is set to 'auto' instead of blindly setting the interface name? This should cater for people who have accidentally left the ipappend option on (or have cargo-culted the option from elsewhere) and have specified a specific interface?

If this is being discussed elsewhere (upstream), I will be happy to take the conversation there.

Example:

LABEL install
        kernel hardy-amd64
        # whoops I have left this on
        ipappend 2
       # and i have specifically asked for an interface (which will be ignored)
        append interface=eth2 [more options]

Revision history for this message
Floris (bos) wrote :

>Perhaps we should check if netcfg/choose_interface is set to 'auto' instead of blindly setting the interface name?

Or perhaps only use the value if netcfg/choose_interface is set to 'bootif', similar to the way kickstart works?

http://fedoraproject.org/wiki/Anaconda/Options#ksdevice

Revision history for this message
Dave Walker (davewalker) wrote :

Deferring for Natty.

Changed in netcfg (Ubuntu Natty):
status: Triaged → Won't Fix
assignee: Dave Walker (davewalker) → nobody
Revision history for this message
Robbie Williamson (robbiew) wrote :

I'd like to try and get a solution to this worked out in 11.10, so we can have it well tested and ready for 12.04 LTS.

Changed in netcfg (Ubuntu Oneiric):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Canonical Server Team (canonical-server)
Revision history for this message
Etienne Goyer (etienne-goyer-outlands) wrote :

Whichever solution we settle upon with Debian, I think it should be introduced in the next lucid dot release. Nominating for 10.04.3 so we can discuss that.

Changed in netcfg (Ubuntu):
milestone: none → ubuntu-10.04.3
Changed in kickseed (Ubuntu Lucid):
status: New → Invalid
Changed in kickseed (Ubuntu Oneiric):
status: New → Invalid
Changed in netcfg (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Medium
Changed in netcfg (Debian):
status: Unknown → New
Changed in netcfg (Ubuntu Oneiric):
assignee: Canonical Server Team (canonical-server) → Ubuntu Server Team (ubuntu-server)
Changed in netcfg (Ubuntu Lucid):
milestone: none → ubuntu-10.04.3
Colin Watson (cjwatson)
Changed in netcfg (Ubuntu Oneiric):
assignee: Ubuntu Server Team (ubuntu-server) → Colin Watson (cjwatson)
Changed in netcfg (Ubuntu Lucid):
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netcfg - 1.63ubuntu1

---------------
netcfg (1.63ubuntu1) oneiric; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Set default hostname to 'ubuntu'.
    - Drop priority of netcfg/get_domain to medium for non-static
      configurations.
    - Use 'auto <interface>' for all interfaces, dropping allow-hotplug
      which doesn't work with current udev.
    - Call /usr/lib/NetworkManager/ifblacklist_migrate.sh from
      finish-install if present, so that 'auto dhcp' interfaces are disabled
      if network-manager is in use. May be preseeded away with
      netcfg/network-manager.
    - Bump the DHCP timeout to 30 seconds.
    - Strip trailing dots from domain when writing to /etc/hosts.
    - Build for ppc64.
    - Move release-dhcp-lease finish-install script after unmounting
      filesystems, to avoid interfering with iSCSI.

netcfg (1.63) unstable; urgency=low

  * If BOOTIF= is set on the Linux command line, look for an interface with
    that address and use it by default (closes: #615600, LP: #56679).

  [ Updated translations ]
  * Asturian (ast.po) by MAAC
  * German (de.po) by Holger Wansing
  * Italian (it.po) by Milo Casagrande
 -- Colin Watson <email address hidden> Thu, 16 Jun 2011 18:10:47 +0100

Changed in netcfg (Ubuntu Oneiric):
status: Triaged → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted netcfg into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in netcfg (Ubuntu Lucid):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Steve Atwell (satwell) wrote :

Looks good.

I just tried the lucid amd64 installer from proposed on a server that the old installer always fails to find the right network interface to DHCP. (Bug 713385 has more details about the hardware.) Using BOOTIF and leaving netcfg/choose_interface=auto, the new installer picks the correct interface to bring up.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netcfg - 1.51ubuntu3

---------------
netcfg (1.51ubuntu3) lucid-proposed; urgency=low

  * If BOOTIF= is set on the Linux command line, look for an interface with
    that address and use it by default (closes: #615600, LP: #56679).
 -- Colin Watson <email address hidden> Thu, 16 Jun 2011 18:16:42 +0100

Changed in netcfg (Ubuntu Lucid):
status: Fix Committed → Fix Released
Changed in netcfg (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.