source: images/mkimage @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 3.7 KB
Line 
1#!/bin/bash
2if [ ! "$1" ]; then
3    echo "Maakt een directory, geschikt voor SYN-3 netwerk boot."
4    echo "Syntax: $0 naam "
5    echo " thinclient: Thin client met rdesktop"
6    echo ""
7    echo "Zooi die je op de server moet trappen staat in out/naam-.../"
8    echo ""
9    echo "Betekenis van directory inhoud:"
10    echo " list  : lijst met packages die in images moeten"
11    echo " root  : Directory tree die over het rootfs heen gekopieerd word"
12    echo " server: Extra files die men op de server moet plaatsen. (voor easy modification)"
13    exit 1
14fi
15DIR=$1
16shift
17for PAR in $*; do eval "$PAR=1" &>/dev/null; done
18
19if ! which tar-1.13; then
20    echo "Je hebt geen tar-1.13 in je path! Zie wiki."
21    exit 1
22fi
23
24
25#if ! mksquashfs-3.1 -version &>/dev/null; then
26#    echo "You need mksquashfs version 3.x. Version 4 is NOT SUPPORTED!";
27#    exit 1
28#fi
29
30
31if ! [ -d $DIR ]; then
32    echo "$DIR config directory not found!"
33    exit 1
34fi
35
36
37###########################################
38########################################### VOORBEREIDING
39###########################################
40
41
42BUILDROOT=`pwd`
43INSTALLPACKAGE=/sbin/installpkg
44CDROOT=/tmp/cdroot
45
46
47
48# Controleer of we als root werken, ivm het gebruik van pkgtools
49if [ $UID != "0" ]; then
50        echo "You are not root, type \"su -\" and try again! :-) "
51        exit 0
52fi
53
54
55###########################################
56########################################### VERSIE BEPALEN
57###########################################
58
59echo "* Versie nummer van deze CD bepalen... (nover om over te slaan)";
60#SVNSTATUS=`svn status -v "../npl/version"` || exit 1
61#BUILD=`echo "$SVNSTATUS" | cut -b14- | cut -f1 -d' '`
62if [ "$nover" ]; then
63        BUILD='none'
64else
65        BUILD=`svnversion ..`
66fi
67
68VERSION="syn3-$UPDATE_VERSION-$BUILD-`date +%d%m%Y-%H%M`" || exit 1
69VERSION=`echo "$VERSION"|sed s/:/to/|sed 's/ //g'` || exit 1
70
71echo "Versie: $VERSION";
72
73
74
75###########################################
76########################################### LIVECD IMAGE
77###########################################
78
79mkdir $CDROOT &>/dev/null
80
81OUTDIR="`pwd`/out/$DIR-$VERSION"
82mkdir -p $OUTDIR
83rm out/latest 2>/dev/null
84ln -s $DIR-$VERSION out/latest
85
86SQUASHROOT="/tmp/live"
87SQUASHIMAGE="$OUTDIR/image"
88
89
90rm -rf "$SQUASHROOT" &>/dev/null
91
92#kijk eerst in $CDPKG en gebruik anders svn versie
93for SHORTPKG in `cat $DIR/list`; do
94        echo -n "Installeren $SHORTPKG..."
95        TGZ=`../npl/findpkg "$SHORTPKG"` || exit 1
96        echo -n "$TGZ..."
97        $INSTALLPACKAGE -root $SQUASHROOT "$TGZ" >/dev/null || exit 1
98        echo "OK"
99done
100
101
102echo "$SQUASHROOT configureren..."
103cp -a $DIR/root/* $SQUASHROOT || exit 1
104chown -R 0:0 $SQUASHROOT/root || exit 1
105chmod 700 $SQUASHROOT/root || exit 1
106
107
108ldconfig -r $SQUASHROOT || exit 1
109
110
111#stip onzinnige zooi uit squashroot
112find $SQUASHROOT -type d -name '*.svn' -exec rm -r "{}" \; 2>/dev/null
113# find $SQUASHROOT -type d -name 'man?' -exec rm -r "{}" \; 2>/dev/null
114# find $SQUASHROOT -type d -name 'doc' -exec rm -r "{}" \; 2>/dev/null
115# find $SQUASHROOT -type d -name 'include' -exec rm -r "{}" \; 2>/dev/null
116# find $SQUASHROOT -type d -name 'gtk-doc' -exec rm -r "{}" \; 2>/dev/null
117# find $SQUASHROOT -type f -name '*.ps' -exec rm -r "{}" \; 2>/dev/null
118
119
120#verplaats kernel + initrd naar output directory
121mv $SQUASHROOT/boot/initrd.gz.test $OUTDIR/initrd.gz || exit 1
122mv $SQUASHROOT/boot/bzImage.test $OUTDIR/bzImage || exit 1
123
124
125echo "Squash image genereren..."
126pushd $SQUASHROOT
127mksquashfs . "$SQUASHIMAGE" || exit 1;
128popd
129rm -rf "$SQUASHROOT"
130
131
132#######################################
133####################################### EXTRA FILES OP SERVER
134#######################################
135
136cp -a $DIR/server/* $OUTDIR || exit 1
137find $OUTDIR -type d -name '*.svn' -exec rm -r "{}" \; 2>/dev/null
138chmod 444 $OUTDIR/*
139
140echo
141echo
142echo "Server data is ready in $OUTDIR"
143exit 0
144
145
Note: See TracBrowser for help on using the repository browser.