Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/usr.bin/mkubootimage Pull up following revision(s) (reque...
details: https://anonhg.NetBSD.org/src/rev/f8ed2eacb7b7
branches: netbsd-8
changeset: 434146:f8ed2eacb7b7
user: snj <snj%NetBSD.org@localhost>
date: Tue Jul 25 02:00:33 2017 +0000
description:
Pull up following revision(s) (requested by jmcneill in ticket #142):
usr.bin/mkubootimage/mkubootimage.1: 1.9-1.10
usr.bin/mkubootimage/mkubootimage.c: 1.20
usr.bin/mkubootimage/uboot.h: 1.7
Add support for "kernel_noload" image types. This type is the same as the
"kernel" type, except it can run from any load address.
--
Remove unnecessary macros. Use standard headers.
diffstat:
usr.bin/mkubootimage/mkubootimage.1 | 16 ++++++++--------
usr.bin/mkubootimage/mkubootimage.c | 31 +++++++++++++++++++++----------
usr.bin/mkubootimage/uboot.h | 3 ++-
3 files changed, 31 insertions(+), 19 deletions(-)
diffs (148 lines):
diff -r 53259c64c42d -r f8ed2eacb7b7 usr.bin/mkubootimage/mkubootimage.1
--- a/usr.bin/mkubootimage/mkubootimage.1 Tue Jul 25 01:58:09 2017 +0000
+++ b/usr.bin/mkubootimage/mkubootimage.1 Tue Jul 25 02:00:33 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.8.8.1 2017/07/25 02:00:33 snj 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
@@ -38,13 +38,13 @@
.Op Fl h
.Fl A No ( arm Ns | Ns arm64 Ns | Ns i386 Ns | Ns mips Ns | Ns mips64 Ns | Ns or1k Ns | Ns powerpc )
.Fl a Ar address
-.Op Fl C No Po bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none Pc
+.Op Fl C Po bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none Pc
.Op Fl E Ar address
.Op Fl e Ar address
.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 )
+.Op Fl O Po freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd Pc
+.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
@@ -120,7 +120,7 @@
.Ar destination
argument is the filename of the image file that is created.
.\"
-.Sh RETURN VALUES
+.Sh EXIT STATUS
.Nm
returns 1 on failure to read the kernel,
generate a header, or create the image.
diff -r 53259c64c42d -r f8ed2eacb7b7 usr.bin/mkubootimage/mkubootimage.c
--- a/usr.bin/mkubootimage/mkubootimage.c Tue Jul 25 01:58:09 2017 +0000
+++ b/usr.bin/mkubootimage/mkubootimage.c Tue Jul 25 02:00:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.18.8.1 2017/07/05 20:15:33 snj Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.18.8.2 2017/07/25 02:00:33 snj 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.18.8.1 2017/07/05 20:15:33 snj Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.18.8.2 2017/07/25 02:00:33 snj 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 53259c64c42d -r f8ed2eacb7b7 usr.bin/mkubootimage/uboot.h
--- a/usr.bin/mkubootimage/uboot.h Tue Jul 25 01:58:09 2017 +0000
+++ b/usr.bin/mkubootimage/uboot.h Tue Jul 25 02:00:33 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.6.8.1 2017/07/25 02:00:33 snj 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