projects
/
vuplus_openvuplus_3.0
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f69620
)
[udev] fix automount.
author
hschang
<chang@dev3>
Thu, 22 Feb 2018 05:19:57 +0000
(14:19 +0900)
committer
hschang
<chang@dev3>
Thu, 22 Feb 2018 05:19:57 +0000
(14:19 +0900)
meta-openvuplus/recipes-core/udev/udev-182/automount.py
patch
|
blob
|
history
meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py
patch
|
blob
|
history
meta-openvuplus/recipes-core/udev/udev_182.bbappend
patch
|
blob
|
history
diff --git
a/meta-openvuplus/recipes-core/udev/udev-182/automount.py
b/meta-openvuplus/recipes-core/udev/udev-182/automount.py
index
05848d2
..
69f5a68
100755
(executable)
--- a/
meta-openvuplus/recipes-core/udev/udev-182/automount.py
+++ b/
meta-openvuplus/recipes-core/udev/udev-182/automount.py
@@
-39,12
+39,25
@@
def isMountedByDevName(devName):
return ismounted
def isUsbDevice(dev_base):
return ismounted
def isUsbDevice(dev_base):
- phyPath = os.path.realpath('/sys/block/' + dev_base)
+ phyPath = os.path.realpath('/sys/block/' + dev_base
+ '/device'
)
for x in glob.glob("/sys/bus/usb/devices/usb*"):
if phyPath.find(os.path.realpath(x)) != -1:
return True
return False
for x in glob.glob("/sys/bus/usb/devices/usb*"):
if phyPath.find(os.path.realpath(x)) != -1:
return True
return False
+def checkFilesystem(device):
+ p = os.popen("blkid %s" % device)
+ data = p.read()
+ p.close()
+
+ fs = None
+ for x in data.split():
+ if x.startswith('TYPE') and x.find('=') != -1:
+ fs = x.split('=')[1].strip('"')
+ break
+
+ return fs
+
def automount():
kernel = sys.argv[1]
dev_kernel = os.path.join("/dev/", kernel)
def automount():
kernel = sys.argv[1]
dev_kernel = os.path.join("/dev/", kernel)
@@
-84,7
+97,15
@@
def automount():
if not os.access(mountPoint, os.F_OK):
return
if not os.access(mountPoint, os.F_OK):
return
- if os.system("mount -t auto -o noatime %s %s" % (dev_kernel, mountPoint)):
+ fs = checkFilesystem(dev_kernel)
+ if fs == "ntfs":
+ cmd = "mount.ntfs-3g %s %s" % (dev_kernel, mountPoint)
+ else:
+ cmd = "mount -t auto -o noatime %s %s" % (dev_kernel, mountPoint)
+
+ ret = os.system(cmd)
+
+ if ret:
os.rmdir(mountPoint)
else:
if mountPoint == "/media/hdd":
os.rmdir(mountPoint)
else:
if mountPoint == "/media/hdd":
diff --git
a/meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py
b/meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py
index
c70d38e
..
ed34b2a
100755
(executable)
--- a/
meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py
+++ b/
meta-openvuplus/recipes-core/udev/udev-182/vuzero4k/automount.py
@@
-39,12
+39,25
@@
def isMountedByDevName(devName):
return ismounted
def isUsbDevice(dev_base):
return ismounted
def isUsbDevice(dev_base):
- phyPath = os.path.realpath('/sys/block/' + dev_base)
+ phyPath = os.path.realpath('/sys/block/' + dev_base
+ '/device'
)
for x in glob.glob("/sys/bus/usb/devices/usb*"):
if phyPath.find(os.path.realpath(x)) != -1:
return True
return False
for x in glob.glob("/sys/bus/usb/devices/usb*"):
if phyPath.find(os.path.realpath(x)) != -1:
return True
return False
+def checkFilesystem(device):
+ p = os.popen("blkid %s" % device)
+ data = p.read()
+ p.close()
+
+ fs = None
+ for x in data.split():
+ if x.startswith('TYPE') and x.find('=') != -1:
+ fs = x.split('=')[1].strip('"')
+ break
+
+ return fs
+
def automount():
kernel = sys.argv[1]
dev_kernel = os.path.join("/dev/", kernel)
def automount():
kernel = sys.argv[1]
dev_kernel = os.path.join("/dev/", kernel)
@@
-83,7
+96,15
@@
def automount():
if not os.access(mountPoint, os.F_OK):
return
if not os.access(mountPoint, os.F_OK):
return
- if os.system("mount -t auto -o noatime %s %s" % (dev_kernel, mountPoint)):
+ fs = checkFilesystem(dev_kernel)
+ if fs == "ntfs":
+ cmd = "mount.ntfs-3g %s %s" % (dev_kernel, mountPoint)
+ else:
+ cmd = "mount -t auto -o noatime %s %s" % (dev_kernel, mountPoint)
+
+ ret = os.system(cmd)
+
+ if ret:
os.rmdir(mountPoint)
else:
if mountPoint == "/media/hdd":
os.rmdir(mountPoint)
else:
if mountPoint == "/media/hdd":
diff --git
a/meta-openvuplus/recipes-core/udev/udev_182.bbappend
b/meta-openvuplus/recipes-core/udev/udev_182.bbappend
index
a5599d6
..
06620a1
100644
(file)
--- a/
meta-openvuplus/recipes-core/udev/udev_182.bbappend
+++ b/
meta-openvuplus/recipes-core/udev/udev_182.bbappend
@@
-1,4
+1,4
@@
-PR .= "-vuplus
6
"
+PR .= "-vuplus
7
"
SRC_URI += " \
file://99_vuplus.rules \
SRC_URI += " \
file://99_vuplus.rules \