summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorSimon Rettberg2013-11-19 15:32:10 +0100
committerSimon Rettberg2013-11-19 15:32:10 +0100
commitda4bf561e1f688b975ecae58a1f78c3b8676ebcc (patch)
tree16ffb2e09cbd2d6df245d8efc180cac42965c670 /data
parent[rootfs-stage32] enable zram swap (diff)
downloadtm-scripts-da4bf561e1f688b975ecae58a1f78c3b8676ebcc.tar.gz
tm-scripts-da4bf561e1f688b975ecae58a1f78c3b8676ebcc.tar.xz
tm-scripts-da4bf561e1f688b975ecae58a1f78c3b8676ebcc.zip
Just for the record: Never used updated openslx install/update scripts
Diffstat (limited to 'data')
-rwxr-xr-xdata/openslx-install2
-rwxr-xr-xdata/openslx-update23
2 files changed, 20 insertions, 5 deletions
diff --git a/data/openslx-install b/data/openslx-install
index d511e88d..1c943efa 100755
--- a/data/openslx-install
+++ b/data/openslx-install
@@ -300,7 +300,7 @@ print "Dienste konfiguriert."
#
print ""
print "Schreibe Bootzeit-Konfiguration für MiniLinux"
-cat > "/srv/openslx/www/config" << HEREEND
+cat > "/opt/openslx/client-config" << HEREEND
SLX_VM_NFS='$SLX_VM_NFS'
SLX_HTTP_ADDR='http://$SLX_LOCAL_ADDR'
SLX_NTP_SERVER='$SLX_NTP_SERVER'
diff --git a/data/openslx-update b/data/openslx-update
index 10ee3d7e..9a0c06a7 100755
--- a/data/openslx-update
+++ b/data/openslx-update
@@ -32,13 +32,14 @@ function download ()
else
print "Prüfsummencheck Datei $1 ok."
fi
+ DLFLAG=1
return 0
}
### Constants ###################################
# Web
MIRROR="http://mltk.boot.openslx.org"
-MIRRORDIR="files"
+MIRRORDIR="files2"
# Files/Dirs
PXEDIR="/srv/openslx/tftp/pxelinux.cfg"
PXECONFIG="$PXEDIR/default"
@@ -50,6 +51,7 @@ SCRIPTBACKUPDIR="/root/backup"
SERVERDEFAULTS="/opt/openslx/server-defaults"
LOCALINDEX="/opt/openslx/local_version"
WWWTEMP="/srv/openslx/www-temp"
+CLIENTCONFIG="/opt/openslx/client-config"
# Other
SLXSCRIPTS="openslx-install openslx-update"
NOW=$(date +%Y%m%d)
@@ -126,7 +128,7 @@ fi
print ""
print "Lade Liste aktuell verfügbarer Versionen..."
-wget -nv -O "$REMOTEINDEX" "$MIRROR/index" || error "Konnte Liste verfügbarer Releases nicht herunterladen."
+wget -nv -O "$REMOTEINDEX" "$MIRROR/index2" || error "Konnte Liste verfügbarer Releases nicht herunterladen."
. "$REMOTEINDEX" || error "Liste verfügbarer Releases Fehlerhaft (konnte $REMOTEINDEX nicht sourcen)"
# Regenerate pxemenu
@@ -141,6 +143,7 @@ for REL in ${!AVAILABLE_*}; do
print "Remote has branch $BRANCH"
PXELINE=""
KERNEL=""
+ ADDONS=""
for FILE in ${!REL}; do
# Handle pxelinux.cfg
if [[ "$FILE" == kernel* ]]; then
@@ -154,6 +157,7 @@ for REL in ${!AVAILABLE_*}; do
PXELINE+="http://$SLX_LOCAL_ADDR/$FILEPREFIX$FILE"
fi
# If file is available locally, don't download again
+ [ -s "$WWWDIR/$FILEPREFIX$FILE" ] && continue
if [ -s "$WWWTEMP/$FILEPREFIX$FILE" ]; then
mv "$WWWTEMP/$FILEPREFIX$FILE" "$WWWDIR/" && continue
warning "Konnte bestehende Datei $WWWTEMP/$FILEPREFIX$FILE nicht nach $WWWDIR/ verschieben, lade erneut herunter..."
@@ -172,11 +176,19 @@ for REL in ${!AVAILABLE_*}; do
echo " $KERNEL" >> "$PXECONFIG"
echo " $PXELINE" >> "$PXECONFIG"
echo " IPAPPEND 3" >> "$PXECONFIG"
- echo " APPEND slxsrv=$SLX_LOCAL_ADDR slxbase=/" >> "$PXECONFIG"
+ echo " APPEND slxsrv=$SLX_LOCAL_ADDR slxbase=$BRANCH" >> "$PXECONFIG"
# Extra files (e.g. vmplayer in its own sqfs that gets downloaded later)
EXTRA="${BRANCH}_EXTRA"
+ mkdir -p "$WWWDIR/$BRANCH"
for FILE in ${!EXTRA}; do
+ if [[ "$FILE" == *stage32* ]]; then
+ ln -sf "../$FILEPREFIX$FILE" "$WWWDIR/$BRANCH/stage32.sqfs"
+ else
+ ADDONS+=" $FILE"
+ ln -sf "../$FILEPREFIX$FILE" "$WWWDIR/$BRANCH/$FILE.sqfs"
+ fi
# If file is available locally, don't download again
+ [ -s "$WWWDIR/$FILEPREFIX$FILE" ] && continue
if [ -s "$WWWTEMP/$FILEPREFIX$FILE" ]; then
mv "$WWWTEMP/$FILEPREFIX$FILE" "$WWWDIR/" && continue
warning "Konnte bestehende Datei $WWWTEMP/$FILEPREFIX$FILE nicht nach $WWWDIR/ verschieben, lade erneut herunter..."
@@ -184,6 +196,9 @@ for REL in ${!AVAILABLE_*}; do
# Download
download "$FILEPREFIX$FILE" "$MIRROR/$MIRRORDIR/$FILE"
done
+ cp "$CLIENTCONFIG" "$WWWDIR/$BRANCH/config"
+ echo "SLX_ADDONS='$ADDONS'" >> "$WWWDIR/BRANCH/config"
+ ln -sf "$CLIENTCONFIG.tgz" "$WWWDIR/$BRANCH/config.tgz"
done
# If we are here, then we can assume everything went either right, or at least no fatal error happened.
@@ -193,7 +208,7 @@ if [ "$DLFLAG" -ne 0 ]; then
else
print "Keine neuen Abbilder heruntergeladen."
fi
-rm -f "$WWWTEMP/"*
+rm -rf "$WWWTEMP"
exit 0