diff options
author | wiktor w brodlo <wiktor@brodlo.net> | 2011-06-09 21:10:07 +0000 |
---|---|---|
committer | wiktor w brodlo <wiktor@brodlo.net> | 2011-06-09 21:10:07 +0000 |
commit | efeb38a7c1235e045e0421a207e9ef19d61bd0c2 (patch) | |
tree | 623edb1f189c27f24d2396d25699450b1a3c55fb /app-misc/sabayonlive-tools/files/2.3/vga-cmd-parser | |
parent | Deps and anaconda, imported from Sabayon (diff) | |
download | anaconda-overlay-efeb38a7c1235e045e0421a207e9ef19d61bd0c2.tar.gz anaconda-overlay-efeb38a7c1235e045e0421a207e9ef19d61bd0c2.tar.bz2 anaconda-overlay-efeb38a7c1235e045e0421a207e9ef19d61bd0c2.zip |
Fixed categories
Diffstat (limited to 'app-misc/sabayonlive-tools/files/2.3/vga-cmd-parser')
-rw-r--r-- | app-misc/sabayonlive-tools/files/2.3/vga-cmd-parser | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/app-misc/sabayonlive-tools/files/2.3/vga-cmd-parser b/app-misc/sabayonlive-tools/files/2.3/vga-cmd-parser new file mode 100644 index 0000000..1e44317 --- /dev/null +++ b/app-misc/sabayonlive-tools/files/2.3/vga-cmd-parser @@ -0,0 +1,53 @@ +#!/usr/bin/python +# Copyright 2008 Fabio Erculiani, Sabayon Linux Chief Architect +# parses vga= parameters from cmdline given by isolinux and returns the right resolution +# Shut up! + +res_map = { + "0x385": ("640x400",24), + "0x312": ("640x480",24), + "0x315": ("800x600",24), + "0x318": ("1024x768",24), + "0x31b": ("1280x1024",24), + "0x330": ("640x400",16), + "0x33E": ("640x400",24), + "0x331": ("640x480",16), + "0x33F": ("640x480",24), + "0x332": ("800x600",16), + "0x340": ("800x600",24), + "0x333": ("1024x768",16), + "0x341": ("1024x768",24), + "0x334": ("1152x864",16), + "0x342": ("1152x864",24), + "0x335": ("1280x960",16), + "0x343": ("1280x960",24), + "0x336": ("1280x1024",16), + "0x344": ("1280x1024",24), + "0x337": ("1400x1050",16), + "0x345": ("1400x1050",24), + "0x338": ("1600x1200",16), + "0x346": ("1600x1200",24), + "0x339": ("1792x1344",16), + "0x347": ("1792x1344",24), + "0x33A": ("1856x1392",16), + "0x348": ("1856x1392",24), + "0x33B": ("1920x1440",16), + "0x349": ("1920x1440",24), + "0x33C": ("2048x1536",16), + "0x34A": ("2048x1536",24) +} + +f = open("/proc/cmdline") +cmdline = f.readline().strip().split() +cmdline.reverse() +for item in cmdline: + if item.startswith("vga="): + item_split = item.split("=") + if len(item_split) == 2: + data = item_split[1] + try: + if res_map.get(data) != None: + print res_map[data][0],res_map[data][1] + break + except TypeError: + pass |