Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mkubootimage Add support for "kernel_noload" image t...



details:   https://anonhg.NetBSD.org/src/rev/f1b90e196d99
branches:  trunk
changeset: 355154:f1b90e196d99
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jul 15 11:13:08 2017 +0000

description:
Add support for "kernel_noload" image types. This type is the same as the
"kernel" type, except it can run from any load address.

diffstat:

 usr.bin/mkubootimage/mkubootimage.1 |  10 +++++-----
 usr.bin/mkubootimage/mkubootimage.c |  31 +++++++++++++++++++++----------
 usr.bin/mkubootimage/uboot.h        |   3 ++-
 3 files changed, 28 insertions(+), 16 deletions(-)

diffs (131 lines):

diff -r 669340d14813 -r f1b90e196d99 usr.bin/mkubootimage/mkubootimage.1
--- a/usr.bin/mkubootimage/mkubootimage.1       Sat Jul 15 10:17:09 2017 +0000
+++ b/usr.bin/mkubootimage/mkubootimage.1       Sat Jul 15 11:13:08 2017 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mkubootimage.1,v 1.8 2014/09/30 10:30:35 wiz Exp $
+.\"    $NetBSD: mkubootimage.1,v 1.9 2017/07/15 11:13:08 jmcneill Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 30, 2014
+.Dd July 15, 2017
 .Dt MKUBOOTIMAGE 1
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@
 .Op Fl m Ar magic
 .Fl n Ar image
 .Op Fl O No Po freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd Pc
-.Fl T No ( fs Ns | Ns kernel Ns | Ns ramdisk Ns | Ns standalone )
+.Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns standalone )
 .Ar source destination
 .\"
 .Sh DESCRIPTION
@@ -62,7 +62,7 @@
 Sets the image load address.
 This is an integer between 0 and
 .Dv UINT32_MAX .
-This is required.
+This is required for all image types except for script, ramdisk, and kernel_noload.
 .It Fl C No ( bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none )
 Defines the compression.
 The default is
@@ -108,7 +108,7 @@
 Defines the operating system type.
 The default OS name is
 .Qq netbsd .
-.It Fl T No ( fs Ns | Ns kernel Ns | Ns ramdisk Ns | Ns standalone Ns | Ns script )
+.It Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns standalone Ns | Ns script )
 Defines the image type.
 This is required.
 .El
diff -r 669340d14813 -r f1b90e196d99 usr.bin/mkubootimage/mkubootimage.c
--- a/usr.bin/mkubootimage/mkubootimage.c       Sat Jul 15 10:17:09 2017 +0000
+++ b/usr.bin/mkubootimage/mkubootimage.c       Sat Jul 15 11:13:08 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.19 2017/07/05 01:09:17 jmcneill Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.20 2017/07/15 11:13:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkubootimage.c,v 1.19 2017/07/05 01:09:17 jmcneill Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.20 2017/07/15 11:13:08 jmcneill Exp $");
 
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -144,11 +144,12 @@
        enum uboot_image_type type;
        const char *name;
 } uboot_type[] = {
-       { IH_TYPE_STANDALONE,   "standalone" },
-       { IH_TYPE_KERNEL,       "kernel" },
-       { IH_TYPE_RAMDISK,      "ramdisk" },
-       { IH_TYPE_FILESYSTEM,   "fs" },
-       { IH_TYPE_SCRIPT,       "script" },
+       { IH_TYPE_STANDALONE,           "standalone" },
+       { IH_TYPE_KERNEL,               "kernel" },
+       { IH_TYPE_KERNEL_NOLOAD,        "kernel_noload" },
+       { IH_TYPE_RAMDISK,              "ramdisk" },
+       { IH_TYPE_FILESYSTEM,           "fs" },
+       { IH_TYPE_SCRIPT,               "script" },
 };
 
 static enum uboot_image_type
@@ -221,7 +222,7 @@
            "<arm|arm64|i386|mips|mips64|or1k|powerpc>");
        fprintf(stderr, " -C <none|bz2|gz|lzma|lzo>");
        fprintf(stderr, " -O <openbsd|netbsd|freebsd|linux>");
-       fprintf(stderr, " -T <standalone|kernel|ramdisk|fs|script>");
+       fprintf(stderr, " -T <standalone|kernel|kernel_noload|ramdisk|fs|script>");
        fprintf(stderr, " -a <addr> [-e <ep>] [-m <magic>] -n <name>");
        fprintf(stderr, " <srcfile> <dstfile>\n");
 
@@ -429,11 +430,21 @@
 
        if (image_arch == IH_ARCH_UNKNOWN ||
            image_type == IH_TYPE_UNKNOWN ||
-           (image_type != IH_TYPE_SCRIPT && image_type != IH_TYPE_RAMDISK &&
-            image_loadaddr == 0) ||
            image_name == NULL)
                usage();
 
+       switch (image_type) {
+       case IH_TYPE_SCRIPT:
+       case IH_TYPE_RAMDISK:
+       case IH_TYPE_KERNEL_NOLOAD:
+               break;
+       default:
+               if (image_loadaddr == 0)
+                       usage();
+                       /* NOTREACHED */
+               break;
+       }
+
        src = argv[0];
        dest = argv[1];
 
diff -r 669340d14813 -r f1b90e196d99 usr.bin/mkubootimage/uboot.h
--- a/usr.bin/mkubootimage/uboot.h      Sat Jul 15 10:17:09 2017 +0000
+++ b/usr.bin/mkubootimage/uboot.h      Sat Jul 15 11:13:08 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uboot.h,v 1.6 2014/09/30 10:21:50 msaitoh Exp $ */
+/* $NetBSD: uboot.h,v 1.7 2017/07/15 11:13:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -54,6 +54,7 @@
        IH_TYPE_RAMDISK = 3,
        IH_TYPE_SCRIPT = 6,
        IH_TYPE_FILESYSTEM = 7,
+       IH_TYPE_KERNEL_NOLOAD = 14,
 };
 
 enum uboot_image_comp {



Home | Main Index | Thread Index | Old Index