| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #!/bin/sh | | 1 | #!/bin/sh |
2 | # $NetBSD: mkimage,v 1.64 2017/04/11 21:06:30 jmcneill Exp $ | | 2 | # $NetBSD: mkimage,v 1.65 2017/06/10 23:26:32 christos Exp $ |
3 | # | | 3 | # |
4 | # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc. | | 4 | # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc. |
5 | # All rights reserved. | | 5 | # All rights reserved. |
6 | # | | 6 | # |
7 | # This code is derived from software contributed to The NetBSD Foundation | | 7 | # This code is derived from software contributed to The NetBSD Foundation |
8 | # by Christos Zoulas. | | 8 | # by Christos Zoulas. |
9 | # | | 9 | # |
10 | # Redistribution and use in source and binary forms, with or without | | 10 | # Redistribution and use in source and binary forms, with or without |
11 | # modification, are permitted provided that the following conditions | | 11 | # modification, are permitted provided that the following conditions |
12 | # are met: | | 12 | # are met: |
13 | # 1. Redistributions of source code must retain the above copyright | | 13 | # 1. Redistributions of source code must retain the above copyright |
14 | # notice, this list of conditions and the following disclaimer. | | 14 | # notice, this list of conditions and the following disclaimer. |
15 | # 2. Redistributions in binary form must reproduce the above copyright | | 15 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -50,27 +50,27 @@ set -e | | | @@ -50,27 +50,27 @@ set -e |
50 | | | 50 | |
51 | DIR="$(cd "$(dirname "$0")" && pwd)" | | 51 | DIR="$(cd "$(dirname "$0")" && pwd)" |
52 | PROG="$(basename "$0")" | | 52 | PROG="$(basename "$0")" |
53 | | | 53 | |
54 | DISKLABEL=${TOOL_DISKLABEL:-disklabel} | | 54 | DISKLABEL=${TOOL_DISKLABEL:-disklabel} |
55 | FDISK=${TOOL_FDISK:-fdisk} | | 55 | FDISK=${TOOL_FDISK:-fdisk} |
56 | MAKEFS=${TOOL_MAKEFS:-makefs} | | 56 | MAKEFS=${TOOL_MAKEFS:-makefs} |
57 | MTREE=${TOOL_MTREE:-mtree} | | 57 | MTREE=${TOOL_MTREE:-mtree} |
58 | INSTALLBOOT=${TOOL_INSTALLBOOT:-installboot} | | 58 | INSTALLBOOT=${TOOL_INSTALLBOOT:-installboot} |
59 | MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE:-mkubootimage} | | 59 | MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE:-mkubootimage} |
60 | GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1) | | 60 | GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1) |
61 | | | 61 | |
62 | src="/usr/src" | | 62 | src="/usr/src" |
63 | sets="base comp etc games man misc modules text" | | 63 | sets="base comp etc games man misc modules tests text" |
64 | xsets="xbase xcomp xetc xfont xserver" | | 64 | xsets="xbase xcomp xetc xfont xserver" |
65 | minfree="10%" | | 65 | minfree="10%" |
66 | bar="===" | | 66 | bar="===" |
67 | | | 67 | |
68 | tmp="$(mktemp -d "/tmp/$PROG.XXXXXX")" | | 68 | tmp="$(mktemp -d "/tmp/$PROG.XXXXXX")" |
69 | mnt="${tmp}/mnt" | | 69 | mnt="${tmp}/mnt" |
70 | mkdir -p "${mnt}/etc" "${mnt}/dev" | | 70 | mkdir -p "${mnt}/etc" "${mnt}/dev" |
71 | | | 71 | |
72 | trap "cleanup" 0 1 2 3 15 | | 72 | trap "cleanup" 0 1 2 3 15 |
73 | | | 73 | |
74 | cleanup() { | | 74 | cleanup() { |
75 | case "$tmp" in | | 75 | case "$tmp" in |
76 | /tmp/$PROG.*) rm -fr "$tmp";; | | 76 | /tmp/$PROG.*) rm -fr "$tmp";; |