11.32Schristos# $NetBSD: Makefile.cdrom,v 1.32 2025/11/06 18:15:12 christos Exp $
21.1Sbouyer
31.2Sjym.include <bsd.own.mk>
41.21Snonaka.include <bsd.endian.mk>
51.2Sjym
61.10SdhollandSYSINSTDIR!= cd ${.CURDIR}/../../../../usr.sbin/sysinst/arch/${MACHINE} && ${PRINTOBJDIR}
71.2Sjym
81.21SnonakaEFIBOOTIMG=	efiboot.img
91.21SnonakaCLEANFILES+=	${EFIBOOTIMG}
101.23Schristos.if ${MKREPRO_TIMESTAMP:Uno} != "no"
111.23SchristosMAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}"
121.23Schristos.endif
131.21Snonaka
141.2Sjym# Need multidot for the boot loader to read kernel modules as it doesn't
151.2Sjym# understand rockridge.
161.21SnonakaCDMAKEFSOPTIONS= bootimage=i386;bootxx.${MACHINE},no-emul-boot,allow-multidot,bootimage=i386;${EFIBOOTIMG},platformid=efi,no-emul-boot
171.2SjymCDINSTKERNEL=	../../instkernel
181.31Spgoyette.if ${KERNEL_DIR:Uno} == "yes"
191.31SpgoyetteCDKERNELS=	netbsd-GENERIC.gz		netbsd/kernel
201.31SpgoyetteCDKERNELS+=	netbsd-GENERIC.symbols.gz       netbsd/kernel.gdb
211.31Spgoyette.else
221.31SpgoyetteCDKERNELS=	netbsd-GENERIC.gz		netbsd
231.31Spgoyette.endif
241.2SjymCDRELEASE_NOISOS=	true
251.28SniaCD_SETS+=	base etc gpufw
261.20Smartin.if ${MKKMOD} != "no"
271.20SmartinCD_SETS+=	modules
281.20Smartin.endif
291.2Sjym
301.30Spgoyette.if ${KERNEL_DIR:Uno} == "yes"
311.30SpgoyetteSPEC_EXTRA:=${.PARSEDIR}/spec-dir.in
321.30Spgoyette.else
331.29SchristosSPEC_EXTRA:=${.PARSEDIR}/spec.in
341.30Spgoyette.endif
351.29Schristos
361.21Snonaka${EFIBOOTIMG}: ${DESTDIR}/usr/mdec/bootx64.efi ${DESTDIR}/usr/mdec/bootia32.efi
371.21Snonaka	${RM} -f ${EFIBOOTIMG}
381.21Snonaka	${RM} -rf efiboot/EFI/boot
391.22Schristos	${MKDIR} ${MKDIRPERM} efiboot/EFI/boot
401.22Schristos	${INSTALL} ${COPY} -m 0444 ${.ALLSRC} efiboot/EFI/boot/
411.26Sdbj.if defined(CDBOOTOPTIONS)
421.26Sdbj	${CHMOD} +w efiboot/EFI/boot/bootx64.efi efiboot/EFI/boot/bootia32.efi
431.26Sdbj	${TOOL_INSTALLBOOT} -m${MACHINE} -e ${CDBOOTOPTIONS} efiboot/EFI/boot/bootx64.efi
441.26Sdbj	${TOOL_INSTALLBOOT} -m${MACHINE} -e ${CDBOOTOPTIONS} efiboot/EFI/boot/bootia32.efi
451.26Sdbj	${CHMOD} -w efiboot/EFI/boot/bootx64.efi efiboot/EFI/boot/bootia32.efi
461.26Sdbj.endif
471.23Schristos	${TOOL_MAKEFS} -M 1m -m 1m -B ${TARGET_ENDIANNESS} ${MAKEFS_TIMESTAMP} \
481.21Snonaka		-t msdos -o F=12,c=1 ${EFIBOOTIMG} efiboot
491.21Snonaka
501.21Snonakaimage_md_pre: ${EFIBOOTIMG}
511.17Smartin	${RM} -f cdrom/etc/gettytab cdrom/etc/ttys cdrom/etc/rc
521.2Sjym	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
531.2Sjym	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys
541.2Sjym	${INSTALL} ${COPY} ${.CURDIR}/../etc.rc cdrom/etc/rc
551.2Sjym	${INSTALL} ${COPY} -m 0555 ${.CURDIR}/../install.sh cdrom/install.sh
561.22Schristos	${MKDIR} ${MKDIRPERM} cdrom/mnt2 cdrom/targetroot
571.19Smartin	${INSTALL} ${COPY} ${SYSINSTDIR}/sysinstmsgs.?? cdrom/usr/share/sysinst/catalog/
581.22Schristos	${MKDIR} ${MKDIRPERM} cdrom/var
591.32Schristos
601.32Schristos__cdromclean::
611.32Schristos	rm -fr efiboot
62