2 # Copyright (C) 2006 OpenWrt.org
5 echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image>"
19 cyl
=$
(( ($KERNELSIZE + $ROOTFSSIZE) * 1024 * 1024 / ($head * $sect * 512)))
21 # create partition table
22 set `ptgen -o "$OUTPUT" -h $head -s $sect -p ${KERNELSIZE}m -p ${ROOTFSSIZE}m`
24 KERNELOFFSET
="$(($1 / 512))"
25 ROOTFSOFFSET
="$(($2 / 512))"
26 ROOTFSSIZE
="$(( ($3 - $2) / 512))"
28 BLOCKS
="$((($ROOTFSOFFSET - $KERNELOFFSET) / 2 - 1))"
30 genext2fs
-d "$KERNELDIR" -b "$BLOCKS" "$OUTPUT.kernel"
31 dd if="$OUTPUT.kernel" of
="$OUTPUT" bs
=512 seek
="$KERNELOFFSET" conv
=notrunc
32 [ -n "$PADDING" ] && dd if=/dev
/zero of
="$OUTPUT" bs
=512 seek
="$ROOTFSOFFSET" conv
=notrunc count
="$ROOTFSSIZE"
33 dd if="$ROOTFSIMAGE" of
="$OUTPUT" bs
=512 seek
="$ROOTFSOFFSET" conv
=notrunc
34 #rm -f "$OUTPUT.kernel"
36 which chpax
>/dev
/null
&& chpax
-zp $
(which grub
)
37 grub
--batch --no-curses --no-floppy --device-map=/dev
/null
<<EOF
39 geometry (hd0) $cyl $head $sect
This page took 0.043533 seconds and 5 git commands to generate.