From 08161b063cdcfe6521fe9a41b3e3768ca4526db3 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 28 Nov 2004 17:10:44 +0000 Subject: [PATCH] Add various customize scripts. --- tools/tools/nanobsd/Customize/NET4801 | 27 ++++++++++ tools/tools/nanobsd/Customize/comconsole | 30 +++++++++++ tools/tools/nanobsd/Customize/default | 64 ++++++++++++++++++++++++ tools/tools/nanobsd/Customize/nobeastie | 25 +++++++++ 4 files changed, 146 insertions(+) create mode 100644 tools/tools/nanobsd/Customize/NET4801 create mode 100644 tools/tools/nanobsd/Customize/comconsole create mode 100644 tools/tools/nanobsd/Customize/default create mode 100644 tools/tools/nanobsd/Customize/nobeastie diff --git a/tools/tools/nanobsd/Customize/NET4801 b/tools/tools/nanobsd/Customize/NET4801 new file mode 100644 index 00000000000..8715f7f0d62 --- /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 00000000000..316cf143243 --- /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 00000000000..c017f9570e0 --- /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 00000000000..4e8d1e1b6db --- /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