-$(top_builddir)/initramfs/fakeroot.log: make-initramfs.sh.in
- -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
- -mv $(VMLINUZ) $(VMLINUZ).bak
- if ! bash make-initramfs.sh; then rm -f $@; exit 1; fi
+$(top_builddir)/initramfs/fakeroot.log: make.sh kmod.whitelist packagelist $(top_builddir)/daemon/guestfsd
+ mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak 2>/dev/null; :
+ mv $(VMLINUZ) $(VMLINUZ).bak 2>/dev/null; :
+ if ! bash make.sh; then rm -f $@; exit 1; fi
+
+# This used to be a configure-generated file (as is update.sh still).
+# However config.status always touches the destination file, which
+# means the appliance got rebuilt too often.
+make.sh: make.sh.in
+ cd $(top_builddir) && \
+ ./config.status --file=appliance/$@-t:appliance/$<
+ chmod +x $@-t
+ mv $@-t $@
+
+$(INITRAMFSIMG): $(top_builddir)/initramfs/fakeroot.log $(top_builddir)/daemon/guestfsd init update.sh
+ rm -f $@
+ bash update.sh
+ touch $@
+
+kmod.whitelist: kmod.whitelist.in
+ grep -v '^[[:space:]]*$$' < $< | grep -v '^#' > $@
+
+packagelist: packagelist.in
+ cpp -undef -D$(DIST)=1 < $< | \
+ grep -v '^[[:space:]]*$$' | grep -v '^#' > $@
+
+# This is for building the supermin appliance. It has to be enabled
+# specifically with './configure --enable-supermin'. You really need
+# to read the README file.