From 0592128b1ea72ad47f4a89ded659b6a751126d11 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 21 Jul 2009 17:23:26 +0200 Subject: [PATCH] dracut-gencmdline: output root device and plymouth theme --- dracut-gencmdline | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/dracut-gencmdline b/dracut-gencmdline index 15c3c94..1b3b3c5 100755 --- a/dracut-gencmdline +++ b/dracut-gencmdline @@ -143,7 +143,7 @@ resolve_device_name() { # echo "resolve_device_name $1" 1>&2 } -readlink() { +freadlink() { /usr/bin/readlink -f "$1" } @@ -183,11 +183,11 @@ finddevicedriverinsys () { } findstoragedriverinsys () { - local sysfs=$(readlink "$1") + local sysfs=$(freadlink "$1") # if its a partition look at the device holding the partition if [ -f "$sysfs/start" ]; then - sysfs=$(readlink ${sysfs%/*}) + sysfs=$(freadlink ${sysfs%/*}) fi if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then @@ -216,7 +216,7 @@ findstoragedriverinsys () { done if [ -L "$sysfs/device" ]; then - qpushd $(readlink "$sysfs/device") + qpushd $(freadlink "$sysfs/device") finddevicedriverinsys qpopd fi @@ -675,10 +675,26 @@ done . /etc/sysconfig/keyboard . /etc/sysconfig/i18n -for i in KEYBOARDTYPE KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do +for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do val=$(eval echo \$$i) [[ $val ]] && echo -n "$i=$val " done +if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then + echo -n "KEYBOARDTYPE=$KEYBOARDTYPE " +fi + +if [ -n "$rootdev" ]; then + echo -n "root=$rootdev " +fi + +if [ -L /usr/share/plymouth/themes/default.plymouth ]; then + theme=$(basename \ + $(dirname \ + $(readlink -f \ + /usr/share/plymouth/themes/default.plymouth))) + [ -n "$theme" ] && echo -n "rd_plytheme=$theme " +fi + echo # vim:ts=8:sw=4:sts=4:et -- 2.7.4