diff options
author | phk <phk@FreeBSD.org> | 2004-11-28 17:10:44 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-28 17:10:44 +0000 |
commit | c9429150894ff0a1e36b497d0f112e563a3ed5c3 (patch) | |
tree | a745ec4d82bdaa6055f4529417b551d5187bd290 /tools | |
parent | a28dea327060c788bf84ea2a7969b4e1557e4e77 (diff) | |
download | FreeBSD-src-c9429150894ff0a1e36b497d0f112e563a3ed5c3.zip FreeBSD-src-c9429150894ff0a1e36b497d0f112e563a3ed5c3.tar.gz |
Add various customize scripts.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/nanobsd/Customize/NET4801 | 27 | ||||
-rw-r--r-- | tools/tools/nanobsd/Customize/comconsole | 30 | ||||
-rw-r--r-- | tools/tools/nanobsd/Customize/default | 64 | ||||
-rw-r--r-- | tools/tools/nanobsd/Customize/nobeastie | 25 |
4 files changed, 146 insertions, 0 deletions
diff --git a/tools/tools/nanobsd/Customize/NET4801 b/tools/tools/nanobsd/Customize/NET4801 new file mode 100644 index 0000000..8715f7f --- /dev/null +++ b/tools/tools/nanobsd/Customize/NET4801 @@ -0,0 +1,27 @@ +#! /bin/sh +# +# Customize a nanoBSD flash image for Soekris NET4801 +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ +# +# Usage: +# +# ${CUSTOMIZE} ${WD} ${WORLDDIR} ${.CURDIR} [ ${LOCAL_FILES_LIST} ] + + +WD=$1 +WORLDDIR=$2 +CURDIR=$3 +LOCAL_FILES_LIST=$4 + +# Older NET4801s do not have the necessary wires on the PCB to run DMA +# mode against the CF card. Disable ata_dma so we can boot. + +touch ${WD}/boot/loader.conf +sed -i "" -e '/hw.ata.ata_dma/d' ${WD}/boot/loader.conf +echo 'hw.ata.ata_dma="0"' >> ${WD}/boot/loader.conf + diff --git a/tools/tools/nanobsd/Customize/comconsole b/tools/tools/nanobsd/Customize/comconsole new file mode 100644 index 0000000..316cf14 --- /dev/null +++ b/tools/tools/nanobsd/Customize/comconsole @@ -0,0 +1,30 @@ +#! /bin/sh +# +# Customize a nanoBSD flash image for serial console +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ +# +# 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 + +# Enable getty on console +sed -i "" -e /ttyd0/s/off/on/ ${WD}/etc/ttys + +# Disable getty on syscons devices +sed -i "" -e '/ttyv[0-8]/s/on/off/' ${WD}/etc/ttys + +# Tell loader to use serial console early. +echo " -h" > ${WD}/boot.config diff --git a/tools/tools/nanobsd/Customize/default b/tools/tools/nanobsd/Customize/default new file mode 100644 index 0000000..c017f95 --- /dev/null +++ b/tools/tools/nanobsd/Customize/default @@ -0,0 +1,64 @@ +#! /bin/sh +# +# Customize a nanoBSD flash image +# +# Copyright (c) 2004 Thomas Quinot +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ +# +# 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 diff --git a/tools/tools/nanobsd/Customize/nobeastie b/tools/tools/nanobsd/Customize/nobeastie new file mode 100644 index 0000000..4e8d1e1 --- /dev/null +++ b/tools/tools/nanobsd/Customize/nobeastie @@ -0,0 +1,25 @@ +#! /bin/sh +# +# Customize a nanoBSD flash image to disable the loaders ascii-art beastie +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ +# +# 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 + +touch ${WD}/boot/loader.conf +sed -i "" -e '/beastie_disable/d' ${WD}/boot/loader.conf +echo 'beastie_disable="YES"' >> ${WD}/boot/loader.conf |