diff options
author | hschang <chang@dev3> | 2017-11-27 02:32:34 (GMT) |
---|---|---|
committer | hschang <chang@dev3> | 2017-11-27 06:59:50 (GMT) |
commit | 8e86621a63f8dc359eb63fe927c75c5158ee9c38 (patch) | |
tree | 47524bdaf54d50e8661ab71d58995d7d9263bc58 /meta-openvuplus | |
parent | c3e542a8e06411e3e58a735970043e53c24315af (diff) |
Support zero4k.
Diffstat (limited to 'meta-openvuplus')
4 files changed, 101 insertions, 3 deletions
diff --git a/meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py b/meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py new file mode 100755 index 0000000..c70d38e --- /dev/null +++ b/meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py @@ -0,0 +1,95 @@ +#!/usr/bin/python +import os +import sys +import glob + +def readFile(fn): + return open(fn, "r").read() + +def getLabelFromDevName(dev_kernel): + data = None + try: + data = os.popen("e2label %s" % dev_kernel).read().strip() + if not data: + data = None + except: + data = None + + return data + +def getModel(dev_base): + model = None + modelpath = "/sys/block/%s/device/model" % dev_base + if os.access(modelpath, os.F_OK): + model = open(modelpath, "r").read().strip().replace(' ','-') + return model + +def isMountedByDevName(devName): + ismounted = False + mounts = file('/proc/mounts').read().split('\n') + for x in mounts: + if not x.startswith('/'): + continue + + devpath, mountpoint = x.split()[:2] + if devpath == devName: + ismounted = True + break + + return ismounted + +def isUsbDevice(dev_base): + phyPath = os.path.realpath('/sys/block/' + dev_base) + for x in glob.glob("/sys/bus/usb/devices/usb*"): + if phyPath.find(os.path.realpath(x)) != -1: + return True + return False + +def automount(): + kernel = sys.argv[1] + dev_kernel = os.path.join("/dev/", kernel) + dev_index = os.path.basename(kernel)[-1] + dev_base = os.path.basename(kernel)[:-1] + removable=readFile("/sys/block/%s/removable" % dev_base).strip() == "1" + dev_real_path = os.path.realpath("/sys/block/%s/device" % dev_base) + + if isMountedByDevName(dev_kernel): + return + + mountPoint = None + if dev_index == "1": + if dev_real_path.find("f0b00500.ehci_v2/usb2/2-1") != -1: + mountPoint = "/media/hdd" + + if (mountPoint == None) or (os.path.ismount(mountPoint)): + label = getLabelFromDevName(dev_kernel) + if label: + mountPoint = "/media/" + label + if dev_index and dev_index != '1': + mountPoint += "_%s" % dev_index + + if (mountPoint == None) or (os.path.ismount(mountPoint)): + model = getModel(dev_base) + if model: + mountPoint = "/media/" + model + if dev_index and dev_index != '1': + mountPoint += "_%s" % dev_index + + if (mountPoint == None) or (os.path.ismount(mountPoint)): + mountPoint = "/media/" + kernel + + if not os.access(mountPoint, os.F_OK): + os.mkdir(mountPoint) + if not os.access(mountPoint, os.F_OK): + return + + if os.system("mount -t auto -o noatime %s %s" % (dev_kernel, mountPoint)): + os.rmdir(mountPoint) + else: + if mountPoint == "/media/hdd": + defaultMoviePath = "/media/hdd/movie" + if not os.access(defaultMoviePath, os.F_OK): + os.mkdir(defaultMoviePath) + +if __name__=="__main__": + automount() diff --git a/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb index f3d3eb7..de2a1a2 100644 --- a/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/enigma2-plugin-extensions-openwebif.bb @@ -25,6 +25,7 @@ SRC_URI = "git://github.com/E2OpenPlugins/e2openplugin-${MODULE}.git;protocol=gi file://box_uno4k.png \ file://box_ultimo4k.png \ file://box_uno4kse.png \ + file://box_zero4k.png \ " # Just a quick hack to "compile" it @@ -42,6 +43,7 @@ do_install_append() { install -m 0755 ${WORKDIR}/box_uno4k.png ${D}${PLUGINPATH}/public/images/boxes/uno4k.png install -m 0755 ${WORKDIR}/box_ultimo4k.png ${D}${PLUGINPATH}/public/images/boxes/ultimo4k.png install -m 0755 ${WORKDIR}/box_uno4kse.png ${D}${PLUGINPATH}/public/images/boxes/uno4kse.png + install -m 0755 ${WORKDIR}/box_zero4k.png ${D}${PLUGINPATH}/public/images/boxes/zero4k.png } python do_package_prepend () { @@ -58,6 +60,7 @@ python do_package_prepend () { ('vuuno4k', 'uno4k.png', 'vu_normal.png'), ('vuultimo4k', 'ultimo4k.png', 'vu_normal.png'), ('vuuno4kse', 'uno4kse.png', 'vu_brown.png'), + ('vuzero4k', 'zero4k.png', 'vu_brown.png'), ] import os top = '${D}${PLUGINPATH}/public/images/' diff --git a/meta-openvuplus/recipes-vuplus/e2openplugins/files/box_zero4k.png b/meta-openvuplus/recipes-vuplus/e2openplugins/files/box_zero4k.png Binary files differnew file mode 100644 index 0000000..07518e7 --- /dev/null +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/files/box_zero4k.png diff --git a/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif_vu_box_remote.patch b/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif_vu_box_remote.patch index 270d8d5..996793e 100644 --- a/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif_vu_box_remote.patch +++ b/meta-openvuplus/recipes-vuplus/e2openplugins/files/openwebif_vu_box_remote.patch @@ -14,21 +14,21 @@ index 9add982..da2be4a 100644 else: info["boximage"] = "unknown.jpg" diff --git a/plugin/controllers/models/owibranding.py b/plugin/controllers/models/owibranding.py -index 9b8f1e5..835cee5 100644 +index 9b8f1e5..4bbf6fb 100644 --- a/plugin/controllers/models/owibranding.py +++ b/plugin/controllers/models/owibranding.py @@ -277,6 +277,8 @@ def getAllInfo(): remote = "vu_duo2" elif procmodel == "ultimo": remote = "vu_ultimo" -+ elif procmodel == "uno4kse": ++ elif procmodel in ("uno4kse", "zero4k"): + remote = "vu_brown" elif procmodel == "e3hd": remote = "e3hd" elif procmodel in ("et9x00", "et9000", "et9200", "et9500"): diff --git a/plugin/public/static/remotes/vu_brown.html b/plugin/public/static/remotes/vu_brown.html new file mode 100644 -index 0000000..b7835d3 +index 0000000..0c3bf8b --- /dev/null +++ b/plugin/public/static/remotes/vu_brown.html @@ -0,0 +1,47 @@ |