Index: /trunk/Config.kmk
===================================================================
--- /trunk/Config.kmk	(revision 2549)
+++ /trunk/Config.kmk	(revision 2550)
@@ -23,12 +23,34 @@
 
 TEMPLATE_usr.bin.doc = /usr/bin/ program documentation.
-# 1: source  2: target  3: default ins path
-TEMPLATE_usr.bin.doc_INSTFUN = $(3)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1))
+# 1: source  2: target  3: _INST  4: default ins path
+TEMPLATE_usr.bin.doc_INSTFUN = $(4)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1))
 
 TEMPLATE_usr.bin.man = /usr/bin/ program manual page
-# 1: source  2: target  3: default ins path
-TEMPLATE_usr.bin.man_INSTFUN = $(3)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz
+# 1: source  2: target  3: _INST  4: default ins path
+TEMPLATE_usr.bin.man_INSTFUN = $(4)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz
 # 1: source  2: destination, 3: target
 TEMPLATE_usr.bin.man_INSTALLER = gzip -9 -c $(1) > $(2)
+
+#
+# The /usr/sbin templates.
+#
+TEMPLATE_usr.sbin = /usr/sbin/ programs.
+TEMPLATE_usr.sbin_TOOL = GCC3
+TEMPLATE_usr.sbin_TOOL.os2 = GCC3OMF
+TEMPLATE_usr.sbin_INST = usr/sbin/
+
+TEMPLATE_usr.sbin.script = /usr/sbin/ scripts
+TEMPLATE_usr.sbin.script_INST = usr/sbin/
+
+TEMPLATE_usr.sbin.doc = /usr/bin/ program documentation.
+# 1: source  2: target  3: _INST  4: default ins path
+TEMPLATE_usr.sbin.doc_INSTFUN = $(4)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1))
+
+TEMPLATE_usr.sbin.man = /usr/bin/ program manual page
+# 1: source  2: target  3: _INST  4: default ins path
+TEMPLATE_usr.sbin.man_INSTFUN = $(4)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz
+# 1: source  2: destination, 3: target
+TEMPLATE_usr.sbin.man_INSTALLER = gzip -9 -c $(1) > $(2)
+
 
 #
Index: /trunk/Makefile.kmk
===================================================================
--- /trunk/Makefile.kmk	(revision 2549)
+++ /trunk/Makefile.kmk	(revision 2550)
@@ -17,6 +17,8 @@
 # The subdirectories to traverse.
 SUBDIRS = \
+	baselayout \
 	yacc \
-	ash
+	ash \
+	emx
 
 ## def_do_subdir
Index: /trunk/baselayout/Makefile.kmk
===================================================================
--- /trunk/baselayout/Makefile.kmk	(revision 2550)
+++ /trunk/baselayout/Makefile.kmk	(revision 2550)
@@ -0,0 +1,132 @@
+# $Id: $
+## @file
+#
+# LIBC Unix Compartment Baselayout
+#
+# Copyright (c) 2005 knut st. osmundsen <bird@anduin.net>
+#
+#
+# This file is part of InnoTek LIBC.
+#
+# InnoTek LIBC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# InnoTek LIBC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with InnoTek LIBC; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+DEPTH = ..
+include $(PATH_KBUILD)/header.kmk
+
+PROGRAMS = \
+	pwd_mkdb
+INSTALLS = baselayout
+
+#
+# Utility for creating the password database
+#							
+pwd_mkdb_TEMPLATE = usr.sbin
+pwd_mkdb_SOURCES  = \
+	src/pwd_mkdb/pwd_mkdb.c
+
+#
+# The baselayout
+#
+baselayout_DIRS = \
+	bin \
+	dev \
+	etc \
+	etc/conf.d \
+	etc/cron.daily \
+	etc/cron.hourly \
+	etc/cron.monthly \
+	etc/cron.weekly \
+	etc/env.d \
+	etc/opt \
+	home \
+	lib \
+	opt \
+	root \
+	sbin \
+	tmp \
+	usr \
+	usr/bin \
+	usr/include \
+	usr/include/asm \
+	usr/include/linux \
+	usr/lib \
+	usr/local \
+	usr/local/bin \
+	usr/local/games \
+	usr/local/include \
+	usr/local/lib \
+	usr/local/sbin \
+	usr/local/share \
+	usr/local/share/doc \
+	usr/local/share/man \
+	usr/local/src \
+	usr/portage \
+	usr/sbin \
+	usr/share/doc \
+	usr/share/info \
+	usr/share/man \
+	usr/share/misc \
+	usr/src \
+	var \
+	var/db/pkg \
+	var/lib/misc \
+	var/lock \
+	var/lock/subsys \
+	var/log/news \
+	var/run \
+	var/spool \
+	var/state \
+	var/tmp \
+
+# For some dirs, we specify mode, uid and/or gid.
+root_MODE = 0700
+tmp_MODE = 1777
+var/tmp_MODE = 1777
+var/lock_MODE = 0775
+var/lock_UID = root
+var/lock_GID = uucp
+
+# A few files too.
+baselayout_SOURCES = \
+	etc/services=>etc/services \
+	etc/protocols=>etc/protocols \
+	etc/master.passwd=>etc/master.passwd \
+
+# A few symlink (symlink=>target)
+baselayout_SYMLINKS = \
+	usr/tmp=>../var/tmp \
+	usr/doc=>share/doc \
+	usr/info=>share/info \
+	usr/man=>share/man \
+	usr/local/doc=>share/doc \
+	usr/local/man=>share/man
+	
+# fix this!!!			
+baselayout_GOALS = \
+	$(PATH_INS)/etc/pwd.db
+
+
+include $(PATH_KBUILD)/footer.kmk
+
+
+#
+# Rule for creating the password database.
+#
+$(PATH_INS)/etc/pwd.db: $(PATH_INS)/etc/master.passwd
+	$(RM) -f $(PATH_INS)/etc/pwd.db.tmp
+	$(TARGET_pwd_mkdb) -p -d $(dir $@) $^
+
