SoftUSB2

+What is it?
SoftUSB2 is a system which simplifies installation and selection of systems/images to run on UFS910

+What do I need?
To run SoftUSB2 you need a pen-drive or disk to store your systems and telnet connection to UFS910

+How do I run it?
This tutorial assumes that your usb drive is mapped as /dev/sda1. Run "df" to check what device is you usb drive mapped to.
Your kernel needs a 2nd stage support. You can check that by running "cat /proc/mtd" and finding lines with the word "2nd".
If you encaruage any error while running this tutorial please give us feedback.

- download SoftUSB2 archive
- prepare a pen-drive
- start Kathrein software on your tuner
- plug your pen-drive into the Kathrein
- login to Kathrein by telnet 
- Telnet: unmount the pen-drive: umount /dev/sda1
  (if you get error try this: rm /etc/mtab; ln -s /proc/mounts /etc/mtab; umount /dev/sda1)
- use Ftp and copy files: mkdosfs & busybox to /tmp (files from archive)
- Telnet: set execution attributes: chmod 775 /tmp/mkdosfs; chmod 775 /tmp/busybox
- Telnet: create mount dir: mkdir -p /tmp/target

If you want to use FAT16/32:
- Telnet: format pen-drive: /tmp/mkdosfs -n "UFS910" /dev/sda1 (if you want to use FAT32 add -F 32)
- Telnet: mount pen-drive: mount -o shortname=mixed -t vfat /dev/sda1 /tmp/target

If you want to use EXT2/3:
- Telnet: format pen-drive: /tmp/busybox mke2fs -j -L "UFS910" -m0 -b4096 /dev/sda1 (if you want to use ext2 remove -j)
- Telnet: mount pen-drive: mount /dev/sda1 /tmp/target

- Telnet: create directory softusb2: mkdir /tmp/target/softusb2
- Ftp: put files from archive to /tmp/target/softusb2
- Telnet: go to directory softusb2: cd /tmp/target/softusb2
- Telnet: set execution attribute: chmod -R 775 *

Commands below install and configure uboot (these operations are done only once)
- Telnet: install 2nd uboot: ./softusb2.sh install 2nd
  (For IPbox ./softusb2.sh install ipbox)
- Telnet: configure network: ./softusb2.sh set net 192.168.1.20 255.255.255.0 192.168.1.1
- Telnet: set SoftUSB2 device: ./softusb2.sh set device usb fat UFS910 (if you use ext2/3 change it as needed)
  (For IPbox ./softusb2.sh set device usb fat IPBOX 0:1 - 0:1 is uboot notation device number)

Commands below configure bootmenu (configuration is written to a file, it is kernel/system independent)
- Telnet: bootmenu configuration: ./softusb2.sh set bootmenu 4 5
- Telnet: creating softusb file: ./softusb2.sh mkimage /hdd/Enigma2.tar.gz e2test
- Telnet: example of menu item configuration: ./softusb2.sh set image 1 "Flash" pvr105 flash (or use auto determine software type automatically)
  (For IPbox ./softusb2.sh set image 1 "Flash" dgs flash)
- Telnet: example of menu item configuration: ./softusb2.sh set image 2 "Enigma2" e2 softusb e2test
- Telnet: configuration information: ./softusb2.sh status

This is only simple example of usage. Full list of commands with description can be found in pdf file.

Known problems/solutions:
- I started Kathrein without pen-drive and nothing boots
  Most probably you will have to reanimate you box uboot settings. SoftUSB2 tries to copy fist uboot configuration while installing 2nd stage uboot, so it should start image from flash. Unfortunately it work OK only if you have standard uboot configuration. You can manually define what should start when there is no pen-drive by defining SoftUSB image 0.
  Firstly try to recover default value of bootcmd: setenv bootcmd 'bootm a0040000'; saveenv.

- Uboot does not detects FAT16/32 label
  To check how uboot reads your partition label run: dd if=/dev/sda1 bs=1 count=11 skip=71 2>/dev/null (where /dev/sda1 is your partition). Try using dosfslabel to set partition label, then uboot should read label correctly. Fix is on its way.

- I am trying to run Kathrein software and tuner is restarting constantly
  Change software version in bootmenu configuration. E.g. AAF2.0e need pvr105, and not pvr106 definition.
  Why it is that? SoftUSB2 adjusts first uboot configuration, so it fits certain software version needs. Unfortunately in some mods bootparamcheck program is from different version and it is causing problems.

- After starting Enigma i get green-screen / Enigma does not start
  By default mkimage command creates softusb file in size of 128mb, this is enough to keep system. Many mods creates swap file in softusb file and it is causing to run out of free space. You have to create biger file in such situations, 256mb should be enough (./softusb2.sh /hdd/e2.tar.gz e2 256)

Here are my configuration commands:
./softusb2.sh install 2nd
./softusb2.sh set device usb fat UFS910
./softusb2.sh set net 192.168.1.252 255.255.255.0 192.168.1.250
./softusb2.sh set bootmenu 5 5
./softusb2.sh set flash pvr105
./softusb2.sh mkimage /hdd/E2_rev996.tar.gz e2 128
./softusb2.sh set image 1 "Enigma2 Stable" e2 softusb e2
./softusb2.sh set image 2 "Enigma2 sda2" e2 part /dev/sda2 0:2
./softusb2.sh set image 3 "AAF3.0beta pvr107 softusb aaf30
./softusb2.sh set image 4 "Enigma2 Dev NFS" e2 nfs /nfs/enigma2
./softusb2.sh extract /hdd/E2_rev996.tar.gz LABEL
./softusb2.sh set image 5 "Enigma2 Dir" e2 partdir /images/e2test LABEL

IPBox version:
(IPBox uboot does not support finding partitions by label so you have to specify device in uboot notation)
./softusb2.sh install ipbox
./softusb2.sh set device usb fat IPBOX 0:1
./softusb2.sh set net 192.168.1.252 255.255.255.0 192.168.1.250
./softusb2.sh set flash dgs
./softusb2.sh mkimage /hdd/E2_rev996.tar.gz e2 128
./softusb2.sh set image 1 "Enigma2 Stable" e2 softusb e2
./softusb2.sh set image 2 "Enigma2 sda2" e2 part /dev/sda2 0:2
./softusb2.sh set image 3 "Enigma2 Dev NFS" e2 nfs /nfs/enigma2
./softusb2.sh extract /hdd/E2_rev996.tar.gz LABEL
./softusb2.sh set image 4 "Enigma2 Dir" e2 partdir /images/e2test LABEL 0:2

Short description of SoftUSB2 loader (softusb2.ub):
It is a mini-system which executes certain procedures before running the target system. Main tasks:
- support of mounting partitions by label (np root=LABEL=UFS910)
- support of softusb files
- shows progress on VFD (icons represents loader status, usb means pen-drive is mounted, hdd means softusb file is mounted, rec means fsck is running)
- detects swap partition (or file swap.part created with mkswap command)

PKT betatesters used mainly ext2/3 FS on their PenDrives, because of problems with FAT labels.
The label is differently saved in linux and in Windows/dos.
Personally I strongly encourage to use FAT, because it allows to backup and restore good images on your own computer in an easy way ;)


Have fun while using this tool

PS. Great thanks to PKT and betatesters for help, ideas and tests :)
Feel free to write your comments. They are usually helpful and inspiring.
