Changeset 325


Ignore:
Timestamp:
Feb 19, 2009, 6:59:55 PM (12 years ago)
Author:
khorben
Message:

Merge from upstream

Location:
trunk/Apps/Devel/Sources/scripts/targets
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Apps/Devel/Sources/scripts/targets/NetBSD

    r278 r325  
    1 #$Id: NetBSD,v 1.3 2008/11/10 13:50:41 khorben Exp $
     1#$Id: NetBSD,v 1.4 2009-02-19 15:39:54 khorben Exp $
    22
    33
    44
    5 [ -z "$KERNEL" ]&& KERNEL="/netbsd"
    6 [ -z "$MKFS" ]  && MKFS="newfs -F"
    7 [ -z "$MOUNT" ] && MOUNT="_netbsd_mount"
    8 [ -z "$UMOUNT" ]&& UMOUNT="_netbsd_umount"
     5[ -z "$FDISK" ]         && FDISK="fdisk"
     6[ -z "$INSTALLBOOT" ]   && INSTALLBOOT="installboot"
     7[ -z "$KERNEL" ]        && KERNEL="/netbsd"
     8[ -z "$MBRLABEL" ]      && MBRLABEL="mbrlabel"
     9[ -z "$MKFS" ]          && MKFS="newfs"
     10[ -z "$MOUNT" ]         && MOUNT="mount"
     11[ -z "$UMOUNT" ]        && UMOUNT="umount"
     12[ -z "$VNCONFIG" ]      && VNCONFIG="vnconfig"
     13[ -z "$VND" ]           && VND="vnd0"
    914
    1015
    1116#functions
    12 _netbsd_mount()
     17#private
     18#image_image
     19_image_image()
    1320{
    14         $SUDO vnconfig -c vnd0 "$1" &&
    15         $SUDO mount /dev/vnd0a "$2"
     21        USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
     22  IMAGE_FILE    Where to write the filesystem image\n\
     23  IMAGE_KERNEL  Path to the kernel\n\
     24  IMAGE_SIZE    Size of the filesystem image in kilobytes\n\
     25  MKFS          Command used to format the filesystem"
     26
     27        #sanity check
     28        check "$USAGE" DD DESTDIR DEVZERO FDISK IMAGE_FILE IMAGE_KERNEL \
     29                IMAGE_SIZE INSTALLBOOT MBRLABEL MKDIR MKFS MOUNT UMOUNT \
     30                VNCONFIG VND
     31
     32        $MKDIR "$DESTDIR"                                       || exit 2
     33        $UMOUNT "$DESTDIR"
     34        $VNCONFIG -u "$VND"
     35        $DD if="$DEVZERO" of="$IMAGE_FILE" count="$IMAGE_SIZE" &&
     36        $FDISK -Ffi "$IMAGE_FILE"                               || exit 2
     37        SIZE=$((IMAGE_SIZE - 63))
     38        $FDISK -Ffu0s "169/63/$SIZE" "$IMAGE_FILE"              || exit 2
     39        $FDISK -Ffa0 "$IMAGE_FILE"                              || exit 2
     40        $VNCONFIG -c "$VND" "$IMAGE_FILE"                       || exit 2
     41        $MBRLABEL -frw "$VND"                                   &&
     42        $MKFS "${VND}e"                                         &&
     43        $MOUNT "/dev/${VND}e" "$DESTDIR"                        &&
     44        target "install"                                        &&
     45        $INSTALL -m 644 "/usr/mdec/boot" "$DESTDIR/boot"        &&
     46        $INSTALL -m 755 "$IMAGE_KERNEL" "$DESTDIR/netbsd"       &&
     47        $INSTALLBOOT -m "$MACHINE" "/dev/r${VND}e" /usr/mdec/bootxx_ffsv1
     48        RET=$?
     49        $UMOUNT "$DESTDIR"
     50        $VNCONFIG -u "$VND"
     51        exit $RET
    1652}
    17 
    18 
    19 _netbsd_umount()
    20 {
    21         $SUDO umount "$1" &&
    22         $SUDO vnconfig -u vnd0
    23 }
  • trunk/Apps/Devel/Sources/scripts/targets/NetBSD-i386

    r278 r325  
    1 source "`dirname $0`/Apps/Devel/Sources/scripts/targets/NetBSD"
     1#$Id: NetBSD-i386,v 1.4 2009-02-19 15:39:54 khorben Exp $
     2
     3
     4
     5#includes
     6. "`dirname $0`/Apps/Devel/Sources/scripts/targets/NetBSD"
     7
     8
     9#functions
     10#public
     11target_image()
     12{
     13        _image_image
     14}
  • trunk/Apps/Devel/Sources/scripts/targets/NetBSD-sparc

    r278 r325  
    1 #$Id: NetBSD-sparc,v 1.2 2008/10/01 16:14:23 khorben Exp $
     1#$Id: NetBSD-sparc,v 1.4 2009-02-19 15:39:54 khorben Exp $
    22
    33
    44
    55#includes
    6 source "`dirname $0`/Apps/Devel/Sources/scripts/targets/NetBSD"
     6. "`dirname $0`/Apps/Devel/Sources/scripts/targets/NetBSD"
    77
    88
    99#functions
    1010#public
     11#target_image
    1112target_image()
    1213{
    13         USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
    14   IMAGE_FILE    Where to write the filesystem image\n\
    15   IMAGE_KERNEL  Path to the kernel\n\
    16   IMAGE_SIZE    Size of the filesystem image in kilobytes\n\
    17   MKFS          Command used to format the filesystem"
    18 
    19         #sanity check
    20         check "$USAGE" DD DESTDIR DEVZERO IMAGE_FILE IMAGE_SIZE INSTALL MKDIR \
    21         MKFS MOUNT UMOUNT
    22 
    23         $MKDIR "$DESTDIR"                                       || exit 2
    24         $UMOUNT "$DESTDIR"
    25         $DD if="$DEVZERO" of="$IMAGE_FILE" count="$IMAGE_SIZE" &&
    26         $MKFS "$IMAGE_FILE"                                     || exit 2
    27         $MOUNT "$IMAGE_FILE" "$DESTDIR"                         || exit 2
    28         target "install"
    29         RET=$?
    30         #FIXME detect errors here too
    31         [ ! -z "$IMAGE_KERNEL" ] &&
    32         $INSTALL -m 755 "$IMAGE_KERNEL" "$DESTDIR/$KERNEL"
    33         $UMOUNT "$DESTDIR"
    34         exit $RET
     14        _image_image
    3515}
Note: See TracChangeset for help on using the changeset viewer.