mirror of
https://salsa.debian.org/raspi-team/image-specs
synced 2026-05-30 06:38:09 +02:00
Add guards against empty recipes/nonexistent images.
This is just a proof of concept at this point, trying to get `make` to succeed.
This commit is contained in:
30
Makefile
30
Makefile
@@ -35,23 +35,35 @@ $(foreach release,$(BUILD_RELEASES), \
|
||||
$(eval $(call dynamic_yaml_target,$(family),$(release)))))
|
||||
|
||||
%.img.sha256: %.img
|
||||
echo $@
|
||||
sha256sum $< > $@
|
||||
if [ -e $< ]; then \
|
||||
echo $@; \
|
||||
sha256sum $< > $@; \
|
||||
fi
|
||||
|
||||
%.img.xz.sha256: %.img.xz
|
||||
echo $@
|
||||
sha256sum $< > $@
|
||||
if [ -e $< ]; then \
|
||||
echo $@; \
|
||||
sha256sum $< > $@; \
|
||||
fi
|
||||
|
||||
%.img.xz: %.img
|
||||
xz -f -k -z -9 $<
|
||||
if [ -e $< ]; then \
|
||||
xz -f -k -z -9 $<; \
|
||||
fi
|
||||
|
||||
%.img.bmap: %.img
|
||||
bmaptool create -o $@ $<
|
||||
if [ -e $< ]; then \
|
||||
bmaptool create -o $@ $<; \
|
||||
fi
|
||||
|
||||
%.img: %.yaml
|
||||
touch $(@:.img=.log)
|
||||
time nice $(as_root) vmdb2 --verbose --rootfs-tarball=$(subst .img,.tar.gz,$@) --output=$@ $(subst .img,.yaml,$@) --log $(subst .img,.log,$@)
|
||||
chmod 0644 $@ $(@,.img=.log)
|
||||
if [ ! -s $< ]; then \
|
||||
echo "W: skipping empty recipe ($<)"; \
|
||||
else \
|
||||
touch $(@:.img=.log); \
|
||||
time nice $(as_root) vmdb2 --verbose --rootfs-tarball=$(subst .img,.tar.gz,$@) --output=$@ $(subst .img,.yaml,$@) --log $(subst .img,.log,$@); \
|
||||
chmod 0644 $@ $(@,.img=.log); \
|
||||
fi
|
||||
|
||||
_ck_root:
|
||||
[ `whoami` = 'root' ] # Only root can summon vmdb2 ☹
|
||||
|
||||
Reference in New Issue
Block a user