Last modified 2 years ago Last modified on 23/06/12 10:54:22
OK, this is the Plan. We boot a diskless Linux 2.6.x kernel, use the /sys (sysfs) file system and modules.pcimap files to autodetect the network hardware and load its driver(s), use udhcpc (from BusyBox?) to grab a DHCP lease, use mount to map the install share on /z, use sysfs and modules.pcimap again to autodetect the mass storage hardware and load its driver(s), run install.pl to partition the disk (using Parted) and generate unattend.txt.
The Makefile generates the Linux boot disk. To download all required sources from their canonical locations.
svn co https://unattended.svn.sourceforge.net/svnroot/unattended/trunk unattended
cd unattended/linuxboot
make download
This will use gobs of disk space, a fast connection, and lots of time. Do "make iso" to build linuxboot.iso. Do "make tftpboot" to populate the tftpboot/ directory. A simple
make
does both.
This assume that you are familiar with Debian. Install only the base system. See http://wiki.freaks-unidos.net/chrooted-debian-server for directions on creating a chrooted virgin Debian base system on either Debian or Red Hat based distros.
aptitude install subversion build-essential bison flex libncurses-dev libncursesw5-dev mkisofs gawk mtools
The Debian package firmware-linux-nonfree might be useful if you have a nic that isn't recognized out of the box. E.g. Broadcomm Netlink BCM57780. Note: This should be working now with kernel 2.6.35.8
Or use a Fedora kernel that has the firmware included -> kernel-2.6.34.7-61.fc13.src.rpm
rpmbuild --target i386 -bp kernel.spec
will give you a patched kernel source that can use the Broadcom Netlink nic above.
attention: this method gave me an error: "openvt: unable to open /dev/tty2: No such file or directory."... you have been warned!
Please tell me how to fix that :)
copy /dev/tty2 from linux host to the extracted initrd image :)
2nd. attention:i think the correct way to do this is to uncheck the current release of unattended from cvs an build the bootdisk from source according to the README.txt file in the linuxboot directory. doing this you are able to build new kernel and modules as well.
get ready
gunzip unattended-4.6-linuxboot.zip
cd linuxboot/
mkdir tmp iso initrd
open default iso and initrd
mount -t iso9660 -o loop linuxboot.iso tmp/
cp -rp tmp/* iso/.
umount tmp/
rmdir tmp/
cd initrd/
cat ../iso/isolinux/initrd | cpio -i
now you can modify everything!
create a brand new iso
cd initrd
find . -xdev | cpio -o -H newc > ../iso/isolinux/initrd
cd ../iso
mkisofs -o ../MegaCool-linuxboot.iso -V 'MyLinuxBoot' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
-boot-info-table -R -J -T .
burn it!
If your custom built kernel panics when starting initrd with something like Inconsistency detected by ld.so: dynamic-link.h: 204: elf_get_dynamic_info: Assertion 'info[15] == ((void *)0)' failed!
You'll need to patch GLibc
--- glibc-2.11.1/elf/dynamic-link.h.orig 2010-10-25 01:24:57.392697801 +0000
+++ glibc-2.11.1/elf/dynamic-link.h 2010-10-25 01:25:35.733821785 +0000
@@ -200,8 +200,8 @@
assert (info[DT_FLAGS] == NULL
|| info[DT_FLAGS]->d_un.d_val == DF_BIND_NOW);
/* Flags must not be set for ld.so. */
- assert (info[DT_RUNPATH] == NULL);
- assert (info[DT_RPATH] == NULL);
+ info[DT_RUNPATH] == NULL;
+ info[DT_RPATH] == NULL;
#else
if (info[DT_FLAGS] != NULL)
{
references http://devpit.org/wiki/Gnu_Toolchain/GLIBC/Building_GLIBC#patching_32-bit