1 INITRD_MAKE= LC_ALL=C \
2 make -m ${.CURDIR}/../share/mk
4 RESCUE_SUBDIRS= oinit rescue rescue.libcrypto
6 # Temporary directory to stage the files for creating the initrd image.
8 # NOTE: Do not place this directory in the object tree, so that the entire
9 # object tree can be exported read-only for upgrading other machines.
12 STAGEDIR:= ${TMPDIR}/initrd_staged.${.MAKE.PID}
16 @echo "--------------------------------------------------------------"
17 @echo ">>> building rescue tools and initrd contents ..."
18 @echo "--------------------------------------------------------------"
19 .for _dir in ${RESCUE_SUBDIRS} ${INITRD_SUBDIRS}
20 (cd ${.CURDIR}/${_dir}; \
22 ${INITRD_MAKE} depend all)
24 @echo "--------------------------------------------------------------"
25 @echo ">>> complete building rescue and initrd"
26 @echo "--------------------------------------------------------------"
30 # If called by 'installworld' (i.e., 'WORLDINSTALL' defined),
31 # do not overwrite the existing ones.
32 .if !(defined(WORLDINSTALL) && exists(${DESTDIR}/rescue/rescue))
33 @echo "--------------------------------------------------------------"
34 @echo ">>> installing rescue tools to ${DESTDIR}/rescue ..."
35 @echo "--------------------------------------------------------------"
36 .for _dir in ${RESCUE_SUBDIRS}
37 (cd ${.CURDIR}/${_dir}; \
38 ${INITRD_MAKE} BINDIR=/rescue install)
42 .if !(defined(WORLDINSTALL) && exists(${DESTDIR}/boot/kernel/initrd.img.gz))
43 @echo "--------------------------------------------------------------"
44 @echo ">>> setting up ${DESTDIR}/boot/kernel/initrd.img.gz ..."
45 @echo "--------------------------------------------------------------"
47 .for _dir in ${INITRD_SUBDIRS}
48 (cd ${.CURDIR}/${_dir}; \
49 mkdir -p ${STAGEDIR}/${_dir}; \
50 ${INITRD_MAKE} BINDIR=${STAGEDIR}/${_dir} DESTDIR="" install)
52 sh ${.CURDIR}/mkinitrd.sh \
54 -r ${DESTDIR}/rescue \
61 .for _dir in ${RESCUE_SUBDIRS} ${INITRD_SUBDIRS}
62 (cd ${.CURDIR}/${_dir} && ${INITRD_MAKE} clean cleandepend)