minix/drivers/ramdisk/Makefile

188 lines
5.4 KiB
Makefile
Raw Normal View History

# Makefile for ramdisk image
.include <bsd.own.mk>
USE_BITCODE:=no
install:
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
RAMDISK_DEFINES= \
-DRAMDISK_INC_ACPI=${RAMDISK_INC_ACPI} \
-DRAMDISK_SMALL=${RAMDISK_SMALL} \
-DRAMDISK_DYNAMIC=${RAMDISK_DYNAMIC}
# The name of the proto file to use
PROTO= proto
# Common to all architectures
ETC= system.conf group
2013-01-22 13:49:15 +01:00
EXTRA= rc
PROTO_FILES= proto.common.etc proto.common.dynamic
PROG_DRIVERS=
PROG_COMMANDS= mount umount grep fsck_mfs sh service loadramdisk sysenv
Input infrastructure, INPUT server, PCKBD driver This commit separates the low-level keyboard driver from TTY, putting it in a separate driver (PCKBD). The commit also separates management of raw input devices from TTY, and puts it in a separate server (INPUT). All keyboard and mouse input from hardware is sent by drivers to the INPUT server, which either sends it to a process that has opened a raw input device, or otherwise forwards it to TTY for standard processing. Design by Dirk Vogt. Prototype by Uli Kastlunger. Additional changes made to the prototype: - the event communication is now based on USB HID codes; all input drivers have to use USB codes to describe events; - all TTY keymaps have been converted to USB format, with the effect that a single keymap covers all keys; there is no (static) escaped keymap anymore; - further keymap tweaks now allow remapping of literally all keys; - input device renumbering and protocol rewrite; - INPUT server rewrite, with added support for cancel and select; - PCKBD reimplementation, including PC/AT-to-USB translation; - support for manipulating keyboard LEDs has been added; - keyboard and mouse multiplexer devices have been added to INPUT, primarily so that an X server need only open two devices; - a new "libinputdriver" library abstracts away protocol details from input drivers, and should be used by all future input drivers; - both INPUT and PCKBD can be restarted; - TTY is now scheduled by KERNEL, so that it won't be punished for running a lot; without this, simply running "yes" on the console kills the system; - the KIOCBELL IOCTL has been moved to /dev/console; - support for the SCANCODES termios setting has been removed; - obsolete keymap compression has been removed; - the obsolete Olivetti M24 keymap has been removed. Change-Id: I3a672fb8c4fd566734e4b46d3994b4b7fc96d578
2013-09-28 14:46:21 +02:00
PROG_SERVERS= input mfs procfs
PROG_BIN=
PROG_SBIN=
PROG_USR.BIN=
PROG_USR.SBIN=
.if ${MKSMALL} != "yes"
RAMDISK_SMALL= 1
.endif
.if ${MACHINE_ARCH} == "i386"
ETC+= rs.single
EXTRA+=
Input infrastructure, INPUT server, PCKBD driver This commit separates the low-level keyboard driver from TTY, putting it in a separate driver (PCKBD). The commit also separates management of raw input devices from TTY, and puts it in a separate server (INPUT). All keyboard and mouse input from hardware is sent by drivers to the INPUT server, which either sends it to a process that has opened a raw input device, or otherwise forwards it to TTY for standard processing. Design by Dirk Vogt. Prototype by Uli Kastlunger. Additional changes made to the prototype: - the event communication is now based on USB HID codes; all input drivers have to use USB codes to describe events; - all TTY keymaps have been converted to USB format, with the effect that a single keymap covers all keys; there is no (static) escaped keymap anymore; - further keymap tweaks now allow remapping of literally all keys; - input device renumbering and protocol rewrite; - INPUT server rewrite, with added support for cancel and select; - PCKBD reimplementation, including PC/AT-to-USB translation; - support for manipulating keyboard LEDs has been added; - keyboard and mouse multiplexer devices have been added to INPUT, primarily so that an X server need only open two devices; - a new "libinputdriver" library abstracts away protocol details from input drivers, and should be used by all future input drivers; - both INPUT and PCKBD can be restarted; - TTY is now scheduled by KERNEL, so that it won't be punished for running a lot; without this, simply running "yes" on the console kills the system; - the KIOCBELL IOCTL has been moved to /dev/console; - support for the SCANCODES termios setting has been removed; - obsolete keymap compression has been removed; - the obsolete Olivetti M24 keymap has been removed. Change-Id: I3a672fb8c4fd566734e4b46d3994b4b7fc96d578
2013-09-28 14:46:21 +02:00
PROG_DRIVERS+= at_wini floppy pci pckbd
PROG_COMMANDS+= cdprobe
PROG_USR.SBIN+= pwd_mkdb
.if ${MKSMALL} != "yes"
PROG_DRIVERS+= ahci
PROG_DRIVERS+= virtio_blk
PROG_SERVERS+= ext2
.endif
.if ${MKACPI} != "no"
RAMDISK_INC_ACPI= 1
PROG_DRIVERS+= acpi
.endif
.endif # ${MACHINE_ARCH} == "i386"
.if ${MACHINE_ARCH} == "earm"
PROG_DRIVERS+= mmc
.endif # ${MACHINE_ARCH} == "earm"
.if ${LDSTATIC} == "-dynamic"
RAMDISK_DYNAMIC= 1
PROG_LIBEXEC+= ld.elf_so
PROG_LIBS+= libc libminlib libcompat_minix libterminfo
.endif
PROGRAMS=${PROG_COMMANDS} \
${PROG_BIN} ${PROG_SBIN} ${PROG_USR.BIN} ${PROG_USR.SBIN} \
${PROG_DRIVERS} ${PROG_SERVERS} \
${PROG_LIBEXEC}
CPPFLAGS+= -I${NETBSDSRCDIR}/servers
# LSC We have to take care of not erasing the source file, so never add EXTRA
# to CLEANFILES
CLEANFILES += ${PROGRAMS} ${SCRIPTS} ${ETC} image image.c t
CLEANFILES += proto.gen proto.dev proto.dev.mtree
CLEANFILES += ${PROG_LIBEXEC}
CLEANFILES += ${.OBJDIR}/etc/*
#############################################################
# LSC Below this point the rules should not be modified
#############################################################
# Tool to bootstrap the password db
TOOL_PWD_MKDB?= ${NETBSDSRCDIR}/usr.sbin/pwd_mkdb/pwd_mkdb
# Remove "drivers/ramdisk" component from path
PROGROOT:= ${.OBJDIR:S,/drivers/ramdisk,,}
# Generate dependencies rules for config files
.for etc in ${ETC}
etc/${etc}: ${NETBSDSRCDIR}/etc/${etc}
mkdir -p ${.OBJDIR}/etc
${INSTALL} $> $@
.endfor
# LSC Force the regeneration of the proto file as it seems sometimes
# they are not copied over as needed.
2013-01-22 13:49:15 +01:00
# LSC ramdisk rc file != /etc/rc
# BJG if ${.CURDIR} == ${.OBJDIR}, we are building in-tree and install
# shouldn't try to install the originals over the originals. Otherwise
# we are building out-of-tree and the contents should be copied
# unconditionally in case the contents have changed after the first copy.
.if ${.CURDIR} != ${.OBJDIR}
.for file in ${EXTRA} ${PROTO} ${PROTO_FILES}
2013-02-07 23:08:37 +01:00
CLEANFILES += ${.OBJDIR}/${file}
${file}: ${NETBSDSRCDIR}/drivers/ramdisk/${file} .PHONY
${INSTALL} $> $@
.endfor
.endif
# Generate dependencies rules for dynamic libraries, if needed
.for lib in ${PROG_LIBS}
PROGRAMS+= ${lib}.so.0
CLEANFILES += ${lib}.so.0
${lib}.so.0:${PROGROOT}/lib/${lib}/${lib}.so.0
${INSTALL} $> $@
${PROGROOT}/lib/${lib}/${lib}.so.0:
${MAKE} -C ${NETBSDSRCDIR}/lib/${lib} all
.endfor
# Generate dependencies rules for binaries
dir.sh:= ash
dir.fsck_mfs:= fsck.mfs
.for srcdir in bin sbin commands drivers libexec servers usr.bin usr.sbin
.for prog in ${PROG_${srcdir:tu}}
${prog}: ${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}
${INSTALL} $> $@
${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}:
${MAKE} -C ${NETBSDSRCDIR}/${srcdir}/${dir.${prog}:U${prog}} all
.endfor # prog
.endfor # srcdir
realall image: proto.gen ${ETC:C/^/etc\//} ${EXTRA} etc/master.passwd etc/pwd.db etc/spwd.db etc/passwd etc/group
${_MKMSG_CREATE} "Generating ramdisk image"
${TOOL_MKFSMFS} image proto.gen || { rm -f image; false; }
# if fsck.mfs -s image | grep -q CLEAN; \
# then : ; \
# else echo "CLEAN sanity check of image failed." ; \
# echo "(Perhaps install current mkfs and fsck.)" ; \
# rm -f image; false; \
# fi
etc/pwd.db etc/spwd.db etc/passwd: etc/master.passwd
etc/master.passwd: ${NETBSDSRCDIR}/etc/master.passwd
rm -rf ${.OBJDIR}/etc/
mkdir -p ${.OBJDIR}/etc
${INSTALL} $> $@
${TOOL_PWD_MKDB} -V 0 -p -d . etc/master.passwd
proto.dev.mtree:
@echo ". type=dir uname=root gname=operator mode=0755" \
>${.TARGET}.tmp && \
echo "./dev type=dir uname=root gname=operator mode=0755" \
>>${.TARGET}.tmp && \
${NETBSDSRCDIR}/commands/MAKEDEV/MAKEDEV.sh -m -r \
>> ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET}
# We have to remove the two first entries of the generated proto file, as
# well as the two last ones (closing $).
# Do not forget to double $ so that make doesn't try to expand it.
proto.dev: proto.dev.mtree etc/pwd.db etc/spwd.db etc/passwd etc/group
${TOOL_MTREE} -f ${.TARGET}.mtree -N ${.OBJDIR}/etc -C -K device | \
${TOOL_TOPROTO} | ${TOOL_SED} -e '1,4d' | \
${TOOL_SED} -e '$$d' |${TOOL_SED} -e '$$d' > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
proto.gen: ${PROTO} ${PROTO_FILES} proto.dev ${PROGRAMS}
${STRIP} ${PROGRAMS}
# We are using the c preprocessor to generate proto.gen
# used in the mkfs tool.
2013-01-25 13:49:18 +01:00
${TOOL_CAT} ${PROTO} | ${CC} \
${RAMDISK_DEFINES} \
-E - | grep -v "^$$" | grep -v "#" >${.TARGET}
2011-07-09 15:04:42 +02:00
.include <minix.service.mk>