head	1.2;
access;
symbols
	RELENG_6_4_0_RELEASE:1.1.4.1
	RELENG_6_4:1.1.4.1.0.10
	RELENG_6_4_BP:1.1.4.1
	RELENG_6_3_0_RELEASE:1.1.4.1
	RELENG_6_3:1.1.4.1.0.8
	RELENG_6_3_BP:1.1.4.1
	RELENG_6_2_0_RELEASE:1.1.4.1
	RELENG_6_2:1.1.4.1.0.6
	RELENG_6_2_BP:1.1.4.1
	RELENG_5_5_0_RELEASE:1.1.2.1
	RELENG_5_5:1.1.2.1.0.4
	RELENG_5_5_BP:1.1.2.1
	RELENG_6_1_0_RELEASE:1.1.4.1
	RELENG_6_1:1.1.4.1.0.4
	RELENG_6_1_BP:1.1.4.1
	RELENG_6_0_0_RELEASE:1.1.4.1
	RELENG_6_0:1.1.4.1.0.2
	RELENG_6_0_BP:1.1.4.1
	RELENG_6:1.1.0.4
	RELENG_6_BP:1.1
	RELENG_5_4_0_RELEASE:1.1.2.1
	RELENG_5_4:1.1.2.1.0.2
	RELENG_5_4_BP:1.1.2.1
	RELENG_5:1.1.0.2;
locks; strict;
comment	@# @;


1.2
date	2005.09.26.14.57.27;	author phk;	state dead;
branches;
next	1.1;

1.1
date	2004.11.28.17.10.44;	author phk;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.1.2.1
date	2005.02.28.10.01.45;	author phk;	state Exp;
branches;
next	;

1.1.4.1
date	2005.09.26.15.00.48;	author phk;	state dead;
branches;
next	;


desc
@@


1.2
log
@Remove the old Makefile based nanobsd build method, the new shell script
based is far better and the only one supported from now on.
@
text
@#! /bin/sh
#
# Customize a nanoBSD flash image
#
# Copyright (c) 2004 Thomas Quinot
#
# See /usr/share/examples/etc/bsd-style-copyright for license terms.
#
# $FreeBSD: src/tools/tools/nanobsd/Customize/default,v 1.1 2004/11/28 17:10:44 phk Exp $
# 
# Usage:
#
# ${CUSTOMIZE} ${WD} ${WORLDDIR} ${.CURDIR} [ ${LOCAL_FILES_LIST} ]

WD=$1
WORLDDIR=$2
CURDIR=$3
LOCAL_FILES_LIST=$4

PKG_DBDIR=${WD}/var/db/pkg
export PKG_DBDIR

add_CURDIR() {
  case "$1" in
    /*) echo "$1" ;;
    *)  echo "${CURDIR}/$1" ;;
  esac
}

pkg_relocate() {
  sed -e "1,/^@@cwd/s#^@@cwd #&${WD}#"
}

installlocalfiles() {
  if [ -n "${LOCAL_FILES_LIST}" ]; then
    while read src dest;
    do
      case "x${src}" in
        x#*|x)
          ;;
        x@@*)
          eval "for pkg in `add_CURDIR \"\`echo ${src} | sed 's/^@@//'\`\"`;
                do pkg_add -M \${pkg} | pkg_relocate | pkg_add -S;
                done"
          ;;
        *)
          dest="${dest:-${src}}"
          mkdir -p ${WD}/`dirname "${dest}x"`
          eval cp -fp `add_CURDIR ${src}` "${WD}/${dest}"
          ;;
      esac
    done < ${LOCAL_FILES_LIST}
  fi
}

movelocaletc() {
  if [ ! -d ${WD}/etc/local -a -d ${WD}/usr/local/etc ]; then
    mv ${WD}/usr/local/etc ${WD}/etc/local
    ln -s ../../etc/local ${WD}/usr/local/etc
  fi
}

installlocalfiles
movelocaletc
@


1.1
log
@Add various customize scripts.
@
text
@d9 1
a9 1
# $FreeBSD$
@


1.1.4.1
log
@MFC:
	nanobsd conversion to shell script.

Approved by:	re@@ (scottl)
@
text
@d9 1
a9 1
# $FreeBSD: src/tools/tools/nanobsd/Customize/default,v 1.1 2004/11/28 17:10:44 phk Exp $
@


1.1.2.1
log
@MFC:
	Bring nanobsd in like with the stuff in -current.
@
text
@@

