From a06daa30bd9784d45329c811b3cec80fb71becb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9meth=20Ott=C3=B3?= Date: Thu, 24 Oct 2019 19:57:31 +0200 Subject: [PATCH] various changes --- grub/files/usr/lib/os-prober/newns | 0 grub/files/usr/lib/os-probes/mounted/05efi | 4 +-- scripts/_screen.sh | 2 +- scripts/_thermal.sh | 4 +-- scripts/fsckall | 2 +- scripts/lsdrmmods | 11 +------ scripts/lsfbcaps | 53 ++++++++++++------------------ scripts/mountall | 2 +- 8 files changed, 29 insertions(+), 49 deletions(-) create mode 100755 grub/files/usr/lib/os-prober/newns rewrite scripts/lsfbcaps (68%) diff --git a/grub/files/usr/lib/os-prober/newns b/grub/files/usr/lib/os-prober/newns new file mode 100755 index 0000000..e69de29 diff --git a/grub/files/usr/lib/os-probes/mounted/05efi b/grub/files/usr/lib/os-probes/mounted/05efi index 93309ce..fcf3697 100755 --- a/grub/files/usr/lib/os-probes/mounted/05efi +++ b/grub/files/usr/lib/os-probes/mounted/05efi @@ -39,9 +39,9 @@ if type udevinfo > /dev/null 2>&1; then debug "$partition partition type is $ID_PART_ENTRY_TYPE" if [ -z "$ID_PART_ENTRY_TYPE" -o -z "$ID_PART_ENTRY_SCHEME" -o \ - \( "$ID_PART_ENTRY_SCHEME" != gpt -a "$ID_PART_ENTRY_SCHEME" != msdos \) -o \ + \( "$ID_PART_ENTRY_SCHEME" != gpt -a "$ID_PART_ENTRY_SCHEME" != dos \) -o \ \( "$ID_PART_ENTRY_SCHEME" = gpt -a "$ID_PART_ENTRY_TYPE" != c12a7328-f81f-11d2-ba4b-00a0c93ec93b \) -o \ - \( "$ID_PART_ENTRY_SCHEME" = msdos -a "$ID_PART_ENTRY_TYPE" != 0xef \) ]; then + \( "$ID_PART_ENTRY_SCHEME" = dos -a "$ID_PART_ENTRY_TYPE" != 0xef \) ]; then debug "$partition is not a ESP partition: exiting" exit 1 fi diff --git a/scripts/_screen.sh b/scripts/_screen.sh index 59b38aa..81d8e45 100644 --- a/scripts/_screen.sh +++ b/scripts/_screen.sh @@ -1,2 +1,2 @@ -[ -z "$1" ] && echo "Add user" && exit 1 +[ -z "$1" ] && echo "Add username as parameter" && exit 1 openvt -c 8 -s -- sudo -u $1 -- screen sh -c 'cd; exec bash -l' diff --git a/scripts/_thermal.sh b/scripts/_thermal.sh index be8f49f..3304612 100644 --- a/scripts/_thermal.sh +++ b/scripts/_thermal.sh @@ -1,9 +1,9 @@ -thermal="/sys/class/hwmon/hwmon0/temp1_input" +thermal=`ls /sys/class/hwmon/*/temp1_input 2> /dev/null | head -n 1` if [ -e $thermal ]; then therm=$(cat $thermal) temp=$(echo "scale=1; $therm/1000" | bc) fi if [ -n "$temp" ]; then cpu="[${temp}°C]" + echo "$cpu" fi -echo "$cpu" diff --git a/scripts/fsckall b/scripts/fsckall index 0775405..4d4db07 100755 --- a/scripts/fsckall +++ b/scripts/fsckall @@ -18,7 +18,7 @@ lsdev | \ while read dev; do type=`blkid -o udev -s TYPE -p /dev/$dev` if [ ! -z "$type" ]; then - grep -qw "^/dev/$dev" /proc/mounts && continue + grep -q "^/dev/$dev " /proc/mounts && continue eval $type validfs $ID_FS_TYPE || continue case "$ID_FS_TYPE" in diff --git a/scripts/lsdrmmods b/scripts/lsdrmmods index 9536c68..be7e36d 100755 --- a/scripts/lsdrmmods +++ b/scripts/lsdrmmods @@ -5,11 +5,6 @@ listmods() find /lib/modules/$LINVER/kernel/drivers/gpu/drm -mindepth 2 -type f -name "*.ko" 2> /dev/null | sed -e 's%.*/%%' -e 's/\.ko$//' | sort } -listmods_gz() -{ -find /lib/modules/$LINVER/kernel/drivers/gpu/drm -mindepth 2 -type f -name "*.ko.gz" 2> /dev/null | sed -e 's%.*/%%' -e 's/\.ko\.gz$//' | sort -} - procmods() { while read MOD; do @@ -23,8 +18,4 @@ LINVER="$1" [ -z "$LINVER" ] && LINVER=`uname -r` [ ! -d /lib/modules/$LINVER ] && exit 1 -module=`head -n 1 /lib/modules/$LINVER/modules.dep | cut -d : -f 1` - -[ "$(echo "$module" | sed 's/\.gz$//')" != "$module" ] && gz=1 - -[ $gz ] && listmods_gz | procmods || listmods | procmods +listmods | procmods diff --git a/scripts/lsfbcaps b/scripts/lsfbcaps dissimilarity index 68% index 69a5f10..251f8c6 100755 --- a/scripts/lsfbcaps +++ b/scripts/lsfbcaps @@ -1,32 +1,21 @@ -#! /bin/bash - -listmods() -{ -(find /lib/modules/$LINVER/kernel/drivers/staging -type f -name "*fb.ko" -path "*fb/*"; \ -find /lib/modules/$LINVER/kernel/drivers/video -type f -name "*.ko" ! -path "*/backlight/*") 2> /dev/null | sed -e 's%.*/%%' -e 's/\.ko$//' | sort -} - -listmods_gz() -{ -(find /lib/modules/$LINVER/kernel/drivers/staging -type f -name "*fb.ko.gz" -path "*fb/*"; \ -find /lib/modules/$LINVER/kernel/drivers/video -type f -name "*.ko.gz" ! -path "*/backlight/*") 2> /dev/null | sed -e 's%.*/%%' -e 's/\.ko\.gz$//' | sort -} - -procmods() -{ -while read MOD; do - if modinfo -k $LINVER $MOD | grep -q "^alias:"; then - modinfo -k $LINVER $MOD | grep -q "^parm:[[:space:]]*mode_option" && echo "$MOD*" || echo "$MOD" - fi -done -} - -LINVER="$1" -[ -z "$LINVER" ] && LINVER=`uname -r` -[ ! -d /lib/modules/$LINVER ] && exit 1 - -module=`head -n 1 /lib/modules/$LINVER/modules.dep | cut -d : -f 1` - -[ "$(echo "$module" | sed 's/\.gz$//')" != "$module" ] && gz=1 - -[ $gz ] && listmods_gz | procmods || listmods | procmods +#! /bin/bash + +listmods() +{ +(find /lib/modules/$LINVER/kernel/drivers/video/fbdev -type f -name "*.ko") 2> /dev/null | sed -e 's%.*/%%' -e 's/\.ko$//' | sort +} + +procmods() +{ +while read MOD; do + if modinfo -k $LINVER $MOD | grep -q "^alias:"; then + modinfo -k $LINVER $MOD | grep -q "^parm:[[:space:]]*mode_option" && echo "$MOD*" || echo "$MOD" + fi +done +} + +LINVER="$1" +[ -z "$LINVER" ] && LINVER=`uname -r` +[ ! -d /lib/modules/$LINVER ] && exit 1 + +listmods | procmods diff --git a/scripts/mountall b/scripts/mountall index b306b95..43a7e1c 100755 --- a/scripts/mountall +++ b/scripts/mountall @@ -27,7 +27,7 @@ fi DEVS=`find /sys/devices -path "*/block/*" \( -name "sd*" -o -name "ub*" -o -name "hd*" -o -name "mmcblk*" \) | sed "s%.*/%%"` -kpartx=`ls /dev/mapper/loop?p?* | sed "s%^/dev/%%"` +kpartx=`ls /dev/mapper/loop?p?* 2> /dev/null | sed "s%^/dev/%%"` lsdevs() -- 2.11.4.GIT