-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (44 loc) · 1.19 KB
/
Makefile
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
#- makefile -
# vim: ft=make:noexpandtab:ts=2:sw=2
INITRAMDIR = /etc/initramfs-tools
all: help
help:
@echo
@echo " make install - install all files"
@echo " make update - updated newer files"
@echo " make diff - shows differences between repository and local files"
@echo " make initrd - generates new initramdisks"
@echo
install:
@set -e; \
umask 022; \
for f in hooks/* scripts/*; do \
[ -f "$${f}" ] || continue; \
dir="$(INITRAMDIR)/$${f%/*}"; \
dest="$(INITRAMDIR)/$${f}"; \
echo "INSTALL $${f} -> $${dest}"; \
mkdir -p "$$dir"; \
cp -a "$$f" "$$dest"; \
chown root: "$$dest"; \
chmod 744 "$$dest"; \
done
update:
@set -e; \
umask 022; \
for f in hooks/* scripts/*; do \
[ -f "$${f}" ] || continue; \
dir="$(INITRAMDIR)/$${f%/*}"; \
dest="$(INITRAMDIR)/$${f}"; \
[ -f "$${dest}" ] || continue; \
cmp -b "$${dest}" "$${f}" > /dev/null && continue || :; \
echo "UPDATE $${f} -> $${dest}"; \
mkdir -p "$$dir"; \
cp -a "$$f" "$$dest"; \
chown root: "$$dest"; \
chmod 744 "$$dest"; \
done
initramfs initrd:
update-initramfs -k$$(uname -r) -u
diff:
@diff -uaNr $(INITRAMDIR)/hooks hooks || :
@diff -uaNr $(INITRAMDIR)/scripts scripts || :