Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 2014 04:43:36 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r263865 - user/marcel/mkimg
Message-ID:  <201403280443.s2S4haN5074072@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Fri Mar 28 04:43:36 2014
New Revision: 263865
URL: http://svnweb.freebsd.org/changeset/base/263865

Log:
  Flesh-out manpage.

Modified:
  user/marcel/mkimg/mkimg.8

Modified: user/marcel/mkimg/mkimg.8
==============================================================================
--- user/marcel/mkimg/mkimg.8	Fri Mar 28 04:42:34 2014	(r263864)
+++ user/marcel/mkimg/mkimg.8	Fri Mar 28 04:43:36 2014	(r263865)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013 Juniper Networks, Inc.
+.\" Copyright (c) 2013, 2014 Juniper Networks, Inc.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 26, 2013
+.Dd March 27, 2014
 .Dt MKIMG 1
 .Os
 .Sh NAME
@@ -32,20 +32,120 @@
 .Nd "utility to make a disk image"
 .Sh SYNOPSIS
 .Nm
+.Op Fl H Ar heads
+.Op Fl P Ar blksz
+.Op Fl S Ar secsz
+.Op Fl T Ar tracksz
 .Op Fl b Ar bootcode
 .Op Fl o Ar outfile
-.Op Fl p Ar partition
-.Op Fl s Ar scheme
-.Op Fl z
+.Op Fl v
+.Fl s Ar scheme
+.Fl p Ar partition
+.Op Fl p Ar partition ...
 .Sh DESCRIPTION
 The
 .Nm
-utility creates a disk image from the raw partition contents and using the
-partitioning scheme specified.
+utility creates a disk image from the raw partition contents specified with
+the
+.Ar partition
+argument(s) and using the partitioning scheme specified with the
+.Ar scheme
+argument.
+The disk image is written to
+.Ar stdout
+by default or the file specified with the
+.Ar outfile
+argument.
+.Pp
+The disk image can be made bootable by specifying the scheme-specific boot
+block contents with the
+.Ar bootcode
+argument and,
+depending on the scheme,
+with a boot partition.
+The contents of such a boot partition is provided like any other partition
+and the
+.Nm
+utility does not treat it any differently from other partitions.
+.Pp
+Some partitioning schemes need a disk geometry and for those the
+.Nm
+utility accepts the
+.Ar tracksz
+and
+.Ar heads
+arguments, specifying the number of sectors per track and the number of
+heads per cylinder (resp.)
+.Pp
+Both the logical and physical sector size can be specified and for that the
+.Nm
+utility
+accepts the
+.Ar secsz
+and
+.Ar blksz
+arguments.
+The
+.Ar secsz
+argument is used to specify the logical sector size.
+This is the sector size reported by a disk when queried for its capacity.
+Modern disks use a larger sector size internally,
+referred to as block size by the
+.Nm
+utility and this can be specified by the
+.Ar blksz
+argument.
+The
+.Nm
+utility will use the (physical) block size to determine the start of
+partitions and to round the size of the disk image.
+.Pp
+The
+.Op Fl v
+option increases the level of output that the
+.Nm
+utility prints.
+.Sh EXAMPLES
+To create a bootable disk image that is partitioned using the GPT scheme and
+containing a root file system that was previously created using
+.Xr makefs
+and also containing a swap partition, run the
+.Nm
+utility as follows:
+.Dl % mkimg -s gpt -b /boot/pmbr -p freebsd-boot:=/boot/gptboot \
+-p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G \
+-o gpt.img
+.Pp
+A nested partitioning scheme is created by running the
+.Nm
+utility twice.
+The output of the first will be fed as the contents of a partition to the
+second.
+This can be done using a temporary file, like so:
+.Dl % mkimg -s bsd -b /boot/boot -p freebsd-ufs:=root-file-system.ufs \
+-p freebsd-swap::1G -o /tmp/bsd.img
+.Dl % mkimg -s mbr -b /boot/mbr -p freebsd:=/tmp/bsd.img -o mbr-bsd.img
+.Pp
+Alternatively, the
+.Nm
+utility can be run in a cascaded fashion, whereby the output of the
+first is fed directly into the second.
+To do this, run the
+.Nm
+utility as follows:
+.Dl % mkimg -s mbr -b /boot/mbr -p freebsd:-'mkimg -s bsd -b /boot/boot \
+-p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G' -o mbr-bsd.img
 .Sh SEE ALSO
+.Xr gpart 8
 .Xr makefs 8
+.Xr mdconfig 8
+.Xr newfs 8
 .Sh HISTORY
 The
 .Nm
 utility appeared in
-.Fx 10.0
+.Fx 11.0
+.Sh AUTHORS
+The
+.Nm
+utility and manpage were written by Marcel Moolenaar <marcelm@juniper.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403280443.s2S4haN5074072>