From 0da1f903c8be383e188ee09e25f847bee38a6608 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 13 Dec 2019 15:18:36 +0100 Subject: [slx-issue] use slx-tools for ID44 detection --- .../slx-issue/data/opt/openslx/scripts/openslx-create_issue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue b/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue index 39b337b0..de6331c7 100755 --- a/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue +++ b/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue @@ -17,6 +17,8 @@ # First script for initial ramfs for OpenSLX linux stateless clients ############################################################################# +export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin + # Set greeting and add information about the booted system declare -rg INFILE=/opt/openslx/etc/issue.template @@ -52,13 +54,14 @@ system="$system_manufacturer $system_product" # Support the boot interface name eventually saved as SLX_PXE_NETIF # from the new dracut-based stage3, fallback to old eth0 if not set linkspeed=$(cat /sys/class/net/${SLX_PXE_NETIF:-eth0}/speed) -tmpstatus=$(grep -m1 ' /tmp ' /proc/mounts | awk '{print $3}') -if [ -z "$tmpstatus" ] || [ "$tmpstatus" = "tmpfs" ]; then + +# Detect if the system is backed by a disk +if slx-tools fs_path_isvolatile /tmp; then tmpstatus="RAMDISK" else tmpstatus="HDD" fi -tmpstatus="$(df -P | grep -m1 ' /tmp$' | awk '{printf "%.1f", $2 / 1024 / 1024}')GiB ($tmpstatus)" +tmpstatus="$(slx-tools fs_path_space /tmp | awk '{printf "%.1f", $2 / 1024 / 1024}')GiB ($tmpstatus)" cat >> "$TMPFILE" <