Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updates to make bootif work correctly and log the MAC that it chose.

With this set of changes, debian-installer honors the BOOTIF parameter that
pxelinux passes to the kernel, and chooses that as the default interface.
  • Loading branch information...
commit 2f18ae3640ec2b2e29d23d2ffc592eea8a262d0c 1 parent 16c2ef5
@VictorLowther VictorLowther authored
View
4 build_crowbar.sh
@@ -509,7 +509,7 @@ BC_QUERY_STRINGS["os_raw_pkgs"]="$PKG_TYPE $OS_TOKEN raw_pkgs"
mkdir -p "$BUILD_DIR/$d"
chmod u+wr "$BUILD_DIR/$d"
# We could also use cp -n, but rhel5 and centos5 do not understand it.
- rsync -rl --ignore-existing --inplace "$IMAGE_DIR/$d/." "$BUILD_DIR/$d/."
+ rsync -rl --ignore-existing --inplace "$IMAGE_DIR/$d" "$BUILD_DIR"
chmod -R u+wr "$BUILD_DIR/$d"
# Bind mount an empty directory on the $IMAGE_DIR instance.
sudo mount -t tmpfs -o size=1K tmpfs "$IMAGE_DIR/$d"
@@ -517,7 +517,7 @@ BC_QUERY_STRINGS["os_raw_pkgs"]="$PKG_TYPE $OS_TOKEN raw_pkgs"
mkdir -p "$BUILD_DIR/isolinux"
chmod u+wr "$BUILD_DIR/isolinux"
rsync -rl --ignore-existing --inplace \
- "$IMAGE_DIR/isolinux/." "$BUILD_DIR/isolinux/."
+ "$IMAGE_DIR/isolinux" "$BUILD_DIR"
chmod -R u+wr "$BUILD_DIR/isolinux"
sudo mount -t tmpfs -o size=1K tmpfs "$IMAGE_DIR/isolinux"
View
4 build_lib.sh
@@ -651,8 +651,8 @@ build_iso() (
cd "$BUILD_DIR"
rm -f isolinux/boot.cat
find -name '.svn' -type d -exec rm -rf '{}' ';' 2>/dev/null >/dev/null
- find . -type f -not -name isolinux.bin -not -name sha1sums -not -path '*/.git/*' | \
- xargs sha1sum -b >sha1sums
+ find . -type f -not -name isolinux.bin -not -name sha1sums \
+ -not -path '*/.git/*' | xargs sha1sum -b >sha1sums
mkdir -p "$ISO_DEST"
# Save the sha1sums and the build-info files along side the iso.
cp sha1sums build-info "$ISO_DEST"
View
65 ubuntu-10.10-extra/build_lib.sh
@@ -144,36 +144,41 @@ final_build_fixups() {
# Copy our isolinux and preseed files.
mv "$BUILD_DIR/extra/isolinux" "$BUILD_DIR/extra/preseed" "$BUILD_DIR"
# Copy our initrd images
- (cd "$IMAGE_DIR"; find -name initrd.gz |cpio -o) | \
- (cd "$BUILD_DIR"; cpio -i --make-directories)
- chmod -R u+w "$BUILD_DIR"
- # Fix up the initrd
- ( cd "$CROWBAR_DIR/initrd"
- debug "Fixing up initrd"
- [[ -d scratch ]] && rm -rf scratch
- mkdir scratch
- # Grab _all_ the nic drivers. We probably don't need them,
- # but a little paranoia never hurt anyone.
- ( cd scratch;
- debug "Adding all nic drivers"
- for udeb in "$IMAGE_DIR/pool/main/l/linux/"nic-*-generic-*.udeb; do
- ar x "$udeb"
- tar xzf data.tar.gz
- rm -rf debian-binary *.tar.gz
- done
- # Make sure installing off a USB connected DVD will work
- debug "Adding USB connected DVD support"
- mkdir -p var/lib/dpkg/info
- cp ../cdrom-detect.postinst var/lib/dpkg/info
- debug "Enabling bootif support for debian-installer"
- mkdir -p lib/debian-installer-startup.d/
- cp "$CROWBAR_DIR/$OS_TO_STAGE-extra/patches/bootif" \
- lib/debian-installer-startup.d/S32set-bootif
- chmod 755 "lib/debian-installer-startup.d/S32-set-bootif"
- # Append our new gzipped CPIO archive onto the old one.
- find . |cpio --create --format=newc --owner root:root 2>/dev/null | \
- gzip -9 >> "$BUILD_DIR/install/initrd.gz" )
- rm -rf scratch )
+ debug "Fixing up initrds"
+ [[ -d $BUILD_DIR/initrd ]] && rm -rf initrd
+ mkdir -p "$BUILD_DIR/initrd"
+ # Grab _all_ the nic drivers. We probably don't need them,
+ # but a little paranoia never hurt anyone.
+ ( cd "$BUILD_DIR/initrd";
+ debug "Adding all nic drivers"
+ for udeb in "$IMAGE_DIR/pool/main/l/linux/"nic-*-generic-*.udeb; do
+ ar x "$udeb"
+ tar xzf data.tar.gz
+ rm -rf debian-binary *.tar.gz
+ done
+ # Make sure installing off a USB connected DVD will work
+ debug "Adding USB connected DVD support"
+ mkdir -p var/lib/dpkg/info
+ cp "$CROWBAR_DIR/initrd/cdrom-detect.postinst" var/lib/dpkg/info
+ debug "Enabling bootif support for debian-installer"
+ mkdir -p lib/debian-installer-startup.d/
+ cp "$CROWBAR_DIR/$OS_TO_STAGE-extra/patches/bootif" \
+ lib/debian-installer-startup.d/S32set-bootif
+ chmod 755 "lib/debian-installer-startup.d/S32set-bootif"
+ for initrd in "install/initrd.gz" \
+ "install/netboot/ubuntu-installer/amd64/initrd.gz"; do
+ [[ -f $IMAGE_DIR/$initrd ]] || continue
+ mkdir -p "$BUILD_DIR/${initrd%/*}"
+ gunzip -c "$IMAGE_DIR/$initrd" >"$BUILD_DIR/initrd.tmp"
+ find . -type f | \
+ cpio --format newc --owner root:root \
+ -oAF "$BUILD_DIR/initrd.tmp"
+ cat "$BUILD_DIR/initrd.tmp" | \
+ gzip -9 > "$BUILD_DIR/$initrd"
+ done
+ rm "$BUILD_DIR/initrd.tmp"
+ )
+ # rm -rf "$BUILD_DIR/initrd"
}
# Check to make sure all our prerequisites are met.
View
6 ubuntu-10.10-extra/patches/bootif
@@ -7,11 +7,11 @@ if [ "$bootif" ]; then
# bootif is 01-00-19-b9-e1-c6-94, convert to MAC
mac=${bootif#01-}
mac=`echo $mac | sed 's/-/:/g'`
- echo "Found bootif $bootif, looking for MAC $mac"
+ log-output -t ethdetect echo "Found bootif $bootif, looking for MAC $mac"
cd /sys/class/net
for interface in *; do
if [ `cat $interface/address` = "$mac" ]; then
- echo "Found matching interface $interface"
+ log-output -t ethdetect echo "Found matching interface $interface"
interface_found=$interface
db_set netcfg/choose_interface $interface
# must mark question as seen otherwise you are reprompted
@@ -19,6 +19,6 @@ if [ "$bootif" ]; then
fi
done
if [ ! "$interface_found" ]; then
- echo "No matching interface for MAC $mac"
+ log-output -t ethdetect echo "No matching interface for MAC $mac"
fi
fi
Please sign in to comment.
Something went wrong with that request. Please try again.