Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo ""
- BOXTYPE="`cat /proc/stb/info/model`"
- if [ "$BOXTYPE" = "dm800" ] || [ "$BOXTYPE" = "dm800se" ] || [ "$BOXTYPE" = "dm500hd" ]
- then
- echo "Detected Dreambox $BOXTYPE"
- else
- echo "ERROR!"
- echo "This is ONLY supported on Dreambox DM800, DM800Se and DM500HD!"
- echo ""
- echo "Doing nothing!"
- echo ""
- exit 0
- fi
- if [ "`uname -r | grep '2.6.18'`" ]
- then
- FS=ext3
- else
- FS=ext4
- fi
- if [ ! -e /dev/sda1 ]
- then
- echo "ERROR!"
- echo "No storage device detected!"
- echo ""
- echo "Doing nothing!"
- echo ""
- exit 0
- fi
- if [ -e /dev/sda1 ] && [ -e /dev/sdb ]
- then
- echo "ERROR!"
- echo "Please make sure you only have ONE storage device attached!"
- echo "An internal HDD or USB Flash drive, NOT BOTH!"
- echo ""
- echo "Doing nothing!"
- echo ""
- exit 0
- fi
- echo "Found storage device /dev/sda1"
- echo ""
- TESTMOUNT="`grep sda1 /proc/mounts | cut -d' ' -f2`"
- if [ "$TESTMOUNT" ]
- then
- echo "Currently mounted at ${TESTMOUNT}"
- echo "Trying to unmount..."
- if [ `umount "$TESTMOUNT"` ]
- then
- echo "ERROR!"
- echo "Failed to unmount!"
- echo ""
- echo "Doing nothing!"
- echo ""
- exit 0
- fi
- echo "success!"
- else
- echo "Not mounted currently"
- fi
- echo ""
- echo "Proceeding..."
- echo ""
- echo "Formatting storage..."
- echo ""
- mkdir -p /mnt/extfZ/rootfs
- mkdir /mnt/extfZ/hdd
- mount -t jffs2 -o ro /dev/mtdblock3 /mnt/extfZ/rootfs
- mkfs.$FS -Lhdd /dev/sda1 > /dev/null 2>&1
- sync
- echo "Copying over rootfs..."
- echo ""
- mount -t $FS /dev/sda1 /mnt/extfZ/hdd
- cp -a /mnt/extfZ/rootfs/* /mnt/extfZ/hdd/
- sync
- mount -o remount,rw /boot
- cp /boot/autoexec.bat /boot/autoexec.bat.bak
- sed -i "s/root=\/dev\/mtdblock3/root=\/dev\/sda1/g; s/rootfstype=jffs2/rootfstype=$FS rootdelay=10/g" /boot/autoexec.bat
- mount -o remount,ro /boot
- sync
- mount --bind /proc /mnt/extfZ/hdd/proc
- mount --bind /sys /mnt/extfZ/hdd/sys
- mount --bind /dev /mnt/extfZ/hdd/dev
- mount --bind /var/volatile /mnt/extfZ/hdd/var/volatile
- echo "Installing extra software..."
- echo ""
- chroot /mnt/extfZ/hdd opkg update > /dev/null 2>&1
- chroot /mnt/extfZ/hdd opkg install gstreamer1.0-libav ffmpeg gstplayer exteplayer3 > /dev/null 2>&1
- chroot /mnt/extfZ/hdd opkg install enigma2-plugin-extensions-subssupport enigma2-plugin-extensions-serviceapp enigma2-plugin-extensions-mediaplayer2 enigma2-plugin-extensions-iptvplayer > /dev/null 2>&1
- chroot /mnt/extfZ/hdd opkg --force-depends remove enigma2-plugin-extensions-dmrootextend > /dev/null 2>&1
- sync
- umount /mnt/extfZ/hdd/dev
- umount /mnt/extfZ/hdd/sys
- umount /mnt/extfZ/hdd/proc
- umount /mnt/extfZ/hdd/var/volatile
- umount /mnt/extfZ/hdd
- umount /mnt/extfZ/rootfs
- rm -Rf /mnt/extfZ
- sync
- echo ""
- echo "Done!"
- echo "Please REBOOT your receiver NOW!"
- echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement