]> spindle.queued.net Git - xodist/commitdiff
mkext3: update for new framework; generates ext3 images. sort of.
authorAndres Salomon <dilinger@debian.org>
Wed, 20 Aug 2008 16:24:14 +0000 (12:24 -0400)
committerAndres Salomon <dilinger@debian.org>
Wed, 20 Aug 2008 16:24:14 +0000 (12:24 -0400)
Signed-off-by: Andres Salomon <dilinger@debian.org>
mkext3.sh

index d08485eb9ac5d785e95e4fdb5c94b7f7ab21dce1..d6a46ce30bf793d0558f28e190d52878d5ff4f4f 100755 (executable)
--- a/mkext3.sh
+++ b/mkext3.sh
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-IMG_NAME="DebOLPC"
-ROOT_SIZE="512"
-IMG_LABEL="DebOLPC"
+IMG_NAME="DebXO"
+ROOT_SIZE="2048"
+IMG_LABEL="DebXO"
 ROOT_DIR=""
-CRCIMG="./crcimg.pl"
 
 . functions.sh
 
@@ -79,7 +78,7 @@ rm_mount()
 
 # @img - image name to create
 # @size - image size
-mk_bootable_img()
+create_bootable_img()
 {
        img="$1"
        size="$2"
@@ -113,7 +112,7 @@ color cyan/blue white/blue
 
 title          $IMG_LABEL
 root           (hd0,0)
-kernel         /bzImage root=LABEL=${IMG_LABEL} rootfstype=ext3 ro
+kernel         /vmlinuz root=LABEL=${IMG_LABEL} ro
 boot
 EOF
 
@@ -168,8 +167,6 @@ usage()
        exit 1
 }
 
-check_for_cmds losetup dd parted mke2fs tune2fs grub || exit 1
-
 while test $# != 0
 do
        case $1 in
@@ -197,13 +194,6 @@ do
        shift
 done
 
-if [ "$(id -u)" != "0" ]; then
-       echo "" 1>&2
-       echo "*** Error: must be run as root!" 1>&2
-       echo "" 1>&2
-       exit 2
-fi
-
 if [ "$ROOT_DIR" = "" ]; then
        echo "" 1>&2
        echo "*** No root directory specified!" 1>&2
@@ -215,8 +205,12 @@ if [ ! -d "$ROOT_DIR" ]; then
        usage
 fi
 
-mk_bootable_img "${IMG_NAME}.ext3.img" "$ROOT_SIZE"
-mk_ext3_fs "${IMG_NAME}.ext3.img" "$IMG_LABEL" "$ROOT_DIR"
+check_for_cmds losetup parted mke2fs tune2fs grub || exit 1
+create_fstab ${ROOT_DIR} ext3
+create_ofwboot ${ROOT_DIR} ext3
+
+create_bootable_img ${IMG_NAME} ${ROOT_SIZE}
+mk_ext3_fs ${IMG_NAME} ${IMG_LABEL} ${ROOT_DIR}
 
 #mount ${IMG_NAME}.ext3 $MOUNT_POINT -o loop,offset=$OS_PART1_BEGIN -t ext3
 #cp -r "$ROOT_DIR"/* $MOUNT_POINT