[X2Go-Commits] [live-build-x2go] 35/108: removable/non-removable detection per device failed for partitioned devices

git-admin at x2go.org git-admin at x2go.org
Wed Mar 20 22:13:11 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.

commit d7eb7102647dea92527f7cdc4d320a33bda8c7b4
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date:   Sun Feb 11 00:27:29 2018 +0100

    removable/non-removable detection per device failed for partitioned devices
---
 config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia     | 2 +-
 config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia   | 2 +-
 config/includes.chroot/lib/live/config/2280-x2go-getportableappsessions | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia
index 3f047ab..1978f2e 100755
--- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia
+++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia
@@ -110,7 +110,7 @@ GetSSHHostKeysFromMedia ()
 					# So there's no active mount for the device with our magic label ...
 					echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8
 					# let's see if this is a fixed disk.
-					if grep -q "^0$" /sys/block/$BLOCKDEV/removable ; then
+					if [ $(lsblk -oRM -nl /dev/$BLOCKDEV) -eq 0 ] ; then
 						# yes, it is, so let's go ahead and try to mount it ...
 						echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8
 						# obviously, we need a mountpoint for it ...
diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia
index 6be457c..09b4054 100755
--- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia
+++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia
@@ -111,7 +111,7 @@ GetSSHClientKeysFromMedia ()
 						# So there's no active mount for the device with our magic label ...
 						echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8
 						# let's see if this is a fixed disk.
-						if grep -q "^0$" /sys/block/$BLOCKDEV/removable ; then
+						if [ $(lsblk -oRM -nl /dev/$BLOCKDEV) -eq 0 ] ; then
 							# yes, it is, so let's go ahead and try to mount it ...
 							echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8
 							# obviously, we need a mountpoint for it ...
diff --git a/config/includes.chroot/lib/live/config/2280-x2go-getportableappsessions b/config/includes.chroot/lib/live/config/2280-x2go-getportableappsessions
index 57d6f05..76ee95b 100755
--- a/config/includes.chroot/lib/live/config/2280-x2go-getportableappsessions
+++ b/config/includes.chroot/lib/live/config/2280-x2go-getportableappsessions
@@ -82,7 +82,7 @@ X2GoGetPortableAppSessions ()
 					# So there's no active mount for the device with our magic label ...
 					echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8
 					# let's see if this is a fixed disk.
-					if grep -q "^0$" /sys/block/$BLOCKDEV/removable ; then
+					if [ $(lsblk -oRM -nl /dev/$BLOCKDEV) -eq 0 ] ; then
 						# yes, it is, so let's go ahead and try to mount it ...
 						echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8
 						# obviously, we need a mountpoint for it ...

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git


More information about the x2go-commits mailing list