[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

A small udeb contribution from an arm-chair developer



Hi guys,

Many moons ago I wrote a few small udebs that I found useful. I offered them to the community, but at the time the consensus was that it was too close to the release of Etch and too many people were too busy to deal with it. But at the same time, there seemed to be a few that thought that my contribution was useful and thought that I should hold on to it until later.

Well, now that Etch has been released, I thought I would give it another try. Here's my udeb package again, updated to work with the latest Etch installer. As I'm not a debian developer, I was hoping that someone who is might be interested enough to take it off my hands. That is, if anyone out there is even interested. The package is small (6.4KB tar.gz file), and consists of shell scripts that should run under any architecture.

From my original post (but updated):

If you're like me, and I know I am, then you work someplace where you have no access to the DHCP server, so allowing the installer to acquire it's networking information from the DHCP server breaks things. You also have a small multitude of machines with varying hard drive configurations. And, last but not least, you're lazy and prone to human error. You don't want to have to type in networking and partitioning information manually for each machine you install, nor do you want to have to burn a separate installer CD for each machine. What you really want, is to be able to put all the information for all your machines on one installer CD and have the installer figure it out for itself.

And, if you're even more like me, then... well... You're freakin' me out, man. Stop it.

I've written a package I've called multi-config that produces two udebs:

multi-netcfg_1.10_all.udeb
From debian/multi-netcfg.README:
This module is designed to allow the installer to preseed network
configuration values for a multitude of machines.

To use:

1) Preseed multi-netcfg/preseed-dir.

Set multi-netcfg/preseed-dir to a directory on the install media where
multi-netcfg is to check for network configuration preseed files.  For
instance, if you are using an install CD, and you have created a directory on
your CD called /preseed/netcfg/, then set your preseed value thusly:

d-i multi-netcfg/preseed-dir string /cdrom/preseed/netcfg

2) Create the netcfg preseed directory and populate with preseed files.

For each machine for which you want to preseed network configuration settings,
create a file in your multi-netcfg directory using the ethernet hardware
address as the filename, but with ':'s changed to '-'s.

For instance: If given an unknown machine with a blank hard drive...

  2a) Boot the machine w/ the Debian installer.

  2b) When prompted for network configuration (after the installer has
      detected the ethernet card and loaded modules), switch to the 2nd
virtual terminal and type "ifconfig -a". You will see something like
      this (numbers have been changed to protect the guilty):

eth0 Link encap:Ethernet HWaddr 0A:12:F3:3A:13:E9 inet addr:xx.xx.xx.xx Bcast:xx.xx.xx.255 Mask:255.255.255.0
                inet6 addr: fe70::212:3fef:fe3b:129e/64 Scope:Link
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:433469293 errors:0 dropped:0 overruns:0 frame:0
TX packets:552342645 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000
RX bytes:4186685499 (3.8 GiB) TX bytes:2485150677 (2.3 GiB)
                Base address:0xdcc0 Memory:dfee0000-dff00000

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0
                inet6 addr: ::1/128 Scope:Host
                UP LOOPBACK RUNNING  MTU:16436  Metric:1
                RX packets:106281703 errors:0 dropped:0 overruns:0 frame:0
TX packets:106281703 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
RX bytes:4107947197 (3.8 GiB) TX bytes:4107947197 (3.8 GiB)

sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

  2c) Locate the hardware address for your ethernet card.  In the above
      example above the hardware address for the ethernet card is
      0A:12:F3:3A:13:E9.

  2d) Permute the hardware address by substituting '-'s for ':'s:
      0A-12-F3-3A-13-E9.

  2e) Create a file by this permuted name under the multi-netcfg directory
containing your network preseed values. You can leave out the preseed value for netcfg/choose_interface, as multi-netcfg will fill this value
      in for you automatically.  An exmaple file might look like this:

      d-i netcfg/disable_dhcp boolean true
      d-i netcfg/get_ipaddress string xx.xx.xx.xx
      d-i netcfg/get_netmask string xx.xx.xx.0
      d-i netcfg/get_gateway string xx.xx.xx.1
      d-i netcfg/get_nameservers string xx.xx.xx.xx xx.xx.xx.xx
      d-i netcfg/confirm_static boolean true
      d-i netcfg/get_hostname string myhost
      d-i netcfg/get_domain string my.domain.net
      d-i netcfg/wireless_wep string

2f) Or, instead of creating a file, create a directory, and populate it with as many files as you want. If the directory name matches, then all the files within will be read. (Note: Subdirectories and files within are
      NOT read.)

3) Activate the multi-netcfg module.

On your installation media, edit (or create) the .disk/udeb_include file to
include a line that reads "multi-netcfg".

4) Sit back and enjoy.

multi-partman_1.10_all.udeb
From debian/multi-partman.README:
This module is designed to allow the installer to preseed hard drive
configuration values for a multitude of machines.

To use:

1) Preseed multi-partman/preseed-dir.

Set multi-partman/preseed-dir to a directory on the install media where
multi-partman is to check for partitioning configuration preseed files. For instance, if you are using an install CD, and you have created a directory on
your CD called /preseed/partman/, then set your preseed value thusly:

d-i multi-partman/preseed-dir string /cdrom/preseed/partman

2) Create the partman preseed directory and populate with preseed files.

  2a) For each machine for which you want to preseed network configuration
settings, create a file in your multi-partman directory for that machine. You may use a permutation of the ethernet hardware address (change ':'s
      to '-'s, see multi-netcfg.README for details), IP address,
      hostname.domainname, or just hostname, or the size of the drives.

      For instance, if you have a machine with the following attributes:
Eth0 HWAddr: 0A:12:F3:3A:13:E9 IP address: 12.34.56.78
        Hostname: myhost
        Hostname+Domain: myhost.my.domain
        Hard drive(s): disk0 = 80GB, disk1 = 160GB
Then you may create a file using any of the following file names: 0A-12-F3-3A-13-E9 12.34.56.78
        myhost
        myhost.my.domain
        disk0-80000.disk1-160000
Each of these names will be considered valid for the example machine
      given above.  Names are considered according to the following order:
1) Hardware address
        2) IP address
        3) Host+Domain name
        4) Host name
5) Number of your disk (starting with 0) and size of (in MB) of disks,
           optionally followed by a '.' and another disk+size combo,
ad-infinitum -- or at least until you blow the installer's string
           buffer.
Once a matching file is found no further matching is attempted. Inside this file, preseed your drive configuration. As an example: d-i partman-auto/disk string /dev/discs/disc0/disc d-i partman-auto/expert_recipe string root-swap :: 40000 10000 40000 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / } . 500 10000 1000000000 ext3 method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /export/home/a } . 64 512 300% linux-swap method{ swap } format{ } .
        d-i partman/confirm_write_new_label     boolean true
d-i partman/choose_partition select Finish partitioning and write changes to disk
        d-i partman/confirm                     boolean true
NOTE: You may also create default files: disk0-generic
        disk0-generic.disk1-generic
        disk0-generic.disk1-generic.disk2-generic
Etc., etc. If no other preseed files match the install machine, one of
      these will be used instead.
If no matching files are found then no preseeding is done, meaning that you will be presented with a chance to manually partition your disks.

2b) Or, instead of a single file, create a directory instead, and populate that directory with as many preseed files as you like. If a directory name matches, then all the files within that directory are read. (Note: Subdirectories and files within are NOT read.)

3) Activate the multi-partman module.

On your installation media, edit (or create) the .disk/udeb_include file to
include a line that reads "multi-partman".

4) Sit back and enjoy.

If anyone is interested in taking this package under their wing, let me know. If anyone is interested in playing with the package or taking a look at the package's contents, feel free to take a gander at it here:

http://www.tiem.utk.edu/~peek/debian/


A giant thanks to all the developers responsible for Debain!

Michael Peek



Reply to: