From dbf0ec2bfc775751c02e22171ad595e051636520 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 22 Aug 2016 19:08:26 +0100 Subject: [PATCH] Fix for util-linux, no lsblk Signed-off-by: Justin Cormack --- alpine/packages/automount/etc/init.d/automount | 2 +- alpine/packages/diagnostics/diagnostics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/packages/automount/etc/init.d/automount b/alpine/packages/automount/etc/init.d/automount index 91c686033..294d4b332 100755 --- a/alpine/packages/automount/etc/init.d/automount +++ b/alpine/packages/automount/etc/init.d/automount @@ -10,7 +10,7 @@ start() { ebegin "Configuring host block device" - DEV="$(lsblk -r | grep ' disk $' | awk '{print $1}' | head -1 )" + DEV="$(find /dev -maxdepth 1 -type b ! -name 'loop*' | grep -v '[0-9]$' | sed 's@.*/dev/@@' | head -1 )" [ -z ${DEV} ] && exit 1 diff --git a/alpine/packages/diagnostics/diagnostics b/alpine/packages/diagnostics/diagnostics index 3027e0fb7..30b3e1096 100755 --- a/alpine/packages/diagnostics/diagnostics +++ b/alpine/packages/diagnostics/diagnostics @@ -1,7 +1,7 @@ #!/bin/sh printf '\n' -DEV="$(lsblk -r | grep ' disk $' | awk '{print $1}' | head -1 )" +DEV="$(find /dev -maxdepth 1 -type b ! -name 'loop*' | grep -v '[0-9]$' | sed 's@.*/dev/@@' | head -1 )" [ $? -eq 0 ] && printf "✓ Drive found: $DEV\n" || printf "✗ No drive found\n" DEV=$(mount | grep '/dev/.*da. on /var type') [ $? -eq 0 ] && printf "✓ Drive mounted: $DEV\n" || printf "✗ No drive mounted\n"