Bug 22115 - Grub2 als Standard-Bootloader
Grub2 als Standard-Bootloader
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Grub
UCS 2.4
Other Linux
: P5 normal (vote)
: UCS 3.0 - MS2
Assigned To: Moritz Muehlenhoff
Janek Walkenhorst
:
Depends on:
Blocks: 23405 29639
  Show dependency treegraph
 
Reported: 2011-04-05 16:38 CEST by Moritz Muehlenhoff
Modified: 2012-12-07 13:03 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
updater.log (2.21 MB, text/plain)
2011-10-24 09:56 CEST, Stefan Gohmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Muehlenhoff univentionstaff 2011-04-05 16:38:15 CEST
Standard-Bootloader sollte Grub2 sein, grub1 wird weiterhin unterstützt.

univention-grub muss angepasst werden (oder ggf. ein univention-grub2-Paket muss man prüfen.
Comment 1 Moritz Muehlenhoff univentionstaff 2011-04-05 16:38:55 CEST
Ich habe dazu auch 
https://hutten.knut.univention.de/mediawiki/index.php/UCS-3.0-Bootloader angelegt.
Comment 2 Moritz Muehlenhoff univentionstaff 2011-04-27 09:53:12 CEST
Mit dem Wechsel auf grub2 sollten auch GPT-Partitionen unterstützt sein, siehe 
Bug 22312.
Comment 3 Stefan Gohmann univentionstaff 2011-05-26 10:56:22 CEST
Für einen Kunden ist das Paket univention-grub2 entstanden (SVN r24482).

Das macht grub2 direkt zum Standard. Die Integration in UCR ist noch nicht vollständig.
Comment 4 Moritz Muehlenhoff univentionstaff 2011-07-20 16:41:45 CEST
Die Konfigurationsdateien haben sich wie folgt geändert (die /boot/grub/menu.list wird nur noch ausgelesen, wenn Chainloading Grub1 -> Grub2 eingerichtet ist):

/boot/grub/grub.cfg ist die zentrale Konfigurations-Datei, sie wird allerdings nicht direkt editiert, sondern aus den unten aufgeführten Dateien "zusammengebaut":

/etc/default/grub -> Hier werden zentrale Einstellungen wie der grub-Timeout vorgenommen. Diese Datei wird durch ein UCR-Template gepflegt werden.

/etc/grub.d/ -> Hier liegen (ausführbare!) Shell-Skripte, deren stdout ebenfalls in die /boot/grub/grub.cfg beschrieben wird. Die Reihenfolge lässt sich durch zwei Ziffern festlegen. Hier werden beispielsweise die menutitle-Einträge angelegt. Hier würden sich dann z.B. auch unsere Bootsplash-Skripte integrieren.

Beim Update wird Grub so konfiguriert, dass aus grub1 direkt grub2 gestartet wird. Der Administrator kann dann nach erfolgter Installation den Bootloader so konfigurieren, dass direkt grub2 gestartet wird.
Comment 5 Stefan Gohmann univentionstaff 2011-08-02 14:35:44 CEST
Während der Installation wird die folgende Fehlermeldung mehrfach angezeigt:

cat: /boot/grub/video.lst: No such file or directory


Setting up univention-grub (5.0.0-3.51.201107211342) ...
File: /boot/grub/menu.lst
Generating grub.cfg ...
cat: /boot/grub/video.lst: No such file or directory
Found linux image: /boot/vmlinuz-2.6.32-ucs38-686
Found initrd image: /boot/initrd.img-2.6.32-ucs38-686
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
done
Comment 6 Stefan Gohmann univentionstaff 2011-08-03 14:45:56 CEST
Grub2 wird installiert, der Rest kann für MS2 erfolgen.
Comment 7 Stefan Gohmann univentionstaff 2011-08-10 16:20:13 CEST
(In reply to comment #6)
> Grub2 wird installiert, der Rest kann für MS2 erfolgen.

Das reicht derzeit noch nicht. Nach dem Update ist die menu.lst leer bzw. enthält keine Kernel.

In UCS 2.x ist die menu.lst ein Template. Sobald das Template neu geschrieben wird, so wird update-grub aufgerufen, damit die Kernel automatisch eingetragen werden. update-grub in aus grub2 schreibt aber nur noch die neue Konfiguration grub.cfg.

root@qamaster:~# ucr commit /boot/grub/menu.lst
File: /boot/grub/menu.lst
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-ucs47-686-bigmem
Found initrd image: /boot/initrd.img-2.6.32-ucs47-686-bigmem
Found linux image: /boot/vmlinuz-2.6.32-ucs37-686-bigmem
Found initrd image: /boot/initrd.img-2.6.32-ucs37-686-bigmem
Found linux image: /boot/vmlinuz-2.6.32-ucs21-686-bigmem
Found initrd image: /boot/initrd.img-2.6.32-ucs21-686-bigmem
Found linux image: /boot/vmlinuz-2.6.32-ucs11-686-bigmem
Found initrd image: /boot/initrd.img-2.6.32-ucs11-686-bigmem
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
done
root@qamaster:~# cat /boot/grub/menu.lst
# Warning: This file is auto-generated and might be overwritten by
#          univention-config-registry.
#          Please edit the following file instead:
# Warnung: Diese Datei wurde automatisch generiert und kann durch
#          univention-config-registry überschrieben werden.
#          Bitte bearbeiten Sie an Stelle dessen die folgende Datei:
#
#       /etc/univention/templates/files/boot/grub/menu.lst
#

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default         0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout         5

# splash image


# Pretty colours
foreground = FFFFFF
background = 000000

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/mapper/vg_ucs-rootfs ro root2fstype=ext3  splash=silent


## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)


## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions= vga=791 loglevel=0


## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0 fbcon=map:2 nosplash

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(single-user mode) single nosplash

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

### END DEBIAN AUTOMAGIC KERNELS LIST

# title         Other OS
# root          (hd0,0)
# makeactive
# chainloader   +1
root@qamaster:~#

Vermutlich wird es das beste sein, im preup.sh das Template zu de-registrieren, damit sollte es dann nicht mehr überschrieben werden.
Comment 8 Moritz Muehlenhoff univentionstaff 2011-09-07 15:57:43 CEST
Die Integration von Grub 2 ist soweit umgesetzt, ein paar Tests stehen aber noch aus:

Bei einer Neuinstallation wird vom Installer direkt Grub 2 in den Bootloader geschrieben.

Bei einem Update bleibt Grub 1 im MBR installiert. Im Preinst wird dabei das alte UCR-Template deregistriert. Grub 2 richtet bei Vorhandensein einer /boot/grub/menu.lst einen Eintrag "Chainload into Grub" ein, der dann das eigentliche Grub-Menü mitbringt.

Durch Aufruf von upgrade-from-grub-legacy kann dann auch bei aktualsierten Systemen Grub 2 direkt in den MBR geschrieben werden. Das hat in meinen Tests gut funktioniert, wir brauchen aber vorr. einen SDB-Artikel, da einige der Debconf-Fragen nicht ganz offensichtlich sind. Dazu habe ich Bug 23544 angelegt.

Wenn die Systeme schon von UCS 1.x aktualisiert wurden, werden eventuell vorhandene lilo-UCR-Variablen entfernt.

Einige UCR-Variablen sind nicht mehr in Verwendung: grub/root, grub/boot und grub/groot. Grub 2 liest hier direkt die Festplatten- und Partitionsdaten aus. Die Variablen werden aber vorerst nicht per ucr unset entfernt.

grub/vga wird nicht mehr supported und per unset entfernt. Die neue Variable für Grub 2 heist grub/gfxmode und wird im Postinst per Default auf 1024x768 gesetzt.

Die Variable grub/memtest86 wurde entfernt. memtest86+ wird jetzt immer das in Grub-Menü integriert.

Der Splashscreen von Grub 1 wurde wg. Bug 23540 entfernt. Für die Integration eines Grub-Designs gibt es Bug 23405.

Die Konfiguration von Grub2 erfolgt zweistufig:

/boot/grub/grub.cfg ist die zentrale Konfigurations-Datei, sie wird allerdings
nicht direkt editiert, sondern aus den unten aufgeführten Dateien durch update-grub "zusammengebaut":

/etc/default/grub -> Hier werden zentrale Einstellungen wie der grub-Timeout
vorgenommen. Dieses Template wurde so angepasst, dass dort die UCR-Variablen
grub/timeout, grub/append, grub/xenhopt, grub/quiet, grub/loglevel und grub/gfxmode ausgewertet werden.

/etc/grub.d/ -> Hier liegen ausführbare! Shell-Skripte, deren stdout
ebenfalls in die /boot/grub/grub.cfg beschrieben wird. Die Reihenfolge lässt
sich durch zwei Ziffern festlegen. Hier werden beispielsweise die
menutitle-Einträge angelegt. Hiuer können sich auch Dritt-Pakete, Bootsplash etc. integrieren.

Die UCR-Variablen-Beschreibungen wurden überarbeitet.

Die Doku-Anpassungen für 3.0 pflege ich noch ein.
Comment 9 Moritz Muehlenhoff univentionstaff 2011-09-08 10:57:25 CEST
(In reply to comment #5)
> Während der Installation wird die folgende Fehlermeldung mehrfach angezeigt:
> 
> cat: /boot/grub/video.lst: No such file or directory
> 
> 
> Setting up univention-grub (5.0.0-3.51.201107211342) ...
> File: /boot/grub/menu.lst
> Generating grub.cfg ...
> cat: /boot/grub/video.lst: No such file or directory
> Found linux image: /boot/vmlinuz-2.6.32-ucs38-686
> Found initrd image: /boot/initrd.img-2.6.32-ucs38-686
> Found memtest86+ image: /memtest86+.bin
> Found memtest86+ multiboot image: /memtest86+_multiboot.bin
> done

Das wurde mit einem Patch korrigiert.
Comment 10 Moritz Muehlenhoff univentionstaff 2011-09-08 18:05:37 CEST
Die neuen Grub-Optionen sind jetzt auch in der 3.0-Doku.

Ausserdem wurden univention-installer und univention-bootsplash angepasst, um keine überflüssigen UCR-Variablen mehr zu setzen.

Die Grub-Konfiguration wurde angepasst, so dass der Grafikmodus des Bootloaders an den Kernel weitergereicht wird. Das ist für den Bootsplash nötig.

Changelog:
\item The bootloader has been updated from Grub 1 to Grub 2. On newly
  installed systems, Grub 2 is chosen automatically. On systems being updated,
  Grub 1 is initially started and chainloads into Grub 2. If that works
  successfully, Grub can be installed directly into the MBR later by running
  the command upgrade-from-grub-legacy Some Univention Configuration Registry variables no longer apply to Grub 2. grub/root,
  grub/boot and grub/groot are no longer needed, since Grub parses
  partition and filesystem data on its own. These variables are kept for
  posterity, but no longer sourced in any templates. The memory test options
  are offered unconditionally and are no longer configured through the UCR
  variable grub/memtest86. UCR variables for lilo are being removed during the
  update. grub/vga is no longer used and has been replaced by grub/gfxmode.
  The configuration of Grub 2 is two-fold: /boot/grub/grub.cfg is the central
  config file, which is being combined from central setting in
  /etc/default/grub and the outpit of scripts below /etc/grub.d. (\ucsBug{22115}).
Comment 11 Moritz Muehlenhoff univentionstaff 2011-09-13 19:55:23 CEST
Zwei Anpassungen wurden noch vorgenommen:

- grub2 wurde gepatcht, so dass in der Kernel-Auswahl "Univention Corporate Server" angezeigt wird, vorher stand dort noch "GNU/Linux" am Ende.

- memtest86+ wurde gepatcht, so dass nur noch ein Memtest zur Auswahl steht und nicht vier Varianten.
Comment 12 Janek Walkenhorst univentionstaff 2011-09-27 17:14:13 CEST
(In reply to comment #11)
> Zwei Anpassungen wurden noch vorgenommen:
> 
> - grub2 wurde gepatcht, so dass in der Kernel-Auswahl "Univention Corporate
> Server" angezeigt wird, vorher stand dort noch "GNU/Linux" am Ende.
> 
> - memtest86+ wurde gepatcht, so dass nur noch ein Memtest zur Auswahl steht und
> nicht vier Varianten.
Stimmt
Comment 13 Janek Walkenhorst univentionstaff 2011-09-27 17:27:39 CEST
(In reply to comment #10)
> Ausserdem wurden univention-installer und univention-bootsplash angepasst, um
> keine überflüssigen UCR-Variablen mehr zu setzen.
Die alten Variablen werden nicht mehr gesetzt.

> Die Grub-Konfiguration wurde angepasst, so dass der Grafikmodus des
> Bootloaders an den Kernel weitergereicht wird. Das ist für den
> Bootsplash nötig.
Bootsplash funktioniert.
Comment 14 Janek Walkenhorst univentionstaff 2011-10-04 12:26:03 CEST
(In reply to comment #10)
> Die neuen Grub-Optionen sind jetzt auch in der 3.0-Doku.
Vorhanden
> Changelog:
OK
Comment 15 Janek Walkenhorst univentionstaff 2011-10-04 12:26:57 CEST
(In reply to comment #9)
> (In reply to comment #5)
> > Während der Installation wird die folgende Fehlermeldung mehrfach angezeigt:
> > cat: /boot/grub/video.lst: No such file or directory
> Das wurde mit einem Patch korrigiert.
Tritt nicht mehr auf.
Comment 16 Janek Walkenhorst univentionstaff 2011-10-04 12:31:47 CEST
(In reply to comment #8)
> Bei einer Neuinstallation wird vom Installer direkt Grub 2 in den Bootloader
> geschrieben.
Stimmt, funktioniert

> Bei einem Update bleibt Grub 1 im MBR installiert. Im Preinst wird dabei das
> alte UCR-Template deregistriert. Grub 2 richtet bei Vorhandensein einer
> /boot/grub/menu.lst einen Eintrag "Chainload into Grub" ein, der dann das
> eigentliche Grub-Menü mitbringt.
Stimmt, funktioniert

> Durch Aufruf von upgrade-from-grub-legacy kann dann auch bei aktualsierten
> Systemen Grub 2 direkt in den MBR geschrieben werden. Das hat in meinen Tests
> gut funktioniert, wir brauchen aber vorr. einen SDB-Artikel, da einige der
> Debconf-Fragen nicht ganz offensichtlich sind. Dazu habe ich Bug 23544
> angelegt.
Bug existiert.

> Wenn die Systeme schon von UCS 1.x aktualisiert wurden, werden eventuell
> vorhandene lilo-UCR-Variablen entfernt.
Funktioniert.

> Einige UCR-Variablen sind nicht mehr in Verwendung: grub/root, grub/boot und
> grub/groot. Grub 2 liest hier direkt die Festplatten- und Partitionsdaten aus.
> Die Variablen werden aber vorerst nicht per ucr unset entfernt.
Bleiben erhalten

> grub/vga wird nicht mehr supported und per unset entfernt. Die neue Variable
> für Grub 2 heist grub/gfxmode und wird im Postinst per Default auf 1024x768
> gesetzt.
Wird entfernt/gesetzt

> Die Variable grub/memtest86 wurde entfernt. memtest86+ wird jetzt immer das in
> Grub-Menü integriert.
Wird entfernt, ist vorhanden

> Der Splashscreen von Grub 1 wurde wg. Bug 23540 entfernt. Für die Integration
> eines Grub-Designs gibt es Bug 23405.
OK

> /etc/default/grub -> Hier werden zentrale Einstellungen wie der grub-Timeout
> vorgenommen. Dieses Template wurde so angepasst, dass dort die UCR-Variablen
> grub/timeout, grub/append, grub/xenhopt, grub/quiet, grub/loglevel und
> grub/gfxmode ausgewertet werden.
UCRV werden ausgewertet.

> Die UCR-Variablen-Beschreibungen wurden überarbeitet.
Sind OK
Comment 17 Stefan Gohmann univentionstaff 2011-10-24 09:56:21 CEST
Nach dem Update von 2.4-4 auf 3.0 bekomme ich nur eine Grub Shell.
Comment 18 Stefan Gohmann univentionstaff 2011-10-24 09:56:46 CEST
Created attachment 3673 [details]
updater.log
Comment 19 Stefan Gohmann univentionstaff 2011-10-25 06:18:40 CEST
Ich habe auf boksel eine VM, für die ich einen Snapshot nach dem UCS 3.0 Update und vor dem ersten Boot erstellt habe:
 stefan_Master-2.4-4-18.1 20111025-0614-updated-3.0
Comment 20 Moritz Muehlenhoff univentionstaff 2011-10-25 10:33:56 CEST
(In reply to comment #17)
> Nach dem Update von 2.4-4 auf 3.0 bekomme ich nur eine Grub Shell.

Die betroffene VM wurde ursprünglich mit Vmware installiert und dann auf KVM migriert. Dadurch hatte sich der Name des Boot-Devices geändert (von /dev/sda auf /dev/vda), die UCR-Variable zeigte aber noch auf /dev/vda.

Ich habe eine zusätzliche Konsistenzprüfung in das Preup integriert, die das Update abbricht, wenn der Inhalt von grub/boot nicht in /proc/partitions auftaucht.
Comment 21 Janek Walkenhorst univentionstaff 2011-11-03 17:40:15 CET
(In reply to comment #20)
> (In reply to comment #17)
> > Nach dem Update von 2.4-4 auf 3.0 bekomme ich nur eine Grub Shell.
> 
> Die betroffene VM wurde ursprünglich mit Vmware installiert und dann auf KVM
> migriert. Dadurch hatte sich der Name des Boot-Devices geändert (von /dev/sda
> auf /dev/vda), die UCR-Variable zeigte aber noch auf /dev/vda.
> 
> Ich habe eine zusätzliche Konsistenzprüfung in das Preup integriert, die das
> Update abbricht, wenn der Inhalt von grub/boot nicht in /proc/partitions
> auftaucht.
Die Prüfung funktioniert. Nach Umstellen um die Prüfung zu umgehen funktioniert auch der Reboot nach dem Update.
Comment 22 Sönke Schwardt-Krummrich univentionstaff 2011-12-13 15:51:24 CET
UCS 3.0-0 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte dieser Bug dupliziert
werden: "Clone This Bug"