This commit was generated by cvs2svn to compensate for changes in r525,
authorAaron Klingaman <alk@cs.princeton.edu>
Mon, 22 Nov 2004 19:28:23 +0000 (19:28 +0000)
committerAaron Klingaman <alk@cs.princeton.edu>
Mon, 22 Nov 2004 19:28:23 +0000 (19:28 +0000)
which included commits to RCS files with non-trunk default branches.

15 files changed:
Makefile.needlessly_complicated [new file with mode: 0644]
build.sh [new file with mode: 0755]
conf_files/fstab [new file with mode: 0644]
conf_files/hosts [new file with mode: 0644]
conf_files/inittab [new file with mode: 0644]
conf_files/isolinux.cfg [new file with mode: 0644]
conf_files/macros [new file with mode: 0644]
conf_files/modprobe.conf [new file with mode: 0644]
conf_files/mtab [new file with mode: 0644]
conf_files/pl_hwinit [new file with mode: 0755]
conf_files/pl_sysinit [new file with mode: 0755]
scripts/rewrite-pcitable.py [new file with mode: 0755]
sources/syslinux-2.11.tar.bz2 [new file with mode: 0644]
sources/syslinux-2.11.url [new file with mode: 0644]
yum.conf [new file with mode: 0644]

diff --git a/Makefile.needlessly_complicated b/Makefile.needlessly_complicated
new file mode 100644 (file)
index 0000000..7814e2f
--- /dev/null
@@ -0,0 +1,154 @@
+VERSION:="3.0"
+FULL_VERSION_STRING:="PlanetLab BootCD $(VERSION)"
+ROOT_PASSWD:='$1$IdEn2srw$/TfrjZSPUC1xP244YCuIi0'
+CDRECORD_FLAGS:="-v -dao -blank=fast"
+
+SYSLINUX:=sources/syslinux-2.11.tar.bz2
+CD_IMAGE:=cd.iso
+CD_ROOT:=cdroot
+CD_PWD:=$(shell pwd)
+BOOTCD_YUM_GROUP:=BootCD
+
+INITRD_MOUNT:=rd
+CD_ROOT_USR:=usr-cd
+INITRD_SIZE:=64
+INITRD:=$(CD_ROOT)/$(CD_ROOT_USR)/isolinux/initrd
+
+CONF_FILES_DIR=conf_files
+
+PRE_CONF_FILES=etc/fstab \
+                   etc/mtab \
+                   etc/rpm/macros
+
+POST_CONF_FILES=etc/inittab \
+                etc/init.d/pl_hwinit \
+                etc/init.d/pl_sysinit \
+                etc/modprobe.conf \
+                etc/hosts
+
+# directories in the cd root to move to /usr/relocated to reduce ramdisk size
+RELOCATE_DIRS=$(CD_ROOT)/lib/tls \
+              $(CD_ROOT)/var/lib/rpm
+
+RELOCATE_DEST_DIR=usr/relocated
+
+CD_PRE_CONF_FILES:=$(patsubst %,$(CD_ROOT)/%,$(PRE_CONF_FILES))
+CD_POST_CONF_FILES:=$(patsubst %,$(CD_ROOT)/%,$(POST_CONF_FILES))
+CD_RELOCATED_DIRS:=$(patsubst %,$(CD_ROOT)/usr/relocated/%,$(RELOCATE_DIRS))
+
+all: $(CD_IMAGE)
+
+
+$(CD_IMAGE): $(CD_PRE_CONF_FILES) $(CD_POST_CONF_FILES) $(CD_ROOT)/.built $(CD_ROOT)/.config $(INITRD).gz $(CD_RELOCATED_DIRS)
+       @echo "building iso"
+       mkisofs -o $(CD_IMAGE) -R -allow-leading-dots -J -r \
+            -b isolinux/isolinux.bin -c isolinux/boot.cat \
+            -no-emul-boot -boot-load-size 4 -boot-info-table \
+           -V PlanetLab-3-0 $(CD_ROOT)/usr
+
+
+$(CD_ROOT)/.built: $(PRE_YUM)
+       @echo "initialize rpm db"
+
+       mkdir -p $(CD_ROOT)/var/lib/rpm
+       rpm --root $(CD_PWD)/$(CD_ROOT) --initdb
+
+       @echo "install boot cd base rpms"
+       yum -c yum.conf --installroot=$(CD_PWD)/$(CD_ROOT) \
+            -y groupinstall $(BOOTCD_YUM_GROUP)
+
+       touch $(CD_ROOT)/.built
+
+$(CD_RELOCATED_DIRS): $(CD_ROOT)/.built
+$(CD_RELOCATED_DIRS): $(CD_ROOT)/$(RELOCATE_DEST_DIR)% : $(CD_ROOT)/%
+       @echo "relocate some large directories out of the root system"
+       mkdir -p $@
+       mv $< $@
+       ln -s $@ $<
+
+
+$(CD_PRE_CONF_FILES): $(CD_ROOT)/% : $(CONF_FILES_DIR)/%
+       mkdir -p $(dir $@)
+       cp -a $< $@
+
+
+$(CD_POST_CONF_FILES): $(CD_ROOT)/.built $(CD_ROOT)/etc/pl_pcitable
+
+$(CD_POST_CONF_FILES): $(CD_ROOT)/% : $(CONF_FILES_DIR)/%
+       mkdir -p $(dir $@)
+       cp -a $< $@
+
+
+$(CD_ROOT)/usr/isolinux/.built:
+       @echo "extracting syslinux, copying isolinux files to cd"
+
+       mkdir -p syslinux
+       mkdir -p $(CD_ROOT)/usr/isolinux/
+
+       tar -C syslinux -xjvf $(SYSLINUX)
+       find syslinux -name isolinux.bin -exec cp -f {} $(CD_ROOT)/usr/isolinux/ \;
+
+       cp -f $(CONF_FILES_DIR)/usr/isolinux/isolinux.cfg $(CD_ROOT)/usr/isolinux/
+       echo "$(FULL_VERSION_STRING)" > $(CD_ROOT)/usr/isolinux/message.txt
+
+       touch $(CD_ROOT)/usr/isolinux/.built
+
+
+$(CD_ROOT)/etc/pl_pcitable:
+       scripts/rewrite-pcitable.py \
+           $(wildcard $(CD_ROOT)/lib/modules/*/modules.pcimap) \
+           $(CD_ROOT)/etc/pl_pcitable
+
+
+$(INITRD).gz: $(CD_ROOT)/.built
+       (cd $(CD_ROOT) && mv usr $(CD_ROOT_USR))
+       mkdir $(CD_ROOT)/usr
+
+       dd if=/dev/zero of=$(INITRD) bs=1M count=$(INITRD_SIZE)
+       mkfs.ext2 -F -m 0 -i 1024 $(INITRD)
+
+       mkdir -p $(INITRD_MOUNT)
+       mount -o loop,rw $(INITRD) $(INITRD_MOUNT)
+       (cd $(CD_ROOT) && tar --exclude $(CD_ROOT_USR) -cf initrdcontents.tar *)
+       tar -C $(INITRD_MOUNT) -xf $(CD_ROOT)/initrdcontents.tar
+       umount $(INITRD_MOUNT)
+       rmdir $(INITRD_MOUNT)
+
+       gzip $(INITRD)
+
+       rm -f $(CD_ROOT)/initrdcontents.tar
+       rmdir $(CD_ROOT)/usr
+       (cd $(CD_ROOT) && mv $(CD_ROOT_USR) usr)
+
+
+$(CD_ROOT)/.config: $(CD_ROOT)/.built $(CD_ROOT)/usr/isolinux/.built
+       @echo "removing unneccessary build files"
+       rm -rf $(wildcard $(CD_ROOT)/lib/modules/*/build/)
+
+       @echo "setting up non-ssh authentication"
+       mkdir -p $(CD_ROOT)/etc/samba
+       chroot $(CD_ROOT) /usr/sbin/authconfig --nostart --kickstart \
+            --enablemd5 --enableshadow
+
+       @echo "setting root password"
+       sed -i "s#root::#root:$(ROOT_PASSWD):#g" $(CD_ROOT)/etc/shadow
+
+       echo "$(FULL_VERSION_STRING)" > $(CD_ROOT)/usr/isolinux/pl_version
+       echo "$(FULL_VERSION_STRING)" > $(CD_ROOT)/pl_version
+
+
+       echo "moving kernel to isolinux directory"
+       mkdir -p $(CD_ROOT)/usr/isolinux/
+       mv -f $(wildcard $(CD_ROOT)/boot/vmlinuz-*) $(CD_ROOT)/usr/isolinux/kernel
+
+
+
+cdr: $(CD_IMAGE)
+       cdrecord $(CDRECORD_FLAGS) -data $(CD_IMAGE)
+
+clean:
+       rm -rf $(CD_ROOT)
+       rm -f $(CD_IMAGE)
+
+
+.PHONY: all cdr clean
diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
index 0000000..47075c0
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,198 @@
+#!/bin/bash
+
+set -e
+
+BOOTCD_VERSION="3.0"
+FULL_VERSION_STRING="PlanetLab BootCD $BOOTCD_VERSION"
+
+SYSLINUX_SRC=sources/syslinux-2.11.tar.bz2
+
+ISO=cd.iso
+
+CD_ROOT=`pwd`/cdroot
+ROOT_PASSWD='$1$IdEn2srw$/TfrjZSPUC1xP244YCuIi0'
+
+BOOTCD_YUM_GROUP=BootCD
+
+CDRECORD_FLAGS="-v -dao -blank=fast"
+
+CONF_FILES_DIR=conf_files/
+
+# location of the uncompressed ramdisk image
+INITRD=$CD_ROOT/usr/isolinux/initrd
+
+# temporary mount point for rd
+INITRD_MOUNT=`pwd`/rd
+
+# size of the ram disk in MB
+RAMDISK_SIZE=48
+
+# the bytes per inode ratio (the -i value in mkfs.ext2) for the ramdisk
+INITRD_BYTES_PER_INODE=1024
+
+
+function build_cdroot()
+{
+    if [ -f $CD_ROOT/.built ]; then
+       echo "cd root already built, skipping"
+       return
+    fi
+
+    clean
+    
+    mkdir -p $CD_ROOT/dev/pts
+    mkdir -p $CD_ROOT/proc
+    mkdir -p $CD_ROOT/etc
+
+    echo "copy fstab and mtab"
+    cp -f $CONF_FILES_DIR/fstab $CD_ROOT/etc/
+    cp -f $CONF_FILES_DIR/mtab $CD_ROOT/etc/
+
+    echo "setup rpm to install only en_US locale and no docs"
+    mkdir -p $CD_ROOT/etc/rpm
+    cp -f $CONF_FILES_DIR/macros $CD_ROOT/etc/rpm
+
+    echo "initialize rpm db"
+    mkdir -p $CD_ROOT/var/lib/rpm
+    rpm --root $CD_ROOT --initdb
+
+    echo "install boot cd base rpms"
+    yum -c yum.conf --installroot=$CD_ROOT -y groupinstall $BOOTCD_YUM_GROUP
+
+    echo "removing unneccessary build files"
+    (cd $CD_ROOT/lib/modules && \
+       find ./ -type d -name build -maxdepth 2 -exec rm -rf {} \;)
+
+    echo "setting up non-ssh authentication"
+    mkdir -p $CD_ROOT/etc/samba
+    chroot $CD_ROOT /usr/sbin/authconfig --nostart --kickstart \
+       --enablemd5 --enableshadow
+
+    echo "setting root password"
+    sed -i "s#root::#root:$ROOT_PASSWD:#g" $CD_ROOT/etc/shadow
+
+    echo "relocate some large directories out of the root system"
+    # get /var/lib/rpm out, its 12mb. create in its place a 
+    # symbolic link to /usr/relocated/var/lib/rpm
+    mkdir -p $CD_ROOT/usr/relocated/var/lib/
+    mv $CD_ROOT/var/lib/rpm $CD_ROOT/usr/relocated/var/lib/
+    (cd $CD_ROOT/var/lib && ln -s ../../usr/relocated/var/lib/rpm rpm)
+
+    # get /lib/tls out
+    mkdir -p $CD_ROOT/usr/relocated/lib
+    mv $CD_ROOT/lib/tls $CD_ROOT/usr/relocated/lib/
+    (cd $CD_ROOT/lib && ln -s ../usr/relocated/lib/tls tls)
+
+    echo "extracting syslinux, copying isolinux files to cd"
+    mkdir -p syslinux
+    mkdir -p $CD_ROOT/usr/isolinux/
+    tar -C syslinux -xjvf $SYSLINUX_SRC
+    find syslinux -name isolinux.bin -exec cp -f {} $CD_ROOT/usr/isolinux/ \;
+
+    echo "moving kernel to isolinux directory"
+    KERNEL=$CD_ROOT/boot/vmlinuz-*
+    mv -f $KERNEL $CD_ROOT/usr/isolinux/kernel
+
+    echo "creating version files"
+    echo "$FULL_VERSION_STRING" > $CD_ROOT/usr/isolinux/pl_version
+    echo "$FULL_VERSION_STRING" > $CD_ROOT/pl_version
+
+    touch $CD_ROOT/.built
+}
+
+function build_initrd()
+{
+    echo "building initrd"
+    rm -f $INITRD
+    rm -f $INITRD.gz
+
+    echo "copy fstab and mtab"
+    cp -f $CONF_FILES_DIR/fstab $CD_ROOT/etc/
+    cp -f $CONF_FILES_DIR/mtab $CD_ROOT/etc/
+
+    echo "installing generic modprobe.conf"
+    cp -f $CONF_FILES_DIR/modprobe.conf $CD_ROOT/etc/
+
+    echo "installing our own inittab and init scripts"
+    cp -f $CONF_FILES_DIR/inittab $CD_ROOT/etc
+    cp -f $CONF_FILES_DIR/pl_sysinit $CD_ROOT/etc/init.d/
+    cp -f $CONF_FILES_DIR/pl_hwinit $CD_ROOT/etc/init.d/
+
+    echo "setup basic networking files"
+    cp -f $CONF_FILES_DIR/hosts $CD_ROOT/etc/
+
+    echo "copying isolinux configuration files"
+    cp -f $CONF_FILES_DIR/isolinux.cfg $CD_ROOT/usr/isolinux/
+    echo "$FULL_VERSION_STRING" > $CD_ROOT/usr/isolinux/message.txt
+
+    echo "making the isolinux initrd kernel command line match rd size"
+    let INITRD_SIZE_KB=$(($RAMDISK_SIZE * 1024))
+    sed -i "s#ramdisk_size=0#ramdisk_size=$INITRD_SIZE_KB#g" \
+       $CD_ROOT/usr/isolinux/isolinux.cfg
+
+    echo "building pcitable for hardware detection"
+    pci_map_file=`find $CD_ROOT/lib/modules/ -name modules.pcimap | head -1`
+    ./scripts/rewrite-pcitable.py $pci_map_file $CD_ROOT/etc/pl_pcitable
+
+    dd if=/dev/zero of=$INITRD bs=1M count=$RAMDISK_SIZE
+    mkfs.ext2 -F -m 0 -i $INITRD_BYTES_PER_INODE $INITRD
+    mkdir -p $INITRD_MOUNT
+    mount -o loop,rw $INITRD $INITRD_MOUNT
+
+    echo "copy all files except usr to ramdisk"
+    (cd $CD_ROOT && find . -path ./usr -prune -o -print | \
+       cpio -p -d -u $INITRD_MOUNT)
+
+    umount $INITRD_MOUNT
+    rmdir $INITRD_MOUNT
+    
+    echo "compressing ramdisk"
+    gzip $INITRD
+}
+
+function build_iso()
+{
+    echo "building iso"
+    rm -f $ISO
+    mkisofs -o $ISO -R -allow-leading-dots -J -r -b isolinux/isolinux.bin \
+       -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
+       -V PlanetLab-3-0 $CD_ROOT/usr
+}
+
+function burn()
+{
+    cdrecord $CDRECORD_FLAGS -data $ISO
+}
+
+function clean()
+{
+    echo "removing built files"
+    rm -rf cdroot
+    rm -rf syslinux
+    rm -rf $INITRD_MOUNT
+    rm -f $ISO
+}
+
+
+if [ "$1" == "clean" ]; then
+    clean
+    exit
+fi
+
+if [ "$1" == "burn" ]; then
+    build_iso
+    burn
+    exit
+fi
+
+if [ "$1" == "force" ]; then
+    clean
+fi
+
+# build base image via yum
+build_cdroot
+
+# always build/rebuild initrd
+build_initrd
+
+build_iso
diff --git a/conf_files/fstab b/conf_files/fstab
new file mode 100644 (file)
index 0000000..a4f3fb7
--- /dev/null
@@ -0,0 +1,4 @@
+/dev/ram0     /              ext2       defaults        1 1
+none          /dev/pts       devpts     gid=5,mode=620  0 0
+none          /proc          proc       defaults        0 0
+none          /sys           sysfs      defaults        0 0
diff --git a/conf_files/hosts b/conf_files/hosts
new file mode 100644 (file)
index 0000000..c75e8bb
--- /dev/null
@@ -0,0 +1 @@
+127.0.0.1   localhost.localdomain  localhost
diff --git a/conf_files/inittab b/conf_files/inittab
new file mode 100644 (file)
index 0000000..234f51d
--- /dev/null
@@ -0,0 +1,12 @@
+id:1:initdefault:
+
+si::sysinit:/etc/init.d/pl_sysinit
+
+l1:1:wait:/sbin/sulogin
+
+u6:6:wait:/bin/umount -a -r 
+r6:6:wait:/sbin/shutdown -r -n now
+u0:0:wait:/bin/umount -a -r 
+h0:0:wait:/sbin/shutdown -h -n now
+
+ca::ctrlaltdel:/sbin/shutdown -t3 -r now
diff --git a/conf_files/isolinux.cfg b/conf_files/isolinux.cfg
new file mode 100644 (file)
index 0000000..b257db7
--- /dev/null
@@ -0,0 +1,5 @@
+DEFAULT kernel
+APPEND load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=0 initrd=initrd.gz root=/dev/ram0 rw
+DISPLAY message.txt
+PROMPT 0
+TIMEOUT 40
diff --git a/conf_files/macros b/conf_files/macros
new file mode 100644 (file)
index 0000000..da310a3
--- /dev/null
@@ -0,0 +1,3 @@
+%_install_langs en_US:en
+%_excludedocs 1
+%__file_context_path /dev/null
diff --git a/conf_files/modprobe.conf b/conf_files/modprobe.conf
new file mode 100644 (file)
index 0000000..6e5ba04
--- /dev/null
@@ -0,0 +1 @@
+include /etc/modprobe.conf.dist
diff --git a/conf_files/mtab b/conf_files/mtab
new file mode 100644 (file)
index 0000000..aad24a1
--- /dev/null
@@ -0,0 +1 @@
+/dev/ram0     /              ext2       defaults        1 1
diff --git a/conf_files/pl_hwinit b/conf_files/pl_hwinit
new file mode 100755 (executable)
index 0000000..33aed4e
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+pci_table=/etc/pl_pcitable
+
+echo "pl_hwinit: loading applicable modules"
+
+# this will contain lines of device_id:vendor_id (no 0x)
+system_devices=$(lspci -n | cut -d " " -f4)
+
+for device in $system_devices; do
+
+    # now vendor_id and device_id are broken apart
+    vendor_id=$(echo $device | cut -d ":" -f1)
+    device_id=$(echo $device | cut -d ":" -f2)
+
+    # either exactly match vendor:device, or a vendor:ffff (let the module
+    # figure out if it can be used for this device), or ffff:device
+    # (not sure if this is legal, but shows up in the pci map)
+    mods=$(grep -i "\($vendor_id:ffff\|$vendor_id:$device_id\|ffff:$device_id\)" \
+       $pci_table | cut -d " " -f1)
+
+    for module in $mods; do
+       if [ -n "$module" ]; then
+           echo "pl_hwinit: found and loading module $module"
+           /sbin/modprobe $module
+       fi
+    done
+done
+
+# just in case, look for any modules that are ffff:ffff and load them
+mods=$(grep -i "ffff:ffff" $pci_table | cut -d " " -f1)
+for module in $mods; do
+    if [ -n "$module" ]; then
+       echo "pl_hwinit: found and loading wild module $module"
+       /sbin/modprobe $module
+    fi
+done
+
+# sd_mod won't get loaded automatically
+echo "pl_hwinit: loading sd_mod"
+/sbin/modprobe sd_mod
+
diff --git a/conf_files/pl_sysinit b/conf_files/pl_sysinit
new file mode 100755 (executable)
index 0000000..0fded15
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+echo "pl_sysinit: bringing system online"
+
+echo "pl_sysinit: mounting file systems"
+/bin/mount -v -a
+
+echo "pl_sysinit: bringing loopback network device up"
+/sbin/ifconfig lo 127.0.0.1 up
+
+echo "pl_sysinit: invoking hardware initialization script"
+/etc/init.d/pl_hwinit
+
+echo "pl_sysinit: finding cd to mount on /usr"
+test_devices=/sys/block/*
+mounted=0
+initrd_version=$(/bin/cat /pl_version)
+mkdir /usr
+
+for device in $test_devices; do
+    device=$(/bin/basename $device)
+
+    # skipping any devices that start with md or ra (ram) or lo (loop)
+    start_device=${device:0:2}
+    if [ "$start_device" == "ra" ] || [ "$start_device" == "md" ] ||
+       [ "$start_device" == "lo" ]; then
+       continue
+    fi
+    
+    echo "pl_sysinit: checking $device for /usr contents"
+    /bin/mount -o ro -t iso9660 /dev/$device /usr 2>&1 > /dev/null
+    if [ $? -eq 0 ]; then
+       # it mounted, but we should probably make sure its our boot cd
+       # this can be done by making sure the /pl_version file (on initrd)
+       # matches /usr/isolinux/pl_version
+       cd_version=$(/bin/cat /usr/isolinux/pl_version)
+
+       if [ "$initrd_version" != "$cd_version" ]; then
+           # eh, wrong cd, keep trying
+           /bin/umount /usr 2>&1 /dev/null
+       else
+           echo "pl_sysinit: found cd and mounted on /usr"
+           mounted=1
+           break
+       fi
+    fi
+done
+
+if [ $mounted -eq 0 ]; then
+    echo "pl_sysinit: unable to find boot cdrom, cannot continue."
+    # todo: maybe we can put a staticly linked sshd here
+    /sbin/shutdown -h now
+fi
+
+
+# parts of this were copied from devmap_mknod.sh from the device-mapper
+# source. Since fedora decided not to include it in the rpm, it is 
+# being copied here
+echo "pl_sysinit: creating device mapper control node"
+
+DM_DIR="mapper"
+DM_NAME="device-mapper"
+DIR="/dev/$DM_DIR"
+CONTROL="$DIR/control"
+
+MAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)
+MINOR=$(sed -n "s/^ *\([0-9]\+\) \+$DM_NAME\$/\1/p" /proc/misc)
+
+if [ -n "$MAJOR" ] && [ -n "$MINOR" ]; then
+    /bin/mkdir -p --mode=755 $DIR
+    /bin/rm -f $CONTROL
+    /bin/mknod --mode=600 $CONTROL c $MAJOR $MINOR
+else
+    echo "pl_sysinit: unable to create device mapper control node, continuing"
+fi
+
diff --git a/scripts/rewrite-pcitable.py b/scripts/rewrite-pcitable.py
new file mode 100755 (executable)
index 0000000..c2dadb5
--- /dev/null
@@ -0,0 +1,112 @@
+#!/usr/bin/env python
+
+"""
+The point of this small utility is to take a file in the format
+of /lib/modules/`uname -r`/modules.pcimap and output a condensed, more
+easily used format for module detection
+
+The output is used by the PlanetLab boot cd (3.0+) and the pl_hwinit script
+to load all the applicable modules by scanning lspci output.
+
+Excepted format of file includes lines of:
+
+# pci_module vendor device subvendor subdevice class class_mask driver_data
+cciss 0x00000e11 0x0000b060 0x00000e11 0x00004070 0x00000000 0x00000000 0x0
+cciss 0x00000e11 0x0000b178 0x00000e11 0x00004070 0x00000000 0x00000000 0x0
+
+Output format, for each line that matches the above lines:
+cciss 0e11:b060 0e11:b178
+"""
+
+import os, sys
+import string
+
+
+def usage():
+    print( "Usage:" )
+    print( "rewrite-pcitable.py <pcitable> [<output>]" )
+    print( "" )
+
+
+if len(sys.argv) < 2:
+    usage()
+    sys.exit(1)
+
+
+pcitable_file_name= sys.argv[1]
+try:
+    pcitable_file= file(pcitable_file_name,"r")
+except IOError:
+    sys.stderr.write( "Unable to open: %s\n" % pcitable_file_name )
+    sys.exit(1)
+
+if len(sys.argv) > 2:
+    output_file_name= sys.argv[2]
+    try:
+        output_file= file(output_file_name,"w")
+    except IOError:
+        sys.stderr.write( "Unable to open %s for writing.\n" % output_file )
+        sys.exit(1)
+else:
+    output_file= sys.stdout
+
+
+line_num= 0
+
+# associative array to store all matches of module -> ['vendor:device',..]
+# entries
+all_modules= {}
+
+for line in pcitable_file:
+    line_num= line_num+1
+    
+    # skip blank lines, or lines that begin with # (comments)
+    line= string.strip(line)
+    if len(line) == 0:
+        continue
+    
+    if line[0] == "#":
+        continue
+
+    line_parts= string.split(line)
+    if line_parts is None or len(line_parts) != 8:
+        sys.stderr.write( "Skipping line %d (incorrect format)\n" % line_num )
+        continue
+
+    # first two parts are always vendor / device id
+    module= line_parts[0]
+    vendor_id= line_parts[1]
+    device_id= line_parts[2]
+    
+
+    # valid vendor and devices are 10 chars (0xXXXXXXXX) and begin with 0x
+    if len(vendor_id) != 10 or len(device_id) != 10:
+        sys.stderr.write( "Skipping line %d (invalid vendor/device id length)\n"
+                          % line_num )
+        continue
+
+    if string.lower(vendor_id[:2]) != "0x" \
+           or string.lower(device_id[:2]) != "0x":
+        sys.stderr.write( "Skipping line %d (invalid vendor/device id format)\n"
+                          % line_num )
+        continue
+
+    # cut down the ids, only need last 4 bytes
+    # start at 6 = (10 total chars - 4 last chars need)
+    vendor_id= string.lower(vendor_id[6:])
+    device_id= string.lower(device_id[6:])
+
+    full_id= "%s:%s" % (vendor_id, device_id)
+
+    if all_modules.has_key(module):
+        all_modules[module].append( full_id )
+    else:
+        all_modules[module]= [full_id,]
+
+for module in all_modules.keys():
+    devices= string.join( all_modules[module], " " )
+    output_file.write( "%s %s\n" % (module,devices) )
+
+    
+output_file.close()
+pcitable_file.close()
diff --git a/sources/syslinux-2.11.tar.bz2 b/sources/syslinux-2.11.tar.bz2
new file mode 100644 (file)
index 0000000..7475edf
Binary files /dev/null and b/sources/syslinux-2.11.tar.bz2 differ
diff --git a/sources/syslinux-2.11.url b/sources/syslinux-2.11.url
new file mode 100644 (file)
index 0000000..33cc432
--- /dev/null
@@ -0,0 +1 @@
+http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-2.11.tar.bz2
diff --git a/yum.conf b/yum.conf
new file mode 100644 (file)
index 0000000..69135eb
--- /dev/null
+++ b/yum.conf
@@ -0,0 +1,19 @@
+[main]
+cachedir=/var/cache/yum
+debuglevel=2
+logfile=/var/log/yum.log
+pkgpolicy=newest
+
+[FedoraCore2Base]
+name=Fedora Core 2 Base -- PlanetLab Central
+baseurl=http://boot.planet-lab.org/install-rpms/stock-fc2/
+
+[FedoraCore2Updates]
+name=Fedora Core 2 Updates -- PlanetLab Central
+baseurl=http://boot.planet-lab.org/install-rpms/updates-fc2/
+
+[BootCDTestRepo]
+name=Fedora Core 2 Boot CD Test
+baseurl=http://boot.planet-lab.org/install-rpms/bootcd-test-repo/
+
+