From ffbb24eec81c92f2ef605cadaaed3e91790a2a75 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Fri, 19 Mar 2004 14:03:14 +0000 Subject: add Olivier Blin fixes to handle symbolic links into detec-resolution --- scripts/detect-resolution | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/detect-resolution b/scripts/detect-resolution index 7087665..3021f95 100755 --- a/scripts/detect-resolution +++ b/scripts/detect-resolution @@ -13,7 +13,7 @@ use strict; my (%main, %entry, $vga, $initrd); if ($ARGV[0]) { - $initrd = $ARGV[0]; + $initrd = -l $ARGV[0] ? readlink($ARGV[0]) : $ARGV[0]; $initrd =~ s,.*/,, } else { $vga = detect_from_cmdline(cat_('/proc/cmdline')); @@ -65,6 +65,7 @@ sub parse_grub_conf { $entry{$title}{vga} = $vga if ($title and $vga); } if (m,initrd\s+\(.*\)(?:.*/)?([^\s]+),){ + #- TODO: support links $entry{$title}{initrd} = $1; $main{initrd}{$1} = $entry{$title}{vga} } @@ -83,7 +84,10 @@ sub parse_lilo_conf { $main{vga} = $1 if m/^vga=(.*)/; $vga = $1 if /vga=(.*)/; $label = remove_quotes($1) if /label=(.*)/; - $loc_initrd = $1 if m,initrd=(?:.*/)?(.*),; + if (/initrd=(.*)/) { + $loc_initrd = -l $1 ? readlink($1) : $1; + $loc_initrd =~ s,.*/,,; + } $entry{$label}{vga} = $vga if ($label && $vga); if (/image/) { if ($loc_initrd && $label && $vga) { -- cgit v1.2.1