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)
27 # If called by 'installworld' (i.e., 'WORLDINSTALL' defined),
28 # do not overwrite the existing ones.
29 .if !(defined(WORLDINSTALL) && exists(${DESTDIR}/rescue/rescue))
30 @echo "--------------------------------------------------------------"
31 @echo ">>> installing rescue tools to ${DESTDIR}/rescue ..."
32 @echo "--------------------------------------------------------------"
33 .for _dir in ${RESCUE_SUBDIRS}
34 (cd ${.CURDIR}/${_dir}; \
35 ${INITRD_MAKE} BINDIR=/rescue install)
39 .if !(defined(WORLDINSTALL) && exists(${DESTDIR}/boot/kernel/initrd.img.gz))
40 @echo "--------------------------------------------------------------"
41 @echo ">>> setting up ${DESTDIR}/boot/kernel/initrd.img.gz ..."
42 @echo "--------------------------------------------------------------"
44 .for _dir in ${INITRD_SUBDIRS}
45 (cd ${.CURDIR}/${_dir}; \
46 mkdir -p ${STAGEDIR}/${_dir}; \
47 ${INITRD_MAKE} BINDIR=${STAGEDIR}/${_dir} DESTDIR="" install)
49 sh ${.CURDIR}/mkinitrd.sh \
51 -r ${DESTDIR}/rescue \
58 .for _dir in ${RESCUE_SUBDIRS} ${INITRD_SUBDIRS}
59 (cd ${.CURDIR}/${_dir} && ${INITRD_MAKE} clean cleandepend)