Log:
First commit !
build.sh:
Added support for snapshots
Fixed label name in mkhybrid (label was empty on mac os x)
Added compression with bzexe
etc:
Fixed group.diff and rc.diff
tools:
added bzexe an alternative of gzexe using bzip2
new package_list ( work in progress )
Added:
branches/eric/
- copied from r330, trunk/
trunk/tools/bzexe (contents, props changed)
Modified:
branches/eric/build.sh
trunk/etc/group.diff
trunk/etc/rc.diff
trunk/etc/welcome
trunk/tools/package_list
Modified: branches/eric/build.sh
==============================================================================
--- trunk/build.sh Thu Nov 5 14:41:40 2009 (r330)
+++ branches/eric/build.sh Fri Oct 1 20:51:57 2010 (r331)
@@ -5,6 +5,7 @@
# Build script for creating the BSDanywhere OpenBSD Live CD image.
# Execute this script with ./build
#
+# Copyright (c) 2010 Eric Lederrey
# Copyright (c) 2009 Stephan A. Rickauer
# Copyright (c) 2008-2009 Rene Maroufi, Stephan A. Rickauer
#
@@ -34,10 +35,12 @@
#
# Variables
#
-BASE=/specify/base/path
+BASE=$HOME
ARCH=$(uname -m)
-RELEASE=$(uname -r)
+RELEASE="snapshots"
+#RELEASE="$(uname -r)
+
R=$(echo $RELEASE | awk -F. '{print $1$2 }')
IMAGE_ROOT=$BASE/image
@@ -47,7 +50,7 @@
export PKG_CACHE=$CACHE_ROOT
MIRROR=http://mirror.switch.ch/ftp/pub/OpenBSD
-export PKG_PATH=$PKG_CACHE:$MIRROR/$RELEASE/packages/$ARCH/
+export PKG_PATH=$PKG_CACHE:$MIRROR/$RELEASE/packages/$ARCH
CWD=$(pwd)
THIS_OS=$(uname)
@@ -57,8 +60,8 @@
#
# Functions go first.
#
-examine_environment() {
+examine_environment() {
echo -n 'This user: '
if [ "$USER" = 'root' ]; then
echo 'root (ok)'
@@ -74,7 +77,14 @@
echo "$THIS_OS (NOT ok)"
return 1
fi
-
+ if [ "$RELEASE" = "snapshots" ]; then
+ #determine which version we are dealing with
+ R=$(ftp -V -o - $MIRROR/$RELEASE/$ARCH/index.txt | awk 'match($0, /comp[0-9][0-9]/){ print substr($0, RSTART+4, RLENGTH-4)}')
+ echo "Release snapshots ($R)"
+ else
+ echo "Release $R"
+ fi
+
echo -n "$BASE "
if [ -d "$BASE" ]; then
echo 'exists (ok)'
@@ -149,7 +159,7 @@
# Get all OpenBSD file sets except compXX.tgz.
install_filesets() {
- for fs in base game man misc etc xbase xetc xfont xserv xshare
+ for fs in base game man misc etc xbase xetc xfont xserv xshare
do
fs=$fs$R.tgz
if [ ! -r "$CACHE_ROOT/$fs" ]
@@ -254,9 +264,11 @@
! -name chmod ! -name chgrp ! -name chown \
! -name tar ! -name pax ! -name cpio \
! -name sh ! -name ksh ! -name rksh \
- -type f -size +200 -exec gzexe {} \;
+ -type f -size +200 -exec $CWD/tools/bzexe {} \;
+ #-type f -size +200 -exec gzexe {} \;
- echo -n 'Removing gzexe ~ copies ... '
+ #echo -n 'Removing gzexe ~ copies ... '
+ echo -n 'Removing bzexe ~ copies ... '
find $IMAGE_ROOT/bin \
$IMAGE_ROOT/usr/bin \
$IMAGE_ROOT/usr/sbin \
@@ -287,9 +299,11 @@
burn_cdimage() {
# Finally, create the image.
+ LABEL="BSDanywhere_$RELEASE"
+ FILENAME="bsdanywhere-$RELEASE-$ARCH.iso"
cd $IMAGE_ROOT/..
echo 'Creating ISO image:'
- mkhybrid -A "BSDanywhere $RELEASE" -quiet -l -R -o bsdanywhere$R-$ARCH.iso -b cdbr -c boot.catalog image
+ mkhybrid -A $LABEL -V $LABEL -quiet -l -R -o $FILENAME -b cdbr -c boot.catalog image
}
clean_buildenv() {
@@ -303,7 +317,6 @@
#
# Main
#
-
examine_environment
[ $? = 0 ] || exit 1
Modified: trunk/etc/group.diff
==============================================================================
--- trunk/etc/group.diff Thu Nov 5 14:41:40 2009 (r330)
+++ trunk/etc/group.diff Fri Oct 1 20:51:57 2010 (r331)
@@ -1,5 +1,5 @@
---- group Mon Oct 19 12:16:05 2009
-+++ group Mon Oct 19 12:17:01 2009
+--- /etc/group Tue Aug 17 20:22:09 2010
++++ group Fri Aug 20 13:03:53 2010
@@ -1,9 +1,9 @@
-wheel:*:0:root
+wheel:*:0:root,live
@@ -12,11 +12,12 @@
bin:*:7:
news:*:8:
wsrc:*:9:
-@@ -61,6 +61,6 @@
- _btd:*:94:
- _smtpd:*:95:
- _rwalld:*:96:
+@@ -66,7 +66,7 @@
+ _sndio:*:99:
+ _ldapd:*:100:
+ _iked:*:101:
-dialer:*:117:
+dialer:*:117:live
nogroup:*:32766:
nobody:*:32767:
+ _iodine:*:598:
Modified: trunk/etc/rc.diff
==============================================================================
--- trunk/etc/rc.diff Thu Nov 5 14:41:40 2009 (r330)
+++ trunk/etc/rc.diff Fri Oct 1 20:51:57 2010 (r331)
@@ -1,5 +1,5 @@
---- rc Mon Oct 19 15:27:34 2009
-+++ rc Mon Oct 19 15:28:54 2009
+--- /etc/rc Mon Aug 16 16:46:47 2010
++++ rc Tue Aug 17 23:10:07 2010
@@ -239,9 +239,30 @@
umount -a >/dev/null 2>&1
@@ -33,7 +33,7 @@
random_seed
# pick up option configuration
-@@ -467,9 +488,9 @@
+@@ -494,9 +515,9 @@
# /var/crash should be a directory or a symbolic link
# to the crash directory if core dumps are to be saved.
@@ -46,7 +46,7 @@
if [ X"${afs}" = X"YES" -a -c /dev/nnpfs0 ]; then
echo -n 'mounting afs:'
-@@ -503,13 +524,13 @@
+@@ -530,14 +551,14 @@
'password file may be incorrect -- /etc/ptmp exists'
fi
@@ -55,16 +55,18 @@
# prune quickly with one rm, then use find to clean up /tmp/[lq]*
# (not needed with mfs /tmp, but doesn't hurt there...)
--(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
+-(cd /tmp && rm -rf [a-km-pr-zA-Z]*)
+-(cd /tmp &&
- find . ! -name . ! -name lost+found ! -name quota.user \
- ! -name quota.group -execdir rm -rf -- {} \; -type d -prune)
-+#(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
++#(cd /tmp && rm -rf [a-km-pr-zA-Z]*)
++#(cd /tmp &&
+# find . ! -name . ! -name lost+found ! -name quota.user \
+# ! -name quota.group -execdir rm -rf -- {} \; -type d -prune)
# create Unix sockets directories for X if needed and make sure they have
# correct permissions
-@@ -817,4 +838,6 @@
+@@ -851,4 +872,6 @@
echo 'starting xdm...'; /usr/X11R6/bin/xdm ${xdm_flags}
fi
Modified: trunk/etc/welcome
==============================================================================
--- trunk/etc/welcome Thu Nov 5 14:41:40 2009 (r330)
+++ trunk/etc/welcome Fri Oct 1 20:51:57 2010 (r331)
@@ -1,5 +1,5 @@
-Welcome to BSDanywhere 4.6 - OpenBSD at your fingertips!
+Welcome to BSDanywhere 4.8 - OpenBSD at your fingertips!
You may now log in using either 'live' or 'root' as a user name. Both
accounts have no default password set. If you'd like to set one, use the
Added: trunk/tools/bzexe
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/tools/bzexe Fri Oct 1 20:51:57 2010 (r331)
@@ -0,0 +1,209 @@
+#!/bin/sh -
+#
+# bzexe is adapted from bzexe. It simply calls bzip2 instead of gzip
+#
+# Copyright (c) 2003 Otto Moerbeek <ot...@drijf.net>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+# The number of lines plus one in the on-the-fly decompression script
+lines=19
+
+# A simple string to recognize already compressed files
+magic="# compressed by bzexe"
+
+# Write the decompression script to stdout
+header () {
+ typeset prog tmp
+ # first section needs variable expansion, second not
+ cat <<- EOF
+ #!/bin/sh -
+ $magic
+ lines=$lines
+ EOF
+ cat <<- 'EOF'
+ prog=`/usr/bin/basename "$0"`
+ tmp=`/usr/bin/mktemp -d /tmp/bzexeXXXXXXXXXX` || {
+ /bin/echo "$prog: cannot create tmp dir"; exit 1
+ }
+ trap '/bin/rm -rf "$tmp"' 0
+ if /usr/bin/tail +$lines "$0" |
+ /usr/bin/bzip2 -dc > "$tmp/$prog" 2> /dev/null; then
+ /bin/chmod u+x "$tmp/$prog"
+ "$tmp/$prog" ${1+"$@"}
+ ret=$?
+ else
+ /bin/echo "$prog: cannot decompress $0"
+ ret=1
+ fi
+ exit $ret
+ EOF
+}
+
+# Test if a file is compressed by checking the magic line
+compressed () {
+ test "X`sed -n 2p "$1" 2> /dev/null`" = "X$magic"
+}
+
+# Decompress a file
+decompress () {
+ tmp=`mktemp /tmp/bzexeXXXXXXXXXX` || {
+ echo "$prog: cannot create tmp file"
+ return 1
+ }
+ if ! cp "$1" "$tmp"; then
+ echo "$prog: cannot copy $1 to $tmp"
+ rm -f "$tmp"
+ return 1
+ fi
+ if ! tail +$lines "$tmp" | bzip2 -vdc > "$1"; then
+ echo "$prog: cannot decompress $1"
+ cp "$tmp" "$1"
+ rm -f "$tmp"
+ return 1
+ fi
+}
+
+# Perform some sanity checks on the file
+check () {
+ if test ! -e "$1"; then
+ echo "$prog: cannot compress non-existing file $1"
+ return 1
+ fi
+
+ if test ! -f "$1"; then
+ echo "$prog: cannot compress non-regular file $1"
+ return 1
+ fi
+
+ case `basename "$1"` in
+ sh | mktemp | rm | echo | tail | bzip2 | chmod | basename)
+ echo "$prog: cannot compress $1, I depend on it"
+ return 1
+ esac
+
+ if test ! -x "$1"; then
+ echo "$prog: cannot compress $1, it is not executable"
+ return 1
+ fi
+
+ if test -u "$1" -o -g "$1"; then
+ echo "$prog: cannot compress $1, it has an s bit set"
+ return 1
+ fi
+
+ # Build a list of files we should not compress.
+ # * files we need to decompress
+ CHECK_LIST="
+ /bin/chmod
+ /bin/echo
+ /bin/sh
+ /bin/rm
+ /usr/bin/basename
+ /usr/bin/bzip2
+ /usr/bin/mktemp
+ /usr/bin/tail
+ "
+ # * files in /bin and /sbin (decompression fails if /usr/bin is not mounted)
+ # (You could skip these if /usr/bin is always mounted on the same mount point.)
+ CHECK_LIST="$CHECK_LIST
+ /bin/*
+ /sbin/*
+ "
+ # See if the program we are trying to compress is in the list.
+ # To avoid compressing hardlinked files (eg compress & gzip)
+ # we compare the device & inode.
+ PROG_STAT_INFO=`stat -f '%d %i' "$1"`
+ for CHECK in $CHECK_LIST; do
+ if test -f "$CHECK"; then
+ CHECK_STAT_INFO=`stat -f '%d %i' "$CHECK"`
+ if test "X$PROG_STAT_INFO" == "X$CHECK_STAT_INFO"; then
+ echo "$prog: cannot compress $1, it is the same file as $CHECK"
+ return 1
+ fi
+ fi
+ done
+}
+
+# Compress a file
+compress () {
+ tmp=`mktemp /tmp/bzexeXXXXXXXXXX` || {
+ echo "$prog: cannot create tmp file"
+ return 1
+ }
+ if ! cp "$1" "$tmp"; then
+ echo "$prog: cannot copy $1 to $tmp"
+ rm -f "$tmp"
+ return 1
+ fi
+ if ! cp "$1" "$1"~; then
+ echo "$prog: cannot create backup copy $1~"
+ rm -f "$1"~ "$tmp"
+ return 1
+ fi
+
+ # Use cp to overwrite the existing file preserving mode and owner
+ # if possible. If the file is not writable, this will produce an
+ # error.
+
+ if header "$1" > "$tmp" && bzip2 -vc "$1" >> "$tmp"; then
+ if ! cp "$tmp" "$1"; then
+ echo "$prog: cannot copy $tmp to $1"
+ rm -f "$tmp"
+ return 1
+ fi
+ else
+ echo "$prog: cannot compress $1"
+ rm -f "$1"~ "$tmp"
+ return 1
+ fi
+}
+
+# Is the -d flag specified?
+dflag=
+
+# Return value
+rc=0
+
+if test "X$1" = X-d; then
+ dflag=1
+ shift
+fi
+
+prog=`basename "$0"`
+USAGE="usage: $prog [-d] file ..."
+if test $# -eq 0; then
+ echo $USAGE
+ exit 1
+fi
+
+while test $# -ne 0; do
+ if test $dflag; then
+ if ! compressed "$1"; then
+ echo "$prog: $1 is not compressed"
+ rc=1;
+ elif ! decompress "$1"; then
+ rc=$?
+ fi
+ else
+ if compressed "$1"; then
+ echo "$prog: $1 is already compressed"
+ rc=1;
+ elif ! check "$1" || ! compress "$1"; then
+ rc=$?
+ fi
+ fi
+ shift
+done
+exit $rc
Modified: trunk/tools/package_list
==============================================================================
--- trunk/tools/package_list Thu Nov 5 14:41:40 2009 (r330)
+++ trunk/tools/package_list Fri Oct 1 20:51:57 2010 (r331)
@@ -2,15 +2,14 @@
# List of packages we install for BSDanywhere
#
aescrypt
-aiccu
amap
angst
arping
bzip2
-dnstop-20080502
+dnstop
dnstracer
-epdfview-0.1.7p0
-firefox35
+epdfview-0.1.7p5
+#firefox35
hexedit
hping
httptunnel
@@ -18,23 +17,24 @@
iodine
ipcalc
iperf
-irssi-0.8.13p1
+irssi-0.8.15
irssi-icb
mboxgrep
+mozilla-firefox
mozilla-thunderbird
-mutt-1.5.20p1-sasl
nano
nbtscan
nemesis
netfwd
netpipe
nmap
-opennx
+#opennx
pftop
pwgen
radiusniff
rsync
scanssh
+scapy
smartmontools
smtpscan
ssldump
@@ -43,5 +43,6 @@
tightvnc-viewer
trafshow
udptunnel
+vim
xfe
xmms-vorbis