=======================================================================
Multiboot for Dreambox 7025 BETA 2.0 by thowi  from 29. April 2006
=======================================================================
Thanks to noggi and grblmpfh for the basic research in this 
area and others that contributed usefull stuff and feedback 
for creating the first Release.
Thanks to 3c5x9 for creating the addon menu coding in 
enigma2, great job !
=======================================================================
Version History
=======================================================================
BETA    1.0 	this was the first Release of multiboot 
BETA    1.3     almost full addon menu support
BETA    2.0 	full addon Menu support now included with Wizzards !
                added ImageX dummy Name if no name passed for 
                compatibility with addon menu
=======================================================================
The English text of readme.txt is below the German text !
=======================================================================
Multiboot fr die 7025 mit CF Karte - wie fngt man damit an ?

Zuerst bentig man eine CF Karte fr seine Dreambox 7025 mit mindestens 
256MB. Grer geht - dann ist nach der letzten Partition noch 
Platz frei fr Logische Partitonen fr Backups, etc,...
Im Moment gibt es fr diesen freien Platz aber (noch) keine 
Untersttzung von multiboot. Kleiner als 256MB geht NICHT - 
ausser, man pat die scripts SELBER an und verzichtet z.B. auf 
die letzte(n) Partition(en) fr Images (aber kein Support dafr).

Zuerst mal bentigt man ein Image Flashen das die CF Karte erkennt.
Im Prinzip geht multiboot auch nur mit Images die
CF Support drinnen haben, das haben aber derzeit alle
weil im CSV von DM enthalten.

Wichtig - whrend dem Flashen die CF Karte natrlich IMMER draussen 
lassen und untere Taste beim Einschalten drcken damit man bers 
WebIF Flashen kann wie gewohnt (mit CF drinnen geht das nmlich nicht).

Dann das multibootXX.tar.bz2 file auf /var/tmp mit FTP kopieren 
(TCP/IP muss natrlich funktionieren).

Wenn Du ein Image im Flash hast das im Blue Pannel die Mglichkeit 
bietet Addons Manuell von /tmp zu installiern kannst Du es 
verwenden um den Kit auszupacken.

Ansonsten den Kit mit folgenden Befehlen auspacken.
Das cd / ist wichtig, weil der multiboot kit jetzt mit 
vollen Filenamen inklusive directory gepackt wird und 
erst durch das kill wird das addon menu von
Multiboot im Spiele/Erweiterungen Menu sichtbar !

> cd /
> bunzip2 /var/tmp/multibootXX.tar.bz2
> tar -xvf /var/tmp/multibootXX.tar
> /var/tmp/multiboot.sh kill

Wenn Du das Partitionslayout auf der Cf karte anpassen willst editiere 
das init.cmd file vor dem Ausfhren des enable comands 
(wenn Du nicht weist wie man das macht dann lasse es lieber !):

Z.B.  FAT Partition auf 16 MB verkleinen (kleiner wird nicht 
gehen, weil man braucht Platz fr alle 3 Kernel), oder die Linux 
Partitionen z.B. von 75MB auf 64MB  verkleinern (kleiner wird 
nicht gehen, weil die images auf der CF Karte ca. 56MB gro sind
und man noch Platz braucht fr logs, Plugins...).

Man kann natrlich die 3 Linux Partitionen auch grer machen 
um den ganzen freien Platz auf der Cf Karte zu benutzen:

(Kartengre - FAT Gre)/3 - Standard ist (256-30)/3=75MB)

Empfohlen ist es aber das Partitionslayout so zu lassen 
wie es ist !

Jetzt kannst Du Multiboot auf der Cf Karte entweder vom 
Spiele/Erweiterungen Menu oder manuell mit dem script 
installieren.

Anmerkung: Wenn Du einfach den Multiboot kit updaten willst 
mit einer neueren version ohne die Images auf der CF Karte zu 
verlieren, dann ersetze das enable command jetzt 
hier mit update !

> cd /
> /var/tmp/multiboot.sh enable

Wenn Du es im Addon Menu machen willst, einfach dort enable 
(oder upgrade) auswhlen !
Dadurch wird die CF Karte fr Multiboot vorbereitet und alle 
4 Partitionen werden initialisiert, wobei aber nur die erste 
(FAT) dabei mit den multiboot Tools befllt wird.
Wenn Du mit dem addon menu weiterarbeiten willst kannst hast Du 
dort jetzt ALLE Befehle  wie boot, info und copy,...
auch zur Verfgung !

Der Rest der Beschreibung erklrt die Verwendung von Multiboot 
aber an Hand des Commandline Interfaces, das Menu Interface 
fhrt auch nur die selben Kommandos aus und zeigt deren Output !

Anschlieend wenn man nicht das menu verwendet auf /media/cf 
weiterarbeiten. Nur whrend enable, disable und update muss
der kit auf /var/tmp ausgepackt sein und multiboot.sh von 
dort ausgefhrt werden (das menu macht das automatisch) !

Also immer vor dem Ausfhren: 

> cd /media/cf 

eingeben, oder multiboot mit vollem Pfad eingeben: 

>/media/cf/multiboot.sh 

Zu Testzwecken (nur beim ersten mal) werden nun alle 3 
Partitionen fr Images mit einer Kopie des Flashes versehen:

> multiboot.sh copy 1 

Optional kann man als 2. Parameter auch einen Imagenamen angeben 
(wenn dieser Leerzeichen inkludiert dann mit "" wie oben im Beispiel)

> multiboot.sh copy 2 "Name des zweiten Images"

Es gibt aber auch eine eigene name|n option mit der man den Namen 
der Partition auch spter erweitern kann, z.B.:

> multiboot n 2 "Name des 2. Images oder weiterer beschreibender Text"

Das 3 Image wird zu Testzwecken als Kopie des 2. Images erstellt:

> multiboot.sh copy 3 2 "Kopie des zweiten Images"
> multiboot.sh info

Der Letzte Befehl sollte zeigen, dass alle Images installiert wurden,
und das noch vom Flash gebootet ist (beim Kopieren eines
Images wird jetzt zur Sicherheit immer auf Flash boot umgestellt).

Dann zum Testen fr eines der Images boot enablen (in unserem 
Beispiel 1) und rebooten:

> multiboot.sh boot 1
> multiboot.sh reboot

Jetzt sollte von der ersten Partition gebootet sein:

> multiboot.sh info

Sollte das besttigen !!!

Jetzt funktioniert die CF Karte bereits fr Multiboot - Gratuliere !

Bevor man nun ein weiteres Image vom Flash auf die CF Karte kopiert 
muss man wieder halten.

> multiboot.sh halt 

Jetzt steht die Box und man kann CF Karte raustun um das nchste Image 
zu flashen und ggf. einzurichten (Settings, Plugins downloaden,...) 
wobei man das natrlich auch spter auf der CF Karte tun kann.

Wenn das Image geflashed ist, einfach wieder runterfahren und die CF 
Karte (die noch auf Flash Boot steht) reintun und damit booten.
Dann einfach dieses neue Flashimage auf die nchste Partition kopieren:

> multiboot.sh copy 2 "Name von zweitem Image"

Optional kann man wie oben gezeigt als dritten Parameter auch einen 
Imagenamen angeben (wenn darin Leerzeichen inkludiert dann mit "" 
wie oben im Beispiel)

Bevor man nun ein weiteres Image vom Flash auf die CF Karte kopiert 
muss man wieder halten:

> multiboot.sh halt 

Jetzt steht die Box und man kann CF Karte raustun um ein
drittes Image fr die CF Karte zu flashen und ggf. einzurichten 
(Settings, Plugins downloaden,...) 
wobei man das natrlich auch spter auf der CF Karte tun kann.

Wenn das Image geflashed ist einfach wieder runterfahren und 
die CF Karte (die noch immer auf Flash Boot steht) reintun 
und damit booten.
Dann einfach dieses neue Flashimage auf die letzte Partition kopieren:

> multiboot.sh copy 3 "Name von drittem Image"

Jetzt kann man noch ein weiteres Image in den Flash kopieren, 
dafr muss man aber wieder halten.

> multiboot.sh halt

Jetzt steht die Box und man kann CF Karte raustun um das 
letzte Image fr den Flash zu flashen und ggf. einzurichten 
(Settings, Plugins downloaden,...).

Wenn das Image geflashed ist einfach wieder runterfahren und die 
CF Karte (die schon wieder auf Flash Boot steht) 
reintun und damit booten.

Dann einfach am Schlu das Flashimage auch noch erweitern (so das das
Multiboot addon und die weiteren CF Images gemounted werden 
- sonst muss man das immer manuell mit der info option machen) 
- dabei wird aber kein Image mehr kopiert !

> multiboot.sh copy 0

Jetzt viel Spass beim Multibooten & Testen !

Im Prinzip muss man nun wenn alle Partitionen gefllt sind nur 
mehr mit multiboot.sh oder im multiboot addon menu die jeweilge 
Partitionsnummer auswhlen (1,2,3 und 0 fr den Flash) 
die man booten will.

> multiboot.sh boot X 

Will man ber eine Partition ein anderes Image drber kopieren, 
so muss man nicht von vorne anfangen, sondern einfach wie oben 
in den Flash mit dem neuen Image und dann als copy die gewnschte 
Partition auswhlen, das script lscht das vorherige sauber runter.

Mit der multiboot info option kann man sich auch das aktuelle 
/media/cf/autorun.bat ansehen um festzustellen was als 
nchstes gebootet wird.

Ausserdem geht jetzt auch Images zwischen den Partitionen 
zu kopieren. Einfach bei der boot option Ziel und 
Quellen Partitionsnummer als drittes Argument angeben. 
0 ist immer das gebootete Image als 
Quelle, sowie wenn keine Quelle bergeben wird.

Es gibt jetzt auch die Mglichkeit mit der s|settings option 
nur die Setting Files (Senderlisten, Bouqets...) zwischen den 
Partitionen zu kopieren. Einfach Ziel und optional Quellen 
Partitionsnummer als drittes Argumente mitgeben. 
0 ist immer das gebootete Image als quelle, sowie wenn 
keine Quelle bergeben wird. 

Wen man beim kopieren eines Images oder der settings fr 
source und target den selben Wert angibt wird einfach das 
Image oder die Settings dort gelscht und im Falle der Settings 
muss man nach dem nchsten Reboot wieder durch den 
Einstellungsassistenten. Im Menu heit diese
Funktion delete image oder delete settings.

Wenn Ihr mehr kopieren wollt als die Settings, dann einfach 
die Befehle am Ende ins /media/cf/cpsettings.sh script 
eintragen, und ggf. auch das rmsettings.sh erweitern 
fr das Lschen der Settings.

Achtung, nach dem Kopieren der Settings mt Ihr noch die 
SAT Konfig berprfen, diese wird nicht mitkopiert und dann 
funktionieren die Settings evt nicht wenn die nicht dazupat.

Wenn die Partitionen nicht auf den cf1, cf2, cf3 Directories 
gemounted sind, kann man mit der info option diese mounten 
(aber die fstab Files sollten whrend dem Image copy 
erweiterter werden damit diese automatisch gemounted werden, 
ausser beim Flash Image - dort macht man es falls gewnscht
mit copy 0)

Wenn einen neue Version von Multiboot rauskommt, muss man 
nicht alles neu machen, einfach FTP des neuen 
multibootXX.tar.bz2 auf /var/tmp und dort wie beim Installieren 
auspacken und dann dort mit der update option die Files auf 
/media/cf austauschen:

> cd /var/tmp
> bunzip2 multibootXX.tar.bz2
> cd /
> tar -xvf /var/tmp/multibootXX.tar
> cd /var/tmp

Obiges geht auch mit Manual Install vom Blue Pannel falls 
im Image verfgbar.

> /var/tmp/multiboot.sh update

Und das Ganze Multiboot Deinstalliert man von der CF Karte 
indem man wie oben beim update in den Flash bootet und 
den kit neu auf /var/tmp auspackt und von dort ausfhrt:

> /var/tmp/multiboot.sh disable
> /var/tmp/multiboot.sh reboot

Wenn man disable vom multiboot auf der CF Karfte 
mit dem menu machen will sollte man den kit neu mit 
FTP auf /var/tmp kopieren, mit Blue Pannel installieren
und dann disable im menu auswhlen.

Damit sollte die CF Karte wieder leer und nach Reboot als 
Ganzes auf /media/cf gemounted sein.

Was macht man, wenn man sein multiboot abgestochen hat 
- z.B. FAT versehentlich gelscht oder wichtige Files dort 
verloren, oder autorun.bat deutet zu einer nicht bootfhigen 
oder leeren partition ?

Man kann immer probieren vom Flash zu booten (einschalten 
ohne CF Karte) und sofort nach der ersten Boot Message auf 
dem LCD die CF Karte wieder einstecken damit sie vom Flash beim
booten erkannt wird - und dann schlimmstenfalls
von vorne anfangen mit der enable option (vorher aber noch 
mit der info option probieren, ob die FAT Partition wieder 
sichtbar wird und man vieleicht mit update die files wieder 
kopieren kann und evt. mit boot 0 wieder ohne Tricks vom 
Flash booten kann)

Schlimmstenfalls CF Karte am PC Formatieren und von vorne 
anfangen.

Wie funktioniert nun die Untersttzung fr 
multiboot im Spiele/Erweiterungen Menu ?

Nun, beim kopieren eines image auf die CF Karte wird auch 
ein kleines addon in 
/usr/lib/enigma2/python/Plugins/Extensions/Multiboot verlinkt
(bzw. beim ersten Image wird es durch das tar -xvf des 
multibootkits dort hinkopiert) welches als Menu die Mglichkeit 
bietet wieder das boot, info, copy, enable und
disable Kommando auszufhren.

Beim multiboot copy befehl wird das Plugin auch im 
neuen Image mitinstalliert, sollte es fehlen, kann man 
es mit der info option nachinstallieren
(den Link anlegen), nach einem restart sollte es da sein.

> /media/cf/multiboot.sh info
> /media/cf/multiboot.sh reboot

Es gibt auch ein kleines script das nur diesen Link
anlegt:

> /media/cf/linkmb.bat

Alle Features von multiboot.sh die man in der shell aufrufen
kann sind jetzt auch als Menu verfgbar !
Mit Images wo sich das multiboot menu addon nicht 
installieren lt, oder es (noch) nicht installiert wurde, 
ist man dann natrlich auch noch auf 
Telnet angewiesen um wieder eine andere Partition zum 
Booten auszuwhlen.

Viel Spass beim Multibooting mit der Fernbedienung !

================================================================
Multiboot for DM 7025 with CF card - how do you start using it ? 

First you need a CF Card for your Dreambox 7025 with at least 
256MB. Bigger ones work, then after the last partition simply 
there will be unused space (for backups,...)
Currently there is (yet) no support for this empty space from 
multiboot. Smaller cards then 256MB do NOT work - except, 
you adapt the scripts   YOURSELF and make them work without 
the last Partition(s) for images (but no support on this)

First time you have to Flash an image that recognizes the CF Card. 
In principle multiboot therefore will work only with images that 
have the CF card support included, however at present all images 
have it included because it is in the CSV of DM contained. 

Important - while Flashing the CF card has to be ALWAYS outside 
of the dreambox especially when pressing the lower button when 
switching it on.

Only then one can flash via the WebIF normaly (with CF card 
inside that cannot be done). 

Then copy the multibootXX.tar.bz2 file to /var/tmp with ftp 
(TCP/IP must be working already). 

If you have flashed an image that offer in Blue Pannel Manual 
Addon Installation you can use this functionality to extract 
the kit.

If not, then unpack the whole files by entering the following 
commands in a Telnet session. The cd / ist important, because 
kit is now built with full filenames including directories, 
and the kill is needed so that multiboot addon menu 
becomes visible in Games/Extensions menu (but you can restart 
also enigma from menu if your images offers this functionality).

> cd /
> bunzip2 /var/tmp/multibootXX.tar.bz2
> tar -xvf /var/tmp/multibootXX.tar
> /var/tmp/multiboot.sh kill

If you now want to change the partition layout on the Cf card edit 
the init.cmd file before executing the enable command 
(if you don't know how to do this then better don't do it !):

For example reducing the FAT Partition to 16MB (smaller will not 
work because you need space for all 3 kernels), or the Linux 
Partitions size from 75MB to for example 64MB (smaller will 
not work because Images on CF card are about 
56MB big and you need free space for logs, Plugins,...).

You can also increase the Linux Partition size to use up all 
empty space of the CF card.

(Size of the card - FAT Size)/3 - Standard is (256-30)/3=75MB)

It is recommended to leave the partitions layout as it is !

Now you can install multiboot on cf card either from menu
or manually with the script as follows.

Remark: If you just want to upgrade multiboot from a previous 
version without loosing the current Images on CF card then 
replace the enable command now with update !

> cd /
> /var/tmp/multiboot.sh enable 

If you do it from addon menu then simply choose enable 
(or update) there.

By this command the CF card is prepared for multiboot and all 
4 partitions are created, however only the first (FAT) is filled 
with the multiboot tools needed. 

If you now want to continue working with multiboot in menu mode 
now ALL commands are there available also !

The rest of this documentation describes the usage of multiboot 
with the command line interface, the menu usage will just execute 
the same commands and show the output.

Subsequently if you are not using the menu interface, continue 
working on /media/cf, only during enable, disable and update 
the kit has to be unpacked at /var/tmp and the multiboot.sh 
executed from there (the menu does this automatically).

Before entering the command always change directory to /media/cf:

> cd /media/cf 

Or enter multiboot with full path:

> /media/cf/multiboot.sh 

For test purposes we will start to fill (only for the first time) 
all 3 partitions with a copy of the Flash:

> multiboot.sh copy 1 

Optional you can pass as 2. Parameter a Name for the image
(if blanks are included use "" as in example above)

> multiboot.sh copy 2 "Name of second Image"

But there is also an option name|n available with which you can 
extend the Partition name later:

> multiboot.sh name 2 "Name of Partition 2 or further text"

The third image is created for testing purpose as a copy 
of the second image:

> multiboot.sh copy 3 2 "Copy of second Image"
> multiboot.sh info

Last command should show that all 3 Images are now installed and 
that you are still booted from flash (when copying an image
now booting is now always set to flash to prevent problems).

Then test with one of the copied images if you can boot-enable 
it (in our example #1) and simply reboot: 

> multiboot.sh boot 1 
> multiboot.sh reboot 

Now should be bootet from the first partition: 

> multiboot.sh info 

That command should confirm this !!! 

Now the CF card is already functional for multiboot - Congratulation! 

Before you now copy a further image to the flash, you 
have to halt again

> multiboot.sh halt

Now the box should be halted and you can remove the CF card 
for flashing the next image.

After Flashing and maybe changig necessary things (like Settings, 
Plugins download,...) you can continue. 

If the image flashing is completed simply shutdown with halt and 
reboot with CF card insterted (which is still pointing to 
Flash booting) 

Then simply this new Flashimage is copied on the next 
partition copy:

> multiboot.sh copy 2 "Name of second Image"

Optional you can pass also a third Parameter a Name for the image
(if blanks are included use "" as in example above)

Before flashing and copying a further image on the CF card you must 
halt.

> multiboot.sh halt 

Now the box is halted and you can remove the CF map card once 
more for flashing the last image. After this you can flash the last 
image for copying to the CF card and maybe doing necessary setups 
(Settings, Plugins download, ... - but you can do this naturally 
also later when bootedfrom the CF card) . 

If the image is flashed you have to shutdown with halt and reboot 
again, then instert the CF card (which is still pointing to 
Flash booting) 

Then simply this new Flashimage is copied on the last partition: 

> multiboot.sh copy 3 "Name of third Image"

Now you can still copy another last image in the Flash for 
booting, but you have to halt again for doing this.

> multiboot.sh halt

Now the box is halted and you can remove the CF card 
for puttitng the last image to the Flash. Flash it 
and if necessary changes are needed (Settings, Plugins 
to download,...) do them im Flash. 

Then you should extend the image in flash, so that it 
also contains the addon menu and the fstab is extended 
that all CF card partitions are mounted (if you don't do 
this you can always do it manually 
with info option) - but no Image is copied in this case !

> multiboot.sh copy 0 

Now much fun with multibooting & testing! 

In principle you can select now that all Partitions are filled 
with multiboot.sh or the multiboot addon menu by passing the 
wanted partitionnumber (X = 1,2,3 and 0 for the Flash) of the 
Image you want to boot:

> multiboot.sh boot X 

With the info option from multiboot you can also display 
the current /media/cf/autorun.bat to find out what will 
be booted next.

If you want to copy a new image over a partition already 
filled then do not worry, you don't need to beginn from start.

Simply put the wanted image into the Flash (as above) and 
then copy it to the wanted partition, the script deletes 
the previous partition cleanly. 

You now have also the possibiltiy to copy images between 
partitions on the cf card. Simply pass also the source partition 
number after the target partiitonnumber as third argument when 
using the copy option of multiboot. 0 will be always 
the booted partition as source, also when no source number 
is passed.

There is no also the possibility to copy only settings 
(like Channel Lists) between Partitions with the s|settings 
option. Optionaly pass also the source partition number after 
the target partitionnumber as third argument when using the 
settings option of multiboot. 0 will be always the booted 
partition as source, also when no source number is passed.

If you pass the same number for source and target for either 
the copy or the settings option then the image or settings will 
be deleten, and in case of the settings after a reboot you will 
have to go trought the Installation wizzard again. In the menu
this feature is called delete image or delete settings.

If you want to copy further stuff too (besides the settings), 
feel free to add the appropiate commands at the end of 
/media/cf/cpsettings.sh, and also the rmsettings.sh

Attention, after coping the settings you will have to check the 
SAT config, this is not copied and if it doesn't match then 
the settings will not work.

When the Partitions are not available at the cf1,cf2,cf3 
directories you can use the info option to mount them 
(but fstab should be extended during image copy to do this 
automatically, except for the flash image where you can do
this if wanted with a copy 0).

When a new version of multiboot is released you don't need to 
do everything again. Simply FTP over the new multibootXX.tar.bz2 
file to /var/tmp and use the same comands
as during installation to extract the files there and then use 
the update option to update the files at /media/cf:

> cd /var/tmp
> bunzip2 multibootXX.tar.bz2
> cd /
> tar -xvf /var/tmp/multibootXX.tar

The above works also with Manual Install from Blue Pannel 
if available.

> /var/tmp/multiboot.sh update

And finally for geting rid of Multiboot you have to boot 
from Flash and unpack the kit again on /var/tmp
and then execute multiboot from there (as done above for 
update): 

> /var/tmp/multiboot.sh disable
> /var/tmp/multiboot.sh reboot

If you want do disable multiboot from CF card via the menu, 
you should FTP the kit again to /var/tmp, and install it 
with Blue Pannel and execute disable from menu.

Then the CF card should be again empty and after a Reboot be 
mounted as a whole on /media/cf

What can you do if you grilleld your multiboot - for example 
the FAT accitentially deletet or important files there lost, 
or when it is pointing to a partition that isn't bootable, 
or empty ?

You can always try to boot from Flash (turn on without CF card)
and immediately after the first things are shown on the LCD 
re-insert the cf card so that it is recognized when booting 
from flash. And then worst case is that
you start again from the beginning with multiboot.sh enable 
(but try before the info option if the FAT Partition is 
seeable again so that maybe with update you can 
re-copy the files or with boot 0 you can make
it booting from flash without any tricks)

Worst case is formating the Cf card on a PC and start again 
from the beginning !

How does now finally the new support from multiboot for the 
games/addon menu work ?

Well, when you copy an image on the CF card there will be also
a small addon linked to 
/usr/lib/enigma2/python/Plugins/Extensions/Multiboot 
(or on the first Image it will be copied there by the tar -xvf 
of the multiboot kit)
which allows you to execute the boot, info, copy, enable, 
disable,...  comand from the menu.

If you copy an image from flash, then the plugin is installed in 
the copy of the image also. 
If it doesn't show up try the info option in a terminal 
which should re-install the plugin (eg. create the link) 
and after a restart it should be there: 

> /media/cf/multiboot.sh info
> /media/cf/multiboot.sh restart

Alternatively there is also a small script available 
which just adds this link to an image:

> /media/cf/linkmb.bat

All features of multiboot.sh not availabel from the command line
are now available from menu interface too !
With images that don't offer the possibility to add this 
multiboot menu addon or where it was not installed (yet) 
you would need still telnet to choose booting another 
partition for booting. 

Enjoy Multibooting with your remote control !
================================================================