summaryrefslogtreecommitdiffstats
path: root/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2016-08-26 10:32:56 +0000
committerramon <ramongomez@us.es>2016-08-26 10:32:56 +0000
commit36919af0f19e74901c2916346171b7af98ebd4f4 (patch)
tree20617ed228bd0c5c319cde720211ce4868d7a5f1 /client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
parent0d9c5e1131e21a27a5b64d63a57cf23af72ea612 (diff)
#724: Adaptación de ogLive basado en Ubuntu 16.04:
* Actualizar lista de módulos de vídeo que no deben cargarse y cargar módulo de ratón USB. * Mostrar resolución de pantalla y driver por defecto, si solo hay una opción disponible. * Soportar resolución por defecto para módulo uvesafb ({{{video=uvesafb:D}}}). git-svn-id: https://opengnsys.es/svn/branches/version1.1@4999 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions')
-rw-r--r--client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions36
1 files changed, 19 insertions, 17 deletions
diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
index 0c2ffb94..1175c7c3 100644
--- a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
+++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
@@ -82,26 +82,28 @@ ogChangeVideoResolution ()
{
# Variables locales.
local DRIVER MODE
-# Obtener driver y resolución.
-DRIVER="$(echo $video|cut -f1 -d:)"
-MODE="$(echo $video|cut -f2 -d:)"
-case "$DRIVER" in
- # Cambiar resolución para driver "uvesafb".
- uvesafb)
- # Mantener resolución por defecto si solo hay una opción disponible.
- if [ $(awk 'END {print NR}' /sys/class/graphics/fb0/modes) -eq 1 ]; then
- echo "Default screen mode: $(awk -F"[:-]" '{print $2}' /sys/class/graphics/fb0/modes),$(cat /sys/class/graphics/fb0/bits_per_pixel)bpp."
- else
+# Mostrar resolución y driver por defecto si solo hay una opción disponible.
+if [ $(grep -c "" /sys/class/graphics/fb0/modes) -eq 1 ]; then
+ echo "Default screen mode: $(cat /sys/class/graphics/fb0/modes),$(cat /sys/class/graphics/fb0/bits_per_pixel)bpp$(lsmod|awk '$1=="video" && $3>0 {printf " (%s)",$4}')."
+else
+ # Obtener driver y resolución.
+ DRIVER="$(echo $video|cut -f1 -d:)"
+ MODE="$(echo $video|cut -f2 -d:)"
+ case "$DRIVER" in
+ # Cambiar resolución para driver "uvesafb".
+ uvesafb)
+ # Obtener modo por defecto si parámetro "video=uvesafb:D".
+ [ "$MODE" == "D" ] && MODE=$(awk -F: '$1=="D" {print $2; nextfile}' /sys/class/graphics/fb0/modes)
# Cambiar resolución según valor del parámetro "video".
- grep ":$(echo $MODE|cut -f1 -d-)p" /sys/class/graphics/fb0/modes | head -1 > /sys/class/graphics/fb0/mode 2>&1 || MODE="640x480-16"
+ grep ":$(echo ${MODE/p/}|cut -f1 -d-)p" /sys/class/graphics/fb0/modes | head -1 > /sys/class/graphics/fb0/mode 2>&1
echo "$(echo $MODE|cut -f2 -d-)" > /sys/class/graphics/fb0/bits_per_pixel 2>&1
echo "Screen mode: $(cat /sys/class/graphics/fb0/mode),$(cat /sys/class/graphics/fb0/bits_per_pixel)bpp."
- fi
- ;;
- # Resolución por defecto para el resto de casos.
- *) echo "Unknown video driver, using default mode."
- ;;
-esac
+ ;;
+ # Resolución por defecto para el resto de casos.
+ *) echo "Unknown video driver, using default mode."
+ ;;
+ esac
+fi
}