From 5cd5287c63bd0be72b4ae00fc1af508a2b42e541 Mon Sep 17 00:00:00 2001 From: nbd Date: Sun, 8 Oct 2006 15:48:56 +0000 Subject: add grub based images for x86-2.6 - still a bit hackish, but works with ext2 and jffs2 git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4962 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/image/x86/gen_image.sh | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 target/image/x86/gen_image.sh (limited to 'target/image/x86/gen_image.sh') diff --git a/target/image/x86/gen_image.sh b/target/image/x86/gen_image.sh new file mode 100755 index 000000000..3edce1e40 --- /dev/null +++ b/target/image/x86/gen_image.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +[ $# == 5 ] || { + echo "SYNTAX: $0 " + exit 1 +} + +file="$1" +part1s="$2" +part1d="$3" +part2s="$4" +part2f="$5" + +head=16 +sect=63 +cyl=$(( ($part1s + $part2s) * 1024 * 1024 / ($head * $sect * 512))) + +dd if=/dev/zero of="$file" bs=1M count=$(($part1s + $part2s)) 2>/dev/null || exit +fdisk -u -C $cyl -H $head -S $sect "$file" > /dev/null 2>/dev/null </dev/null && chpax -zp $(which grub) +grub --device-map=/dev/null <