diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 2005-05-19 15:23:48 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 2005-05-19 15:23:48 +0000 |
| commit | 72d8960f33e4c14cf5907e1ae65cce9a6ff83cf3 (patch) | |
| tree | 6f503bee9790d7b85f16cb510a41882a165d7f54 /tools | |
| parent | 660675189b2ba8bd98a1f61ead5d253273fa5aaf (diff) | |
Notes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/tools/nanobsd/Customize/files | 15 | ||||
| -rw-r--r-- | tools/tools/nanobsd/Customize/pkgs | 18 | ||||
| -rw-r--r-- | tools/tools/nanobsd/Files/root/change_password | 15 | ||||
| -rw-r--r-- | tools/tools/nanobsd/Files/root/save_sshkeys | 17 | ||||
| -rw-r--r-- | tools/tools/nanobsd/Files/root/updatep1 | 24 | ||||
| -rw-r--r-- | tools/tools/nanobsd/Files/root/updatep2 | 28 |
6 files changed, 117 insertions, 0 deletions
diff --git a/tools/tools/nanobsd/Customize/files b/tools/tools/nanobsd/Customize/files new file mode 100644 index 000000000000..6573b18baa2c --- /dev/null +++ b/tools/tools/nanobsd/Customize/files @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Install whatever files are in ${.CURDIR}/Files +# +# 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} ] + +cd $3/Files +find . -print | cpio -dumpv $1 diff --git a/tools/tools/nanobsd/Customize/pkgs b/tools/tools/nanobsd/Customize/pkgs new file mode 100644 index 000000000000..d63ee658b114 --- /dev/null +++ b/tools/tools/nanobsd/Customize/pkgs @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Install whatever packages are in ${.CURDIR}/Pkg +# +# 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} ] + +rm -rf $1/tmp/Pkg $1/var/db/pkg/* $1/usr/local/* +mkdir $1/tmp/Pkg +ln $3/Pkg/* $1/tmp/Pkg +( chroot $1 sh -c "cd /tmp/Pkg && pkg_add -v *" ) +rm -rf $1/tmp/Pkg diff --git a/tools/tools/nanobsd/Files/root/change_password b/tools/tools/nanobsd/Files/root/change_password new file mode 100644 index 000000000000..aae27f5c8f0e --- /dev/null +++ b/tools/tools/nanobsd/Files/root/change_password @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ + +set -ex + +passwd root + +mount /dev/ad0s3 /mnt +cp /etc/master.passwd /etc/passwd /etc/pwd.db /etc/spwd.db /etc/group /mnt +umount /mnt diff --git a/tools/tools/nanobsd/Files/root/save_sshkeys b/tools/tools/nanobsd/Files/root/save_sshkeys new file mode 100644 index 000000000000..19bb8cd03d16 --- /dev/null +++ b/tools/tools/nanobsd/Files/root/save_sshkeys @@ -0,0 +1,17 @@ +#!/bin/sh +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ + +set -ex + +mount /dev/ad0s3 /mnt +mkdir -p /mnt/ssh +( +cd /etc/ssh +cp ssh_host_* /mnt/ssh +) +umount /mnt diff --git a/tools/tools/nanobsd/Files/root/updatep1 b/tools/tools/nanobsd/Files/root/updatep1 new file mode 100644 index 000000000000..9c67749c2880 --- /dev/null +++ b/tools/tools/nanobsd/Files/root/updatep1 @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ +# +# Script to update partition 1 on a NanoBSD system. +# +# usage: +# ssh somewhere cat image.s1 | sh updatep1 +# + +set -e + +if mount | grep ad0s1 > /dev/null ; then + echo "You are running partition 1 already" + echo "you probably want to use 'updatep2' instead" + exit 1 +fi + +dd of=/dev/ad0s1 obs=64k +boot0cfg -s 1 -v ad0 diff --git a/tools/tools/nanobsd/Files/root/updatep2 b/tools/tools/nanobsd/Files/root/updatep2 new file mode 100644 index 000000000000..6f8eb447ac40 --- /dev/null +++ b/tools/tools/nanobsd/Files/root/updatep2 @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright (c) 2004 Poul-Henning Kamp +# +# See /usr/share/examples/etc/bsd-style-copyright for license terms. +# +# $FreeBSD$ +# +# Script to update partition 2 on a NanoBSD system. +# +# usage: +# ssh somewhere cat image.s1 | sh updatep2 +# + +set -e + +if mount | grep ad0s2 > /dev/null ; then + echo "You are running partition 2 already" + echo "you probably want to use 'updatep1' instead" + exit 1 +fi + +dd of=/dev/ad0s2 obs=64k +mount /dev/ad0s2a /mnt +sed -i "" 's/ad0s1/ad0s2/' /mnt/conf/base/etc/fstab +sed -i "" 's/ad0s1/ad0s2/' /mnt/etc/fstab +umount /mnt +boot0cfg -s 2 -v ad0 |
