#!/bin/sh

# Network-boot ptable+kernel+cramfs from flash.

if ! which awk > /dev/null; then
	echo "Cannot find awk in your PATH!"
	exit 1
fi

PSIZE_RESCUE=`awk '!/\#/ { if ( $4 == "rescue" ) print $2 }' ptablespec`
PSIZE_KERNEL=`awk '!/\#/ { if ( $4 == "kernel" ) print $2 }' ptablespec`
INAME_KERNEL=`awk '!/\#/ { if ( $4 == "kernel" ) print $5 }' ptablespec`

OFFSET=$PSIZE_RESCUE
SIZE=$PSIZE_KERNEL

boot_linux -f -o $OFFSET -s $SIZE -i $INAME_KERNEL $*
