-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (32 loc) · 1.14 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
# Iguana generation makefile
target_dir := ${DESTDIR}/usr/share/iguana
build_dir := out
kernel_filepath := $(shell find /boot \( -name 'vmlinuz-*' -o -name 'Image-*' \) | sort -r -V | head -1)
file_split := $(subst -, ,${kernel_filepath})
kernel_prefix := $(word 1, ${file_split})
kernel_file := $(notdir ${kernel_filepath})
kernel_version := $(subst ${kernel_prefix}-,,${kernel_filepath})
.PHONY: build
build: ${build_dir} ${build_dir}/iguana-initrd ${build_dir}/${kernel_file}
@echo "All done"
${build_dir}:
@mkdir ${build_dir}
${build_dir}/iguana-initrd:
@echo "Generating initrd"
dracut --force --no-hostonly --no-hostonly-cmdline \
--no-hostonly-default-device --no-hostonly-i18n \
--no-machineid --reproducible --add iguana \
${build_dir}/iguana-initrd ${kernel_version}
${build_dir}/${kernel_file}:
@echo "Collecting kernel used for initrd build"
@cp ${kernel_filepath} ${build_dir}/${kernel_file}
install:
install -d -m 755 ${target_dir}
for f in ${build_dir}/*; do \
install -m 644 $$f ${target_dir} ;\
done
all: build install
check:
lsinitrd -m ${target_dir}/iguana-initrd | grep -q iguana
clean:
rm -r ${build_dir}