aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/detect-resolution
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/detect-resolution')
-rwxr-xr-xscripts/detect-resolution8
1 files changed, 6 insertions, 2 deletions
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) {