all:
+#
+# Add a few defines we are going to use during the image
+# creation to determine what features and binaries to include
+# in the final image
+# ACPI do we have/include the acpi binary
+# RAMDISK_SMALL is the script called with MKSMALL=yes
+# DYNAMIC does the ramdisk contain dynamic binaries?
+RAMDISK_INC_ACPI=0
+RAMDISK_SMALL=0
+RAMDISK_DYNAMIC=0
+
+# the name of the proto file to use
+PROTO= proto
+
PROG_DRIVERS=at_wini floppy pci
PROG_COMMANDS=cdprobe loadramdisk mount fsck.mfs sysenv sh \
service
PROG_USRSBIN=pwd_mkdb
PROGRAMS=${PROG_DRIVERS} ${PROG_COMMANDS} ${PROG_SERVERS} ${PROG_USRSBIN}
EXTRA=system.conf master.passwd rs.single
-PROTO_FILES=proto.common.etc proto.common.dynamic proto.sh proto.dev
+PROTO_FILES=proto.common.etc proto.common.dynamic proto.dev
.if ${MKSMALL} != "yes"
+RAMDISK_SMALL=1
PROG_DRIVERS+= ahci
PROG_SERVERS+= ext2
-PROTO= proto
-.else
-PROTO= proto.small
.endif
+
.if ${MKACPI} != "no"
PROG_DRIVERS+= acpi
+RAMDISK_INC_ACPI=1
.endif
CPPFLAGS+= -I${NETBSDSRCDIR}/servers
pwd.db spwd.db passwd: etc/master.passwd
${INSTALL} etc/${@F} ${@F}
+
proto.gen: ${PROTO} ${PROTO_FILES} ${PROGRAMS}
${STRIP} ${PROGRAMS}
- ${HOST_SH} -e proto.sh ${PROTO} >${.OBJDIR}/${.TARGET}
+ # We are using the c preprocessor to generate proto.gen
+ # used in the mkfs tool.
+ ${TOOL_CAT} ${PROTO} | ${HOST_CC} \
+ -DRAMDISK_INC_ACPI=${RAMDISK_INC_ACPI} \
+ -DRAMDISK_SMALL=${RAMDISK_SMALL} \
+ -DRAMDISK_DYNAMIC=${RAMDISK_DYNAMIC} \
+ -traditional-cpp -E - | grep -v "^$$" | grep -v "#" >${.OBJDIR}/${.TARGET}
.include <minix.service.mk>
d--755 0 0
bin d--755 0 0
cdprobe ---755 0 0 cdprobe
+#if RAMDISK_SMALL == 1
fsck.mfs ---755 0 0 fsck.mfs
+#endif
mount ---755 0 0 mount
sh ---755 0 0 sh
service ---755 0 0 service
floppy ---755 0 0 floppy
ahci ---755 0 0 ahci
at_wini ---755 0 0 at_wini
+#if RAMDISK_SMALL == 1
ext2 ---755 0 0 ext2
+#endif
mfs ---755 0 0 mfs
procfs ---755 0 0 procfs
$
loadramdisk ---755 0 0 loadramdisk
$
sbin d--755 0 0
- @ACPI@
+#if RAMDISK_INC_ACPI == 1
+ acpi ---755 0 0 acpi
+#endif
pci ---755 0 0 pci
$
$
dev d--755 0 0
-@DEV@
+#include "proto.dev"
$
+#include "proto.common.etc"
+#if RAMDISK_DYNAMIC == 1
+#include "proto.common.dynamic"
+#endif
+$
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-PROTO=${1:-proto}
-sed -n '1,/@ACPI/p' <${PROTO} | grep -v @ACPI@
-if [ -e acpi ]
-then
-echo " acpi ---755 0 0 acpi"
-fi
-sed -n '/@ACPI/,/@DEV/p' <${PROTO} | grep -v -e @ACPI@ -e @DEV@
-cat proto.dev
-sed -n '/@DEV/,$p' <${PROTO} | grep -v @DEV@
-cat proto.common.etc
-if [ -x /libexec/ld.elf_so ]
-then cat proto.common.dynamic
-fi
-echo '$'
+++ /dev/null
-boot
-0 0
-d--755 0 0
- bin d--755 0 0
- cdprobe ---755 0 0 cdprobe
- loadramdisk ---755 0 0 loadramdisk
- mount ---755 0 0 mount
- sh ---755 0 0 sh
- service ---755 0 0 service
- sysenv ---755 0 0 sysenv
- $
- sbin d--755 0 0
- @ACPI@
- at_wini ---755 0 0 at_wini
- floppy ---755 0 0 floppy
- pci ---755 0 0 pci
- mfs ---755 0 0 mfs
- procfs ---755 0 0 procfs
- $
- dev d--755 0 0
-@DEV@
- $