-
Notifications
You must be signed in to change notification settings - Fork 17
/
macros.initrd
29 lines (25 loc) · 1.12 KB
/
macros.initrd
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
# Packages installing files and binaries that end up in the initrd should
# call these macros in their post(trans) scriptlets to have the initrd
# regenerated
# See also fate#313506
# mkdir is part of the coreutils package. When the post scriptlet of some
# package using regenerate_initrd_post is run, the mkdir command may be
# unavailable. This is non-fatal, because in all cases that matter for initrd
# generation, coreutils will be part of the same transaction and will trigger
# an initrd rebuild later. See boo#1217775.
#
# Anyway, packages can use the regenerate_initrd_requires macro below to make
# sure mkdir is available in their post scriptlet. Use if this macro is not
# mandatory.
%regenerate_initrd_requires \
Requires(post): /usr/bin/mkdir \
%nil
%regenerate_initrd_post \
! command -v mkdir >/dev/null || mkdir -p /run/regenerate-initrd/; \
[ ! -d /run/regenerate-initrd ] || > /run/regenerate-initrd/all; \
%nil
%regenerate_initrd_posttrans \
if test -x /usr/lib/module-init-tools/regenerate-initrd-posttrans; then \
/bin/bash -c 'set +e; /usr/lib/module-init-tools/regenerate-initrd-posttrans' \
fi \
%nil