File tree Expand file tree Collapse file tree 5 files changed +80
-0
lines changed Expand file tree Collapse file tree 5 files changed +80
-0
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,16 @@ all-test:
9
9
install :
10
10
install -D -m 0755 -t $(DESTDIR )$(prefix ) /bin target/release/bootc
11
11
install -d $(DESTDIR )$(prefix ) /lib/bootc/install
12
+ # Support installing pre-generated man pages shipped in source tarball, to avoid
13
+ # a dependency on pandoc downstream
14
+ if test -d man; then install -D -m 0644 -t $( DESTDIR) $( prefix) /share/man/man5 man/* .5; fi
12
15
if test -d man; then install -D -m 0644 -t $( DESTDIR) $( prefix) /share/man/man8 man/* .8; fi
13
16
17
+ # These are not installed by default; one recommendation is to put them in a separate
18
+ # sub-package or sub-component.
19
+ install-systemd-auto :
20
+ install -D -m 0644 -t $(DESTDIR ) /$(prefix ) /lib/systemd/system systemd/* .service systemd/* .timer
21
+
14
22
bin-archive : all
15
23
$(MAKE ) install DESTDIR=tmp-install && tar --zstd -C tmp-install -cf target/bootc.tar.zst . && rm tmp-install -rf
16
24
Original file line number Diff line number Diff line change
1
+ # NAME
2
+
3
+ bootc-fetch-apply-updates.service
4
+
5
+ # DESCRIPTION
6
+
7
+ This service causes ` bootc ` to perform the following steps:
8
+
9
+ - Check the source registry for an updated container image
10
+ - If one is found, download it
11
+ - Reboot
12
+
13
+ This service also comes with a companion ` bootc-fetch-apply-updates.timer `
14
+ systemd unit. The current default systemd timer shipped in the upstream
15
+ project is enabled for daily updates.
16
+
17
+ However, it is fully expected that different operating systems
18
+ and distributions choose different defaults.
19
+
20
+ ## Customizing updates
21
+
22
+ Note that all three of these steps can be decoupled; they
23
+ are:
24
+
25
+ - ` bootc upgrade --check `
26
+ - ` bootc upgrade `
27
+ - ` bootc upgrade --apply `
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ Description =Apply bootc updates
3
+ Documentation =man:bootc(8)
4
+ ConditionPathExists =/run/ostree-booted
5
+
6
+ [Service]
7
+ Type =oneshot
8
+ ExecStart =/usr/bin/bootc update --apply --quiet
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ Description=Apply bootc updates
3
+ Documentation=man:bootc(8)
4
+ ConditionPathExists=/run/ostree-booted
5
+
6
+ [Timer]
7
+ OnBootSec=1h
8
+ # This time is relatively arbitrary and obviously expected to be overridden/changed
9
+ OnUnitInactiveSec=8h
10
+
11
+ [Install]
12
+ WantedBy=timers.target
Original file line number Diff line number Diff line change @@ -79,12 +79,37 @@ fn gitrev(sh: &Shell) -> Result<String> {
79
79
80
80
#[ context( "Manpages" ) ]
81
81
fn manpages ( sh : & Shell ) -> Result < ( ) > {
82
+ // We currently go: clap (Rust) -> man -> markdown for the CLI
82
83
sh. create_dir ( "target/man" ) ?;
83
84
cmd ! (
84
85
sh,
85
86
"cargo run --features=docgen -- man --directory target/man"
86
87
)
87
88
. run ( ) ?;
89
+ // We also have some man pages for the systemd units which are canonically
90
+ // maintained as markdown; convert them to man pages.
91
+ let extradir = sh. current_dir ( ) . join ( "manpages-md-extra" ) ;
92
+ for ent in std:: fs:: read_dir ( extradir) ? {
93
+ let ent = ent?;
94
+ let srcpath = ent. path ( ) ;
95
+ let extension = if let Some ( extension) = srcpath. extension ( ) {
96
+ extension
97
+ } else {
98
+ continue ;
99
+ } ;
100
+ if extension != "md" {
101
+ continue ;
102
+ }
103
+ let base_filename = srcpath
104
+ . file_stem ( )
105
+ . and_then ( |name| name. to_str ( ) )
106
+ . ok_or_else ( || anyhow ! ( "Expected filename in {srcpath:?}" ) ) ?;
107
+ cmd ! (
108
+ sh,
109
+ "pandoc --from=markdown --to=man --output=target/man/{base_filename}.5 {srcpath}"
110
+ )
111
+ . run ( ) ?;
112
+ }
88
113
Ok ( ( ) )
89
114
}
90
115
You can’t perform that action at this time.
0 commit comments