PDA

View Full Version : [SCRIPTS] knoppix-live-cd-installer for fprot, sim, dvdcss2



Fabianx
03-30-2003, 10:49 PM
Hi,

I now made a one to do all script.

this is just v.0.1 so it has not everythingI want to have it, but one ahve to make backups and this is a public one :-)

As there are dirs, this time its a diff.

Syntax is easy ...

Just do a:

./knx-live-inst.sh l

to see modules availabe ...

then do:

./knx-live-inst.sh sim-0.8.1

to install it.

sim-0.8.1 is for KDE 3.1.0-woody, sim-0.8.2 for KDE 3.1.1-unstable.

Easy isn't it ?

Files are for the moment downloaded from the net or you have to put them into:

modules/<name>/<yourfile.deb>

So one could also do a install-mirror-tgz with all binaries already in there. :D

Also note that for now programs are installed into $HOME/.dist so it'll be kept if configuration is saved!

I'm working hard to get alsa working with the new installer (I myself already have it, nice sound :-)) )

Stay tuned! There are great things to come!

cu

Fabian



diff -Nur knx-live-inst/knx-live-inst.sh knx-live-inst-0.1/knx-live-inst.sh
--- knx-live-inst/knx-live-inst.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/knx-live-inst.sh 2003-03-30 23:12:50.000000000 +0200
@@ -0,0 +1,138 @@
+#!/bin/bash
+#
+# Install software while it is runnin from CD into home directory - useful in combination with persistant home
+#
+# GPL
+#
+# Author: Fabian Franz <knx-live-inst@fabian-franz.de>
+#
+
+# Constants
+
+DESTDIR="$HOME/.dist"
+export DESTDIR
+TMPDIR="/tmp/knx-live-inst.$$"
+MODPATH=$(pwd)
+MODULES=$MODPATH/modules/
+FILES="files"
+INSTALL="install.sh"
+mkdir -p $TMPDIR
+cd $TMPDIR
+
+function clean_exit
+{
+ cd ~
+ rm -rf $TMPDIR
+}
+
+trap "clean_exit" EXIT
+
+# Functions needed
+
+function deb-unpack()
+{
+ ar p $1 data.tar.gz | tar xz
+}
+
+function rpm-unpack()
+{
+ rpm2cpio $1 | cpio --extract --make-directories
+}
+
+function tgz-unpack()
+{
+ tar xzf $1
+}
+
+function tbz-unpack()
+{
+ tar xzj $1
+}
+
+# knx-unpack filename location type md5sum
+function knx-unpack()
+{
+ [ ! -f $1 ] && return 2
+ case "$3" in
+ deb) deb-unpack $1 ;;
+ rpm) rpm-unpack $1 ;;
+ tgz) tgz-unpack $1 ;;
+ tbz) tbz-unpack $1 ;;
+ *)
+ echo "Unknown Package format"
+ false
+ ;;
+ esac
+}
+
+function setup_destdir()
+{
+ # setup $HOME/.bashrc
+
+ mkdir -p $DESTDIR/bin
+ mkdir -p $DESTDIR/lib
+ mkdir -p $DESTDIR/man
+
+ cp $HOME/.bashrc $HOME/.bashrc.templ.$$
+ cat $HOME/.bashrc.templ.$$ | grep -v "DESTDIR=" | grep -v "export MANPATH=\$DESTDIR/man" | grep -v "export PATH=\$DESTDIR/bin/" | grep -v "export LD_LIBRARY_PATH=\$DESTDIR/lib" > $HOME/.bashrc
+ echo "DESTDIR=$DESTDIR" >> $HOME/.bashrc
+ echo "export MANPATH=\$DESTDIR/man/:\$MANPATH" >> $HOME/.bashrc
+ echo "export PATH=\$DESTDIR/bin/:\$PATH" >> $HOME/.bashrc
+ echo "export LD_LIBRARY_PATH=\$DESTDIR/lib:\$LD_LIBRARY_PATH" >> $HOME/.bashrc
+ rm -f $HOME/.bashrc.templ.$$
+
+}
+
+function abort
+{
+ echo $1
+ exit $2
+}
+
+# Format of Files order + package_name
+# So package basename location type md5sum
+function get_file()
+{
+ [ -f $MODULES/$1/$2 ] && cp $MODULES/$1/$2 $TMPDIR
+ [ -f $MODULES/$1/$2 ] || wget $3
+}
+
+if [ "$#" -lt "1" ]; then
+ echo Usage: $(basename $0) "<module-name>"
+ exit 1
+fi
+
+if [ ! -f "$MODULES/$1/$FILES" ];
+then
+ echo "Fatal: Package not found"
+ echo "Availabe are:"
+ ls $MODULES | tr ' ' \n
+ exit 1
+fi
+
+echo "OK, Installing $1..."
+setup_destdir
+
+NUM=$(cat $MODULES/$1/files | egrep -v "^#" | wc -l | sed 's/ //g')
+echo "Getting $NUM files..."
+I="1"
+while [ "$I" -le "$NUM" ];
+do
+ file=$(cat $MODULES/$1/files | egrep -v "^#" | tail +$I | head -n 1)
+ get_file $1 $file
+ I=$(($I+1))
+done
+
+echo "Unpacking $NUM files..."
+I="1"
+while [ "$I" -le "$NUM" ];
+do
+ file=$(cat $MODULES/$1/files | egrep -v "^#" | tail +$I | head -n 1)
+ knx-unpack $file
+ [ $? -eq 2 ] && abort "Fatal file not found!" 1
+ I=$(($I+1))
+done
+
+echo "Installing program..."
+sh $MODULES/$1/install.sh
+echo "All done"
Binärdateien knx-live-inst/.knx-live-inst.sh.swp and knx-live-inst-0.1/.knx-live-inst.sh.swp sind verschieden.
diff -Nur knx-live-inst/modules/f-prot/files knx-live-inst-0.1/modules/f-prot/files
--- knx-live-inst/modules/f-prot/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/f-prot/files 2003-03-30 23:06:18.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+fp-linux-sb.tar.gz ftp://ftp.f-prot.com/pub/linux/fp-linux-sb.tar.gz tgz
diff -Nur knx-live-inst/modules/f-prot/install.sh knx-live-inst-0.1/modules/f-prot/install.sh
--- knx-live-inst/modules/f-prot/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/f-prot/install.sh 2003-03-30 23:22:53.000000000 +0200
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+
+mkdir -p $DESTDIR/man/man8
+
+cp -a f-prot $DESTDIR/f-prot
+
+# Make starter links
+ln -fs $DESTDIR/f-prot/f-prot.sh $DESTDIR/bin/f-prot
+ln -fs $DESTDIR/f-prot/check-updates.sh $DESTDIR/bin/check-updates.sh
+ln -fs $DESTDIR/f-prot/man8/f-prot.8 $DESTDIR/man/man8/
+ln -fs $DESTDIR/f-prot/man8/check-updates.sh.8 $DESTDIR/man/man8/
+
+# Fix pathes
+sed 's%/usr/local/f-prot/%'$DESTDIR'/f-prot/%g' f-prot/f-prot.sh > $DESTDIR/f-prot/f-prot.sh
+
+sed 's%/usr/local/f-prot/%'$DESTDIR'/f-prot/%g' f-prot/check-updates.sh > $DESTDIR/f-prot/check-updates.sh
+
+
diff -Nur knx-live-inst/modules/libdvdcss2-1.2.6/files knx-live-inst-0.1/modules/libdvdcss2-1.2.6/files
--- knx-live-inst/modules/libdvdcss2-1.2.6/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/libdvdcss2-1.2.6/files 2003-03-30 23:01:00.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+libdvdcss2_1.2.6-1_i386.deb http://www.videolan.org/pub/libdvdcss/1.2.6/deb/libdvdcss2_1.2.6-1_i386.deb deb 729eaab91589061eedb087bbf5eeab87
diff -Nur knx-live-inst/modules/libdvdcss2-1.2.6/install.sh knx-live-inst-0.1/modules/libdvdcss2-1.2.6/install.sh
--- knx-live-inst/modules/libdvdcss2-1.2.6/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/libdvdcss2-1.2.6/install.sh 2003-03-30 23:01:41.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+
+cp -a usr/lib/* $DESTDIR/lib/
+
diff -Nur knx-live-inst/modules/sim-0.8.1/files knx-live-inst-0.1/modules/sim-0.8.1/files
--- knx-live-inst/modules/sim-0.8.1/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.1/files 2003-03-30 22:50:30.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+sim_0.8.1-1_i386.deb http://telia.dl.sourceforge.net/sourceforge/sim-icq/sim_0.8.1-1_i386.deb deb 2e27a48d8ddf5d11b9b1271fc014bda6
diff -Nur knx-live-inst/modules/sim-0.8.1/install.sh knx-live-inst-0.1/modules/sim-0.8.1/install.sh
--- knx-live-inst/modules/sim-0.8.1/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.1/install.sh 2003-03-30 22:04:08.000000000 +0200
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+cp -a usr/bin/* $DESTDIR/bin
+# copy menu-items & co
+cp -a usr/share/ $HOME/.kde/
+# change menu-item to fit our needs
+sed 's$Exec=sim$Exec='$DESTDIR'/bin/sim$g' usr/share/applnk/Internet/sim.desktop >$HOME/.kde/share/applnk/Internet/sim.desktop
+
diff -Nur knx-live-inst/modules/sim-0.8.2/files knx-live-inst-0.1/modules/sim-0.8.2/files
--- knx-live-inst/modules/sim-0.8.2/files 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.2/files 2003-03-30 22:25:42.000000000 +0200
@@ -0,0 +1,3 @@
+# Format of this is:
+# basename location_to_download type md5sum
+sim_0.8.2cvs22022003-1_i386.deb http://sim-icq.sourceforge.net/sim_0.8.2cvs22022003-1_i386.deb deb 8ddefa3887508c12febc2c3804de82ea
diff -Nur knx-live-inst/modules/sim-0.8.2/install.sh knx-live-inst-0.1/modules/sim-0.8.2/install.sh
--- knx-live-inst/modules/sim-0.8.2/install.sh 1970-01-01 01:00:00.000000000 +0100
+++ knx-live-inst-0.1/modules/sim-0.8.2/install.sh 2003-03-30 22:08:26.000000000 +0200
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# File to actually install the software
+# copy main prog
+cp -a usr/bin/* $DESTDIR/bin
+# copy menu-items & co
+cp -a usr/share/ $HOME/.kde/
+# change menu-item to fit our needs
+sed 's$Exec=sim$Exec='$DESTDIR'/bin/sim$g' usr/share/applnk/Internet/sim.desktop >$HOME/.kde/share/applnk/Internet/sim.desktop
+

Fabianx
03-30-2003, 11:56 PM
Alsa support ok!!!

It does all work now!

Download from:

http://www.linuxfaqs.de/knoppix/

Instructions for alsa:

cd ~
tar xzf knx-live-inst-0.1.tar.gz
cd knx-live-inst-0.1
./knx-live-inst.sh alsa

Then play some sound!

Enjoy!

cu

Fabian

vynx
04-14-2003, 12:16 PM
some one can give me a mirror from this web site?
i can't open http://www.linuxfaqs.de/knoppix

thanks

Fabianx
04-15-2003, 02:11 PM
some one can give me a mirror from this web site?
i can't open http://www.linuxfaqs.de/knoppix

thanks

Mirror with knx-live-inst-0.1-2 is availabe at :

http://www.computer-ag.de/download/knoppix/

Please use this only as a temporary mirror as my bandwith is limited. Thank you!

I'll soon upload new version of live-installer, I'm working atm moment.

cu

Fabian

vynx
04-16-2003, 12:20 PM
can some one give me URL for download knx-alsa packages?

thanks

Fabianx
04-16-2003, 12:59 PM
can some one give me URL for download knx-alsa packages?

thanks

For what do you need them. I'm the author so I could upload it. Do you mean the live-installer-package ? [thats in live-inst]

or do you really mean the knx-alsa-package included in newest knoppix ?

cu

Fabian

vynx
04-17-2003, 03:08 AM
i already founded it in knx-live-install. thanks

i need for my final assignment,i was studying in informatic engineering.
i make a linux distro for my final assignment. i need some newest file
from knoppix last version: knoppix-autoconfig(in /etc/init.d/),alsa auto configuration(i dont know position) and hwsetup
some one can give the URL?

vynx
04-17-2003, 08:04 AM
i need knx-alsa packages in new knoppix too.

probono
04-17-2003, 09:05 PM
edonkey would be nice (the rpm on their website works well)

As a starting point:

cd ~
wget http://flow.dl.sourceforge.net/sourceforge/ed2k-gtk-gui/ed2k-gtk-gui-0.5.0-2.i386.rpm
rpm2cpio ed2k-gtk-gui-0.5.0-2.i386.rpm | cpio -idmv --no-absolute-filenames
rm -f ed2k-gtk-gui-0.5.0-2.i386.rpm


but then I don't know how to continue... Fabian, can you help?

vynx
04-17-2003, 09:29 PM
i dont know what edonkey use for?
it seems like dont relationship with what i need..
or i am wrong?

Fabianx
04-23-2003, 01:29 PM
i need knx-alsa packages in new knoppix too.

Just download newest iso, then repack the package with:

dpkg-repack knx-alsa

And cp knoppix-autoconfig.

Or do you really need the knx-alsa-package, what project ?

If you provide an email, I can send you, what I sent to Klaus, but I thought you had already sent me an email if it was so importatn for you.

So please send me an email and ask exactly what you want!

cu

Fabian

qa1433
04-24-2003, 08:19 PM
Are you talking run these scrips with the live cd running or will they work on an Knoppix Debian hd install?
Paul 8)

Fabianx
04-24-2003, 08:35 PM
Are you talking run these scrips with the live cd running or will they work on an Knoppix Debian hd install?
Paul 8)

Its an LIVE installer, so it works from CD ;-)

cu

Fabian

qa1433
04-24-2003, 08:36 PM
Thanks for the info Fabian!
paul :lol:

vynx
04-25-2003, 11:20 AM
i have downloaded the new knoppix 3.2 and it solved my problem.
thanks to fabian

c_cinq
05-10-2004, 12:10 AM
Are these instructions for using your live-installer still the way? Should i make a /modules directory in my /home? ( I am using a persistent home on my windows hd)

Download my package in...

modules/<package>/<package.deb>

Do I have to use .deb or can I use .rpm, .tgz? And then, in xterm, as root...

./knx-live-inst.sh package

Fabianx
05-10-2004, 12:18 AM
Are these instructions for using your live-installer still the way? Should i make a /modules directory in my /home? ( I am using a persistent home on my windows hd)

Download my package in...

modules/<package>/<package.deb>

Do I have to use .deb or can I use .rpm, .tgz? And then, in xterm, as root...

./knx-live-inst.sh package

No its not.

Please see: /usr/share/knx-live-inst/modules/.

Then:



cp -a /usr/share/knx-live-inst/modules/ .
# make your own module
knx-live-inst.sh


Btw. this is not the right thread to talk about that, please open a new one.

cu

Fabian

woodway
07-25-2004, 03:33 PM
the ftp-URL on the f-prot server has changed, are you going to update your script?