1 INITRD_MAKE
= LC_ALL
=C \
2 make
-m
${.CURDIR
}/..
/share
/mk
4 # Target directory to install the rescue tools
7 # Temporary directory to stage the initrd files (e.g., /etc)
8 # NOTE: Ignore ${DESTDIR} when staging files into this directory
9 INITRD_STAGEDIR
!= mktemp
-d
-t initrd-stage
12 @
rm -rf
${INITRD_STAGEDIR}
15 @echo
">>> Building rescue tools ..."
16 .for _dir in oinit rescue rescue.libcrypto
17 (cd
${.CURDIR
}/${_dir} && \
18 ${INITRD_MAKE} obj
&& \
19 ${INITRD_MAKE} depend
all)
23 @echo
">>> Installing rescue tools ..."
24 .for _dir in oinit rescue rescue.libcrypto
25 (cd
${.CURDIR
}/${_dir} && \
26 ${INITRD_MAKE} BINDIR
=${RESCUE_DIR} install)
30 @echo
">>> Staging initrd contents ..."
31 (cd
${.CURDIR
}/etc
&& \
32 mkdir
${INITRD_STAGEDIR}/etc
&& \
33 ${INITRD_MAKE} obj
&& \
34 ${INITRD_MAKE} depend
all && \
35 ${INITRD_MAKE} BINDIR
=${INITRD_STAGEDIR}/etc DESTDIR
="" install)
38 @echo
">>> Creating initrd.img.gz ..."
39 sh
${.CURDIR
}/mkinitrd.sh \
41 -r
${DESTDIR}${RESCUE_DIR} \
45 @echo
">>> Cleaning rescue ..."
46 .for _dir in oinit rescue rescue.libcrypto
47 (cd
${.CURDIR
}/${_dir} && ${INITRD_MAKE} clean cleandepend
)
51 @echo
">>> Cleaning initrd ..."
52 (cd
${.CURDIR
}/etc
&& ${INITRD_MAKE} clean cleandepend
)
54 clean: _clean_rescue _clean_initrd
56 quickrescue
: _build_rescue _install_rescue
57 rescue
: _clean_rescue quickrescue .PHONY
58 .ORDER
: _clean_rescue _build_rescue _install_rescue
60 _quickinitrd
: _stage_initrd _make_initrd
61 _initrd
: _clean_initrd _quickinitrd
62 .ORDER
: _clean_initrd _stage_initrd _make_initrd
64 quickinitrd
: quickrescue _quickinitrd
65 initrd
: rescue _initrd
66 .ORDER
: quickrescue _quickinitrd
67 .ORDER
: rescue _initrd