-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkrootfs.release.7
233 lines (233 loc) · 5.93 KB
/
mkrootfs.release.7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
.\" mkrootfs.release(7) manual page
.\" See COPYING and COPYRIGHT files for corresponding information.
.Dd May 22, 2024
.Dt MKROOTFS.RELEASE 7
.Os
.\" ==================================================================
.Sh NAME
.Nm mkrootfs.release
.Nd prepare an release with mkrootfs
.\" ==================================================================
.Sh DESCRIPTION
This manual page describes the how to build the root filesystem
tarball and prepare the Zeppe-Lin release on GitHub.
.\" ------------------------------------------------------------------
.Ss Overview
The
.Xr mkrootfs 8
utility uses by default
.Pa /etc/mkrootfs/config ,
.Pa /etc/pkgmk.conf
and
.Pa /etc/pkgman.conf
configuration files.
These files (if you haven't edited them in your installation)
contain reasonable defaults and can be used to create a root
filesystem with your current built system packages.
.Pp
If you changed configuration files mentioned above, for example changed
.Dq CFLAGS
in
.Pa /etc/pkgmk.conf
from
.Qo Li -march=x86_64 Qc
to
.Qo Li -march=native Qc ,
but want to build a rootfs for generic x86_64, then make a copy of
.Pa pkgmk.conf
with your settings and tell
.Xr mkrootfs 8
to use it through
.Fl x Ns / Ns Fl -pkgmk-config
command-line option like:
.Bd -literal -offset indent
$ sudo mkrootfs -x /etc/mkrootfs/pkgmk.conf [...]
.Ed
.Pp
You can also edit
.Pa /etc/mkrootfs/config
and specify the configuration file location through
.Dq PKGMK_CONF
variable definition like:
.Bd -literal -offset indent
PKGMK_CONF=/etc/mkrootfs/pkgmk.conf
.Ed
.Pp
Also, use the
.Fl y Ns / Ns Fl -pkgman-config
command-line option if you want to use your custom
.Pa pkgman.conf
file, or specify the configuration file location through
.Dq PKGMAN_CONF
variable definition.
Like described above.
.Pp
It is possibly worth mentioning that by default,
.Xr mkrootfs 8
builds the rootfs in the
.Dq /tmp/rootfs- Ns Ao DATE Ac Ns - Ns Ao ARCH Ac Ns /
directory, and stores build/installation logs in
.Dq /tmp/rootfs- Ns Ao DATE Ac Ns - Ns Ao ARCH Ac Ns .log .
Use the
.Fl r Ns / Ns Fl -rootfs
and
.Fl l Ns / Ns Fl -log
command-line options to change that, or specify your paths through
.Dq ROOTFS_DIR
and
.Dq ROOTFS_LOG
variables definition in
.Pa /etc/mkrootfs/config .
.Pp
By default
.Xr mkrootfs 8
builds and installs only
.Em core
packages
.Pq all packages from Dq core pkgsrc collection .
This can be changed by specifying
.Sy mkrootfs Ns '
command-line arguments or by specifying your packages through
.Qo Li PACKAGES Qc
variable definition in
.Pa /etc/mkrootfs/config .
.Pp
Make sure you read carefully
.Xr mkrootfs 8
and
.Xr mkrootfs.config 5
manual pages.
It is simply necessary to understand the steps in this manual.
.\" ------------------------------------------------------------------
.Ss Prepare rootfs
The official Zeppe-Lin tarball must be built for x86_64 architecture.
Make sure you don't mess with
.Dq CFLAGS
and let's go.
.Pp
Create the rootfs directory (build and install packages):
.Bd -literal -offset indent
$ sudo mkrootfs -B
.Ed
.Pp
In the end, you'll see the report of installed packages and the
message that
.Dq Install transaction done
in case of success.
Otherwise, exit code
.Ql 1
will be returned.
.Pp
The next step is to check the rootfs for missing libraries of
installed packages:
.Bd -literal -offset indent
$ sudo mkrootfs -C
.Ed
.Pp
In case there are some missing libraries, you'll see the broken
packages and exit code
.Ql 2
will be returned.
Hint: add
.Fl vv
command-line option to see the packages and their missing
dependencies.
.Pp
Now, prepare the rootfs tarball (compress the rootfs directory):
.Bd -literal -offset indent
$ sudo mkrootfs -T
.Ed
.Pp
This will compress root filesystem into the
.Qo Li tar.xz Qc
archive.
.Pp
Note that you can combine all these steps like:
.Bd -literal -offset indent
$ sudo mkrootfs -BCT
.Ed
.Pp
If you haven't modified rootfs/log/tarball location,
.Xr mkrootfs 8
produced the following files:
.Pp
.Bl -column "/tmp/rootfs‐⟨DATE⟩‐⟨ARCH⟩.tar.xz" -offset indent -compact
.It Sy File Ta Sy Description
.It /tmp/rootfs- Ns Ao DATE Ac Ns - Ns Ao ARCH Ac Ns / Ta
rootfs directory (work dir)
.It /tmp/rootfs- Ns Ao DATE Ac Ns - Ns Ao ARCH Ac Ns .log Ta
build/installation log file
.It /tmp/rootfs- Ns Ao DATE Ac Ns - Ns Ao ARCH Ac Ns .tar.xz Ta
rootfs tarball
.El
.Pp
You may remove rootfs directory and log file if you no more need them.
.\" ------------------------------------------------------------------
.Ss Prepare an Official Release
First, you need to prepare rootfs tarball as described above.
Next, sign prepared tarball:
.Bd -literal -offset indent
$ gpg --output /tmp/rootfs-<DATE>-<ARCH>.tar.xz.sig \e
--detach-sign /tmp/rootfs-<DATE>-<ARCH>.tar.xz
.Ed
.Pp
Create a tag in
.Dq core pkgsrc repository :
.Bd -literal -offset indent -compact
$ cd /usr/src/pkgsrc-core
$ PREVTAG=$(git describe --tags --abbrev=0)
$ CURTAG=$(date +%F)
$ git tag -a $CURTAG -m $CURTAG
$ git push
$ git push --tags
.Ed
.Pp
Go to Zeppe-Lin's
.Dq pkgsrc-core
repository on GitHub and press
.Lk https://github.com/zeppe-lin/pkgsrc-core/release/new \
Draft New Release
.Bl -bullet
.It
Select
.Sy Choose a tag
and select the tag you previously created.
.It
Set
.Sy Release title
the same as the tag.
To describe this release, prepare the git log for the rootfs tarball:
.Bd -literal -offset indent
$ cd /usr/src/pkgsrc-core
$ git log --oneline $PREVTAG..$CURTAG . |
xclip -selection clipboard
.Ed
.Pp
Next, paste the clipboard content into the
.Qo Li Describe Qc
section on GitHub.
.It
Attach previously created rootfs tarball and it's signature.
.It
Publish the release.
.It
.Sy REMEMBER
to update the rootfs' URL in the
.Lk https://github.com/zeppe-lin/handbook Zeppe-Lin Handbook .
.Pp
Also, after that, regenerate the website:
.Bd -literal -offset indent
$ cd /usr/src/zeppe-lin.github.io
$ make -j`nproc`
$ make update
$ git push
.Ed
.El
.Pp
That's it.
.\" ==================================================================
.Sh SEE ALSO
.Xr mkrootfs.config 5 ,
.Xr mkrootfs 8
.\" vim: cc=72 tw=70
.\" End of file.