Advertisement
shashilx

Untitled

Dec 7th, 2017
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. #!/bin/sh
  2. echo ""
  3. BOXTYPE="`cat /proc/stb/info/model`"
  4. if [ "$BOXTYPE" = "dm800" ] || [ "$BOXTYPE" = "dm800se" ] || [ "$BOXTYPE" = "dm500hd" ]
  5. then
  6. echo "Detected Dreambox $BOXTYPE"
  7. else
  8. echo "ERROR!"
  9. echo "This is ONLY supported on Dreambox DM800, DM800Se and DM500HD!"
  10. echo ""
  11. echo "Doing nothing!"
  12. echo ""
  13. exit 0
  14. fi
  15. if [ "`uname -r | grep '2.6.18'`" ]
  16. then
  17. FS=ext3
  18. else
  19. FS=ext4
  20. fi
  21. if [ ! -e /dev/sda1 ]
  22. then
  23. echo "ERROR!"
  24. echo "No storage device detected!"
  25. echo ""
  26. echo "Doing nothing!"
  27. echo ""
  28. exit 0
  29. fi
  30. if [ -e /dev/sda1 ] && [ -e /dev/sdb ]
  31. then
  32. echo "ERROR!"
  33. echo "Please make sure you only have ONE storage device attached!"
  34. echo "An internal HDD or USB Flash drive, NOT BOTH!"
  35. echo ""
  36. echo "Doing nothing!"
  37. echo ""
  38. exit 0
  39. fi
  40. echo "Found storage device /dev/sda1"
  41. echo ""
  42. TESTMOUNT="`grep sda1 /proc/mounts | cut -d' ' -f2`"
  43. if [ "$TESTMOUNT" ]
  44. then
  45. echo "Currently mounted at ${TESTMOUNT}"
  46. echo "Trying to unmount..."
  47. if [ `umount "$TESTMOUNT"` ]
  48. then
  49. echo "ERROR!"
  50. echo "Failed to unmount!"
  51. echo ""
  52. echo "Doing nothing!"
  53. echo ""
  54. exit 0
  55. fi
  56. echo "success!"
  57. else
  58. echo "Not mounted currently"
  59. fi
  60. echo ""
  61. echo "Proceeding..."
  62. echo ""
  63. echo "Formatting storage..."
  64. echo ""
  65. mkdir -p /mnt/extfZ/rootfs
  66. mkdir /mnt/extfZ/hdd
  67. mount -t jffs2 -o ro /dev/mtdblock3 /mnt/extfZ/rootfs
  68. mkfs.$FS -Lhdd /dev/sda1 > /dev/null 2>&1
  69. sync
  70. echo "Copying over rootfs..."
  71. echo ""
  72. mount -t $FS /dev/sda1 /mnt/extfZ/hdd
  73. cp -a /mnt/extfZ/rootfs/* /mnt/extfZ/hdd/
  74. sync
  75. mount -o remount,rw /boot
  76. cp /boot/autoexec.bat /boot/autoexec.bat.bak
  77. sed -i "s/root=\/dev\/mtdblock3/root=\/dev\/sda1/g; s/rootfstype=jffs2/rootfstype=$FS rootdelay=10/g" /boot/autoexec.bat
  78. mount -o remount,ro /boot
  79. sync
  80. mount --bind /proc /mnt/extfZ/hdd/proc
  81. mount --bind /sys /mnt/extfZ/hdd/sys
  82. mount --bind /dev /mnt/extfZ/hdd/dev
  83. mount --bind /var/volatile /mnt/extfZ/hdd/var/volatile
  84. echo "Installing extra software..."
  85. echo ""
  86. chroot /mnt/extfZ/hdd opkg update > /dev/null 2>&1
  87. chroot /mnt/extfZ/hdd opkg install gstreamer1.0-libav ffmpeg gstplayer exteplayer3 > /dev/null 2>&1
  88. 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
  89. chroot /mnt/extfZ/hdd opkg --force-depends remove enigma2-plugin-extensions-dmrootextend > /dev/null 2>&1
  90. sync
  91. umount /mnt/extfZ/hdd/dev
  92. umount /mnt/extfZ/hdd/sys
  93. umount /mnt/extfZ/hdd/proc
  94. umount /mnt/extfZ/hdd/var/volatile
  95. umount /mnt/extfZ/hdd
  96. umount /mnt/extfZ/rootfs
  97. rm -Rf /mnt/extfZ
  98. sync
  99. echo ""
  100. echo "Done!"
  101. echo "Please REBOOT your receiver NOW!"
  102. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement