@@ -27,27 +27,27 @@ $ go1.21.5 version
27
27
# Now use go1.21.5 in place of go
28
28
```
29
29
30
- Download and install mkuimage either via git:
30
+ Download and install uimage either via git:
31
31
32
32
``` shell
33
33
git clone https://github.com/u-root/mkuimage
34
- cd mkuimage/cmd/mkuimage
34
+ cd mkuimage/cmd/uimage
35
35
go install
36
36
```
37
37
38
38
Or install directly with go:
39
39
40
40
``` shell
41
- go install github.com/u-root/mkuimage/cmd/mkuimage @latest
41
+ go install github.com/u-root/mkuimage/cmd/uimage @latest
42
42
```
43
43
44
44
> [ !NOTE]
45
- > The ` mkuimage ` command will end up in ` $GOPATH/bin/mkuimage ` , so you may
45
+ > The ` uimage ` command will end up in ` $GOPATH/bin/uimage ` , so you may
46
46
> need to add ` $GOPATH/bin ` to your ` $PATH ` .
47
47
48
48
## Examples
49
49
50
- Here are some examples of using the ` mkuimage ` command to build an initramfs.
50
+ Here are some examples of using the ` uimage ` command to build an initramfs.
51
51
52
52
``` shell
53
53
git clone https://github.com/u-root/u-root
@@ -57,7 +57,7 @@ git clone https://github.com/u-root/cpu
57
57
Build gobusybox binaries of these two commands and add to initramfs:
58
58
59
59
``` shell
60
- $ mkuimage ./u-root/cmds/core/{init,gosh}
60
+ $ uimage make ./u-root/cmds/core/{init,gosh}
61
61
62
62
$ cpio -ivt < /tmp/initramfs.linux_amd64.cpio
63
63
...
@@ -70,7 +70,7 @@ lrwxrwxrwx 0 root root 2 Jan 1 1970 bbin/init -> bb
70
70
Add symlinks for shell and init:
71
71
72
72
``` shell
73
- $ mkuimage -initcmd=init -defaultsh=gosh ./u-root/cmds/core/{init,gosh}
73
+ $ uimage make -initcmd=init -defaultsh=gosh ./u-root/cmds/core/{init,gosh}
74
74
75
75
$ cpio -ivt < /tmp/initramfs.linux_amd64.cpio
76
76
...
@@ -84,7 +84,7 @@ lrwxrwxrwx 0 root root 9 Jan 1 1970 init -> bbin/init
84
84
Build everything from core without ls and losetup:
85
85
86
86
``` shell
87
- $ mkuimage ./u-root/cmds/core/* -./u-root/cmds/core/{ls,losetup}
87
+ $ uimage make ./u-root/cmds/core/* -./u-root/cmds/core/{ls,losetup}
88
88
```
89
89
90
90
Build an initramfs with init, gosh and cpud in a gobusybox binary:
@@ -99,7 +99,7 @@ Build an initramfs with init, gosh and cpud in a gobusybox binary:
99
99
> To properly resolve these dependencies, head down to the [ multi-module uimages section] ( #multi-module-uimages ) .
100
100
101
101
``` shell
102
- $ mkuimage ./u-root/cmds/core/{init,gosh} ./cpu/cmds/cpud
102
+ $ uimage make ./u-root/cmds/core/{init,gosh} ./cpu/cmds/cpud
103
103
...
104
104
01:24:15 INFO GBB_STRICT is not set.
105
105
01:24:15 INFO [WARNING] github.com/u-root/cpu/cmds/cpud depends on github.com/u-root/u-root @ version v0.11.1-0.20230913033713-004977728a9d
@@ -115,12 +115,12 @@ lrwxrwxrwx 0 root root 2 Jan 1 1970 bbin/init -> bb
115
115
...
116
116
```
117
117
118
- ` GBB_PATH ` is a place that mkuimage will look for commands. Each colon-separated
118
+ ` GBB_PATH ` is a place that uimage will look for commands. Each colon-separated
119
119
` GBB_PATH ` element is concatenated with patterns from the command-line and
120
120
checked for existence. For example:
121
121
122
122
``` shell
123
- GBB_PATH=$( pwd) /u-root:$( pwd) /cpu mkuimage \
123
+ GBB_PATH=$( pwd) /u-root:$( pwd) /cpu uimage make \
124
124
cmds/core/{init,gosh} \
125
125
cmds/cpud
126
126
@@ -137,7 +137,7 @@ If you add binaries with `-files` are listed, their ldd dependencies will be
137
137
included as well.
138
138
139
139
``` shell
140
- $ mkuimage -files /bin/bash
140
+ $ uimage make -files /bin/bash
141
141
142
142
$ cpio -ivt < /tmp/initramfs.linux_amd64.cpio
143
143
...
@@ -156,7 +156,7 @@ lrwxrwxrwx 0 root root 42 Jan 1 1970 lib64/ld-linux-x86-64.so.
156
156
You can determine placement with colons:
157
157
158
158
``` shell
159
- $ mkuimage -files " /bin/bash:sbin/sh"
159
+ $ uimage make -files " /bin/bash:sbin/sh"
160
160
161
161
$ cpio -ivt < /tmp/initramfs.linux_amd64.cpio
162
162
...
@@ -168,7 +168,7 @@ For example on Debian, if you want to add two kernel modules for testing,
168
168
executing your currently booted kernel:
169
169
170
170
``` shell
171
- $ mkuimage -files " $HOME /hello.ko:etc/hello.ko" -files " $HOME /hello2.ko:etc/hello2.ko" ./u-root/cmds/core/*
171
+ $ uimage make -files " $HOME /hello.ko:etc/hello.ko" -files " $HOME /hello2.ko:etc/hello2.ko" ./u-root/cmds/core/*
172
172
$ qemu-system-x86_64 -kernel /boot/vmlinuz-$( uname -r) -initrd /tmp/initramfs.linux_amd64.cpio
173
173
```
174
174
@@ -177,7 +177,7 @@ $ qemu-system-x86_64 -kernel /boot/vmlinuz-$(uname -r) -initrd /tmp/initramfs.li
177
177
To cross compile for an ARM, on Linux:
178
178
179
179
``` shell
180
- GOARCH=arm mkuimage ./u-root/cmds/core/*
180
+ GOARCH=arm uimage make ./u-root/cmds/core/*
181
181
```
182
182
183
183
If you are on OSX, and wish to build for Linux on AMD64:
@@ -213,7 +213,7 @@ has native uimage support.
213
213
214
214
## Multi-module uimages
215
215
216
- Rather than having mkuimage decide how to resolve dependencies across
216
+ Rather than having uimage decide how to resolve dependencies across
217
217
multi-module repositories, you may also create a go.mod with all commands you
218
218
intend to use in them.
219
219
@@ -247,20 +247,20 @@ mod tidy` to add these dependencies to `go.mod`:
247
247
``` sh
248
248
go mod tidy
249
249
250
- mkuimage \
250
+ uimage make \
251
251
github.com/u-root/u-root/cmds/core/ip \
252
252
github.com/u-root/u-root/cmds/core/init \
253
253
github.com/hugelgupf/p9/cmd/p9ufs
254
254
```
255
255
256
256
## Build Modes
257
257
258
- mkuimage can create an initramfs in two different modes, specified by ` -build ` :
258
+ uimage can create an initramfs in two different modes, specified by ` -build ` :
259
259
260
260
* ` bb ` mode: One busybox-like binary comprising all the Go tools you ask to
261
261
include.
262
262
See [ the gobusybox README for how it works] ( https://github.com/u-root/gobusybox ) .
263
- In this mode, mkuimage copies and rewrites the source of the tools you asked
263
+ In this mode, uimage copies and rewrites the source of the tools you asked
264
264
to include to be able to compile everything into one busybox-like binary.
265
265
266
266
* ` binary ` mode: each specified binary is compiled separately and all binaries
0 commit comments