2010-05-27 00:49:57 +02:00
|
|
|
# Makefile for ramdisk image
|
|
|
|
|
2011-02-23 14:05:28 +01:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2013-06-17 16:51:49 +02:00
|
|
|
USE_BITCODE:=no
|
|
|
|
|
2012-05-01 16:43:09 +02:00
|
|
|
install:
|
|
|
|
|
|
|
|
all:
|
|
|
|
|
2013-01-10 10:50:32 +01:00
|
|
|
# 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?
|
2013-01-13 17:20:11 +01:00
|
|
|
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
|
2013-10-03 18:26:21 +02:00
|
|
|
ETC= system.conf master.passwd group
|
2013-01-22 13:49:15 +01:00
|
|
|
EXTRA= rc
|
2013-10-03 18:26:21 +02:00
|
|
|
PROTO_FILES= proto.common.etc proto.common.dynamic
|
2013-01-13 17:20:11 +01:00
|
|
|
PROG_DRIVERS=
|
2013-05-15 17:45:33 +02:00
|
|
|
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
|
2013-01-13 17:20:11 +01:00
|
|
|
PROG_BIN=
|
2013-02-26 16:49:27 +01:00
|
|
|
PROG_SBIN=
|
|
|
|
PROG_USR.BIN=
|
|
|
|
PROG_USR.SBIN=
|
2013-01-13 17:20:11 +01:00
|
|
|
|
2013-03-06 19:27:47 +01:00
|
|
|
.if ${MKSMALL} != "yes"
|
|
|
|
RAMDISK_SMALL= 1
|
|
|
|
.endif
|
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
|
|
ETC+= rs.single
|
2013-01-30 20:09:02 +01:00
|
|
|
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
|
2013-03-06 19:27:47 +01:00
|
|
|
PROG_COMMANDS+= cdprobe
|
2013-02-26 16:49:27 +01:00
|
|
|
PROG_USR.SBIN+= pwd_mkdb
|
2013-01-10 10:50:32 +01:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
.if ${MKSMALL} != "yes"
|
|
|
|
PROG_DRIVERS+= ahci
|
2012-12-15 13:59:08 +01:00
|
|
|
PROG_DRIVERS+= virtio_blk
|
2013-01-13 17:20:11 +01:00
|
|
|
PROG_SERVERS+= ext2
|
2013-01-10 17:05:12 +01:00
|
|
|
.endif
|
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
.if ${MKACPI} != "no"
|
|
|
|
RAMDISK_INC_ACPI= 1
|
|
|
|
PROG_DRIVERS+= acpi
|
2010-09-02 17:44:36 +02:00
|
|
|
.endif
|
2013-01-13 17:20:11 +01:00
|
|
|
.endif # ${MACHINE_ARCH} == "i386"
|
2010-09-02 17:44:36 +02:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
.if ${MACHINE_ARCH} == "earm"
|
2013-03-06 19:27:47 +01:00
|
|
|
PROG_DRIVERS+= mmc
|
2013-01-13 17:20:11 +01:00
|
|
|
.endif # ${MACHINE_ARCH} == "earm"
|
2013-01-10 10:50:32 +01:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
.if ${LDSTATIC} == "-dynamic"
|
|
|
|
RAMDISK_DYNAMIC= 1
|
|
|
|
PROG_LIBEXEC+= ld.elf_so
|
|
|
|
PROG_LIBS+= libc libminlib libcompat_minix libterminfo
|
2012-04-10 04:07:51 +02:00
|
|
|
.endif
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2013-02-26 16:49:27 +01:00
|
|
|
PROGRAMS=${PROG_COMMANDS} \
|
|
|
|
${PROG_BIN} ${PROG_SBIN} ${PROG_USR.BIN} ${PROG_USR.SBIN} \
|
|
|
|
${PROG_DRIVERS} ${PROG_SERVERS} \
|
|
|
|
${PROG_LIBEXEC}
|
2013-01-13 17:20:11 +01:00
|
|
|
|
2012-06-06 13:16:32 +02:00
|
|
|
CPPFLAGS+= -I${NETBSDSRCDIR}/servers
|
2013-01-13 17:20:11 +01:00
|
|
|
|
|
|
|
# LSC We have to take care of not erasing the source file, so never add EXTRA
|
|
|
|
# to CLEANFILES
|
2013-10-03 18:26:21 +02:00
|
|
|
CLEANFILES += ${PROGRAMS} ${SCRIPTS} ${ETC} image image.c t
|
|
|
|
CLEANFILES += proto.gen proto.dev proto.dev.mtree
|
2013-01-10 17:05:12 +01:00
|
|
|
CLEANFILES += ${PROG_LIBEXEC}
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
CLEANFILES += ${.OBJDIR}/etc/*
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
#############################################################
|
|
|
|
# LSC Below this point the rules should not be modified
|
|
|
|
#############################################################
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
# Tool to bootstrap the password db
|
|
|
|
TOOL_PWD_MKDB?= ${NETBSDSRCDIR}/usr.sbin/pwd_mkdb/pwd_mkdb
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
# Remove "drivers/ramdisk" component from path
|
2013-10-03 18:26:21 +02:00
|
|
|
PROGROOT:= ${.OBJDIR:S,/drivers/ramdisk,,}
|
2013-01-13 17:20:11 +01:00
|
|
|
|
|
|
|
# Generate dependencies rules for config files
|
|
|
|
.for etc in ${ETC}
|
|
|
|
${etc}: ${NETBSDSRCDIR}/etc/${etc}
|
2012-05-01 16:43:09 +02:00
|
|
|
${INSTALL} $> $@
|
2013-01-13 17:20:11 +01:00
|
|
|
.endfor
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
# 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
|
2013-01-17 16:58:12 +01:00
|
|
|
# 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}
|
2013-01-13 17:20:11 +01:00
|
|
|
.for file in ${EXTRA} ${PROTO} ${PROTO_FILES}
|
2013-02-07 23:08:37 +01:00
|
|
|
CLEANFILES += ${.OBJDIR}/${file}
|
2013-01-13 17:20:11 +01:00
|
|
|
${file}: ${NETBSDSRCDIR}/drivers/ramdisk/${file} .PHONY
|
2013-01-17 16:58:12 +01:00
|
|
|
${INSTALL} $> $@
|
2012-04-10 04:07:51 +02:00
|
|
|
.endfor
|
2013-01-17 16:58:12 +01:00
|
|
|
.endif
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
# Generate dependencies rules for dynamic libraries, if needed
|
2013-01-10 17:05:12 +01:00
|
|
|
.for lib in ${PROG_LIBS}
|
2013-01-13 17:20:11 +01:00
|
|
|
PROGRAMS+= ${lib}.so.0
|
2013-01-10 17:05:12 +01:00
|
|
|
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
|
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
# Generate dependencies rules for binaries
|
|
|
|
dir.sh:= ash
|
2013-02-26 16:49:27 +01:00
|
|
|
.for srcdir in bin sbin commands drivers libexec servers usr.bin usr.sbin
|
2013-01-13 17:20:11 +01:00
|
|
|
.for prog in ${PROG_${srcdir:tu}}
|
|
|
|
${prog}: ${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}
|
2013-01-10 17:05:12 +01:00
|
|
|
${INSTALL} $> $@
|
|
|
|
|
2013-01-13 17:20:11 +01:00
|
|
|
${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}:
|
|
|
|
${MAKE} -C ${NETBSDSRCDIR}/${srcdir}/${dir.${prog}:U${prog}} all
|
|
|
|
.endfor # prog
|
|
|
|
.endfor # srcdir
|
2013-01-10 17:05:12 +01:00
|
|
|
|
2013-10-03 18:26:21 +02:00
|
|
|
realall image: proto.gen ${ETC} ${EXTRA} pwd.db spwd.db passwd group
|
2013-01-13 17:20:11 +01:00
|
|
|
${_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
|
2010-05-27 00:49:57 +02:00
|
|
|
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
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
|
|
|
|
|
2012-10-26 15:22:39 +02:00
|
|
|
# LSC We use @F because some version of make still output a full path for @,
|
|
|
|
# even when the target is just a file name
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
pwd.db spwd.db passwd: etc/master.passwd
|
2012-10-26 15:22:39 +02:00
|
|
|
${INSTALL} etc/${@F} ${@F}
|
2010-07-01 08:14:06 +02:00
|
|
|
|
2013-10-03 18:26:21 +02:00
|
|
|
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 pwd.db spwd.db passwd group
|
|
|
|
${TOOL_MTREE} -f ${.TARGET}.mtree -N ${.OBJDIR} -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}
|
2012-10-26 15:22:39 +02:00
|
|
|
${STRIP} ${PROGRAMS}
|
2013-01-10 10:50:32 +01:00
|
|
|
# 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} \
|
2013-01-13 17:20:11 +01:00
|
|
|
${RAMDISK_DEFINES} \
|
2013-10-03 18:26:21 +02:00
|
|
|
-E - | grep -v "^$$" | grep -v "#" >${.TARGET}
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2011-07-09 15:04:42 +02:00
|
|
|
.include <minix.service.mk>
|