--- grub2-1.98.orig/configure.ac +++ grub2-1.98/configure.ac @@ -31,7 +31,7 @@ dnl type. -AC_INIT([GRUB],[1.98],[bug-grub@gnu.org]) +AC_INIT([GRUB],[0],[bug-grub@gnu.org]) dnl version is filled by debian/rules AM_INIT_AUTOMAKE() AC_PREREQ(2.60) AC_CONFIG_SRCDIR([include/grub/dl.h]) --- grub2-1.98.orig/util/hostdisk.c +++ grub2-1.98/util/hostdisk.c @@ -715,7 +715,7 @@ char *bsd_part_str = NULL; if (dos_part >= 0) - dos_part_str = xasprintf (",%d", dos_part + 1); + dos_part_str = xasprintf (",%d", dos_part + (getenv ("GRUB_LEGACY_0_BASED_PARTITIONS") ? 0 : 1)); if (bsd_part >= 0) bsd_part_str = xasprintf (",%c", dos_part + 'a'); --- grub2-1.98.orig/po/it.po +++ grub2-1.98/po/it.po @@ -20,7 +20,7 @@ msgstr "" "Project-Id-Version: grub-1.97+20091221\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-01-05 19:28+0100\n" "Last-Translator: Milo Casagrande \n" "Language-Team: Italian \n" @@ -1026,7 +1026,7 @@ msgid "core image is too big (%p > %p)" msgstr "L'immagine core è troppo grande (%p > %p)\n" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, fuzzy, c-format msgid "Try `%s --help' for more information.\n" msgstr "Usare \"%s --help\" per ulteriori informazioni.\n" @@ -1075,44 +1075,44 @@ msgid "cannot open %s" msgstr "impossibile aprire %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 #, fuzzy msgid "the first sector of the core file is not sector-aligned" msgstr "Il primo settore del file core non è allineato rispetto al settore" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 #, fuzzy msgid "non-sector-aligned data is found in the core file" msgstr "Trovati dati non allineati rispetto al settore nel file core" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 #, fuzzy msgid "the sectors of the core file are too fragmented" msgstr "I settori del file core sono troppo frammentati" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, fuzzy, c-format msgid "the size of `%s' is not %u" msgstr "La dimensione di \"%s\" non è %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, fuzzy, c-format msgid "the size of `%s' is too small" msgstr "La dimensione di \"%s\" è troppo piccola" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, fuzzy, c-format msgid "the size of `%s' is too large" msgstr "La dimensione di \"%s\" è troppo grande" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, fuzzy, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "Impossibile identificare un file system in %s; non è possibile eseguire un " "controllo di sicurezza" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1125,19 +1125,19 @@ "DISTRUZIONE del file system se dati importanti vengono sovrascritti da grub-" "setup (--skip-fs-probe disabilita questo controllo, usare a proprio rischio)." -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 #, fuzzy msgid "no DOS-style partitions found" msgstr "Non sono state trovate partizioni in stile DOS" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Tentativo di installare GRUB su un disco privo di partizioni. Non è una " "buona idea." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1145,11 +1145,11 @@ "Tentativo di installare GRUB in una partizione invece che nel MBR. Non è una " "buona idea." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Non sono state trovate partizioni in stile DOS" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1157,7 +1157,7 @@ "L'etichetta della partizione in stile MS-DOS non presenta uno spazio dopo " "l'MBR; l'embed non sarà possibile." -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1165,19 +1165,19 @@ "L'etichetta della partizione GPT non presenta una BIOS Boot Partition; " "l'embed non sarà possibile." -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "L'immagine core.img è troppo grande. Non può essere contenuta nell'area di " "embed." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "L'area di embed è troppo piccola. L'immagine core.img non può esservi " "contenuta." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 #, fuzzy msgid "" "embedding is not possible, but this is required when the root device is on a " @@ -1186,7 +1186,7 @@ "L'embed non è possibile, ma è richiesto quando il dispositivo di root si " "trova su un array RAID o un volume LVM." -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1196,47 +1196,47 @@ "configurazione solo usando blocklist. Le blocklist non sono comunque " "affidabili e ne viene sconsigliato l'uso." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 #, fuzzy msgid "if you really want blocklists, use --force" msgstr "Per utilizzare le blocklist, usare --force." -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "tentativo di leggere l'immagine core \"%s\" da GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "tentativo di leggere nuovamente l'immagine core \"%s\" da GRUB" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, fuzzy, c-format msgid "cannot read `%s' correctly" msgstr "Impossibile leggere \"%s\" correttamente" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 #, fuzzy msgid "no terminator in the core image" msgstr "Nessun terminatore nell'immagine core" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 #, fuzzy msgid "failed to read the first sector of the core image" msgstr "Lettura del primo settore dell'immagine core non riuscita" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 #, fuzzy msgid "failed to read the rest sectors of the core image" msgstr "Lettura dei restanti settori dell'immagine core non riuscita" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, fuzzy, c-format msgid "cannot open `%s'" msgstr "Impossibile aprire \"%s\"" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, fuzzy, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1276,27 +1276,27 @@ "\n" "Segnalare i bug a <%s>.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Nessun device specificato.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Argomento aggiuntivo \"%s\" sconosciuto.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Device \"%s\" non valido.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, fuzzy, c-format msgid "invalid root device `%s'" msgstr "Device root \"%s\" non valido" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 #, fuzzy msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" @@ -1311,19 +1311,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "" -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, con Linux %s (modalità ripristino)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, con Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "" -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "" --- grub2-1.98.orig/po/nl.po +++ grub2-1.98/po/nl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub-1.97+20091122\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2009-12-12 19:15+0100\n" "Last-Translator: Erwin Poeze \n" "Language-Team: Dutch \n" @@ -985,7 +985,7 @@ msgid "core image is too big (%p > %p)" msgstr "Core-afbeelding is te groot (%p > %p)\n" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, fuzzy, c-format msgid "Try `%s --help' for more information.\n" msgstr "Gebruik ``%s --help'' voor meer informatie.\n" @@ -1034,44 +1034,44 @@ msgid "cannot open %s" msgstr "kan %s niet openen" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 #, fuzzy msgid "the first sector of the core file is not sector-aligned" msgstr "De eerste sector van het core-bestand is niet sector-uitgelijnd." -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 #, fuzzy msgid "non-sector-aligned data is found in the core file" msgstr "Niet-sector-uitgelijnde gegevens gevonden in het core-bestand" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 #, fuzzy msgid "the sectors of the core file are too fragmented" msgstr "De sectoren van het core-bestand zijn te gefragmenteerd" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, fuzzy, c-format msgid "the size of `%s' is not %u" msgstr "De grootte van `%s' is niet %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, fuzzy, c-format msgid "the size of `%s' is too small" msgstr "De grootte van `%s' is te klein" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, fuzzy, c-format msgid "the size of `%s' is too large" msgstr "De grootte van `%s' is te groot" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, fuzzy, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "Bestandssysteem in %s wordt niet herkend; veiligheidscontrole kan niet " "worden uitgevoerd" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1085,19 +1085,19 @@ "waardevolle gegevens worden overschreven door grub-setup (--skip-fs-probe " "schakelt deze controle uit, op uw eigen risico)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 #, fuzzy msgid "no DOS-style partitions found" msgstr "Geen DOS-achtige partities gevonden" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Poging om GRUB op een schijf zonder partitie te installeren. Dit is een " "SLECHT idee." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1105,11 +1105,11 @@ "Poging om GRUB in een partitie te installeren in plaats van de MBR. Dit is " "een SLECHT idee." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Geen DOS-achtige partities gevonden" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1117,7 +1117,7 @@ "Dit MSDOS-achtige partitielabel heeft geen ruimte na de MBR; inbedding is " "niet mogelijk!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1125,18 +1125,18 @@ "Dit GPT-partitielabel heeft geen BIOS opstartpartitie; inbedding is niet " "mogelijk!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "Uw core.img is ongebruikelijk groot. Het zal niet in de inbeddingsruimte " "passen." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "Uw inbeddingsruimte is ongebruikelijk klein. core.img zal er niet in passen." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 #, fuzzy msgid "" "embedding is not possible, but this is required when the root device is on a " @@ -1145,7 +1145,7 @@ "Inbedding is niet mogelijk, maar dit is wel vereist als het root-device op " "een RAID-array of LVM-volume staat." -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1155,47 +1155,47 @@ "geïnstalleerd met bloklijsten. Echter, bloklijsten zijn ONBETROUWBAAR en het " "gebruik ervan wordt ontraden." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 #, fuzzy msgid "if you really want blocklists, use --force" msgstr "Als u zeker bloklijsten wilt, gebruik dan --force. " -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "poging om de core-afbeelding `%s' uit GRUB te lezen" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "poging om de core-afbeelding `%s' uit GRUB opnieuw te lezen" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, fuzzy, c-format msgid "cannot read `%s' correctly" msgstr "Lezen `%s' niet correct" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 #, fuzzy msgid "no terminator in the core image" msgstr "De core-afbeelding bevat geen eindteken" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 #, fuzzy msgid "failed to read the first sector of the core image" msgstr "Lezen van de eerste sector van de core-afbeelding is mislukt" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 #, fuzzy msgid "failed to read the rest sectors of the core image" msgstr "Lezen van de overige sectoren van de core-afbeelding is mislukt" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, fuzzy, c-format msgid "cannot open `%s'" msgstr "Openen `%s' is mislukt" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, fuzzy, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1240,27 +1240,27 @@ "Programmafouten melden bij <%s>.\n" "Vertaalfouten melden bij .\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Geen apparaat opgegeven.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Extra argument `%s' is onbekend.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Ongeldig apparaat `%s'.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, fuzzy, c-format msgid "invalid root device `%s'" msgstr "Ongeldig root-apparaat `%s'" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 #, fuzzy msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "Kan het root-apparaat niet raden. Gebruik de optie ``--root-device''." @@ -1273,19 +1273,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "" -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, met Linux %s (herstelmodus)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, met Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "" -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "" --- grub2-1.98.orig/po/fr.po +++ grub2-1.98/po/fr.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub-1.97+20091122\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2009-12-22 21:32+0100\n" "Last-Translator: Nicolas Provost \n" "Language-Team: French \n" @@ -985,7 +985,7 @@ msgid "core image is too big (%p > %p)" msgstr "L'image principale (core) est trop grande (%p > %p)\n" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, fuzzy, c-format msgid "Try `%s --help' for more information.\n" msgstr "Essayez ``%s --help'' pour plus d'informations.\n" @@ -1033,44 +1033,44 @@ msgid "cannot open %s" msgstr "impossible d'ouvrir %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 #, fuzzy msgid "the first sector of the core file is not sector-aligned" msgstr "Le premier secteur du fichier noyau n'est pas aligné sur un secteur" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 #, fuzzy msgid "non-sector-aligned data is found in the core file" msgstr "Données non alignées sur des secteurs trouvées dans le fichier noyau" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 #, fuzzy msgid "the sectors of the core file are too fragmented" msgstr "Les secteurs du fichier noyau sont trop dispersés" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, fuzzy, c-format msgid "the size of `%s' is not %u" msgstr "La taille de `%s' n'est pas égale à %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, fuzzy, c-format msgid "the size of `%s' is too small" msgstr "La taille de `%s' est trop petite" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, fuzzy, c-format msgid "the size of `%s' is too large" msgstr "La taille de `%s' est trop large" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, fuzzy, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "Impossible d'identifier le système de fichiers sur %s; contrôle impossible à " "effectuer" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1084,18 +1084,18 @@ "l'installation de grub (--skip-fs-probe désactive ce contrôle, à utiliser à " "vos risques et périls)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 #, fuzzy msgid "no DOS-style partitions found" msgstr "Aucune partition de type DOS trouvée" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Tentative d'installation de GRUB sur un disque sans partition. Mauvaise idée." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1103,85 +1103,85 @@ "Tentative d'installation de GRUB sur une partition au lieu du MBR. Mauvaise " "idée." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Aucune partition de type DOS trouvée" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" msgstr "" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" msgstr "" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "Votre image noyau est inhabituellement grande. Elle ne tiendra pas dans " "l'aire dédiée." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" msgstr "" -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " "discouraged." msgstr "" -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "tentative de lecture de l'image noyau `%s' par GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "nouvelle tentative de lecture de l'image noyau `%s' par GRUB" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, fuzzy, c-format msgid "cannot read `%s' correctly" msgstr "Impossible de lire `%s' correctement" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 #, fuzzy msgid "no terminator in the core image" msgstr "Pas de terminateur dans l'image noyau" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 #, fuzzy msgid "failed to read the first sector of the core image" msgstr "Echec de lecture du premier secteur de l'image noyau" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 #, fuzzy msgid "failed to read the rest sectors of the core image" msgstr "Echec de lecture des secteurs restants de l'image noyau" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, fuzzy, c-format msgid "cannot open `%s'" msgstr "Impossible d'ouvrir `%s'" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, fuzzy, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1224,27 +1224,27 @@ "\n" "Report bugs to <%s>.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Aucun périphérique spécifié.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Argument superflu inconnu `%s'.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Périphérique non valide `%s'.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, fuzzy, c-format msgid "invalid root device `%s'" msgstr "Périphérique racine non valide `%s'" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 #, fuzzy msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" @@ -1259,19 +1259,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "" -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, avec Linux %s (mode de dépannage)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, avec Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "" -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "" --- grub2-1.98.orig/po/ca.po +++ grub2-1.98/po/ca.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: GNU GRUB\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2009-11-17 12:26+0100\n" "Last-Translator: Robert Millan \n" "Language-Team: None \n" @@ -982,7 +982,7 @@ msgid "core image is too big (%p > %p)" msgstr "" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, fuzzy, c-format msgid "Try `%s --help' for more information.\n" msgstr "Proveu «%s --help» per a obtenir més informació.\n" @@ -1014,39 +1014,39 @@ msgid "cannot open %s" msgstr "" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1055,95 +1055,95 @@ "disables this check, use at your own risk)" msgstr "" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." msgstr "" -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" msgstr "" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" msgstr "" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" msgstr "" -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " "discouraged." msgstr "" -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1165,27 +1165,27 @@ "Report bugs to <%s>.\n" msgstr "" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" @@ -1197,18 +1197,18 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "" -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "" -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "" --- grub2-1.98.orig/po/de.po +++ grub2-1.98/po/de.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub-1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-02-01 11:32+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" @@ -900,8 +900,8 @@ "Ctrl-x to boot, Ctrl-c for a command-line or ESC to return menu." msgstr "" "Minimale Emacs-ähnliche Bildschirmbearbeitung wird unterstützt. TAB listet " -"Vervollständigungen auf. Drücken Sie Strg-C für eine Befehlszeile oder ESC, " -"um zum Menü zurückzukehren." +"Vervollständigungen auf. Drücken Sie Strg-X zum Booten, Strg-C für eine " +"Befehlszeile oder ESC, um zum Menü zurückzukehren." #: normal/menu_text.c:186 #, c-format @@ -1019,7 +1019,7 @@ msgid "core image is too big (%p > %p)" msgstr "Core-Abbild ist zu groß (%p > %p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Rufen Sie »%s --help« auf, um weitere Informationen zu erhalten.\n" @@ -1062,42 +1062,42 @@ msgid "cannot open %s" msgstr "%s kann nicht geöffnet werden" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "Der erste Sektor der Core-Datei ist nicht sektor-ausgerichtet" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "" "Nicht an Sektoren ausgerichtete Daten wurden in der Core-Datei gefunden" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "Die Sektoren der Core-Datei sind zu stark fragmentiert" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "Die Größe von »%s« ist nicht %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "»%s« ist zu klein" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "»%s« ist zu groß" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "Es kann kein Dateisystem in %s erkannt werden. Sicherheitsüberprüfung kann " "nicht ausgeführt werden" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1111,18 +1111,18 @@ "überschrieben werden. Die Option --skip-fs-probe deaktiviert diese " "Überprüfung, verwenden Sie dies auf eigene Gefahr." -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "Keine DOS-Partitionen gefunden" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Es wird versucht, GRUB auf einer nicht partitionierten Platte zu " "installieren. Das ist eine SCHLECHTE Idee." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1130,11 +1130,11 @@ "Es wird versucht, GRUB in eine Partition anstelle in den MBR zu " "installieren. Das ist eine SCHLECHTE Idee." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Keine DOS-Partitionen gefunden" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1142,7 +1142,7 @@ "Die MSDOS-Partitionsbezeichnung hat keinen Freiraum nach dem MBR, Einbettung " "würde unmöglich sein!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1150,19 +1150,19 @@ "Diese GPT-Partitionsbezeichnung hat keine BIOS-Boot-Partition, Einbettung " "würde unmöglich sein!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "Ihr core.img ist ungewöhnlich groß. Es würde nicht in den Einbettungsbereich " "passen." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "Ihr Einbettungsbereich ist ungewöhnlich klein. core.img würde nicht " "hineinpassen." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" @@ -1170,7 +1170,7 @@ "Einbettung ist nicht möglich, jedoch erforderlich, wenn das Root-Gerät sich " "in einem RAID-Verbund oder einem LVM-Datenträger befindet." -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1180,43 +1180,43 @@ "Blocklisten installiert werden. Blocklisten sind allerdings UNZUVERLÄSSIG " "und deren Verwendung wird daher nicht empfohlen." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "Benutzen Sie --force, wenn Sie wirklich Blocklisten verwenden wollen." -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "Es wird versucht, das Core-Abbild »%s« aus GRUB zu lesen" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "Es wird versucht, das Core-Abbild »%s« erneut aus GRUB zu lesen" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "»%s« kann nicht korrekt gelesen werden" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "Kein Terminator im Core-Abbild" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "Lesen des ersten Sektors des Core-Abbildes ist gescheitert" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "Lesen der übrigen Sektoren des Core-Abbildes ist gescheitert" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "»%s« kann nicht geöffnet werden" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1255,27 +1255,27 @@ "\n" "Fehler bitte an <%s> melden.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Kein Gerät angegeben.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Unbekanntes zusätzliches Argument »%s«.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Ungültiges Gerät »%s«.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "Ungültiges Root-Gerät »%s«" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" "Das Root-Gerät kann nicht ermittelt werden. Verwenden Sie die Option »--root-" @@ -1289,19 +1289,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "FreeBSD-Kernel %s wird geladen …" -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, mit Linux %s (Wiederherstellungsmodus)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, mit Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Linux %s wird geladen …" -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Initiale Ramdisk wird geladen …" --- grub2-1.98.orig/po/ru.po +++ grub2-1.98/po/ru.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub 1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-01-25 21:49+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" @@ -1018,7 +1018,7 @@ msgid "core image is too big (%p > %p)" msgstr "базовый образ слишком большой (%p > %p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "По команде %s --help можно получить дополнительную информацию.\n" @@ -1064,41 +1064,41 @@ msgid "cannot open %s" msgstr "не удалось открыть %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "первый сектор базового файла не выровнен посекторно" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "в базовом файле найдены невыравненные посекторно данные" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "секторы базового файла слишком фрагментированы" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "размер %s не равен %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "размер %s слишком мал" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "размер %s слишком велик" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "не удалось определить файловую систему в %s; невозможно выполнить безопасную " "проверку" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1112,26 +1112,26 @@ "перезаписаны grub-setup (параметр --skip-fs-probe выключает эту проверку, но " "вас предупредили)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "разделов в стиле DOS не найдено" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "Попытка установить GRUB на диск без разделов. Лучше этого НЕ ДЕЛАТЬ." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." msgstr "Попытка установить GRUB на раздел вместо MBR. Лучше этого НЕ ДЕЛАТЬ." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Разделов в стиле DOS не найдено" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1139,25 +1139,25 @@ "Метка раздела в стиле msdos не имеет промежутка после MBR; встраивание " "невозможно!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" msgstr "" "Метка раздела GPT не имеет BIOS Boot Partition; встраивание невозможно!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "Данный core.img необычно большого размера. Он не влезет во встраиваемую " "область." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "Встраиваемая область необычно маленького размера. core.img не влезет в неё." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" @@ -1165,7 +1165,7 @@ "встраивание невозможно, но оно необходимо, если корневое устройство " "располагается в RAID-массиве или томе LVM." -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1175,43 +1175,43 @@ "только с помощью списка блоков (blocklists). Однако, список блоков является " "НЕНАДЁЖНЫМ механизмом и его лучше не использовать." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "если вы всё равно хотите использовать список блоков, укажите --force." -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "попытка прочитать базовый образ %s из GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "повторная попытка прочитать базовый образ %s из GRUB" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "не удалось прочитать %s правильно" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "в базовом образе нет метки окончания" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "не удалось прочитать первый сектор базового образа" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "не удалось прочитать оставшиеся секторы базового образа" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "не удалось открыть %s" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1255,27 +1255,27 @@ "\n" "Сообщения об ошибках направляйте на <%s>.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Не указано устройство.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Неизвестный дополнительный параметр %s.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Неверное устройство %s.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "неверное корневое устройство %s" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" "не удалось вычислить корневое устройство. Укажите его параметром --root-" @@ -1289,19 +1289,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "Загружается ядро FreeBSD %s ..." -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, с Linux %s (режим восстановления)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, с Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Загружается Linux %s ..." -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Загружается начальный ramdisk ..." --- grub2-1.98.orig/po/zh_CN.po +++ grub2-1.98/po/zh_CN.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: grub 1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-02-15 14:30+0800\n" "Last-Translator: Aron Xu \n" "Language-Team: Chinese (simplified) \n" @@ -1003,7 +1003,7 @@ msgid "core image is too big (%p > %p)" msgstr "核心镜像太大(%p > %p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "请尝试运行“%s --help”以获得更多信息。\n" @@ -1044,39 +1044,39 @@ msgid "cannot open %s" msgstr "无法打开 %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "核心文件的第一扇区未对齐" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "核心文件中发现未对齐的扇区" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "核心文件的扇区碎片太多" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "“%s”的大小不是 %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "“%s”的尺寸太小" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "“%s”的尺寸太大" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "无法在 %s 中识别文件系统,无法执行安全性检测" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1088,52 +1088,52 @@ "致 grub-setup 覆盖重要数据从而损坏文件系统(--skip-fs-probe 参数可以禁用这个检" "查,使用该选项风险自负)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "未找到 DOS 类型分区" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "正在试图将 GRUB 安装至未分区的磁盘。这是一个坏主意。" -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." msgstr "正在试图将 GRUB 安装至一个分区而非 MBR。这是一个坏主意。" -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "未找到 DOS 类型分区" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" msgstr "此 DOS 分区标签没有 MBR 前间隔,无法进行嵌入!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" msgstr "此 GPT 分区标签没有 BIOS 引导分区,无法进行嵌入!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "您的 core.img 过大,无法装入嵌入区域。" -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "您的嵌入区域过小,无法装入 core.img。" -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" msgstr "无法嵌入,但在根设备位于 RAID 阵列或 LVM 卷上时必须使用嵌入。" -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1142,43 +1142,43 @@ "无法嵌入,在此次安装中 GRUB 只能通过使用块列表安装。但是块列表是不可信赖的," "不推荐使用" -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "如果确实要使用块列表,请使用 --force 选项" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "正在尝试从 GRUB 读取核心镜像“%s”" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "正在尝试再次从 GRUB 读取核心镜像“%s”" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "无法正确读取“%s”" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "核心镜像中没有终止符" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "读取核心镜像的第一扇区失败" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "读取核心镜像的其他扇区失败" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "无法打开“%s”" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1217,27 +1217,27 @@ "\n" "软件错误请报告给 %s\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "没有指定设备。\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "未知的额外参数“%s”。\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "无效的设备“%s”。\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "无效的根设备“%s”" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "无法猜测根设备。请使用“--root-device”参数指定。" @@ -1249,19 +1249,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "载入 FreeBSD 内核 %s ..." -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s,Linux %s (恢复模式)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s,Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "载入 Linux ..." -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "载入引导虚拟磁盘。" --- grub2-1.98.orig/po/ast.po +++ grub2-1.98/po/ast.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub-1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-02-15 14:15+0100\n" "Last-Translator: Marcos Alvarez Costales \n" @@ -1019,7 +1019,7 @@ msgid "core image is too big (%p > %p)" msgstr "la imaxe del núcleu ye enforma grande (%p > %p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Executa `%s --help' pa más información.\n" @@ -1063,41 +1063,41 @@ msgid "cannot open %s" msgstr "nun puede abrise %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "el primer sector del ficheru principal nun ta alliniáu col sector" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "atopáronse datos non alliniaos con un sector nel ficheru principal" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "los sectores del ficheru núcleu tán enforma estrizaos." -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "el tamañu de «%s» nun ye %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "el tamañu de «%s» ye enforma pequeñu" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "el tamañu de «%s» ye enforma grande" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "nun ye dable identificar un sistema d'ficheros en %s; nun puede llevase a " "cabu una comprobación de seguridá" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1111,17 +1111,17 @@ "grub-setup (--skip-fs-probe desactiva esta comprobación; úsalu baxo la to " "responsabilidá)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "nun s'atopó denguna partición tipu DOS" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Intentando instalar GRUB a un discu ensin partición. Esto ye una MALA idega." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1129,11 +1129,11 @@ "Intentado instalar GRUB a una partición en llugar del MBR. Esto ye una MALA " "idega." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Nun s'alcontraron particiones DOS-style" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1141,7 +1141,7 @@ "Esta etiqueta de partición tipu MS-DOS nun tien un buecu darrera del MBR; " "nun ye dable incrustar" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1149,17 +1149,17 @@ "La etiqueta de partición GPT nun tien una Partición BIOS Boot; l'embebíu nun " "ye posible!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "El core.img ye enforma grande. Nun va poder contenese nel area d'embebíu" -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "La so área d'empotráu ye inusualmente pequeña. core.img nun va caber nella." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" @@ -1167,7 +1167,7 @@ "nun ye posible incrusta, pero esto ye necesariu cuando'l preséu raigañu ta " "nún array RAID o nún volume LVM." -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1177,43 +1177,43 @@ "usando llistes de bloques. Sicasí, éstes NUN SON FIABLES y el so usu " "desaconséyase." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "Si daveres quies usar llistes de bloques, usa --force" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "intentando lleer la imaxe del nucleu `%s' dende'l GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "intentando lleer la imaxe del nucleu `%s' dende'l GRUB otra vegada" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "nun puede lleese «%s» correchamente" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "nun hai terminador na imaxe principal" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "fallu al lleer el primer sector de la imaxe principal" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "fallu al lleer los restantes sectores de la imaxe principal" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "nun puede abrise «%s»" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1257,27 +1257,27 @@ "\n" "Informe de fallos a <%s>.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Nun s'especificó dengún preséu.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Argumentu estra desconocíu `%s'.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Preséu inválidu `%s'.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "Preséu root invalidu «%s»" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" "nun puede determinase'l preséu raigañu. Especifique la opción `--root-device'" @@ -1290,19 +1290,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "Cargando núcleu de FreeBSD %s ..." -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, con Linux %s (mou recuperación)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, con Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Cargando Linux %s ..." -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Cargando'l discu RAM inicial..." --- grub2-1.98.orig/po/hu.po +++ grub2-1.98/po/hu.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub 1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-01-26 12:39+0100\n" "Last-Translator: Gabor Kelemen \n" "Language-Team: Hungarian \n" @@ -997,7 +997,7 @@ msgid "core image is too big (%p > %p)" msgstr "" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "" @@ -1029,39 +1029,39 @@ msgid "cannot open %s" msgstr "" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1070,95 +1070,95 @@ "disables this check, use at your own risk)" msgstr "" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." msgstr "" -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" msgstr "" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" msgstr "" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" msgstr "" -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " "discouraged." msgstr "" -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1180,27 +1180,27 @@ "Report bugs to <%s>.\n" msgstr "" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" @@ -1212,18 +1212,18 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "FreeBSD %s kernelének betöltése…" -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, Linux %s verzióval (helyreállítási mód)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, Linux %s verzióval" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Linux %s betöltése…" -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Kiindulási RAM-lemez betöltése…" --- grub2-1.98.orig/po/fi.po +++ grub2-1.98/po/fi.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub 1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-01-25 21:51+0200\n" "Last-Translator: Jorma Karvonen \n" "Language-Team: Finnish \n" @@ -1024,7 +1024,7 @@ msgid "core image is too big (%p > %p)" msgstr "ydinvedos on liian iso (%p > %p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Lisätietoja komennolla ”%s --help”.\n" @@ -1071,45 +1071,45 @@ msgstr "ei voi avata tulostekohdetta %s" # Tämä oli ilmeisesti merkitty fuzzyksi, koska sektoritasattu-sanasta puuttui väliviiva :( -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "ydintiedoston ensimmäinen sektori ei ole sektoritasattu" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "ei-sektoritasattua dataa löytyi ydintiedostosta" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "ydintiedoston sektorit ovat liian hajallaan" # paikankorvaajasta tulee "boot_path" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "alkulatauspolun ”%s” koko ei ole %u" # paikankorvaajasta tulee "core_path" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "ydinpolun ”%s” koko on liian pieni" # paikankorvaajasta tulee "core_path" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "ydinpolun ”%s” koko on liian suuri" # dest_dev->disk->name eli kohdelevyaseman nimi -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "ei kyetä tunnistamaan tiedostojärjestelmää levyasemassa %s; turvatarkistusta " "ei voitu suorittaa" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1123,27 +1123,27 @@ "tietoa (valitsin --skip-fs-probe ottaa pois käytöstä tämän tarkistuksen, " "käytä sitä omalla vastuullasi)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "ei löytynyt DOS-tyylisiä osioita" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Yritetään asentaa GRUB osioimattomalle levyasemalle. Tämä on HUONO ajatus." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." msgstr "Yritetään asentaa GRUB osioon eikä MBR:ään. Tämä on HUONO ajatus." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "DOS-tyylisiä osioita ei löytynyt" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1151,7 +1151,7 @@ "Tässä msdos-tyylisessä osionimiössä ei ole MBR:n jälkeistä aukkoa; " "upottaminen ei ole mahdollista!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1159,17 +1159,17 @@ "Tässä GPT-osionimiössä ei ole BIOS alkulatausosiota; upottaminen ei ole " "mahdollista!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "Tiedostosi core.img on epätavallisen iso. Se ei sovi upotusalueelle." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "Upotettava alueesi on epätavallisen pieni. Tiedosto core.img ei mahdu " "siihen." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" @@ -1177,7 +1177,7 @@ "upottaminen ei ole mahdollista, mutta sitä vaaditaan kun juurilaite on RAID-" "taulukko tai LVM-taltio" -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1187,45 +1187,45 @@ "käyttäen lohkoluetteloja. Lohkoluettelot ovat kuitenkin EPÄLUOTETTAVIA ja " "niiden käyttöä ei suositella." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "jos todella haluat käyttää lohkoluetteloja, käytä valitsinta --force." -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "yritetään lukea ydinvedosta ”%s” GRUB:sta" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "yritetään lukea ydinvedosta ”%s” GRUB:sta uudelleen" # Ydinvedoksen luku GRUBista epäonnistui maksimiyrityskertojen määrän -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "ei voida lukea ydinvedosta ”%s” oikein" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "ei päätöslohkoa ydinvedoksessa" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "ydinvedoksen ensimmäisen sektorin lukeminen epäonnistui" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "ydinvedoksen loppujen sektoreiden lukeminen epäonnistui" # avattava kohde on "core_path" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "ei voi avata ydintä ”%s”" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1268,27 +1268,27 @@ "Ilmoita käännösvirheistä osoitteeseen .\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Laitetta ei ole annettu.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Tuntematon ylimääräinen argumentti ”%s”.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Virheellinen laite ”%s”.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "virheellinen juurilaite ”%s”." -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "ei kyetä arvaamaan juurilaitetta. Anna valitsin ”--root-device”." @@ -1300,19 +1300,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "Ladataan FreeBSD %s käyttöjärjestelmäydin ..." -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, jakeluversiolla Linux %s (toipumistila)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, jakeluversiolla Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Ladataan Linux %s käyttöjärjestelmäydin ..." -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Ladataa alustava ram-levy ..." --- grub2-1.98.orig/po/id.po +++ grub2-1.98/po/id.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: grub 1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-01-25 16:30+0700\n" "Last-Translator: Arif E. Nugroho \n" "Language-Team: Indonesian \n" @@ -1024,7 +1024,7 @@ msgid "core image is too big (%p > %p)" msgstr "Image core terlalu besar (%p >%p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Coba `%s --help' untuk informasi lebih lanjut.\n" @@ -1068,41 +1068,41 @@ msgid "cannot open %s" msgstr "tidak dapat membuka %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "sektor pertama dari berkas core tidak selaras secara sektor" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "sektor-tidak-selaras data ditemukan dalam berkas core" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "sektor dari berkas core terlalu terpotong potong" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "ukuran dari `%s' bukan %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "ukuran dari `%s' terlalu kecil" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "ukuran dari `%s' terlalu besar" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "tidak dapat mengidentifikasikan sebuah sistem berkas dalam %s; pemeriksaan " "keamanan tidak dapat dilakukan" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1115,18 +1115,18 @@ "KERUSAKAN SISTEM BERKAS jika data berharga dipaksa tulis oleh grub-setup (--" "skip-fs-probe menonaktifkan pemeriksaan ini, gunakan sesuai resiko anda)" -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "tidak ditemukan gaya partisi DOS" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Mencoba memasang GRUB ke sebuah disk yang tidak berpartisi. Ini mungkin " "bukan ide baik." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1134,11 +1134,11 @@ "Mencoba memasang GRUB ke sebuah partisi daripada MBR. Ini mungkin bukan ide " "baik." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Tidak ditemukan gaya partisi DOS" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1146,7 +1146,7 @@ "Label partisi gaya msdos ini tidak memiliki post-MBR gap; penempatan tidak " "memungkinkan!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1154,16 +1154,16 @@ "Label partisi GPT ini tidak memiliki partisi boot BIOS; penempatan tidak " "memungkinkan!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "Besar core.img anda sangat besar. Ini tidak akan masuk dalam area penempatan." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "Penempatan anda sangat kecil. core.img tidak akan masuk disana." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" @@ -1171,7 +1171,7 @@ "penempatan tidak memungkinkan, tetapi ini dibutuhkan ketika perangkat root " "berada di sebuah array RAID atau volume LVM." -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1181,43 +1181,43 @@ "dengan menggunakan blocklists. Akan tetapi, blocklists TIDAK DAPAT DIJAGAKAN " "dan penggunaan ini tidak disarankan." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "jika anda benar benar menginginkan blocklists, gunakan --force." -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "mencoba untuk membaca image core `%s' dari GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "mencoba untuk membaca image core `%s' dari GRUB lagi" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "tidak dapat membaca `%s' secara benar" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "tidak ada pengakhir dalam image core" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "gagal untuk membaca sektor pertama dari core image" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "gagal untuk membaca sektor selanjutnya dari image core" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "tidak dapat membuka `%s'" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1257,27 +1257,27 @@ "\n" "Laporkan bugs ke <%s>.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Perangkat tidak dispesifikasikan.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Argumen ekstra `%s' tidak diketahui.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Perangkat `%s' tidak valid.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "perangkat root `%s' tidak valid" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "" "tidak dapat menebak perangkat root. Spesifikasikan pilihan ``--root-device''." @@ -1290,19 +1290,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "Memuat kernel dari FreeBSD %s ..." -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, dengan Linux %s (mode penyembuhan)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, dengan Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Memuat Linux %s ..." -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Memuat inisial ramdisk ..." --- grub2-1.98.orig/po/grub.pot +++ grub2-1.98/po/grub.pot @@ -0,0 +1,1216 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: commands/acpi.c:40 +msgid "Don't load host tables specified by comma-separated list." +msgstr "" + +#: commands/acpi.c:43 +msgid "Load only tables specified by comma-separated list." +msgstr "" + +#: commands/acpi.c:44 +msgid "Expose v1 tables." +msgstr "" + +#: commands/acpi.c:45 +msgid "Expose v2 and v3 tables." +msgstr "" + +#: commands/acpi.c:46 +msgid "Set OEMID of RSDP, XSDT and RSDT." +msgstr "" + +#: commands/acpi.c:48 +msgid "Set OEMTABLE ID of RSDP, XSDT and RSDT." +msgstr "" + +#: commands/acpi.c:50 +msgid "Set OEMTABLE revision of RSDP, XSDT and RSDT." +msgstr "" + +#: commands/acpi.c:52 +msgid "Set creator field of RSDP, XSDT and RSDT." +msgstr "" + +#: commands/acpi.c:54 +msgid "Set creator revision of RSDP, XSDT and RSDT." +msgstr "" + +#: commands/acpi.c:55 +msgid "" +"Don't update EBDA. May fix failures or hangs on some. BIOSes but makes it " +"ineffective with OS not receiving RSDP from GRUB." +msgstr "" + +#: commands/acpi.c:763 +msgid "" +"[-1|-2] [--exclude=TABLE1,TABLE2|--load-only=table1,table2] FILE1 [FILE2] " +"[...]" +msgstr "" + +#: commands/acpi.c:766 +msgid "Load host ACPI tables and tables specified by arguments." +msgstr "" + +#: commands/blocklist.c:114 commands/cat.c:82 commands/configfile.c:57 +#: commands/configfile.c:60 commands/configfile.c:65 commands/crc.c:64 +#: commands/minicmd.c:357 loader/i386/bsd.c:1297 loader/i386/bsd.c:1301 +#: loader/i386/bsd.c:1305 +msgid "FILE" +msgstr "" + +#: commands/blocklist.c:114 +msgid "Print a block list." +msgstr "" + +#: commands/boot.c:190 +msgid "Boot an operating system." +msgstr "" + +#: commands/cat.c:82 commands/minicmd.c:357 +msgid "Show the contents of a file." +msgstr "" + +#: commands/cmp.c:113 +msgid "FILE1 FILE2" +msgstr "" + +#: commands/cmp.c:113 +msgid "Compare two files." +msgstr "" + +#: commands/configfile.c:57 +msgid "Load another config file." +msgstr "" + +#: commands/configfile.c:61 commands/configfile.c:66 +msgid "Load another config file without changing context." +msgstr "" + +#: commands/crc.c:65 +msgid "Calculate the crc32 checksum of a file." +msgstr "" + +#: commands/date.c:139 +msgid "[[year-]month-day] [hour:minute[:second]]" +msgstr "" + +#: commands/date.c:140 +msgid "Command to display/set current datetime." +msgstr "" + +#: commands/echo.c:27 +msgid "Do not output the trailing newline." +msgstr "" + +#: commands/echo.c:28 +msgid "Enable interpretation of backslash escapes." +msgstr "" + +#: commands/echo.c:117 +msgid "[-e|-n] STRING" +msgstr "" + +#: commands/echo.c:117 +msgid "Display a line of text." +msgstr "" + +#: commands/efi/fixvideo.c:103 +msgid "Fix video problem." +msgstr "" + +#: commands/efi/loadbios.c:207 +msgid "Fake BIOS." +msgstr "" + +#: commands/efi/loadbios.c:211 +msgid "Load BIOS dump." +msgstr "" + +#: commands/gptsync.c:244 +msgid "DEVICE [PARTITION[+/-[TYPE]]] ..." +msgstr "" + +#: commands/gptsync.c:245 +msgid "" +"Fill hybrid MBR of GPT drive DEVICE. specified partitions will be a part of " +"hybrid mbr. Up to 3 partitions are allowed. TYPE is an MBR type. + means " +"that partition is active. Only one partition can be active." +msgstr "" + +#: commands/halt.c:39 +msgid "" +"Halts the computer. This command does not work on all firmware " +"implementations." +msgstr "" + +#: commands/handler.c:94 +msgid "[class [handler]]" +msgstr "" + +#: commands/handler.c:95 +msgid "List or select a handler." +msgstr "" + +#: commands/hdparm.c:30 +msgid "" +"Set Advanced Power Management\n" +"(1=low, ..., 254=high, 255=off)." +msgstr "" + +#: commands/hdparm.c:33 +msgid "Check power mode." +msgstr "" + +#: commands/hdparm.c:34 +msgid "Freeze ATA security settings until reset." +msgstr "" + +#: commands/hdparm.c:36 +msgid "Check SMART health status." +msgstr "" + +#: commands/hdparm.c:37 +msgid "" +"Set Automatic Acoustic Management\n" +"(0=off, 128=quiet, ..., 254=fast)." +msgstr "" + +#: commands/hdparm.c:40 +msgid "" +"Set standby timeout\n" +"(0=off, 1=5s, 2=10s, ..., 240=20m, 241=30m, ...)." +msgstr "" + +#: commands/hdparm.c:43 +msgid "Set drive to standby mode." +msgstr "" + +#: commands/hdparm.c:44 +msgid "Set drive to sleep mode." +msgstr "" + +#: commands/hdparm.c:45 +msgid "Print drive identity and settings." +msgstr "" + +#: commands/hdparm.c:47 +msgid "Dump contents of ATA IDENTIFY sector." +msgstr "" + +#: commands/hdparm.c:49 +msgid "Disable/enable SMART (0/1)." +msgstr "" + +#: commands/hdparm.c:50 +msgid "Do not print messages." +msgstr "" + +#: commands/hdparm.c:414 +msgid "[OPTIONS] DISK" +msgstr "" + +#: commands/hdparm.c:415 +msgid "Get/set ATA disk parameters." +msgstr "" + +#: commands/help.c:103 lib/arg.c:110 +msgid "Usage:" +msgstr "" + +#: commands/help.c:136 +msgid "[PATTERN ...]" +msgstr "" + +#: commands/help.c:137 +msgid "Show a help message." +msgstr "" + +#: commands/hexdump.c:30 +msgid "Skip offset bytes from the beginning of file." +msgstr "" + +#: commands/hexdump.c:32 +msgid "Read only LENGTH bytes." +msgstr "" + +#: commands/hexdump.c:125 +msgid "[OPTIONS] FILE_OR_DEVICE" +msgstr "" + +#: commands/hexdump.c:126 +msgid "Dump the contents of a file or memory." +msgstr "" + +#: commands/i386/cpuid.c:37 +msgid "Check for long mode flag (default)." +msgstr "" + +#: commands/i386/cpuid.c:92 +msgid "Check for CPU features." +msgstr "" + +#: commands/i386/pc/drivemap.c:37 +msgid "Show the current mappings." +msgstr "" + +#: commands/i386/pc/drivemap.c:38 +msgid "Reset all mappings to the default values." +msgstr "" + +#: commands/i386/pc/drivemap.c:39 +msgid "Perform both direct and reverse mappings." +msgstr "" + +#: commands/i386/pc/drivemap.c:407 +msgid "-l | -r | [-s] grubdev osdisk." +msgstr "" + +#: commands/i386/pc/drivemap.c:408 +msgid "Manage the BIOS drive mappings." +msgstr "" + +#: commands/i386/pc/halt.c:27 +msgid "Do not use APM to halt the computer." +msgstr "" + +#: commands/i386/pc/halt.c:51 +msgid "Halt the system, if possible using APM." +msgstr "" + +#: commands/i386/pc/play.c:262 +msgid "FILE | TEMPO [PITCH1 DURATION1] [PITCH2 DURATION2] ... " +msgstr "" + +#: commands/i386/pc/play.c:263 +msgid "Play a tune." +msgstr "" + +#: commands/i386/pc/pxecmd.c:46 +msgid "Unload PXE environment." +msgstr "" + +#: commands/i386/pc/vbeinfo.c:179 +msgid "List compatible VESA BIOS extension video modes." +msgstr "" + +#: commands/i386/pc/vbetest.c:173 +msgid "Test VESA BIOS Extension 2.0+ support." +msgstr "" + +#: commands/ieee1275/suspend.c:43 +msgid "Return to Open Firmware prompt." +msgstr "" + +#: commands/keystatus.c:28 +msgid "Check Shift key." +msgstr "" + +#: commands/keystatus.c:29 +msgid "Check Control key." +msgstr "" + +#: commands/keystatus.c:30 +msgid "Check Alt key." +msgstr "" + +#: commands/keystatus.c:85 +msgid "[--shift] [--ctrl] [--alt]" +msgstr "" + +#: commands/keystatus.c:86 +msgid "Check key modifier status." +msgstr "" + +#: commands/loadenv.c:33 +msgid "Specify filename." +msgstr "" + +#: commands/loadenv.c:383 commands/loadenv.c:389 +msgid "[-f FILE]" +msgstr "" + +#: commands/loadenv.c:384 +msgid "Load variables from environment block file." +msgstr "" + +#: commands/loadenv.c:390 +msgid "List variables from environment block file." +msgstr "" + +#: commands/loadenv.c:395 +msgid "[-f FILE] variable_name [...]" +msgstr "" + +#: commands/loadenv.c:396 +msgid "Save variables to environment block file." +msgstr "" + +#: commands/ls.c:37 +msgid "Show a long list with more detailed information." +msgstr "" + +#: commands/ls.c:38 +msgid "Print sizes in a human readable format." +msgstr "" + +#: commands/ls.c:39 +msgid "List all files." +msgstr "" + +#: commands/ls.c:269 +msgid "[-l|-h|-a] [FILE]" +msgstr "" + +#: commands/ls.c:270 +msgid "List devices and files." +msgstr "" + +#: commands/lsmmap.c:47 +msgid "List memory map provided by firmware." +msgstr "" + +#: commands/lspci.c:228 +msgid "List PCI devices." +msgstr "" + +#: commands/memrw.c:31 +msgid "Save read value into variable VARNAME." +msgstr "" + +#: commands/memrw.c:123 commands/memrw.c:126 commands/memrw.c:129 +#: commands/minicmd.c:366 +msgid "ADDR" +msgstr "" + +#: commands/memrw.c:123 +msgid "Read byte from ADDR." +msgstr "" + +#: commands/memrw.c:126 +msgid "Read word from ADDR." +msgstr "" + +#: commands/memrw.c:129 +msgid "Read dword from ADDR." +msgstr "" + +#: commands/memrw.c:132 commands/memrw.c:135 commands/memrw.c:138 +msgid "ADDR VALUE [MASK]" +msgstr "" + +#: commands/memrw.c:132 +msgid "Write byte VALUE to ADDR." +msgstr "" + +#: commands/memrw.c:135 +msgid "Write word VALUE to ADDR." +msgstr "" + +#: commands/memrw.c:138 +msgid "Write dword VALUE to ADDR." +msgstr "" + +#: commands/minicmd.c:360 +msgid "Show this message." +msgstr "" + +#: commands/minicmd.c:363 commands/probe.c:154 +msgid "[DEVICE]" +msgstr "" + +#: commands/minicmd.c:363 +msgid "Set the root device." +msgstr "" + +#: commands/minicmd.c:366 +msgid "Dump memory." +msgstr "" + +#: commands/minicmd.c:369 +msgid "MODULE" +msgstr "" + +#: commands/minicmd.c:369 +msgid "Remove a module." +msgstr "" + +#: commands/minicmd.c:372 +msgid "Show loaded modules." +msgstr "" + +#: commands/minicmd.c:375 +msgid "Exit from GRUB." +msgstr "" + +#: commands/minicmd.c:378 +msgid "Clear the screen." +msgstr "" + +#: commands/parttool.c:325 +msgid "PARTITION COMMANDS" +msgstr "" + +#: commands/password.c:78 +msgid "USER PASSWORD" +msgstr "" + +#: commands/password.c:79 +msgid "Set user password (plaintext). Unrecommended and insecure." +msgstr "" + +#: commands/probe.c:38 +msgid "Set a variable to return value." +msgstr "" + +#: commands/probe.c:39 +msgid "Determine driver." +msgstr "" + +#: commands/probe.c:40 +msgid "Determine partition map type." +msgstr "" + +#: commands/probe.c:41 +msgid "Determine filesystem type." +msgstr "" + +#: commands/probe.c:42 +msgid "Determine filesystem UUID." +msgstr "" + +#: commands/probe.c:43 +msgid "Determine filesystem label." +msgstr "" + +#: commands/probe.c:155 +msgid "Retrieve device info." +msgstr "" + +#: commands/read.c:83 +msgid "[ENVVAR]" +msgstr "" + +#: commands/read.c:84 +msgid "Set variable with user input." +msgstr "" + +#: commands/reboot.c:39 +msgid "Reboot the computer." +msgstr "" + +#: commands/search.c:161 +msgid "NAME [VARIABLE]" +msgstr "" + +#: commands/search_file.c:5 +msgid "" +"Search devices by file. If VARIABLE is specified, the first device found is " +"set to a variable." +msgstr "" + +#: commands/search_label.c:5 +msgid "" +"Search devices by label. If VARIABLE is specified, the first device found is " +"set to a variable." +msgstr "" + +#: commands/search_uuid.c:5 +msgid "" +"Search devices by UUID. If VARIABLE is specified, the first device found is " +"set to a variable." +msgstr "" + +#: commands/sleep.c:31 +msgid "Verbose countdown." +msgstr "" + +#: commands/sleep.c:32 +msgid "Interruptible with ESC." +msgstr "" + +#: commands/sleep.c:106 +msgid "NUMBER_OF_SECONDS" +msgstr "" + +#: commands/sleep.c:107 +msgid "Wait for a specified number of seconds." +msgstr "" + +#: commands/test.c:424 +msgid "EXPRESSION ]" +msgstr "" + +#: commands/test.c:424 commands/test.c:426 +msgid "Evaluate an expression." +msgstr "" + +#: commands/test.c:426 +msgid "EXPRESSION" +msgstr "" + +#: commands/true.c:47 +msgid "Do nothing, successfully." +msgstr "" + +#: commands/true.c:50 +msgid "Do nothing, unsuccessfully." +msgstr "" + +#: commands/usbtest.c:199 +msgid "Test USB support." +msgstr "" + +#: commands/videotest.c:180 +msgid "Test video subsystem." +msgstr "" + +#: commands/xnu_uuid.c:92 +msgid "GRUBUUID [VARNAME]" +msgstr "" + +#: commands/xnu_uuid.c:93 +msgid "Transform 64-bit UUID to format suitable for XNU." +msgstr "" + +#: disk/loopback.c:40 +msgid "Delete the loopback device entry." +msgstr "" + +#: disk/loopback.c:41 +msgid "Simulate a hard drive with partitions." +msgstr "" + +#: disk/loopback.c:249 +msgid "[-d|-p] DEVICENAME FILE." +msgstr "" + +#: disk/loopback.c:250 +msgid "Make a device of a file." +msgstr "" + +#: hello/hello.c:43 +msgid "Say \"Hello World\"." +msgstr "" + +#: lib/arg.c:34 +msgid "Display this help and exit." +msgstr "" + +#: lib/arg.c:36 +msgid "Display the usage of this command and exit." +msgstr "" + +#: loader/efi/appleloader.c:325 +msgid "Boot legacy system." +msgstr "" + +#: loader/efi/chainloader.c:340 loader/i386/pc/chainloader.c:153 +msgid "Load another boot loader." +msgstr "" + +#: loader/i386/bsd.c:65 +msgid "Display output on all consoles." +msgstr "" + +#: loader/i386/bsd.c:66 +msgid "Use serial console." +msgstr "" + +#: loader/i386/bsd.c:67 loader/i386/bsd.c:93 loader/i386/bsd.c:114 +msgid "Ask for file name to reboot from." +msgstr "" + +#: loader/i386/bsd.c:68 +msgid "Use CDROM as root." +msgstr "" + +#: loader/i386/bsd.c:69 +msgid "Invoke user configuration routing." +msgstr "" + +#: loader/i386/bsd.c:70 loader/i386/bsd.c:97 loader/i386/bsd.c:117 +msgid "Enter in KDB on boot." +msgstr "" + +#: loader/i386/bsd.c:71 +msgid "Use GDB remote debugger instead of DDB." +msgstr "" + +#: loader/i386/bsd.c:72 +msgid "Disable all boot output." +msgstr "" + +#: loader/i386/bsd.c:74 +msgid "Wait for keypress after every line of output." +msgstr "" + +#: loader/i386/bsd.c:76 +msgid "Use compiled-in rootdev." +msgstr "" + +#: loader/i386/bsd.c:77 loader/i386/bsd.c:96 loader/i386/bsd.c:120 +msgid "Boot into single mode." +msgstr "" + +#: loader/i386/bsd.c:78 loader/i386/bsd.c:121 +msgid "Boot with verbose messages." +msgstr "" + +#: loader/i386/bsd.c:94 loader/i386/bsd.c:115 +msgid "Don't reboot, just halt." +msgstr "" + +#: loader/i386/bsd.c:95 loader/i386/bsd.c:116 +msgid "Change configured devices." +msgstr "" + +#: loader/i386/bsd.c:98 loader/i386/bsd.c:124 +msgid "Set root device." +msgstr "" + +#: loader/i386/bsd.c:112 +msgid "Disable SMP." +msgstr "" + +#: loader/i386/bsd.c:113 +msgid "Disable ACPI." +msgstr "" + +#: loader/i386/bsd.c:119 +msgid "Don't display boot diagnostic messages." +msgstr "" + +#: loader/i386/bsd.c:122 +msgid "Boot with debug messages." +msgstr "" + +#: loader/i386/bsd.c:123 +msgid "Supress normal output (warnings remain)." +msgstr "" + +#: loader/i386/bsd.c:124 +msgid "DEVICE" +msgstr "" + +#: loader/i386/bsd.c:1297 +msgid "Load kernel of FreeBSD." +msgstr "" + +#: loader/i386/bsd.c:1301 +msgid "Load kernel of OpenBSD." +msgstr "" + +#: loader/i386/bsd.c:1305 +msgid "Load kernel of NetBSD." +msgstr "" + +#: loader/i386/bsd.c:1309 +msgid "Load FreeBSD env." +msgstr "" + +#: loader/i386/bsd.c:1312 +msgid "Load FreeBSD kernel module." +msgstr "" + +#: loader/i386/bsd.c:1315 +msgid "Load FreeBSD kernel module (ELF)." +msgstr "" + +#: loader/i386/efi/linux.c:1011 loader/i386/ieee1275/linux.c:301 +#: loader/i386/linux.c:1012 loader/i386/pc/linux.c:399 +#: loader/powerpc/ieee1275/linux.c:353 loader/sparc64/ieee1275/linux.c:514 +msgid "Load Linux." +msgstr "" + +#: loader/i386/efi/linux.c:1013 loader/i386/ieee1275/linux.c:303 +#: loader/i386/linux.c:1014 loader/i386/pc/linux.c:402 +#: loader/powerpc/ieee1275/linux.c:355 loader/sparc64/ieee1275/linux.c:516 +msgid "Load initrd." +msgstr "" + +#: loader/i386/xnu.c:1032 +msgid "Load device-properties dump." +msgstr "" + +#: loader/multiboot_loader.c:133 +msgid "Load a multiboot 2 kernel." +msgstr "" + +#: loader/multiboot_loader.c:136 +msgid "Load a multiboot kernel." +msgstr "" + +#: loader/multiboot_loader.c:141 +msgid "Load a multiboot module." +msgstr "" + +#: loader/xnu.c:1428 +msgid "Load XNU image." +msgstr "" + +#: loader/xnu.c:1430 +msgid "Load 64-bit XNU image." +msgstr "" + +#: loader/xnu.c:1432 +msgid "Load XNU extension package." +msgstr "" + +#: loader/xnu.c:1434 +msgid "Load XNU extension." +msgstr "" + +#: loader/xnu.c:1436 +msgid "DIRECTORY [OSBundleRequired]" +msgstr "" + +#: loader/xnu.c:1437 +msgid "Load XNU extension directory." +msgstr "" + +#: loader/xnu.c:1444 +msgid "Load a splash image for XNU." +msgstr "" + +#: loader/xnu.c:1449 +msgid "Load XNU hibernate image." +msgstr "" + +#: normal/auth.c:233 +msgid "Enter username: " +msgstr "" + +#: normal/auth.c:238 +msgid "Enter password: " +msgstr "" + +#: normal/color.c:80 +#, c-format +msgid "Warning: syntax error (missing slash) in `%s'\n" +msgstr "" + +#: normal/color.c:89 +#, c-format +msgid "Warning: invalid foreground color `%s'\n" +msgstr "" + +#: normal/color.c:95 +#, c-format +msgid "Warning: invalid background color `%s'\n" +msgstr "" + +#: normal/dyncmd.c:147 +msgid "not loaded" +msgstr "" + +#: normal/main.c:408 +#, c-format +msgid "GNU GRUB version %s" +msgstr "" + +#: normal/main.c:539 +#, c-format +msgid "" +"Minimal BASH-like line editing is supported. For the first word, TAB lists " +"possible command completions. Anywhere else TAB lists possible device or " +"file completions. %s" +msgstr "" + +#: normal/main.c:542 +msgid "ESC at any time exits." +msgstr "" + +#: normal/menu_entry.c:1060 +msgid "Possible commands are:" +msgstr "" + +#: normal/menu_entry.c:1064 +msgid "Possible devices are:" +msgstr "" + +#: normal/menu_entry.c:1068 +msgid "Possible files are:" +msgstr "" + +#: normal/menu_entry.c:1072 +msgid "Possible partitions are:" +msgstr "" + +#: normal/menu_entry.c:1076 +msgid "Possible arguments are:" +msgstr "" + +#: normal/menu_entry.c:1080 +msgid "Possible things are:" +msgstr "" + +#: normal/menu_entry.c:1184 +msgid "Booting a command list" +msgstr "" + +#: normal/menu_entry.c:1397 +msgid "Press any key to continue..." +msgstr "" + +#: normal/menu_text.c:179 +msgid "" +"Minimum Emacs-like screen editing is supported. TAB lists completions. Press " +"Ctrl-x to boot, Ctrl-c for a command-line or ESC to return menu." +msgstr "" + +#: normal/menu_text.c:186 +#, c-format +msgid "Use the %C and %C keys to select which entry is highlighted.\n" +msgstr "" + +#: normal/menu_text.c:203 +msgid "" +"Press enter to boot the selected OS, 'e' to edit the commands before booting " +"or 'c' for a command-line. ESC to return previous menu.\n" +msgstr "" + +#: normal/menu_text.c:211 +msgid "" +"Press enter to boot the selected OS, 'e' to edit the commands before booting " +"or 'c' for a command-line.\n" +msgstr "" + +#: normal/menu_text.c:363 +#, c-format +msgid "The highlighted entry will be executed automatically in %ds." +msgstr "" + +#: normal/misc.c:41 +#, c-format +msgid "Partition %s:" +msgstr "" + +#: normal/misc.c:46 +#, c-format +msgid "Device %s:" +msgstr "" + +#: normal/misc.c:52 +msgid "Filesystem cannot be accessed" +msgstr "" + +#: normal/misc.c:63 +#, c-format +msgid "Filesystem type %s" +msgstr "" + +#: normal/misc.c:73 +#, c-format +msgid "- Label \"%s\"" +msgstr "" + +#: normal/misc.c:88 +#, c-format +msgid "- Last modification time %d-%02d-%02d %02d:%02d:%02d %s" +msgstr "" + +#: normal/misc.c:111 +msgid "Unknown filesystem" +msgstr "" + +#: normal/misc.c:113 +msgid "Partition table" +msgstr "" + +#: term/serial.c:46 +msgid "Set the serial unit." +msgstr "" + +#: term/serial.c:47 +msgid "Set the serial port address." +msgstr "" + +#: term/serial.c:48 +msgid "Set the serial port speed." +msgstr "" + +#: term/serial.c:49 +msgid "Set the serial port word length." +msgstr "" + +#: term/serial.c:50 +msgid "Set the serial port parity." +msgstr "" + +#: term/serial.c:51 +msgid "Set the serial port stop bits." +msgstr "" + +#: util/grub-mkrawimage.c:69 +msgid "the core image is too small" +msgstr "" + +#: util/grub-mkrawimage.c:81 +msgid "cannot compress the kernel image" +msgstr "" + +#: util/grub-mkrawimage.c:156 +msgid "prefix is too long" +msgstr "" + +#: util/grub-mkrawimage.c:242 +msgid "the core image is too big" +msgstr "" + +#: util/grub-mkrawimage.c:247 +#, c-format +msgid "diskboot.img size must be %u bytes" +msgstr "" + +#: util/grub-mkrawimage.c:330 +#, c-format +msgid "core image is too big (%p > %p)" +msgstr "" + +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "" + +#: util/grub-mkrawimage.c:436 +#, c-format +msgid "" +"Usage: %s [OPTION]... [MODULES]\n" +"\n" +"Make a bootable image of GRUB.\n" +"\n" +" -d, --directory=DIR use images and modules under DIR [default=%s]\n" +" -p, --prefix=DIR set grub_prefix directory [default=%s]\n" +" -m, --memdisk=FILE embed FILE as a memdisk image\n" +" -f, --font=FILE embed FILE as a boot font\n" +" -c, --config=FILE embed FILE as boot config\n" +" -o, --output=FILE output a generated image to FILE [default=stdout]\n" +" -O, --format=FORMAT generate an image in format [default=%s]\n" +" available formats: %s\n" +" -h, --help display this message and exit\n" +" -V, --version print version information and exit\n" +" -v, --verbose print verbose messages\n" +"\n" +"Report bugs to <%s>.\n" +msgstr "" + +#: util/grub-mkrawimage.c:580 +#, c-format +msgid "cannot open %s" +msgstr "" + +#: util/i386/pc/grub-setup.c:160 +msgid "the first sector of the core file is not sector-aligned" +msgstr "" + +#: util/i386/pc/grub-setup.c:174 +msgid "non-sector-aligned data is found in the core file" +msgstr "" + +#: util/i386/pc/grub-setup.c:188 +msgid "the sectors of the core file are too fragmented" +msgstr "" + +#: util/i386/pc/grub-setup.c:199 +#, c-format +msgid "the size of `%s' is not %u" +msgstr "" + +#: util/i386/pc/grub-setup.c:216 +#, c-format +msgid "the size of `%s' is too small" +msgstr "" + +#: util/i386/pc/grub-setup.c:218 +#, c-format +msgid "the size of `%s' is too large" +msgstr "" + +#: util/i386/pc/grub-setup.c:255 +#, c-format +msgid "unable to identify a filesystem in %s; safety check can't be performed" +msgstr "" + +#: util/i386/pc/grub-setup.c:259 +#, c-format +msgid "" +"%s appears to contain a %s filesystem which isn't known to reserve space for " +"DOS-style boot. Installing GRUB there could result in FILESYSTEM " +"DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe " +"disables this check, use at your own risk)" +msgstr "" + +#: util/i386/pc/grub-setup.c:308 +msgid "no DOS-style partitions found" +msgstr "" + +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 +msgid "" +"Attempting to install GRUB to a partitionless disk. This is a BAD idea." +msgstr "" + +#: util/i386/pc/grub-setup.c:330 +msgid "" +"Attempting to install GRUB to a partition instead of the MBR. This is a BAD " +"idea." +msgstr "" + +#: util/i386/pc/grub-setup.c:358 +msgid "No DOS-style partitions found" +msgstr "" + +#: util/i386/pc/grub-setup.c:363 +msgid "" +"This msdos-style partition label has no post-MBR gap; embedding won't be " +"possible!" +msgstr "" + +#: util/i386/pc/grub-setup.c:365 +msgid "" +"This GPT partition label has no BIOS Boot Partition; embedding won't be " +"possible!" +msgstr "" + +#: util/i386/pc/grub-setup.c:372 +msgid "Your core.img is unusually large. It won't fit in the embedding area." +msgstr "" + +#: util/i386/pc/grub-setup.c:374 +msgid "Your embedding area is unusually small. core.img won't fit in it." +msgstr "" + +#: util/i386/pc/grub-setup.c:419 +msgid "" +"embedding is not possible, but this is required when the root device is on a " +"RAID array or LVM volume" +msgstr "" + +#: util/i386/pc/grub-setup.c:422 +msgid "" +"Embedding is not possible. GRUB can only be installed in this setup by " +"using blocklists. However, blocklists are UNRELIABLE and its use is " +"discouraged." +msgstr "" + +#: util/i386/pc/grub-setup.c:426 +msgid "if you really want blocklists, use --force" +msgstr "" + +#: util/i386/pc/grub-setup.c:445 +#, c-format +msgid "attempting to read the core image `%s' from GRUB" +msgstr "" + +#: util/i386/pc/grub-setup.c:446 +#, c-format +msgid "attempting to read the core image `%s' from GRUB again" +msgstr "" + +#: util/i386/pc/grub-setup.c:513 +#, c-format +msgid "cannot read `%s' correctly" +msgstr "" + +#: util/i386/pc/grub-setup.c:526 +msgid "no terminator in the core image" +msgstr "" + +#: util/i386/pc/grub-setup.c:537 +msgid "failed to read the first sector of the core image" +msgstr "" + +#: util/i386/pc/grub-setup.c:543 +msgid "failed to read the rest sectors of the core image" +msgstr "" + +#: util/i386/pc/grub-setup.c:562 +#, c-format +msgid "cannot open `%s'" +msgstr "" + +#: util/i386/pc/grub-setup.c:604 +#, c-format +msgid "" +"Usage: %s [OPTION]... DEVICE\n" +"\n" +"Set up images to boot from DEVICE.\n" +"DEVICE must be a GRUB device (e.g. `(hd0,1)').\n" +"\n" +" -b, --boot-image=FILE use FILE as the boot image [default=%s]\n" +" -c, --core-image=FILE use FILE as the core image [default=%s]\n" +" -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n" +" -m, --device-map=FILE use FILE as the device map [default=%s]\n" +" -r, --root-device=DEV use DEV as the root device [default=guessed]\n" +" -f, --force install even if problems are detected\n" +" -s, --skip-fs-probe do not probe for filesystems in DEVICE\n" +" -h, --help display this message and exit\n" +" -V, --version print version information and exit\n" +" -v, --verbose print verbose messages\n" +"\n" +"Report bugs to <%s>.\n" +msgstr "" + +#: util/i386/pc/grub-setup.c:734 +#, c-format +msgid "No device is specified.\n" +msgstr "" + +#: util/i386/pc/grub-setup.c:740 +#, c-format +msgid "Unknown extra argument `%s'.\n" +msgstr "" + +#: util/i386/pc/grub-setup.c:757 +#, c-format +msgid "Invalid device `%s'.\n" +msgstr "" + +#: util/i386/pc/grub-setup.c:770 +#, c-format +msgid "invalid root device `%s'" +msgstr "" + +#: util/i386/pc/grub-setup.c:783 +msgid "cannot guess the root device. Specify the option `--root-device'" +msgstr "" + +#: util/grub.d/10_kfreebsd.in:47 +msgid "%s, with kFreeBSD %s" +msgstr "" + +#: util/grub.d/10_kfreebsd.in:55 +msgid "Loading kernel of FreeBSD %s ..." +msgstr "" + +#: util/grub.d/10_linux.in:60 +msgid "%s, with Linux %s (recovery mode)" +msgstr "" + +#: util/grub.d/10_linux.in:62 +msgid "%s, with Linux %s" +msgstr "" + +#: util/grub.d/10_linux.in:87 +msgid "Loading Linux %s ..." +msgstr "" + +#: util/grub.d/10_linux.in:92 +msgid "Loading initial ramdisk ..." +msgstr "" --- grub2-1.98.orig/po/sv.po +++ grub2-1.98/po/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: grub 1.97+20100124\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-06 21:00+0100\n" +"POT-Creation-Date: 2010-03-08 22:55+0000\n" "PO-Revision-Date: 2010-02-01 22:15+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -995,7 +995,7 @@ msgid "core image is too big (%p > %p)" msgstr "kärnavbildningen är för stor (%p > %p)" -#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:587 +#: util/grub-mkrawimage.c:434 util/i386/pc/grub-setup.c:602 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Prova \"%s --help\" för mer information.\n" @@ -1039,41 +1039,41 @@ msgid "cannot open %s" msgstr "kan inte öppna %s" -#: util/i386/pc/grub-setup.c:159 +#: util/i386/pc/grub-setup.c:160 msgid "the first sector of the core file is not sector-aligned" msgstr "första sektorn i kärnfilen är inte sektorjusterad" -#: util/i386/pc/grub-setup.c:173 +#: util/i386/pc/grub-setup.c:174 msgid "non-sector-aligned data is found in the core file" msgstr "data som inte är sektorjusterad hittades i kärnfilen" -#: util/i386/pc/grub-setup.c:187 +#: util/i386/pc/grub-setup.c:188 msgid "the sectors of the core file are too fragmented" msgstr "sektorerna för kärnfilen är för fragmenterade" -#: util/i386/pc/grub-setup.c:198 +#: util/i386/pc/grub-setup.c:199 #, c-format msgid "the size of `%s' is not %u" msgstr "storleken för \"%s\" är inte %u" -#: util/i386/pc/grub-setup.c:215 +#: util/i386/pc/grub-setup.c:216 #, c-format msgid "the size of `%s' is too small" msgstr "storleken på \"%s\" är för liten" -#: util/i386/pc/grub-setup.c:217 +#: util/i386/pc/grub-setup.c:218 #, c-format msgid "the size of `%s' is too large" msgstr "storleken på \"%s\" är för stor" -#: util/i386/pc/grub-setup.c:254 +#: util/i386/pc/grub-setup.c:255 #, c-format msgid "unable to identify a filesystem in %s; safety check can't be performed" msgstr "" "kunde inte identifiera ett filsystem på %s; säkerhetskontroll kan inte " "genomföras" -#: util/i386/pc/grub-setup.c:258 +#: util/i386/pc/grub-setup.c:259 #, c-format msgid "" "%s appears to contain a %s filesystem which isn't known to reserve space for " @@ -1086,17 +1086,17 @@ "FÖRSTÖRS om viktiga data skrivs över av grub-setup (flaggan --skip-fs-probe " "avaktivera denna kontroll, använd den på egen risk)." -#: util/i386/pc/grub-setup.c:307 +#: util/i386/pc/grub-setup.c:308 msgid "no DOS-style partitions found" msgstr "inga DOS-liknande partitioner hittades" -#: util/i386/pc/grub-setup.c:323 util/i386/pc/grub-setup.c:348 +#: util/i386/pc/grub-setup.c:324 util/i386/pc/grub-setup.c:349 msgid "" "Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "" "Försöker installera GRUB på en opartitionerad disk. Detta är en DÅLIG idé." -#: util/i386/pc/grub-setup.c:329 +#: util/i386/pc/grub-setup.c:330 msgid "" "Attempting to install GRUB to a partition instead of the MBR. This is a BAD " "idea." @@ -1104,11 +1104,11 @@ "Försöker installera GRUB på en partition instället för i MBR. Detta är en " "DÅLIG idé." -#: util/i386/pc/grub-setup.c:357 +#: util/i386/pc/grub-setup.c:358 msgid "No DOS-style partitions found" msgstr "Inga DOS-liknande partitioner hittades" -#: util/i386/pc/grub-setup.c:362 +#: util/i386/pc/grub-setup.c:363 msgid "" "This msdos-style partition label has no post-MBR gap; embedding won't be " "possible!" @@ -1116,7 +1116,7 @@ "Denna msdos-liknande partitionsettikett har inget utrymme efter MBR, " "inbäddning kommer inte att fungera!" -#: util/i386/pc/grub-setup.c:364 +#: util/i386/pc/grub-setup.c:365 msgid "" "This GPT partition label has no BIOS Boot Partition; embedding won't be " "possible!" @@ -1124,19 +1124,19 @@ "Denna GPT-partitions-ettikett har ingen BIOS-partition för uppstart, " "inbäddning kommer inte att fungera!" -#: util/i386/pc/grub-setup.c:371 +#: util/i386/pc/grub-setup.c:372 msgid "Your core.img is unusually large. It won't fit in the embedding area." msgstr "" "Din fil core.img är ovanligt stor. Den kommer inte att få plats i utrymmet " "avsett för inbäddning." -#: util/i386/pc/grub-setup.c:373 +#: util/i386/pc/grub-setup.c:374 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "" "Ditt utrymme för inbäddning är ovanligt litet. core.img kommer inte att få " "plats." -#: util/i386/pc/grub-setup.c:416 +#: util/i386/pc/grub-setup.c:419 msgid "" "embedding is not possible, but this is required when the root device is on a " "RAID array or LVM volume" @@ -1144,7 +1144,7 @@ "inbäddning är inte möjligt, detta krävs dock när rotenheten finns på en RAID-" "kedja eller LVM-volym" -#: util/i386/pc/grub-setup.c:419 +#: util/i386/pc/grub-setup.c:422 msgid "" "Embedding is not possible. GRUB can only be installed in this setup by " "using blocklists. However, blocklists are UNRELIABLE and its use is " @@ -1154,43 +1154,43 @@ "att anvnda blocklistor. Blocklistor är tyvärr OPÅLITLIGA och användandet av " "dem är inte uppmuntrat." -#: util/i386/pc/grub-setup.c:423 +#: util/i386/pc/grub-setup.c:426 msgid "if you really want blocklists, use --force" msgstr "om du verkligen vill använda blocklistor, använd --force" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:445 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "försöker läsa kärnavbildningen \"%s\" från GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:446 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "försöker läsa kärnavbildningen \"%s\" från GRUB igen" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:513 #, c-format msgid "cannot read `%s' correctly" msgstr "kan inte läsa \"%s\" korrekt" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:526 msgid "no terminator in the core image" msgstr "ingen terminering i kärnavbildningen" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:537 msgid "failed to read the first sector of the core image" msgstr "misslyckades med att läsa första sektorn av kärnavbildningen" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:543 msgid "failed to read the rest sectors of the core image" msgstr "mIsslyckades med att läsa restsektorerna i kärnavbildningen" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:562 #, c-format msgid "cannot open `%s'" msgstr "kan inte öppna \"%s\"" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:604 #, c-format msgid "" "Usage: %s [OPTION]... DEVICE\n" @@ -1230,27 +1230,27 @@ "Rapportera fel till <%s>.\n" "Rapportera kommentarer om översättningen till .\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:734 #, c-format msgid "No device is specified.\n" msgstr "Ingen enhet har angivits.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:740 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Okänt extra argument \"%s\".\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid device `%s'.\n" msgstr "Ogiltig enhet \"%s\".\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:770 #, c-format msgid "invalid root device `%s'" msgstr "ogiltig rotenhet \"%s\"" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:783 msgid "cannot guess the root device. Specify the option `--root-device'" msgstr "kan inte gissa rotenhet. Ange flaggan \"--root-device\"" @@ -1262,19 +1262,19 @@ msgid "Loading kernel of FreeBSD %s ..." msgstr "Läser in kärna för FreeBSD %s ..." -#: util/grub.d/10_linux.in:59 +#: util/grub.d/10_linux.in:60 msgid "%s, with Linux %s (recovery mode)" msgstr "%s, med Linux %s (återställningsläge)" -#: util/grub.d/10_linux.in:61 +#: util/grub.d/10_linux.in:62 msgid "%s, with Linux %s" msgstr "%s, med Linux %s" -#: util/grub.d/10_linux.in:86 +#: util/grub.d/10_linux.in:87 msgid "Loading Linux %s ..." msgstr "Läser in Linux %s ..." -#: util/grub.d/10_linux.in:91 +#: util/grub.d/10_linux.in:92 msgid "Loading initial ramdisk ..." msgstr "Läser in initial ramdisk ..." --- grub2-1.98.orig/debian/changelog +++ grub2-1.98/debian/changelog @@ -0,0 +1,3045 @@ +grub2 (1.98-1ubuntu12) lucid-proposed; urgency=low + + * Fix use of freed memory when replacing existing loopback device + (LP: #742967). + * Make sure to reinstall GRUB on upgrade if Wubi is in use (LP: #742967). + * Enable grub-fstest, so that we can use it to help find wubildr + (LP: #610898). + * Make NTFS UUIDs uppercase (LP: #695290). + + -- Colin Watson Wed, 27 Apr 2011 10:39:15 +0100 + +grub2 (1.98-1ubuntu11) lucid-proposed; urgency=low + + * Backport multipath probing fixes (LP: #687501). + + -- Colin Watson Fri, 11 Mar 2011 13:51:04 +0000 + +grub2 (1.98-1ubuntu10) lucid-proposed; urgency=low + + * If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask + where to install GRUB, since it probably means we're in some kind of + specialised environment such as a live USB stick (LP: #591202). + * Drop the default priority of grub2/linux_cmdline to medium. We only + need to ask it if we're upgrading from GRUB Legacy and found an empty + kopt in menu.lst (LP: #591202). + + -- Colin Watson Thu, 20 Jan 2011 15:43:48 +0000 + +grub2 (1.98-1ubuntu9) lucid-proposed; urgency=low + + * in update-grub, explicitly ignore kernels ending in -ec2 (LP: #671097) + + -- Scott Moser Mon, 22 Nov 2010 16:15:12 +0000 + +grub2 (1.98-1ubuntu8) lucid-proposed; urgency=low + + * On Wubi, don't ask for an install device, but just update wubildr using + the diverted grub-install (LP: #581760). + + -- Colin Watson Thu, 23 Sep 2010 14:26:00 +0100 + +grub2 (1.98-1ubuntu7) lucid-proposed; urgency=low + + * Update harmfully incorrect German translation of menu legend, which + omitted mention of pressing Ctrl-x to boot (LP: #580178). + * Rearrange postinst install_devices logic so that preparatory code is run + only once and the while loop only encloses actual asking of questions, + and so that the question being asked is always marked for redisplay when + going round the while loop again (LP: #580408). + * Only offer partitions containing /, /boot, or /boot/grub for + grub-install; installing to other partitions may have harmful effects + such as making Windows unbootable, and installing GRUB to every single + partition is likely to result in confusion anyway (LP: #576724). + + -- Colin Watson Wed, 30 Jun 2010 14:37:47 +0100 + +grub2 (1.98-1ubuntu6) lucid-proposed; urgency=low + + * When migrating from the old grub-pc/install_devices scheme, check if the + old value indicated installation to a single partition on a single disk. + In that case, if there is only one disk present and it has a matching + partition number, then we can install to that partition without asking + (LP: #508173). + + -- Colin Watson Wed, 28 Apr 2010 15:48:02 +0100 + +grub2 (1.98-1ubuntu5) lucid; urgency=low + + * Enclose all translated strings in grub.cfg in single quotes, and escape + them appropriately (LP: #552921). + + -- Colin Watson Tue, 13 Apr 2010 14:29:45 +0100 + +grub2 (1.98-1ubuntu4) lucid; urgency=low + + * Only use the first word of GRUB_DISTRIBUTOR for --class, to avoid + problems if somebody puts spaces in GRUB_DISTRIBUTOR (LP: #557606). + * Probe all devices in 'grub-probe --target=drive' if + /boot/grub/device.map is missing (LP: #549980). + * Adjust hostdisk id for hard disks, allowing grub-setup to use its + standard workaround for broken BIOSes (thanks to TJ for detailed + investigation; LP: #555500). + + -- Colin Watson Fri, 09 Apr 2010 09:46:44 +0100 + +grub2 (1.98-1ubuntu3) lucid; urgency=low + + * Make sure GRUB_TIMEOUT isn't quoted unnecessarily (LP: #544890). + + -- Colin Watson Tue, 30 Mar 2010 10:23:42 +0100 + +grub2 (1.98-1ubuntu2) lucid; urgency=low + + * Fix LVM/RAID probing in the absence of /boot/grub/device.map + (LP: #525085, #527401). + * Backport my upstream patch to copy .mo files from /usr/share/locale to + match where 'make install' puts them (LP: #537998). + * Look for .mo files in /usr/share/locale-langpack as well, in preference + (LP: #537998). + * Don't generate /boot/grub/device.map during grub-mkconfig (we already + suppressed it during grub-install, but then grub-mkconfig generated it + shortly afterwards, producing confusing results). + * Don't run /etc/grub.d/README, even if it somehow ended up being + executable (LP: #537123). + + -- Colin Watson Mon, 22 Mar 2010 19:57:10 +0000 + +grub2 (1.98-1ubuntu1) lucid; urgency=low + + * Resynchronise with Debian (bug-fixes relative to previous snapshot + release). Remaining changes: + - Adjust for default Ubuntu boot options ("quiet splash"). + - Default to hiding the menu; holding down Shift at boot will show it. + - Set a monochromatic theme for Ubuntu. + - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title, + recovery mode, quiet option, tweak how memtest86+ is displayed, and + use UUIDs where appropriate. + - Conflict with grub (<< 0.97-54) as well as grub-legacy. + - Fix backslash-escaping in merge_debconf_into_conf. + - Remove "GNU/Linux" from default distributor string. + - Add crashkernel= options if kdump and makedumpfile are available. + - If other operating systems are installed, then automatically unhide + the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus + if available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, then + fall back to a short delay interruptible with Escape. + - Allow Shift to interrupt 'sleep --interruptible'. + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + - Remove some verbose messages printed before reading the configuration + file. + - Suppress progress messages as the kernel and initrd load for + non-recovery kernel menu entries. + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + - Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. + - Ignore devices loop-mounted from files in 10_linux. + - Show the boot menu if the previous boot failed, that is if it failed + to get to the end of one of the normal runlevels. + - Handle RAID devices containing virtio components. + - Improve DM-RAID probing support. + - Don't generate /boot/grub/device.map during grub-install by default. + - Store grub-pc/install_devices as persistent device names under + /dev/disk/by-id/. + - Change priority to optional to match the priority of grub. + - Shave eight bytes off the pre-partition-table part of boot.img. + - Don't display "GRUB loading" unless Shift is held down. + - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate + our backport of the grub-doc split. + - Optimise hostdisk device handling, substantially speeding up + grub-probe filesystem reads. + + -- Colin Watson Tue, 09 Mar 2010 22:18:14 +0000 + +grub2 (1.98-1) unstable; urgency=low + + * New upstream release (closes: #572898). + - Fix grub-script-check to handle empty lines (closes: #572302). + - Fix offset computation when reading last sectors. Partition reads and + writes within and outside a partition (closes: #567469, #567884). + - Fix script execution error handling bug that meant that an error in a + menuentry's last statement caused the whole menuentry to fail (closes: + #566538, LP: #464743). + - Support GRUB_GFXPAYLOAD_LINUX (closes: #536453, LP: #416772). + + [ Samuel Thibault ] + * Add GRUB_INIT_TUNE example to /etc/default/grub (closes: #570340). + + [ Colin Watson ] + * Build-depend on libusb-dev so that grub-emu is reliably built with USB + support (closes: #572854). + * Update directions in debian/rules on exporting grub-extras to account + for it being maintained in Bazaar nowadays. + * Add myself to Uploaders. + * Acknowledge NMUs, thanks to Torsten Landschoff and Julien Cristau. + + -- Colin Watson Tue, 09 Mar 2010 13:25:35 +0000 + +grub2 (1.98~20100128-1.2) unstable; urgency=low + + * Non-maintainer upload. + * Stop setting gfxpayload=keep (closes: #567245). + + -- Julien Cristau Sun, 14 Feb 2010 20:37:51 +0100 + +grub2 (1.98~20100128-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Apply trivial patch (already merged upstream) fixing the offset + computation for non-cached reads (closes: #567637). + + -- Torsten Landschoff Mon, 08 Feb 2010 22:15:01 +0100 + +grub2 (1.98~20100128-1ubuntu4) lucid; urgency=low + + [ Colin Watson ] + * Update DM-RAID probing patch, removing some configure.ac cruft. + * Add patch from Colin King to shave eight bytes off the + pre-partition-table part of boot.img. + * Don't display "GRUB loading" unless Shift is held down. + * Use light-gray as the default background for highlighted menu entries; + white is not safe because some systems interpret the top bit as blink + (thanks, proski; LP: #527334). + * Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate + our backport of the grub-doc split (LP: #493968). + * Optimise hostdisk device handling, substantially speeding up grub-probe + filesystem reads (LP: #425650). + + -- Colin Watson Wed, 03 Mar 2010 20:33:03 +0000 + +grub2 (1.98~20100128-1ubuntu3) lucid; urgency=low + + * Stop forcing gfxpayload=keep when CONFIG_FB_EFI=y, which it always is on + Ubuntu kernels; this apparently causes trouble with some KMS + framebuffers. + + -- Colin Watson Thu, 04 Feb 2010 18:23:39 -0800 + +grub2 (1.98~20100128-1ubuntu2) lucid; urgency=low + + [ Michael Vogt ] + * Change the priority to optional to match the priority of grub. This + prevents grub-pc getting removed in favour of grub (LP: #449679). + + [ Colin Watson ] + * Stop the postinst failing if there are no devices. + + -- Colin Watson Thu, 04 Feb 2010 12:44:29 -0800 + +grub2 (1.98~20100128-1ubuntu1) lucid; urgency=low + + * Resynchronise with Debian. Remaining changes: + - Adjust for default Ubuntu boot options ("quiet splash"). + - Default to hiding the menu; holding down Shift at boot will show it. + - Set a monochromatic theme for Ubuntu. + - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title, + recovery mode, quiet option, tweak how memtest86+ is displayed, and + use UUIDs where appropriate. + - Conflict with grub (<< 0.97-54) as well as grub-legacy. + - Fix backslash-escaping in merge_debconf_into_conf. + - Remove "GNU/Linux" from default distributor string. + - Add crashkernel= options if kdump and makedumpfile are available. + - If other operating systems are installed, then automatically unhide + the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus + if available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, then + fall back to a short delay interruptible with Escape. + - Allow Shift to interrupt 'sleep --interruptible'. + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + - Remove some verbose messages printed before reading the configuration + file. + - Suppress progress messages as the kernel and initrd load for + non-recovery kernel menu entries. + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + - Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. + - Ignore devices loop-mounted from files in 10_linux. + - Show the boot menu if the previous boot failed, that is if it failed + to get to the end of one of the normal runlevels. + - Handle RAID devices containing virtio components. + - Improve DM-RAID probing support. + * Don't generate /boot/grub/device.map during grub-install by default. + * Store grub-pc/install_devices as persistent device names under + /dev/disk/by-id/ (LP: #496435). Migrate previous device names to that, + with explicit confirmation in non-trivial cases to make sure we got the + right ones. If the devices we were told to install to ever go away, ask + again. + * If the user opts to install GRUB nowhere, make sure they really mean it. + * Backport disk read fixes from upstream. + + -- Colin Watson Wed, 03 Feb 2010 16:53:33 -0800 + +grub2 (1.98~20100128-1) unstable; urgency=low + + * New Bazaar snapshot. + - Fix corruption problem when reading files from CDROM. (Closes: #567219) + + [ Felix Zielcke ] + * Never strip kernel.img in rules. Upstream already does it when it + can be done. (Closes: #561933) + * Bump Standards-Version to 3.8.4. + + [ Robert Millan ] + * rules: Run the testsuite (make check) when building grub-pc. + + -- Robert Millan Thu, 28 Jan 2010 16:28:45 +0100 + +grub2 (1.98~20100126-1) unstable; urgency=low + + * New Bazaar snapshot. + - Includes mipsel-yeeloong port. + + [ Robert Millan ] + * config.in: Lower priority of grub2/linux_cmdline_default. + + [ Felix Zielcke ] + * Drop `CFLAGS=-O0' workaround on powerpc. Should be fixed correctly now. + * Ship grub-bin2h and grub-script-check in grub-common. + * Terminate NEWS.Debian with a blank line like lintian would suggest + if that check would be working correctly. + + -- Felix Zielcke Tue, 26 Jan 2010 19:26:25 +0100 + +grub2 (1.98~20100115-1ubuntu3) lucid; urgency=low + + * Build-depend on libdevmapper-dev for DM-RAID probing patch. + * Handle conversion of DM-RAID disk paths (as well as partition paths) to + GRUB drive names. + + -- Colin Watson Mon, 01 Feb 2010 15:31:07 +0000 + +grub2 (1.98~20100115-1ubuntu2) lucid; urgency=low + + * Restore patch to suppress progress messages as the kernel and initrd + load for non-recovery kernel menu entries. The messages were just moved + into the configuration file upstream, not removed entirely as I'd + mistakenly thought. + + -- Colin Watson Thu, 28 Jan 2010 18:31:37 +0000 + +grub2 (1.98~20100115-1ubuntu1) lucid; urgency=low + + * Resynchronise with Debian. Remaining changes: + - Adjust for default Ubuntu boot options ("quiet splash"). + - Default to hiding the menu; holding down Shift at boot will show it. + - Set a monochromatic theme for Ubuntu. + - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title, + recovery mode, quiet option, tweak how memtest86+ is displayed, and + use UUIDs where appropriate. + - Conflict with grub (<< 0.97-54) as well as grub-legacy. + - Fix backslash-escaping in merge_debconf_into_conf. + - Remove "GNU/Linux" from default distributor string. + - Add crashkernel= options if kdump and makedumpfile are available. + - If other operating systems are installed, then automatically unhide + the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus + if available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, then + fall back to a short delay interruptible with Escape. + - Allow Shift to interrupt 'sleep --interruptible'. + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + - Remove some verbose messages printed before reading the configuration + file. + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + - Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. + - Ignore devices loop-mounted from files in 10_linux. + - Show the boot menu if the previous boot failed, that is if it failed + to get to the end of one of the normal runlevels. + - Handle RAID devices containing virtio components. + * Improve DM-RAID probing support; grub-probe and grub-mkdevicemap should + both now do something reasonable. + + -- Colin Watson Thu, 28 Jan 2010 14:04:48 +0000 + +grub2 (1.98~20100115-1) unstable; urgency=low + + * New Bazaar snapshot. + - Includes savedefault / grub-reboot branch. + - Includes Multiboot video support (from latest 1.x draft). + + -- Robert Millan Fri, 15 Jan 2010 18:15:26 +0100 + +grub2 (1.98~20100110-1) unstable; urgency=low + + * New Bazaar snapshot. + + [ Robert Millan ] + * grub-rescue-pc.postinst: Fix image generation during upgrades. + (Closes: #564261) + + -- Robert Millan Sun, 10 Jan 2010 02:45:52 +0100 + +grub2 (1.98~20100107-1) unstable; urgency=low + + * New Bazaar snapshot. + + [ Robert Millan ] + * grub-rescue-pc.postinst: Use grub-mkrescue for floppy as well. + + [ Updated translations ] + * Chinese (zh_TW.po) by Tetralet. (Closes: #564044) + + -- Robert Millan Thu, 07 Jan 2010 17:56:10 +0100 + +grub2 (1.98~20100101-1ubuntu2) lucid; urgency=low + + * Renumber Ubuntu patches to start from 950 with no gaps. + * Don't record failed boots when using grub-reboot, as that can leave + remote users stranded at a timeout=-1 menu (thanks, Jordan Uggla). + + -- Colin Watson Fri, 15 Jan 2010 12:29:50 +0000 + +grub2 (1.98~20100101-1ubuntu1) lucid; urgency=low + + * Resynchronise with Debian. Remaining changes: + - Adjust for default Ubuntu boot options ("quiet splash"). + - Default to hiding the menu; holding down Shift at boot will show it. + - Set a monochromatic theme for Ubuntu. + - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title, + recovery mode, quiet option, tweak how memtest86+ is displayed, and + use UUIDs where appropriate. + - Conflict with grub (<< 0.97-54) as well as grub-legacy. + - Fix backslash-escaping in merge_debconf_into_conf. + - Remove "GNU/Linux" from default distributor string. + - Add crashkernel= options if kdump and makedumpfile are available. + - If other operating systems are installed, then automatically unhide + the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus + if available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, then + fall back to a short delay interruptible with Escape. + - Allow Shift to interrupt 'sleep --interruptible'. + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + - Remove some verbose messages printed before reading the configuration + file. + - If the environment variable "quiet" is set to something other than 0, + suppress progress messages as the kernel and initrd load. Set this for + non-recovery kernel menu entries. + - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot + utilities. Provides functionality essentially equivalent to GRUB + Legacy's savedefault. + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + - Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. + - Ignore devices loop-mounted from files in 10_linux. + - Show the boot menu if the previous boot failed, that is if it failed + to get to the end of one of the normal runlevels. + - Handle RAID devices containing virtio components. + * Update savedefault patch from current Bazaar branch, fixing grub-reboot + to have distinct behaviour from grub-set-default (LP: #497326). + * Fix grub-mkisofs compilation error with FORTIFY_SOURCE. + * Convert recordfail boilerplate in each menu entry to use a function. + + -- Colin Watson Mon, 11 Jan 2010 11:12:55 +0000 + +grub2 (1.98~20100101-1) unstable; urgency=high + + * New Bazaar snapshot. + - Fix FTBS on sparc. + + [ Robert Millan ] + * rules: Auto-update version from debian/changelog. + + [ Felix Zielcke ] + * Add -O0 to CFLAGS on powerpc to avoid the `_restgpr_31_x in boot is + not defined' FTBFS. + + -- Felix Zielcke Fri, 01 Jan 2010 00:31:37 +0100 + +grub2 (1.98~20091229-1) unstable; urgency=high + + * New Bazaar snapshot. + - Fix slowness when $prefix uses an UUID. + (Closes: #541145, LP: #420933) + - Correctly set TARGET_CFLAGS. (Closes: #562953) + + [ Robert Millan ] + * grub-rescue-pc.postinst: Build USB rescue image. + * rules: Invoke configure with relative path. This makes binaries smaller, + since dprintf strings are constructed using this path. + + [ Felix Zielcke ] + * Urgency=high due to RC bug fix. + * Fix version comparison in grub-common.preinst for handling obsolete + /etc/grub.d/10_freebsd. (Closes: #562921) + + -- Felix Zielcke Tue, 29 Dec 2009 16:05:00 +0100 + +grub2 (1.98~20091222-1) unstable; urgency=low + + * New Baazar snapshot. + - Make 30_os-prober again dash compatible. (Closes: #562034) + + -- Felix Zielcke Tue, 22 Dec 2009 12:50:57 +0100 + +grub2 (1.98~20091221-1) unstable; urgency=low + + * New Bazaar snapshot. + - Fix search command failing on some broken BIOSes. (Closes: #530357) + + [ Felix Zielcke ] + * Add Replaces:/Conflicts: grub-linuxbios to grub-coreboot. (Closes: #561811) + * Delete obsolete /etc/grub.d/10_freebsd if it has not been modified, + else disable it. (Closes: #560346) + + -- Robert Millan Mon, 21 Dec 2009 22:04:17 +0100 + +grub2 (1.98~20091210-1) unstable; urgency=low + + * Version bump. + + -- Robert Millan Mon, 14 Dec 2009 14:52:59 +0100 + +grub2 (1.97+20091210-1) unstable; urgency=low + + * New Bazaar snapshot. + - patches/02_fix_mountpoints_in_mkrelpath.diff: Remove (merged). + - Fixes FTBFS on powerpc (again) and sparc. + - patches/903_grub_legacy_0_based_partitions.diff: Resync (merged into + debian branch). + + * Fix dpkg dependency for lenny compatibility. + + -- Robert Millan Thu, 10 Dec 2009 00:35:20 +0100 + +grub2 (1.97+20091130-1ubuntu1) lucid; urgency=low + + * Resynchronise with Debian (LP: #485457). Remaining changes: + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + - Default to hiding the menu; holding down Shift at boot will show it. + + debian/templates.in: + - Change default value of grub2/linux_cmdline_default to "quiet + splash". + + debian/config.in, debian/postinst.in, debian/grub-pc.templates.in: + - Migrate timeout settings from menu.lst. + + debian/grub.d/05_debian_theme: + - Set a monochromatic theme for Ubuntu. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/control: + - Conflict with grub (<< 0.97-54) as well as grub-legacy. + + debian/postinst.in: + - Fix backslash-escaping in merge_debconf_into_conf. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - Add crashkernel= options if kdump and makedumpfile are available. + + debian/patches/951_quick_boot.diff: + - If other operating systems are installed, then automatically unhide + the menu. + - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if + available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, + then fall back to a short delay interruptible with Escape. + + debian/patches/952_sleep_shift.diff: + - Allow Shift to interrupt 'sleep --interruptible'. + + debian/patches/954_normal_quiet.diff: + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + + debian/patches/955_really_quiet.diff: + - Remove some verbose messages printed before reading the + configuration file. + + debian/patches/956_linux_quiet.diff: + - If the environment variable "quiet" is set to something other than + 0, suppress progress messages as the kernel and initrd load. Set + this for non-recovery kernel menu entries. + + debian/patches/957_savedefault.diff, debian/rules: + - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot + utilities. Provides functionality essentially equivalent to GRUB + Legacy's savedefault. + + debian/patches/959_loopback_root.diff: + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + + debian/patches/961_handle_loopback.diff: + - Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. + + debian/patches/963_linux_no_loopmount.diff: + - Ignore devices loop-mounted from files in 10_linux. + + debian/patches/965_failed_boot_menu.diff, debian/grub-common.init, + debian/grub-common.pm-sleep, debian/grub-common.dirs, debian/rules: + - Show the boot menu if the previous boot failed, that is if it failed + to get to the end of one of the normal runlevels. + + debian/patches/968_raid_virtio.diff: + - Handle RAID devices containing virtio components. + * debian/patches/957_savedefault.diff: Fix --version output from + grub-reboot and grub-set-default (see LP #480571). + * debian/patches/957_savedefault.diff: Cope with /boot being on a separate + filesystem (LP: #478035). + * debian/patches/957_savedefault.diff, 965_failed_boot_menu.diff: Use 'set + var=val' rather than plain 'var=val'. + * debian/patches/969_format_errors.diff: Fix compilation errors due to + gettext work. + + -- Colin Watson Mon, 07 Dec 2009 20:04:28 +0000 + +grub2 (1.97+20091130-1) unstable; urgency=low + + * New Bazaar snapshot. + * Enable ntldr-img from grub-extras. + + -- Robert Millan Mon, 30 Nov 2009 02:33:03 +0100 + +grub2 (1.97+20091125-2) unstable; urgency=low + + [ Updated translations ] + * Bulgarian (bg.po) by Damyan Ivanovi (Closes: #558039) + + [ Robert Millan ] + * control: Remove genisoimage from Build-Depends/Suggests (no longer + used). + * grub.d/05_debian_theme: Make output string distro-agnostic. + + [ Felix Zielcke ] + * patches/02_fix_mountpoints_in_mkrelpath.diff: New patch to handle + mount points like the old shell function did. (Closes: #558042) + + -- Felix Zielcke Sun, 29 Nov 2009 21:38:00 +0100 + +grub2 (1.97+20091125-1) unstable; urgency=low + + [ Robert Millan ] + * New upstream snapshot. + - Fixes script parser load error. + + * Add gettext to Build-Depends and gettext-base to grub-common's + Depends. + + -- Felix Zielcke Wed, 25 Nov 2009 19:22:51 +0100 + +grub2 (1.97+20091124-1) unstable; urgency=low + + * New upstream snapshot. + - Fix grub-mkisofs related FTBFS on powerpc. (Closes: #557704) + - Create fake GRUB devices for devices not listed in device.map. + This also makes dmraid and multipath work as long as + search --fs-uuid works. (Closes: #442382, #540549, LP: #392136) + - rules: grub-emu is now built as a port. + + [ Felix Zielcke ] + * Change the bt-utf-source build dependency to xfonts-unifont. It's + more complete, better maintained and grub-mkfont supports actually + more then BDF fonts as input, thanks to libfreetype. + * Use grub-probe to get the GRUB device of /boot/grub instead of + passing (hd0) to grub-install when creating the core.img with + chainloading. This avoids the (UUID=) hack slowness in case + /boot/grub is on a different disk then (hd0) in device.map. + * patches/903_grub_legacy_0_based_partitions.diff: Update. + * Add a build dependency on automake and python. + * Set TARGET_CC=$(CC) to really use gcc-4.4 everywhere. Also pass it + and CC as arguments to ./configure instead of env vars so they get + preserved. + * Ship grub-mkrelpath in grub-common. + * Ship the locale files in grub-common. + * Add a dependency on 'dpkg (>= 1.15.4) | install-info' for grub-common + as recommended by Policy and lintian. + + + -- Felix Zielcke Tue, 24 Nov 2009 21:20:00 +0100 + +grub2 (1.97+20091115-1) unstable; urgency=low + + * New upstream snapshot. + - Fix security problem with password checking. (Closes: #555195) + - Fix the generated GNU/Hurd menu entries and also add support for + it in 30_os-prober. (Closes: #555188) + - Same grub-mkrescue for grub-pc and grub-coreboot, used by + grub-rescue-pc during postinst now. (Closes: #501867) + + [ Felix Zielcke ] + * Ship grub-mkisofs in grub-common. + * patches/002_grub.d_freebsd.in.diff: Remove (merged upstream). + * patches/906_grub_extras.diff: Remove. Superseded by GRUB_CONTRIB variable + in recent upstream trunk. + * rules: Export GRUB_CONTRIB to enable grub-extras add-ons. + * Pass --force to grub-install in the postinst. (Closes: #553415) + * Don't strip debug symbols from grub-emu. It's meant for debugging + and with them it's much more useful. + * Ship grub-mkfloppy in grub-pc. + * Revert the Replaces: grub-common to (<= 1.96+20080413-1) on the + grub-pc package. It was wrongly modified long ago. + + [ Robert Millan ] + * copyright: Document mkisofs. + * control: Update Vcs- fields (moved to Bazaar). + * rules: Update debian/legacy/update-grub rule to Bazaar. + + -- Felix Zielcke Sun, 15 Nov 2009 19:13:31 +0100 + +grub2 (1.97-1) unstable; urgency=low + + [ Robert Millan ] + * patches/905_setup_force.diff: Remove, no longer needed as of + grub-installer >= 1.47. + * grub.d/05_debian_theme: Attempt to source grub_background.sh from + desktop-base (Needed for #495282, #495616, #500134, see also + #550984). + + [ Felix Zielcke ] + * Add a build dependency on texinfo. + * Fix little typo in /etc/default/grub. (LP: #457703) + + [ Updated translations ] + * Finnish (fi.po) by Esko Arajärvi. (Closes: #551912) + + -- Felix Zielcke Sun, 25 Oct 2009 19:50:21 +0100 + +grub2 (1.97~beta4-1ubuntu4) karmic-proposed; urgency=low + + * New patch, 969_os_prober_separate_boot, fixes wrong kernel/initrd + pathnames and wrong partition UUID/GRUB path when generating menuentries + from os-prober output of a detected system with a separate /boot; thanks + Colin Watson; LP: #462961. + + -- Loïc Minier Thu, 29 Oct 2009 02:30:35 +0000 + +grub2 (1.97~beta4-1ubuntu3) karmic; urgency=low + + * Backport from Debian (Felix Zielcke): + - Add a build dependency on texinfo (LP: #453442). + * debian/patches/968_raid_virtio.diff: Handle RAID devices containing + virtio components (LP: #457687). + + -- Colin Watson Fri, 23 Oct 2009 21:58:13 +0100 + +grub2 (1.97~beta4-1ubuntu2) karmic; urgency=low + + * debian/patches/967_no_mmx_sse.diff: Build with -mno-mmx -mno-sse + -mno-sse2 on i386/lpia, since otherwise lpia is unbootable (LP: + #444562). + + -- Colin Watson Fri, 16 Oct 2009 16:31:12 +0100 + +grub2 (1.97~beta4-1ubuntu1) karmic; urgency=low + + * Resynchronise with Debian. Remaining changes: + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + - Default to hiding the menu; holding down Shift at boot will show it. + + debian/templates.in: + - Change default value of grub2/linux_cmdline_default to "quiet + splash". + + debian/config.in, debian/postinst.in, debian/grub-pc.templates.in: + - Migrate timeout settings from menu.lst. + + debian/grub.d/05_debian_theme: + - Set a monochromatic theme for Ubuntu. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/control: + - Conflict with grub (<< 0.97-54) as well as grub-legacy. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - Add crashkernel= options if kdump and makedumpfile are available. + + debian/patches/951_quick_boot.diff: + - If other operating systems are installed, then automatically unhide + the menu. + - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if + available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, + then fall back to a short delay interruptible with Escape. + + debian/patches/952_sleep_shift.diff: + - Allow Shift to interrupt 'sleep --interruptible'. + + debian/patches/954_normal_quiet.diff: + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + + debian/patches/955_really_quiet.diff: + - Remove some verbose messages printed before reading the + configuration file. + + debian/patches/956_linux_quiet.diff: + - If the environment variable "quiet" is set to something other than + 0, suppress progress messages as the kernel and initrd load. Set + this for non-recovery kernel menu entries. + + debian/patches/957_savedefault.diff, debian/rules: + - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot + utilities. Provides functionality essentially equivalent to GRUB + Legacy's savedefault. + + debian/patches/959_loopback_root.diff: + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + + debian/patches/961_handle_loopback.diff: + - Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. + + debian/patches/963_linux_no_loopmount.diff: + - Ignore devices loop-mounted from files in 10_linux. + + debian/patches/965_failed_boot_menu.diff, debian/grub-common.init, + debian/rules: + - Show the boot menu if the previous boot failed, that is if it failed + to get to the end of one of the normal runlevels. + * debian/patches/957_savedefault.diff, + debian/patches/965_failed_boot_menu.diff: Silently ignore zero-sized + environment blocks (thanks, Felix Zielcke; LP: #439784). + * debian/grub-common.pm-sleep, debian/grub-common.dirs, debian/rules: + Record a successful boot on resume from hibernate (thanks, Maxim + Levitsky; LP: #447725). + * debian/postinst.in: Fix backslash-escaping in merge_debconf_into_conf + (LP: #448413). + * debian/patches/966_mkconfig_probe_option.diff: Backport upstream patch + to make the grub-install --grub-probe option work, which is useful for + vm-builder. + + -- Colin Watson Wed, 14 Oct 2009 12:07:42 +0100 + +grub2 (1.97~beta4-1) unstable; urgency=low + + * New upstream beta release. + + [ Felix Zielcke ] + * Change the Recommends: os-prober to (>= 1.33). + * patches/907_grub.cfg_400.diff: Really add it. Somehow it was a 0 byte file. + (Closes: #547409) + * Convert newlines back to spaces when parsing kopt from + GRUB Legacy's menu.lst, before giving the value to Debconf. + Thanks to Colin Watson. (Closes: #547649) + * Ship the info docs in grub-common. (Closes: #484074) + * Remove generated /usr/share/info/dir* files. + * Update the presubj bug file and also install it for grub-common. + + [ Robert Millan ] + * Enable ZFS and 915resolution in grub-extras (now requires explicit + switch). + * grub-common conflicts with grub-doc (<< 0.97-32) and grub-legacy-doc + (<< 0.97-59). + * Move grub-emu to a separate package. + + [ Updated translations ] + * Japanese (ja.po) by Hideki Yamane. (Closes: #549599) + + -- Robert Millan Mon, 05 Oct 2009 20:03:04 +0200 + +grub2 (1.97~beta3-1ubuntu8) karmic; urgency=low + + [ Colin Watson ] + * debian/control: Conflict with grub (<< 0.97-54) as well as grub-legacy + (see LP #410886). + * debian/grub-common.init: Create /boot/grub if it doesn't exist, to avoid + noise on fresh installations. + + [ Tormod Volden ] + * debian/grub-common.init: do not call log_end_msg if not VERBOSE + (LP: #440879) + + -- Colin Watson Tue, 06 Oct 2009 23:32:54 +0100 + +grub2 (1.97~beta3-1ubuntu7) karmic; urgency=low + + * debian/grub-common.init: /boot/grub/grubenv sometimes seems to end up + zero-sized for some reason. If it is, just delete it (LP: #439784). + + -- Colin Watson Sun, 04 Oct 2009 21:52:10 +0100 + +grub2 (1.97~beta3-1ubuntu6) karmic; urgency=low + + * debian/patches/965_failed_boot_menu.diff, debian/grub-common.init, + debian/rules: Show the boot menu if the previous boot failed, that is if + it failed to get to the end of one of the normal runlevels. + + -- Colin Watson Mon, 28 Sep 2009 09:29:34 +0100 + +grub2 (1.97~beta3-1ubuntu5) karmic; urgency=low + + * debian/patches/957_savedefault.diff: Quote the value assigned to + 'default', in case it contains spaces (LP: #431179). + * debian/patches/964_os-prober_errors.diff: Don't throw away errors from + os-prober; it makes things hard to debug. + + -- Colin Watson Fri, 18 Sep 2009 18:47:06 +0100 + +grub2 (1.97~beta3-1ubuntu4) karmic; urgency=low + + * debian/patches/963_linux_no_loopmount.diff: Ignore devices loop-mounted + from files in 10_linux. + + -- Colin Watson Wed, 16 Sep 2009 17:46:10 +0100 + +grub2 (1.97~beta3-1ubuntu3) karmic; urgency=low + + * debian/patches/962_os-prober_windows_7.diff: Cope with Windows 7 in + os-prober output. + + -- Colin Watson Tue, 15 Sep 2009 06:48:13 +0100 + +grub2 (1.97~beta3-1ubuntu2) karmic; urgency=low + + * debian/config.in: Fix logic if GRUB_HIDDEN_TIMEOUT is entirely missing + from /etc/default/grub. + * debian/patches/961_handle_loopback.diff: Change + prepare_grub_to_access_device to handle filesystems loop-mounted on file + images. + + -- Colin Watson Tue, 15 Sep 2009 00:34:11 +0100 + +grub2 (1.97~beta3-1ubuntu1) karmic; urgency=low + + * Resynchronise with Debian. Remaining changes: + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + - Default to hiding the menu; holding down Shift at boot will show it. + + debian/templates.in: + - Change default value of grub2/linux_cmdline_default to "quiet + splash". + + debian/config.in, debian/postinst.in, debian/grub-pc.templates.in: + - Migrate timeout settings from menu.lst. + + debian/grub.d/05_debian_theme: + - Set a monochromatic theme for Ubuntu. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - Add crashkernel= options if kdump and makedumpfile are available. + + debian/patches/951_quick_boot.diff: + - If other operating systems are installed, then automatically unhide + the menu. + - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if + available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, + then fall back to a short delay interruptible with Escape. + + debian/patches/952_sleep_shift.diff: + - Allow Shift to interrupt 'sleep --interruptible'. + + debian/patches/954_normal_quiet.diff: + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. Don't clear the screen just before + booting if we never drew the menu in the first place. + + debian/patches/955_really_quiet.diff: + - Remove some verbose messages printed before reading the + configuration file. + + debian/patches/956_linux_quiet.diff: + - If the environment variable "quiet" is set to something other than + 0, suppress progress messages as the kernel and initrd load. Set + this for non-recovery kernel menu entries. + + debian/patches/957_savedefault.diff, debian/rules: + - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot + utilities. Provides functionality essentially equivalent to GRUB + Legacy's savedefault. + + debian/patches/959_loopback_root.diff: + - Keep the loopback file open so that subsequent changes to the "root" + environment variable don't affect it. + * debian/patches/960_test_invalid_fs.diff: Fix test crash if loopback + device does not contain a filesystem. + + -- Colin Watson Mon, 14 Sep 2009 10:52:59 +0100 + +grub2 (1.97~beta3-1) unstable; urgency=high + + * New upstream beta release. + - Make it more clear how to use /etc/grub.d/40_custom. (Closes: #545153) + - fix a serious memory corruption in the graphical subsystem. + (Closes: #545364, #544155, #544639, #544822, LP: #424503) + - patches/003_grub_probe_segfault.diff: Remove (merged). + + * Change the watch file so upstream beta releases are recognized. + * Include /etc/default/grub in bug reports. + * Recommend os-prober (>= 1.32). (Closes: #491872) + * Change the gcc-multilib [sparc] build dependency to gcc-4.4-multilib + [sparc]. + * patches/907_grub.cfg_400.diff: New patch to make grub.cfg again mode + 444 if it does not contain a password line. + * Use `su' in the bug reporting script to read grub.cfg in case the user + is not allowed to read it. + * Readd grub-pc/kopt-extracted template. + + [ Updated translations ] + * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge. + * Japanese (ja.po) by Hideki Yamane. (Closes: #545331) + * Spanish (es.po) by Francisco Javier Cuadrado. (Closes: #545566) + * Italian (it.po) by Luca Monducci. (Closes: #546035) + + -- Felix Zielcke Sat, 12 Sep 2009 15:28:20 +0200 + +grub2 (1.97~beta2-2ubuntu2) karmic; urgency=low + + * debian/patches/951_quick_boot.diff: Only do the hidden-timeout checks if + timeout is not already set to -1 (i.e. show menu, no timeout). + * debian/patches/954_normal_quiet.diff: Don't clear the screen just before + booting if we never drew the menu in the first place. + * debian/patches/955_really_quiet.diff: Remove "Booting" message; it turns + out to be hard to suppress any other way. + * debian/patches/956_linux_quiet.diff: Don't try to suppress "Booting" + based on the value of "quiet", as the menu entry commands aren't run + until after this message. + * debian/patches/958_ntfs_64bit.diff: Handle 64-bit file sizes in NTFS. + * debian/patches/959_loopback_root.diff: Keep the loopback file open so + that subsequent changes to the "root" environment variable don't affect + it. + * debian/config.in, debian/postinst.in, debian/grub-pc.templates.in: + Migrate timeout settings from menu.lst (LP: #386789). + * debian/grub-pc.templates.in: Add grub-pc/kopt_extracted template. + + -- Colin Watson Fri, 11 Sep 2009 15:40:38 +0100 + +grub2 (1.97~beta2-2ubuntu1) karmic; urgency=low + + * Resynchronise with Debian. Remaining changes: + + debian/control: + - Recommend rather than Suggest os-prober. + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + - Default to hiding the menu; holding down Shift at boot will show it. + + debian/templates.in: + - Change default value of grub2/linux_cmdline_default to "quiet + splash". + + debian/grub.d/05_debian_theme: + - Set a monochromatic theme for Ubuntu. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - Add crashkernel= options if kdump and makedumpfile are available. + + debian/patches/951_quick_boot.diff: + - If other operating systems are installed, then automatically unhide + the menu. + - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if + available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, + then fall back to a short delay interruptible with Escape. + + debian/patches/952_sleep_shift.diff: + - Allow Shift to interrupt 'sleep --interruptible'. + + debian/patches/954_normal_quiet.diff: + - Don't display introductory message about line editing unless we're + actually offering a shell prompt. + + debian/patches/955_really_quiet.diff: + - Remove some verbose messages printed before reading the + configuration file. + + debian/patches/956_linux_quiet.diff: + - If the environment variable "quiet" is set to something other than + 0, suppress progress messages as the kernel and initrd load. Set + this for non-recovery kernel menu entries. + + debian/patches/957_savedefault.diff, debian/rules: + - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot + utilities. Provides functionality essentially equivalent to GRUB + Legacy's savedefault. + * Drop 953_no_eh_frame.diff, merged upstream. + + -- Colin Watson Mon, 07 Sep 2009 13:33:12 +0100 + +grub2 (1.97~beta2-2) unstable; urgency=low + + [ Updated translations ] + * Dutch (nl.po) by Paul Gevers. (Closes: #545050) + + [ Felix Zielcke ] + * Move GRUB Legacy's grub-set-default to /usr/lib/grub-legacy in + preparation for GRUB 2's grub-set-default. + * Remove password lines in bug script. + + [ Robert Millan ] + * Do not conflict with `grub' dummy package (this prevented upgrades). + * patches/003_grub_probe_segfault.diff: Disable file test codepath, which + wasn't normally used before. + + -- Felix Zielcke Sat, 05 Sep 2009 00:27:22 +0200 + +grub2 (1.97~beta2-1) unstable; urgency=low + + * New upstream beta release. + - Fix loading of FreeBSD modules. (Closes: #544305) + + [ Updated translations ] + * French (fr.po) by Christian Perrier. (Closes: #544320) + * Czech (cs.po) by Miroslav Kure. (Closes: #544327) + * Belarusian (be.po) by Hleb Rubanau. + * Arabic (ar.po) by Ossama M. Khayat. + * Catalan (ca.po) by Juan Andrés Gimeno Crespo. + * Russian (ru.po) by Yuri Kozlov. (Closes: #544730) + * Swedish (sv.po) by Martin Ågren. (Closes: #544759) + * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge. (Closes: #544810) + * German (de.po) by Helge Kreutzmann. (Closes: #544912) + + [ Robert Millan ] + * Build with GCC 4.4. + + -- Robert Millan Fri, 04 Sep 2009 14:40:20 +0200 + +grub2 (1.97~beta1-1ubuntu4) karmic; urgency=low + + * Move grub-reboot and grub-set-default to grub-$platform, since + grub-common is also used by GRUB Legacy (LP: #424425). + + -- Colin Watson Fri, 04 Sep 2009 17:54:10 +0100 + +grub2 (1.97~beta1-1ubuntu3) karmic; urgency=low + + * Restore legacy version of grub-set-default, now moved to + /usr/lib/grub-legacy. + + -- Colin Watson Fri, 04 Sep 2009 15:35:19 +0100 + +grub2 (1.97~beta1-1ubuntu2) karmic; urgency=low + + * debian/patches/953_no_eh_frame.diff: Build with -fno-dwarf2-cfi-asm to + stop gcc-4.4 generating .eh_frame sections that cause core.img to be too + big to embed in some common cases (LP: #423412). + * debian/patches/954_normal_quiet.diff: Don't display introductory message + about line editing unless we're actually offering a shell prompt. + * debian/patches/955_really_quiet.diff: Remove some verbose messages + printed before reading the configuration file. In some ways this is + awkward because it makes debugging harder, but it's a requirement for a + smooth-looking boot process; we may be able to do better in future (LP: + #386922). + * debian/patches/956_linux_quiet.diff: If the environment variable "quiet" + is set to something other than 0, suppress progress messages as the + kernel and initrd load. Set this for non-recovery kernel menu entries + (LP: #386922). + * debian/patches/957_savedefault.diff: Add GRUB_DEFAULT=saved, as well as + grub-set-default and grub-reboot utilities. Provides functionality + essentially equivalent to GRUB Legacy's savedefault (LP: #216178). + * debian/rules, debian/grub-pc.install.in: Install grub-reboot and + grub-set-default only in grub-common. + * Add tag information to old Ubuntu patches. + + -- Colin Watson Fri, 04 Sep 2009 15:02:36 +0100 + +grub2 (1.97~beta1-1ubuntu1) karmic; urgency=low + + * Resynchronise with Debian. Remaining changes: + + debian/control: + - Recommend rather than Suggest os-prober. + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + - Default to hiding the menu; holding down Shift at boot will show it. + + debian/templates.in: + - Change default value of grub2/linux_cmdline_default to "quiet + splash". + + debian/grub.d/05_debian_theme: + - Set a monochromatic theme for Ubuntu. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - Add crashkernel= options if kdump and makedumpfile are available. + + debian/patches/951_quick_boot.diff: + - If other operating systems are installed, then automatically unhide + the menu. + - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if + available to check whether Shift is pressed. If it is, show the + menu, otherwise boot immediately. If keystatus is not available, + then fall back to a short delay interruptible with Escape. + + debian/patches/952_sleep_shift.diff: + - Allow Shift to interrupt 'sleep --interruptible'. + * Drop 950_getkeystatus.diff, merged upstream. + + -- Colin Watson Tue, 01 Sep 2009 17:37:19 +0100 + +grub2 (1.97~beta1-1) unstable; urgency=low + + * New upstream beta release. + + [ Updated translations ] + * German (de.po) by Helge Kreutzmann. (Closes: #544261) + * Asturian (ast.po) by Marcos. + * Georgian (ka.po) by Aiet Kolkhi. + + [ Robert Millan ] + * Merge config, templates, postinst, postrm, dirs and install files + into a single source. + * Disable Linux-specific strings on GNU/kFreeBSD. Enable translations + in grub2/linux_cmdline_default. Add grub2/kfreebsd_* strings (still + unused). + + -- Felix Zielcke Sun, 30 Aug 2009 18:01:40 +0200 + +grub2 (1.96+20090829-1) unstable; urgency=low + + * New SVN snapshot. + - Fix filesystem mapping on GNU/kFreeBSD. (Closes: #543950) + + * New grub-extras SVN snapshot. + - Add 915resolution support to the GMA500 (poulsbo) graphics chipset. + Thanks to Pedro Bulach Gapski. (Closes: #543917) + + * Use `cp -p' to copy /usr/share/grub/default/grub to the temporary + file to preverse permissions. + * Remove also efiemu files from /boot/grub on purge if requested. + * Check that GRUB_CMDLINE_LINUX and GRUB_CMDLINUX_LINUX_DEFAULT is at + the start of line in *.postinst. + * Don't check that $GRUB_CMDLINE_LINUX{,DEFAULT} are non empty strings + in *.config. + * Add empty GRUB_CMDLINE_LINUX to /usr/share/grub/default/grub. + * Factorise the editing of the temporary file. Thanks to Martin F + Krafft. + * Read in /etc/default/grub in *.config files. + + [ Updated translations ] + * French (fr.po) by Christian Perrier. (Closes: #544023) + * Russian (ru.po) by Yuri Kozlov. (Closes: #544077) + * Italian (it.po) by Luca Monducci. (Closes: #544200) + + -- Felix Zielcke Sat, 29 Aug 2009 17:01:17 +0200 + +grub2 (1.96+20090826-3ubuntu3) karmic; urgency=low + + * 951_quick_boot.diff: Always initialise timeout from GRUB_TIMEOUT, + otherwise there'll be no timeout when other operating systems are + installed. + + -- Colin Watson Thu, 27 Aug 2009 14:13:03 +0100 + +grub2 (1.96+20090826-3ubuntu2) karmic; urgency=low + + * 952_sleep_shift.patch: New patch. Allow Shift to interrupt 'sleep + --interruptible', for consistency with the quick-boot scheme. + * debian/*.templates: Change default value of grub2/linux_cmdline_default + to 'quiet splash', to match debian/default/grub. + + -- Colin Watson Thu, 27 Aug 2009 11:29:24 +0100 + +grub2 (1.96+20090826-3ubuntu1) karmic; urgency=low + + * Resynchronise with Debian (LP: #413151). Remaining changes: + + debian/control: + - Recommend rather than Suggest os-prober. + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + - Default to hiding the menu with a three-second timeout. Pressing + Escape during this time will show the menu. + + debian/grub.d/05_debian_theme: + - Set a monochromatic theme for Ubuntu. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - add crashkernel= options if kdump and makedumpfile + is available (part of the kernel-crashdump spec) + * Drop 950_hidden_timeout.diff, merged upstream. + * Drop 951_gfxpayload_keep.diff. It doesn't make as much sense as I + thought, and it needs better kernel support anyway. + * 950_getkeystatus.diff: New patch. Add getkeystatus terminal method, and + add a new keystatus command to query it. + * 951_quick_boot.diff: New patch: + - If other operating systems are installed, then automatically unhide + the menu (LP: #411584). + - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if + available to check whether Shift is pressed. If it is, show the menu, + otherwise boot immediately. If keystatus is not available, then fall + back to a short delay interruptible with Escape. + * debian/default/grub: Adjust defaults to match new quick-boot code. + + -- Colin Watson Thu, 27 Aug 2009 00:35:22 +0100 + +grub2 (1.96+20090826-3) unstable; urgency=low + + * Add missing quotes in grub-pc.config and *.postinst. + + -- Felix Zielcke Wed, 26 Aug 2009 19:14:23 +0200 + +grub2 (1.96+20090826-2) unstable; urgency=low + + * Really use the correct templates in grub-pc.config. ARGS. + + -- Felix Zielcke Wed, 26 Aug 2009 14:10:41 +0200 + +grub2 (1.96+20090826-1) unstable; urgency=low + + * New SVN snapshot. + + * Use the right templates in grub-pc.config. (Closes: #543615) + + -- Felix Zielcke Wed, 26 Aug 2009 11:00:36 +0200 + +grub2 (1.96+20090825-1) unstable; urgency=low + + * New SVN snapshot. + - Enable gfxterm only if there's a suitable video backend and don't + print an error if not. (Closes: #520846) + + [ Felix Zielcke ] + * Copy unicode.pf2 instead of ascii.pf2 to /boot/grub in grub-pc + postinst (Closes: #542314). + * Update Standards version to 3.8.3. + * Use DEB_HOST_ARCH_CPU for the generation of the lintian overrides. + * Fix calling the grub-pc/postrm_purge_boot_grub template in + grub-pc.postinst. + * Handle GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT via + debconf. Thanks to Martin F. Krafft and Colin Watson for idea and + hints. + * Use ucfr --force when /etc/default/grub is registered to a grub-* package. + * Use #!/bin/sh in *.config and fix a small bashism in grub-pc.config. + + [ Robert Millan ] + * patches/907_terminal_output_workaround.diff: Remove. It seems that + it wasn't really necessary. + * grub-pc.postinst: Avoid printing an error if /etc/kernel-img.conf + doesn't exist, because it is misleading. We simply refrain from + fixing it and move along. + * grub-pc.postinst: Don't schedule generation of grub.cfg via "grub-install" + code path unless we actually run grub-install. + * grub-pc.postinst: Only copy unicode.pf2 and moreblue-orbit-grub.png when + /boot/grub/grub.cfg is scheduled to be generated. + * legacy/upgrade-from-grub-legacy: Reset grub-pc/install_devices. + Thanks Colin Watson. (Closes: #541230) + + -- Felix Zielcke Tue, 25 Aug 2009 21:45:24 +0200 + +grub2 (1.96+20090808-1) unstable; urgency=low + + * New SVN snapshot. + - Fix XFS with inode size different then 256. (Closes: #528761) + - Add support for multiple LVM metadata areas. (LP: #408580) + - patches/008_dac_palette_width.diff: Remove. (merged) + - Prefer unicode over ascii font. (LP: #352034) + + [ Felix Zielcke ] + * Fix the generation of the lintian override for efiemu64.o. + * Remove the Conflicts dmsetup. + * Use ?= for setting DEB_HOST_ARCH. + * Document GRUB_DISABLE_LINUX_RECOVERY in /etc/default/grub. + (Closes: #476536 LP: #190207) + * Add docs/grub.cfg to examples. + * patches/01_uuids_and_lvm_dont_play_along_nicely.diff: Updated to + also disable UUIDs on LVM over RAID. + * Add a debconf prompt to remove all grub2 files from /boot/grub on + purge. (Closes: #527068, #470400) + * Move the Suggests: os-prober from grub-pc to grub-common. + * patches/901_dpkg_version_comparison.diff: Updated. + * Update the Replaces on grub-common for the other packages to (<< + 1.96+20080831-1). (Closes: #540492) + + [ Robert Millan ] + * Reorganize grub-pc.{config,postinst} logic. The idea being that if there's + no trace of GRUB Legacy, the grub-pc/install_devices template will be + shown even if this is the first install. + * When setting grub-pc/install_devices, obtain input dynamically from + grub-mkdevicemap (rather than devices.map). (Closes: #535525) + * Add a note to grub-pc/install_devices template that it's also possible + to install GRUB to a partition boot record. + * patches/002_grub.d_freebsd.in.diff: New patch. Reimplement + 10_freebsd.in to handle multiple kernel versions & acpi.ko. + + -- Robert Millan Mon, 10 Aug 2009 18:49:52 +0200 + +grub2 (1.96+20090725-1ubuntu2) karmic; urgency=low + + * 950_hidden_timeout.diff: New patch. Add GRUB_HIDDEN_TIMEOUT support. + Move the timeout setting to the end so that the sleep comes after + terminal setup. + * debian/default/grub: Default to hiding the menu with a three-second + timeout. Pressing Escape during this time will show the menu. + grub-installer will unhide it if other operating systems are installed. + * debian/grub.d/05_debian_theme: Set a monochromatic theme for Ubuntu. + * 951_gfxpayload_keep.diff: New patch. If gfxpayload starts with "keep" or + if GRUB_ASSUME_LINUX_HAS_FB_SUPPORT is defined, then tell Linux to use + the current video mode. + + -- Colin Watson Mon, 10 Aug 2009 13:08:21 +0100 + +grub2 (1.96+20090725-1ubuntu1) karmic; urgency=low + + * New upstream version. + + Fixes offering Windows (LP: #402795) + + Fixes Vista/Win7 fails to boot (LP: #402154) + + Fixes installation onto VFAT (LP: #401971) + * Merge from debian unstable, remaining changes: + + debian/control: + - Depend on rather than Suggest os-prober; Ubuntu version does not + suffer from the mount problem that prevents Debian from marking this + Depends. + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use new GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + + debian/patches/10_crashkernel.patch: + - add crashkernel= options if kdump and makedumpfile + is available (part of the kernel-crashdump spec) + * Update 10_crashkernel.patch for changes upstream. + * Drop 999_os-prober_drivemap_root.diff, upstream. + + -- Mario Limonciello Thu, 30 Jul 2009 12:41:19 -0500 + +grub2 (1.96+20090725-1) unstable; urgency=high + + * New SVN snapshot. + - Don't add drivemap call with Windows Vista/7. It breaks Win 7. + (LP: #402154) + + [ Felix Zielcke ] + * Don't build grub-efi-amd64 on hurd-i386. + * Change DEB_BUILD_ARCH to DEB_HOST_ARCH in the check for sparc. + * Don't add the lintian override for kernel.img for sparc and grub-pc. + * Add a lintian override for binary-from-other-architecture for + grub-efi-amd64 and grub-pc on i386. + * Use wildcards in the lintian overrides. + * Add a Conflicts/Replaces for all packages except grub-common. + (Closes: #538177) + + [ Robert Millan ] + * 008_dac_palette_width.diff: New patch. Fix blank screen when booting + Linux with vga= parameter set to a packed color mode (<= 8-bit). + (Closes: #535026) + * Set urgency=high because #535026 affects 1.96+20090709-1 which is in + testing now. + * patches/907_terminal_output_workaround.diff: Work around recent regression + with terminal_output command (not critical, just breaks gfxterm). + + -- Robert Millan Sat, 25 Jul 2009 19:00:53 +0200 + +grub2 (1.96+20090721-4) unstable; urgency=low + + * Place grub-ofpathname only in grub-common. (Closes: #537999) + + -- Felix Zielcke Wed, 22 Jul 2009 13:38:24 +0200 + +grub2 (1.96+20090721-3) unstable; urgency=low + + * Don't strip kernel.img on sparc. + * Suggest efibootmgr on grub-efi-{amd64,ia32}. + * Pass --disable-grub-fstest to configure. (Closes: #537897) + + -- Felix Zielcke Tue, 21 Jul 2009 21:46:01 +0200 + +grub2 (1.96+20090721-2) unstable; urgency=low + + * Add back Conflicts/Replaces grub. + + -- Felix Zielcke Tue, 21 Jul 2009 11:24:45 +0200 + +grub2 (1.96+20090721-1) unstable; urgency=low + + * New SVN snapshot. + + * Change License of my update-grub(8) and update-grub2(8) manpages to + GPL3+ to match new copyright file. + * Merge from Ubuntu: Don't build grub-efi-amd64 on lpia. + * Don't pass `--enable-efiemu' to configure. On kfreebsd-i386 it won't + compile and it should be now auto detected if it's compilable. + (Closes: #536783) + * Don't build grub-efi-amd64 on kfreebsd-i386. It lacks 64bit compiler + support. + * Rename the lintian override for kernel.elf to kernel.img. + * Strip kernel.img not kernel.elf, but not in the case of grub-pc. + * Rename the Conflicts/Replaces grub to grub-legacy. (Closes: #537824) + + -- Felix Zielcke Tue, 21 Jul 2009 10:50:20 +0200 + +grub2 (1.96+20090709-1) unstable; urgency=low + + * New SVN snapshot. + + * control (Build-Depends): Add gcc-multilib [sparc]. + * copyright: Rewrite using DEP-5 format. + * Merge grub-extras into the package, and integrate it with GRUB's + build system. + - patches/906_grub_extras.diff + - rules + - copyright + + -- Robert Millan Thu, 09 Jul 2009 00:26:49 +0200 + +grub2 (1.96+20090702-1) unstable; urgency=low + + * New SVN snapshot. + * rules: Remove duplicated files in sparc64-ieee1275 port. + * rules: Comment out -DGRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 setting. We'll + re-evaluate using it when it's more mature. (Closes: #535026). + + -- Robert Millan Thu, 02 Jul 2009 13:23:51 +0200 + +grub2 (1.96+20090629-1) unstable; urgency=low + + * New SVN snapshot. + - Misc fixes in Linux loader. + + * control (grub-firmware-qemu): Make it buildable only on i386/amd64. + * control: Add sparc (grub-ieee1275), remove remnants of ppc64. + * rules: Include all modules in grub-firmware-qemu build. + + -- Robert Millan Mon, 29 Jun 2009 19:22:37 +0200 + +grub2 (1.96+20090628-1) unstable; urgency=low + + * New SVN snapshot. + * Re-enable QEMU port. + + -- Robert Millan Sun, 28 Jun 2009 01:11:10 +0200 + +grub2 (1.96+20090627-2) unstable; urgency=low + + * Disable QEMU port untill it goes through NEW. + * Upload to unstable. + + -- Robert Millan Sat, 27 Jun 2009 18:40:17 +0200 + +grub2 (1.96+20090627-1) experimental; urgency=low + + * New SVN snapshot. + - Fix parsing of --output in grub-mkconfig. (Closes: #532956) + + [ Felix Zielcke ] + * Use ucfr --force in grub-ieee1275.postinst in case we're upgrading + from previous version. It registered /etc/default/grub wrongly with + package iee1275. + * Drop the build dependency on libc6-dev-i386. + * Remove ppc64 from the Architectures. It's totally dead. + * Add a note to /etc/default/grub that update-grub needs to be run to + update grub.cfg. (Closes: #533026) + * Fix the svn-snapshot rule. + * Update Standards version to 3.8.2. No changes needed. + + [ Robert Millan ] + * legacy/upgrade-from-grub-legacy: Invoke grub-pc.postinst directly rather + than dpkg-reconfigure. Since we pretend we're upgrading, it will DTRT. + * Add grub-firmware-qemu package. + - patches/008_qemu.diff: QEMU port (patch from upstream). + - control (grub-firmware-qemu): New package. + - rules: Add grub-firmware-qemu targets. + - debian/grub-firmware-qemu.dirs + - debian/grub-firmware-qemu.install + * patches/906_revert_to_linux16.diff: Remove, now that gfxpayload is + supported. + + -- Robert Millan Sat, 27 Jun 2009 00:46:23 +0200 + +grub2 (1.96+20090611-1ubuntu4) karmic; urgency=low + + * debian/patches/10_crashkernel.diff: + - make crashkernel= commandline appear before the other options + to workaround a bug in the crashkernel parser + (http://lists.infradead.org/pipermail/kexec/2009-July/003444.html) + + -- Michael Vogt Thu, 16 Jul 2009 11:37:05 +0200 + +grub2 (1.96+20090611-1ubuntu3) karmic; urgency=low + + * Drop os-prober to a Recommends at Felix Zielcke's suggestion. + * Don't build grub-efi-amd64 on lpia for the moment, since we don't seem + to have sufficient compiler support. + + -- Colin Watson Wed, 08 Jul 2009 16:25:58 +0100 + +grub2 (1.96+20090611-1ubuntu2) karmic; urgency=low + + * 10_crashkernel.patch: + - add crashkernel= options if kdump and makedumpfile + is available (part of the kernel-crashdump spec) + + -- Michael Vogt Wed, 24 Jun 2009 10:19:57 +0200 + +grub2 (1.96+20090611-1ubuntu1) karmic; urgency=low + + * Resynchronise with Debian. Remaining changes: + + debian/control: + - Depend on rather than Suggest os-prober; Ubuntu version does not + suffer from the mount problem that prevents Debian from marking this + Depends. + + debian/default/grub: + - Adjust for default Ubuntu boot options. + - Use new GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + + debian/legacy/update-grub: + - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak + how memtest86+ is displayed. + - Use UUIDs where appropriate. + + debian/patches/03_ubuntu_grub_standards: + - Remove GNU/Linux from default string. + * debian/patches/999_os-prober_drivemap_root.diff: + - Backport r2333 from upstream to fix chain-loading of operating systems + detected by os-prober. + + -- Colin Watson Wed, 17 Jun 2009 12:05:47 +0100 + +grub2 (1.96+20090611-1) experimental; urgency=low + + * New SVN snapshot. + + * Append .diff to patches/01_uuids_and_lvm_dont_play_along_nicely so + it gets really applied. + * Drop completely the build dependency on gcc-multilib. + * Instead of arborting in the preinst if /etc/kernel-img.conf still + contains /sbin/update-grub, change the file with sed. Policy allows + thisi, because it's not a conffile, according to Colin Watson. + * Change /etc/default/grub to an ucf managed file instead of dpkg + conffile. + + -- Felix Zielcke Fri, 12 Jun 2009 11:46:24 +0200 + +grub2 (1.96+20090609-1) experimental; urgency=low + + * New SVN snapshot. + - Fix variable parsing inside strings. (Closes: #486180) + - Add `true' command. (Closes: #530736) + + [ Robert Millan ] + * Split grub-efi in grub-efi-ia32 and grub-efi-amd64, both available + on i386 and amd64. (Closes: #524756) + * Add kopensolaris-i386 to arch list. + + [ Felix Zielcke ] + * Add a NEWS entry about the grub-efi split. + * Drop the build dependency on gcc-multilib for all *i386. + * Change upgrade-from-grub-legacy to use `dpkg-reconfigure grub-pc' to + install grub2 into MBR. + + [ New translations ] + * Catalan (ca.po) by Jordi Mallach. + + [ Updated translations ] + * Spanish (es.po) by Francisco Javier Cuadrado. (Closes: #532407) + + -- Jordi Mallach Tue, 09 Jun 2009 19:21:15 +0200 + +grub2 (1.96+20090603-1) unstable; urgency=low + + * New SVN snapshot. + + * Abort the install of grub-pc if /etc/kernel-img.conf still contains + /sbin/update-grub (Closes: #500631). + + -- Felix Zielcke Wed, 03 Jun 2009 20:01:11 +0200 + +grub2 (1.96+20090602-1) unstable; urgency=low + + * New SVN snapshot. + + [ Felix Zielcke ] + * Skip floopies in the grub-install debconf prompt in grub-pc postinst. + Patch by Fabian Greffrath. (Closes: #530848) + + [ Robert Millan ] + * Change Vcs-Browser field to viewsvn. + + [ Felix Zielcke ] + * Change Vcs-Svn field to point to the trunk. (Closes: #531391) + * patches/01_uuids_and_lvm_dont_play_along_nicely: New patch. + On Debian root=UUID= with lvm still doestn't work so disable it. + (Closes: #530357) + * Remove Otavio Salvador from Uploaders with his permission. + * add grub-pc.preinst + + -- Felix Zielcke Wed, 03 Jun 2009 14:42:11 +0200 + +grub2 (1.96+20090523-1ubuntu1) karmic; urgency=low + + [ Colin Watson ] + * Resynchronise with Debian. Remaining changes: + + debian/control: + - Depend on rather than Suggest os-prober; Ubuntu version does not + suffer from the mount problem that prevents Debian from marking this + Depends. + + debian/default/grub + - Adjust for default Ubuntu boot options. + - Use new GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + + debian/patches/03_ubuntu_grub_standards + - Remove GNU/Linux from default string. + * debian/legacy/update-grub: Apply Ubuntu branding: title, recovery mode, + quiet option, and tweak how memtest86+ is displayed. + + [ Andy Whitcroft ] + * debian/legacy/update-grub: fix generation to use the uuid command for + the root specifier when the groot is a UUID. Use the same test as is + used in the 'grub' package. LP: #376879 + + -- Colin Watson Thu, 04 Jun 2009 11:20:12 +0100 + +grub2 (1.96+20090523-1) unstable; urgency=low + + * New SVN snapshot. + - Add drivemap command, similar to grub-legacy's map command. + (Closes: 503630) + - Export GRUB_TERMINAL_INPUT in grub-mkconfig. (Closes: #526741) + + [ Robert Millan ] + * rules: Set GRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 in CFLAGS. + * patches/905_setup_force.diff: Relax blocklist warnings. + * patches/906_revert_to_linux16.diff: Keep using linux16 for now. + + [ Felix Zielcke ] + * patches/07_core_in_fs.diff: Updated. + * Remove /etc/grub.d/10_hurd on non-Hurd systems in the grub-common + preinst. Likewise for 10_freebsd for non kFreebsd and 10_linux on + kFreebsd and Hurd. (Closes: #523777) + + -- Felix Zielcke Sat, 23 May 2009 20:05:10 +0200 + +grub2 (1.96+20090504-1) experimental; urgency=low + + * New SVN snapshot. + - Add support for parttool command, which can be used to hide partitions. + (Closes: #505905) + - Fix a segfault with LVM on RAID. (Closes: #520637) + - Add support for char devices on (k)FreeBSD. (Closes: #521292) + - patches/08_powerpc-ieee1275_build_fix.patch: Remove (merged). + + [ Updated translations ] + * Basque (eu.po) by Piarres Beobide. (Closes: #522457) + * German (de.po) by Helge Kreutzmann. (Closes: #522815) + + [ Robert Millan ] + * Update my email address. + * Remove 04_uuids_and_abstraction_dont_play_along_nicely.diff now that + bugs #435983 and #455746 in mdadm and dmsetup have been fixed. + + [ Felix Zielcke ] + * Place new grub-dumpbios in grub-common. + * Add lpia to the archictectures to reduce the ubuntu delta. + * Add a manpage for the update-grub and update-grub2 stubs, written by + me. (Closes: #523876) + * Suggest genisoimage on grub-pc and grub-ieee1275, because grub-mkrescue + needs it to create a cd image. (Closes: #525845) + * Add a dependency on $(AUTOGEN_FILES) for the configure/grub-common target, + this is needed now that upstream removed the autogenerated files from SVN. + * Add `--enable-efiemu to' `./configure' flags. + * Add a build dependency on gcc-multilib for i386. + * Drop alternate build dependency on gcc-4.1 (<< 4.1.2). + + -- Felix Zielcke Mon, 04 May 2009 21:01:22 +0200 + +grub2 (1.96+20090402-1) experimental; urgency=low + + * New SVN snapshot. + - Fix regression in disk/raid.c. (Closes: #521897, #514338) + - Fix handling of filename string lengths in HFS. + (Really closes: #516458). + * Add myself to Uploaders. + * Add patch 08_powerpc-ieee1275_build_fix.patch to fix powerpc-ieee1275 + builds which were lacking header files for kernel_elf_HEADERS. Thanks + Vladimir Serbinenko. + + -- Jordi Mallach Fri, 03 Apr 2009 20:58:37 +0200 + +grub2 (1.96+20090401-1) experimental; urgency=low + + [ Felix Zielcke ] + * New SVN snapshot. + - Pass grub's gfxterm mode to Linux kernel. (Closes: #519506) + - Fix ext4 extents on powerpc. (Closes: #520286) + + [ Robert Millan ] + * Remove grub-of transitional package (Lenny had grub-ieee1275 already). + * Fix kopt parsing in grub-pc.config. Thanks Marcus Obst. (Closes: #514837) + * Add debconf template to automatically run grub-install during upgrades + (prior user confirmation). (Closes: #514705) + + -- Robert Millan Wed, 01 Apr 2009 01:19:45 +0200 + +grub2 (1.96+20090317-1) unstable; urgency=low + + * New SVN snapshot. + - Fix loading of files with underscore in HFS. (Closes: #516458) + + * Update Standards version to 3.8.1. No changes needed. + + [ Updated translations ] + * Brazilian Portuguese (pt_BR.po) by Flamarion Jorge. (Closes: #519417) + + -- Felix Zielcke Tue, 17 Mar 2009 14:42:10 +0100 + +grub2 (1.96+20090309-1) unstable; urgency=low + + * New SVN snapshot. + + -- Felix Zielcke Mon, 09 Mar 2009 10:03:13 +0100 + +grub2 (1.96+20090307-1) unstable; urgency=low + + * New SVN snapshot. + - Add support for /dev/md/dNNpNN mdraid devices. (Closes: #509960) + - Add new PF2 fontengine. (Closes: #510344) + - Avoid mounting ext2 partitions with backward-incompatible features. + (Closes: #502333) + - Try to avoid false positives with FAT. (Closes: #514263) + + [ Felix Zielcke ] + * Remove build-dependency on unifont package and add one for bf-utf-source + package and libfreetype6-dev + * grub-pc.postinst: Copy new ascii.pf2 instead of old ascii.pff to /boot/grub. + * Add `--enable-grub-mkfont' to configure flags. + * Put new grub-mkfont in grub-common package. + * Add a dependency for ${misc:Depends} to all packages to make lintian a bit + more happy. + * Detect when grub-setup leaves core.img in filesystem, and include that + info in bug report templates. + - debian/patches/07_core_in_fs.diff + - debian/script + * Add myself to Uploads and add `DM-Upload-Allowed: yes' tag. + + [ Updated translations ] + * Asturian (ast.po) by Marcos Alvarez Costales. (Closes: #511144) + * Traditional Chinese (zh_TW.po) by Tetralet. (Closes: #513918) + * Belarusian (be.po) by Pavel Piatruk. (Closes: #516243) + + -- Felix Zielcke Sat, 07 Mar 2009 11:54:43 +0100 + +grub2 (1.96+20081201-1) experimental; urgency=low + + * New SVN snapshot. + + -- Robert Millan Mon, 1 Dec 2008 00:07:31 +0100 + +grub2 (1.96+20081120-1) experimental; urgency=low + + * New SVN snapshot. + + * Update to new debian theme. + - grub-pc.postinst: Switch to moreblue-orbit-grub.png. + - grub.d/05_debian_theme: Likewise. + * grub.d/05_debian_theme: + - Update to use new grub-mkconfig_lib instead of the deprecated + update-grub_lib. + - Update to check if `GRUB_TERMINAL_OUTPUT' is `gfxterm' instead of + `GRUB_TERMINAL'. + + [ Updated translations ] + * Romanien (ro.po) by Eddy Petrișor. (Closes: #506039) + + -- Felix Zielcke Thu, 20 Nov 2008 20:25:56 +0100 + +grub2 (1.96+20081108-1) experimental; urgency=low + + * New SVN snapshot. + - Add support for /dev/md/N style mdraid devices. (Closes: #475585) + - Handle LVM dash escaping. (Closes: #464215) + - Use case insensitive match in NTFS. (Closes: #497889) + - Use hd%d drive names in grub-mkdevicemap for all architectures. + (Closes: #465365) + - Handle LVM circular metadata. (Closes: #462835, #502953) + - Fix NULL dereference and failure paths in LVM. Thanks Guillem Jover. + (Closes: #500482) + - Provides GRUB header files (only in grub-common). + + [ Updated translations ] + * Dutch (nl.po) by Paul Gevers. (Closes: #500514) + * French (fr.po) by Christian Perrier. (Closes: #503708) + * Georgian (ka.po) by Aiet Kolkhi. (Closes: #503715) + * Czech (cs.po) by Miroslav Kure. (Closes: #503809) + * German (de.po) by Helge Kreutzmann. (Closes: #503841) + * Japanese (ja.po) by Hideki Yamane. (Closes: #503869) + * Italian (it.po) by Luca Monducci. (Closes: #504076) + * Swedish (sv.po) by Martin Ågren. (Closes: #504207) + * Arabic (ar.po) by Ossama Khayat. (Closes: #504254) + * Portuguese (pt.po) by Miguel Figueiredo. (Closes: #504280) + * Russian (ru.po) by Yuri Kozlov. (Closes: #504324) + * Finnish (fi.po) by Esko Arajärvi. (Closes: #504310) + * Basque (eu.po) by Piarres Beobide. (Closes: #504466) + * Dutch (nl.po) by Paul Gevers. (Closes: #504683) + + [ Felix Zielcke ] + * patches/01_grub_legacy_0_based_partitions.diff: Rename to + * patches/903_grub_legacy_0_based_partitions.diff: this and adapt for + s/biosdisk.c/hostdisk.c/ rename upstream. + * patches/03_disable_floppies.diff + patches/904_disable_floppies.diff: Likewise. + * update-grub has been renamed to grub-mkconfig, so provide a stub for + compatibility. + * Make grub-pc/linux_cmdline debconf template translatable. (Closes: #503478) + * Remove ro.po and ta.po. They don't contain a single translated + message. + + [ Robert Millan ] + * control: Make grub-common dependency = ${binary:Version}. + * default/grub: Set GRUB_CMDLINE_LINUX=quiet to syncronize with + default D-I settings. + + -- Robert Millan Sat, 8 Nov 2008 13:54:10 +0100 + +grub2 (1.96+20080831-1) experimental; urgency=low + + * New SVN snapshot. + - patches/00_fix_double_prefix.diff: Remove (merged). (Closes: #487565) + - patches/00_getline.diff: Remove (merged). (Closes: #493289) + - Handle errors in RAID/LVM scan routine (rather than letting the upper + layer cope with them). (Closes: #494501, #495049) + - patches/901_linux_coreboot.diff: Remove (replaced). + - Add support for GFXMODE variable (Closes: #493106) + - Skips /dev/.* in grub-probe. (Closes: #486624) + - RAID code has various fixes. (Closes: #496573) + - Buffered file read is now used to read the background image faster. + (Closes: #490584) + + * We are already using LZMA, because upstream includes it's own lzma encoder, + so drop completely the liblzo handling in control and rules files. + + [ Felix Zielcke ] + * Remove the 1.95 partition numbering transition debconf warning + from grub2 package and removed it from all languages (*.po). + (Closes: #493744) + * Add a comment for the new GFXMODE in default/grub. + * debian/rules: + - Remove 2 ./configure options which it didn't understand. + - New grub-mkelfimage belongs to grub-common. + * debian/control: + - Change debhelper compat level to 7 and build depend on it >= 7. + - Remove ${misc:Depend} dependency on all packages except grub-pc which is + the only one using debconf. + - Replace deprecated ${Source-Version} with ${source:Version} for << + dependency and with ${build:Version} for = ones. + - Remove versioned dependency of Build-Depends patchutils and cdbs, + because etch has newer versions then the one used. + - Remove dpkg-dev completely from Build-Depends because it's + build-essentail and a non versioned dependency results in a lintian error. + - Remove Conflict/Replaces pupa, it has been removed from Debian 2004. + - Change build-dependency of unifont-bin to unifont (>= 1:5.1.20080820), + it's the new package containing unifont.hex and that version to avoid + licensing problems (Closes: #496061) + - Remove Jason Thomas from Uploaders with his permission. + * Preserve arguments in update-grub2 stub. (Closes: #496610) + + [ Updated translations ] + * Japanese (ja.po) by Hideki Yamane (Closes: #493347) + + [ Robert Millan ] + * Move a few files to grub-common and remove them from the arch- + specific packages. + * patches/02_old_linux_version_comparison.diff: Replace with ... + * patches/901_dpkg_version_comparison.diff: ... this. + Use dpkg --compare-versions in update-grub. (Closes: #494158) + * patches/03_disable_floppies.diff: Free .drive struct member when skipping + floppy drives. (Closes: #496040) + * patches/902_boot_blocklist_hack.diff: Support separate /boot when using + blocklists. (Closes: #496820, #489287, #494589) + + -- Robert Millan Sun, 31 Aug 2008 18:40:09 +0200 + +grub2 (1.96+20080730-1) experimental; urgency=low + + * New SVN snapshot. + - patches/00_fix_overflow.diff: Remove (merged). + - patches/00_uuid_boot.diff: Remove (merged). + - patches/00_raid_duped_disks.diff: Remove (merged). + - patches/00_xfs.diff: Remove (merged). + - patches/00_strengthen_apple_partmap_check.diff: Remove (merged). + - patches/00_skip_dev_dm.diff: Remove (merged). + + * patches/901_linux_coreboot.diff: Implements Linux load on Coreboot + (patch from Coresystems). + + * grub-linuxbios -> grub-coreboot rename again. + + -- Robert Millan Wed, 30 Jul 2008 22:12:07 +0200 + +grub2 (1.96+20080724-12ubuntu2) jaunty; urgency=low + + * Build for lpia. + + -- Colin Watson Wed, 25 Feb 2009 18:28:37 +0000 + +grub2 (1.96+20080724-12ubuntu1) jaunty; urgency=low + + * Merge from Debian Unstable (LP: #298872, LP: #256578). + Remaining Ubuntu changes: + + debian/control: + - Depend on rather than Suggest os-prober; Ubuntu version does not + suffer from the mount problem that prevents Debian from marking this + Depends. + + debian/default/grub + - Adjust for default Ubuntu boot options. + - Use new GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for + default items only. These options won't be set in single user mode. + + debian/patches/03_ubuntu_grub_standards + - Remove GNU/Linux from default string. + * New upstream snapshot includes ext4 extents support (LP: #294763) + * Debian patch 02_dpkg_version_comparison.diff fixes kernel ordering + (LP: #215513) + * debian/patches/04_uuids_and_abstraction_dont_play_along_nicely: + + Drop. Ubuntu's mdadm and lvm properly populate /dev/disk/by-uuid, so + this workaround is unnecessary. + * debian/changelog: + + Drop duplicated 1.96+20080203-1ubuntu2 and 1.96+20080203-1ubuntu1 + entries. We only really need them in there once! + * Drop debian/patches/04_convert_root_uuid: + - GRUB2 upstream now uses UUIDs when possible. + + -- Christopher James Halse Rogers Mon, 17 Nov 2008 10:06:18 +1100 + +grub2 (1.96+20080724-4) unstable; urgency=high + + * patches/00_fix_overflow.diff: fix overflow with a big grub.cfg. + (Closes: #473543) + + -- Felix Zielcke Tue, 29 Jul 2008 17:10:59 +0200 + +grub2 (1.96+20080724-3) unstable; urgency=low + + [ Felix Zielcke ] + * changed dependency for debconf to also support debconf-2.0. (Closes: #492543) + * patches/00_xfs.diff: Fix "out of partition" error with XFS. + (Closes: #436943) + + [ Robert Millan ] + * patches/00_raid_duped_disks.diff: Do not abort when two RAID disks with + the same number are found. (Closes: #492656) + * patches/00_strengthen_apple_partmap_check.diff: Be more strict when probing + for Apple partition maps (this prevents false positives on i386-pc + installs). (Closes: #475718) + + -- Robert Millan Tue, 29 Jul 2008 00:48:01 +0200 + +grub2 (1.96+20080724-2) unstable; urgency=high + + [ Felix Zielcke ] + * fixed lintian override for kernel.elf + * debian/rules: changed cvs targets to use svn + + [ Robert Millan ] + * patches/00_skip_dev_dm.diff: Skip /dev/dm-[0-9] devices also (implicitly) + for RAID. (Closes: #491977) + * patches/00_uuid_boot.diff: Fix cross-disk installs by using UUIDs. + (Closes: #492204) + + -- Robert Millan Sat, 26 Jul 2008 01:06:07 +0200 + +grub2 (1.96+20080724-1) unstable; urgency=high + + * New SVN snapshot. + - Support for ext4dev extents. + - patches/00_speed_up_font_load.diff: Remove (merged). + + [ Felix Zielcke ] + * upgrade-from-grub-legacy now calls update-grub if grub.cfg doestn't exist + and prints a big warning if it failed. + * Update Standards version to 3.8.0. No changes need. + * Added Build-Dep for po-debconf and a lintian override, to make it happy. + + [ Updated translations ] + * Swedish (sv.po) by Martin Ågren (Closes: #492056) + + [ Robert Millan ] + * Revert r844. grub-coreboot is stuck on NEW, and it was too early + for branching. + + -- Robert Millan Thu, 24 Jul 2008 13:27:53 +0200 + +grub2 (1.96+20080717-1) experimental; urgency=low + + * New SVN snapshot. + - Provides LZMA support (not yet used in the package). + - Fix grub-mkrescue manpage generation. (Closes: #489440) + + * Rename grub-linuxbios to grub-coreboot (and leave a dummy grub-linuxbios + package to handle upgrades). + + [ Updated translations ] + * Spanish (es.po) by Maria Germana Oliveira Blazetic (Closes: #489877) + * Portuguese (pt.po) by Ricardo Silva (Closes: #489807) + + -- Robert Millan Sat, 12 Jul 2008 17:47:09 +0200 + +grub2 (1.96+20080704-2) unstable; urgency=high + + * patches/02_old_linux_version_comparison.diff: Set interpreter to /bin/bash. + (Closes: #489426, #489446) + + -- Robert Millan Mon, 7 Jul 2008 15:17:58 +0200 + +grub2 (1.96+20080704-1) unstable; urgency=high + + * New SVN snapshot. + * default/grub: Add commented example to disable graphical terminal. + * Use substvars to support linking with liblzo1. + * Bring 03_disable_floppies.diff to pre-r805 state. (Closes: #488375) + * patches/02_old_linux_version_comparison.diff: New patch. Steal version + comparison code from GRUB Legacy's update-grub. (Closes: #464086, #489133) + * patches/00_speed_up_font_load.diff: New patch. Generate font files with + only the needed characters. (Closes: #476479, #477083) + + -- Robert Millan Fri, 4 Jul 2008 21:39:07 +0200 + +grub2 (1.96+20080626-1) unstable; urgency=high + + * New CVS snapshot. + - Avoids passing UUID to Linux when not using initrd. (Closes: #484228) + - patches/04_uuids_and_abstraction_dont_play_along_nicely.diff: Resync. + + -- Robert Millan Thu, 26 Jun 2008 16:43:48 +0200 + +grub2 (1.96+20080621-1) unstable; urgency=high + + * Urgency set to "high" because of #482688. + * New CVS snapshot. + - Fix module load hook in prepare_grub_to_access_device(). + (Closes: #486804) + - Call prepare_grub_to_access_device() before accessing devices, never + afterwards. (Closes: #487198) + * grub.d/05_debian_theme: Prefer /boot/grub over /usr for image + loading, since chances are it's less LVMed. + + -- Robert Millan Sat, 21 Jun 2008 15:52:48 +0200 + +grub2 (1.96+20080617-1) unstable; urgency=low + + * New CVS snapshot. + - Supports IDA block devices. (Closes: #483858) + - Fixes some problems in ext2/ext3. (Closes: #485068, #485065) + - Uses EUID instead of UID in update-grub. (Closes: #486043, #486039, + #486040, #486041). + - Fixes incomplete I2O device support. Thanks Sven Mueller. + (Closes: #486505) + - Fixes recent regressions in fs/ext2.c. (Closes: #485279) + - Only use UUIDs when requested device is not the same as the one + providing /boot. (Closes: #486119) + - patches/02_libgcc_powerpc_hack.diff: Remove. Probably not needed + anymore. + - patches/04_uuids_and_abstraction_dont_play_along_nicely.diff: Update. + * patches/06_olpc_prefix_hack.diff: Hardcode prefix to (sd,1) on OLPC. + * Refurbish 03_disable_floppy_support_in_util_biosdisk.diff into + 03_disable_floppies.diff. + + -- Robert Millan Tue, 17 Jun 2008 01:07:52 +0200 + +grub2 (1.96+20080601-2) unstable; urgency=low + + * 04_run_grub_mkdevicemap_when_grub_probe_fails.diff: Remove. Argueably + makes grub-probe unreliable and is quite annoying. + * 04_uuids_and_abstraction_dont_play_along_nicely.diff: New patch. Disable + UUID parameter to Linux when LVM or dmRAID is in use. (Closes: #484228) + This is a workaround for bug #484297 in udev. + + -- Robert Millan Tue, 3 Jun 2008 16:29:53 +0200 + +grub2 (1.96+20080601-1) unstable; urgency=low + + * New CVS snapshot. + - patches/06_backward_compat_in_uuid_support.diff: Merged. + - Fixes NULL pointer dereference in biosdisk.c. (Closes: #483895, #483900) + - Extends UUID support for XFS and ReiserFS. + + -- Robert Millan Sun, 1 Jun 2008 15:44:08 +0200 + +grub2 (1.96+20080531-1) unstable; urgency=low + + * New CVS snapshot. + - Work around BIOS bug affecting keyboard on macbooks. (Closes: #482860) + - Adjust grub.d/05_debian_theme to use the new UUID-compatible API. + - default/grub: Add commented GRUB_DISABLE_LINUX_UUID variable. + - patches/06_backward_compat_in_uuid_support.diff: New. Make update-grub + generate code that is compatible with older GRUB installs. + - util/biosdisk.c no longer complains about duplicated device.map entries. + (Closes: #481236) + + [ Updated translations ] + * Galician (gl.po) by Jacobo Tarrio (Closes: #480977) + + -- Robert Millan Sat, 31 May 2008 00:02:54 +0200 + +grub2 (1.96+20080512-1ubuntu2) intrepid; urgency=low + + [ Onkar Shinde ] + * debian/patches: + - Add 03_ubuntu_grub_standards to remove GNU/Linux from the + default string. (LP: #192955) Don't show splash screen or quiet mode + in single user mode. + - Add 04_convert_root_uuid.diff to default to using UUIDs + on new GRUB2 installations. (LP: #192956) + * debian/control: + - Move os-prober to 'Depends' since Ubuntu version does not suffer from + the mount problem in Debian version. 'os-prober' is needed for probing + other operating systems. (LP: #214642) + * Other bugs fixed - LP: #219580 + + [ Mario Limonciello ] + * Add items from missed merge bug (LP: #234288) + + -- Onkar Shinde Fri, 23 May 2008 14:28:36 +0530 + +grub2 (1.96+20080512-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Adjust debian/default/grub for default Ubuntu boot options. + + -- Mario Limonciello Tue, 27 May 2008 11:32:41 -0500 + +grub2 (1.96+20080512-1) unstable; urgency=low + + * New CVS snapshot. + - Adds support for default-only Linux cmdline options. (Closes: #460843) + - Supports Xen virtual block devices. (Closes: #456777) + - Supports Virtio block devices. (Closes: #479056) + - Supports CCISS block devices. (Closes: #479735) + - Fixes handling of more LVM abnormal conditions. (Closes: #474343, + #474931, #477175) + + * Switch to liblzo2 now that it's GPLv3-compatible. (Closes: #466375) + * grub-pc.postinst: Escape \ and / in cmdline sed invokation. + (Closes: #479279) + + [ Updated translations ] + * Italian (it.po) by Luca Monducci (Closes: #480740) + + -- Robert Millan Mon, 12 May 2008 17:46:38 +0200 + +grub2 (1.96+20080429-1) unstable; urgency=high + + * New CVS snapshot. + - Includes sample grub.cfg file; we use it for grub-rescue-pc. + (Closes: #478324) + * grub-common: Upgrade Replaces to << 1.96+20080426-3. (Closes: #478224, + #478353, #478144) + + [ Updated translations ] + * French (fr.po) by Christian Perrier (Closes: #471291) + + -- Robert Millan Tue, 29 Apr 2008 13:27:52 +0200 + +grub2 (1.96+20080426-1) unstable; urgency=high + + * New CVS snapshot. + - Fixes syntax error when setting GRUB_PRELOAD_MODULES. (Closes: #476517) + * Move os-prober to Suggests, to avoid trouble with #476184. + (Closes: #476684) + * patches/04_run_grub_mkdevicemap_when_grub_probe_fails.diff: New patch, + does what its name says. (Closes: #467127) + - Also move grub-mkdevicemap from grub-pc to grub-common, so that GRUB + Legacy can use it. + + [ Updated translations ] + * Basque (eu.po) by Piarres Beobide (Closes: #476708) + + -- Robert Millan Sat, 26 Apr 2008 20:06:55 +0200 + +grub2 (1.96+20080413-1) unstable; urgency=high + + * New CVS snapshot. + - Provides 30_os-prober update-grub add-on. Thanks Fabian Greffrath. + (Closes: #461442) + - Improves robustness when handling LVM. + (Closes: #474931, #474343) + * patches/03_disable_floppy_support_in_util_biosdisk.diff: New. Does + what its name says. (Closes: #475177) + + -- Robert Millan Sun, 13 Apr 2008 13:53:28 +0200 + +grub2 (1.96+20080408-1) unstable; urgency=low + + * New CVS snapshot. + - grub-probe skips non-existant devices when processing device.map. + (Closes: #473209) + * control: Fix syntax error. + + [ Updated translations ] + * Finnish (fi.po) by Esko Arajärvi (Closes: #468641) + + -- Robert Millan Tue, 8 Apr 2008 15:45:25 +0200 + +grub2 (1.96+20080228-1) unstable; urgency=low + + * New CVS snapshot. + * Split grub-probe into grub-common package. Make all flavours depend on it. + (Closes: #241972) + * Suggest multiboot-doc. + * patches/01_grub_legacy_0_based_partitions.diff: New patch. Add a hack that + tells grub-probe you want 0-based partition count + (GRUB_LEGACY_0_BASED_PARTITIONS variable) + * Stop depending on lsb-release (too heavy! we don't need python in base). + Instead of assuming it's there, try calling it and otherwise just echo + Debian. + + -- Robert Millan Thu, 28 Feb 2008 16:43:40 +0100 + +grub2 (1.96+20080219-3) unstable; urgency=low + + * default/grub: Use lsb_release to support Debian derivatives. + (Closes: #466561) + * grub.d/05_debian_theme: Only setup background image when a reader for it + is present in /boot/grub. (Closes: #467111) + + [ Updated translations ] + * Russian (ru.po) by Yuri Kozlov (Closes: #467181) + + -- Robert Millan Sun, 24 Feb 2008 15:39:50 +0100 + +grub2 (1.96+20080219-2) unstable; urgency=high + + * grub-pc.postinst: Create /boot/grub if it doesn't exist. + + -- Robert Millan Wed, 20 Feb 2008 07:15:14 +0100 + +grub2 (1.96+20080219-1) unstable; urgency=high + + * New CVS snapshot. + - Improves GPT support, allowing it to work without blocklists. + + -- Robert Millan Tue, 19 Feb 2008 15:05:10 +0100 + +grub2 (1.96+20080216-1) unstable; urgency=high + + * New CVS snapshot. + - Fixes offset calculation issue when installing on GPT (urgency set + to high because of this). + * Fix Vcs-Browser tag. Thanks James. (Closes: #465697) + * Only process grub-pc/linux_cmdline if /boot/grub/menu.lst exists. + (Closes: #465708) + + [ Updated translations ] + * French (fr.po) by Christian Perrier (Closes: #465706) + + -- Robert Millan Sat, 16 Feb 2008 23:30:55 +0100 + +grub2 (1.96+20080213-1) unstable; urgency=low + + * New CVS snapshot. + - Failure to read one device in a RAID-1 array no longer causes boot + to fail (so long as there's a member that works). (Closes: #426341) + * script: For /proc/mounts, only report lines that start with /dev/. + * Add new upgrade-from-grub-legacy script for the user to complete the upgrade + process from GRUB Legacy, and advertise it prominently in menu.lst. + (Closes: #464912) + * Add a hack to support gfxterm / background_image on systems where /usr + isn't accessible. (Closes: #464911, #463144) + - grub-pc.postinst + - grub.d/05_debian_theme + * Fix a pair of spelling mistakes in debconf. (Closes: #465296) + * Migrate kopt from menu.lst. (Closes: #461164, #464918) + + [ Updated translations ] + * Portuguese (pt.po) by Ricardo Silva (Closes: #465137) + * German (de.po) by Helge Kreutzmann (Closes: #465295) + + -- Robert Millan Wed, 13 Feb 2008 16:37:13 +0100 + +grub2 (1.96+20080210-1) unstable; urgency=high + + * New CVS snapshot. + - Errors that cause GRUB to enter rescue mode are displayed now. + (Closes: #425149) + - Build LVM/RAID modules into a few commands that were missing them + (notably, grub-setup). (Closes: #465033) + * Fix license violation (incompatibility between GRUB and LZO2). + (Closes: #465056) + - Urgency set to high. + - control: Move liblzo2-dev from Build-Depends to Build-Conflicts + (leaving liblzo-dev as the only option). + + -- Robert Millan Sun, 10 Feb 2008 17:09:15 +0100 + +grub2 (1.96+20080209-1) unstable; urgency=low + + * New CVS snapshot. + - Fix a root device setting issue in grub-setup. (Closes: #463391) + - Fix partmap detection under LVM/RAID. + - Add scripting commands that would allow user to implement hiddenmenu-like + functionality (http://grub.enbug.org/Hiddenmenu). + - Provide manpages for grub-setup, grub-emu, grub-mkimage and others. + (Closes: #333516, #372890) + * Fix a pair of spelling errors in debconf templates. Thanks Christian + Perrier. (Closes: #464133) + * Run debconf-updatepo. (Closes: #463918) + * Lower base-files versioned dependency to >= 4.0.1~bpo40+1. + + -- Robert Millan Sat, 9 Feb 2008 13:43:49 +0100 + +grub2 (1.96+20080203-1ubuntu2) hardy; urgency=low + + * Update 03_ubuntu_grub_standards. + - Don't show splash screen or quiet mode in single user mode. + + -- Mario Limonciello Wed, 05 Mar 2008 19:05:04 -0600 + +grub2 (1.96+20080203-1ubuntu1) hardy; urgency=low + + * debian/default/grub + - Show lsb_release rather than statically displaying "Debian" (LP: #192955) + - Include Ubuntu specific "quiet splash" on default grub command line. + (LP: #193024) + * debian/patches: + - Add 03_ubuntu_grub_standards to remove GNU/Linux from the + default string. (LP: #192955) + - Add 04_convert_root_uuid.diff to default to using UUIDs + on new GRUB2 installations. (LP: #192956) + * debian/control: + - Update maintainer per XSBC-Original-Maintainer spec. + + -- Mario Limonciello Mon, 18 Feb 2008 14:05:06 -0600 + +grub2 (1.96+20080203-1) unstable; urgency=low + + * New CVS snapshot (and release, but we skipped that ;-)) + - patches/01_regparm.diff: Delete. + - Improved XFS support. + - util/grub.d/00_header.in: Add runtime error detection (for gfxterm). + - Fixes problem when chainloading to Vista. + * Fix po-debconf errors. Thanks Thomas Huriaux. (Closes: #402972) + * grub.d/05_debian_theme: + - Add runtime error detection. + - Detect/Enable PNG background when it is present. + * control (grub-ieee1275): Remove versioned dependency on powerpc-ibm-utils. + + -- Robert Millan Sun, 3 Feb 2008 19:31:23 +0100 + +grub2 (1.95+20080201-1) unstable; urgency=low + + * New CVS snapshot. + * presubj: Improve notice. + * patches/01_regparm.diff: Fix CPU context corruption affecting fs/xfs.c. + (Closes: #463081, #419766, #462159) + * patches/02_libgcc_powerpc_hack.diff: Fix FTBFS on powerpc. (Closes: #457491) + * patches/disable_xfs.diff: Actually remove this time... + + -- Robert Millan Fri, 1 Feb 2008 17:06:00 +0100 + +grub2 (1.95+20080128-1) unstable; urgency=low + + * New CVS snapshot. + - Fixes bogus CLAIM problems on Apple firmware. (Closes: #449135, #422729) + - grub-probe performs sanity checks to make sure our filesystem drivers + are usable. (Closes: #462449) + - patches/disable_ata.diff: Remove. ATA module isn't auto-loaded in + rescue floppies now. + - patches/disable_xfs.diff: Remove. See above (about grub-probe). + * Bring back grub-emu; it can help a lot with debugging feedback. + - control + - rules + + -- Robert Millan Mon, 28 Jan 2008 00:01:11 +0100 + +grub2 (1.95+20080116-2) unstable; urgency=low + + * grub.d/05_debian_theme: Enable swirlish beauty. + * rules: Obtain debian/legacy/update-grub dynamicaly from GRUB Legacy svn. + + -- Robert Millan Sat, 19 Jan 2008 13:16:18 +0100 + +grub2 (1.95+20080116-1) unstable; urgency=low + + * New CVS snapshot. + - update-grub ignores stale *.dpkg-* files. (Closes: #422708, #424223) + - LVM/RAID now working properly (except when it affects /boot). + (Closes: #425666) + - Fixes flickery in timeout message. (Closes: #437275) + * grub-pc.postinst: Use `--no-floppy' whenever possible. Die, floppies, + die! + * Resync with latest version of GRUB Legacy's update-grub. This time, + using the $LET_US_TRY_GRUB_2 hack to reuse the same script both for + addition of core.img and its removal. + * grub-*.install: Add update-grub2 stub. Packages providing /etc/grub.d/ + scripts should invoke update-grub2 in both postinst and postrm (whenever + it is found, of course). + * control: Reorganize a bit, including a complete rewrite of the + package descriptions. + * control (grub-ieee1275): Enable for i386/amd64. + + -- Robert Millan Wed, 16 Jan 2008 15:00:54 +0100 + +grub2 (1.95+20080107-1) unstable; urgency=low + + * New CVS snapshot. + - Supports ReiserFS. (Closes: #430742) + - patches/disable_ata.diff: Resync. + + -- Robert Millan Mon, 7 Jan 2008 12:46:39 +0100 + +grub2 (1.95+20080105-2) unstable; urgency=low + + * grub-pc.postinst: Fix covered assumption that menu.lst exists. + (Closes: #459247) + * copyright: Fix copyright/license reference. + + -- Robert Millan Sun, 6 Jan 2008 18:02:28 +0100 + +grub2 (1.95+20080105-1) unstable; urgency=low + + * New CVS snapshot. + - Fixes install on non-devfs systems with devfs-style paths (ouch). + (Closes: #450709). + - Fixes boot of "Linux" zImages (including memtest86+). (Closes: #436113). + - Corrects usage message in grub-setup. (Closes: #458600). + - patches/menu_color.diff: Remove. Made obsolete by `menu_color_normal' + and `menu_color_highlight' variables. Add/install grub.d/05_debian_theme + to make use of them. + * Reestructure grub-pc.postinst. Notably: + - Do not touch menu.lst unless user has confirmed it (via debconf). + (Closes: #459247) + - When we do, keep a backup in /boot/grub/menu.lst_backup_by_grub2_postinst. + + -- Robert Millan Sat, 5 Jan 2008 17:55:37 +0100 + +grub2 (1.95+20080101-1) unstable; urgency=low + + * New CVS snapshot. + - patches/disable_xfs.diff: Rewrite in a way that won't collide with + upstream changes so often. + - unifont.hex now processed by upstream. + - rules: Disable build of unifont.pff. + - *.install: Remove build/unifont.pff line. + - patches/menu_color.diff: Change menu color to our traditional blue theme. + * Support new dpkg fields (Homepage, Vcs-Svn, Vcs-Browser). + * patches/disable_ata.diff: Prevent ATA module from being built on i386-pc. + + -- Robert Millan Tue, 1 Jan 2008 19:45:30 +0100 + +grub2 (1.95+20071101-1) unstable; urgency=low + + * New CVS snapshot. + - patches/linuxbios.diff: Remove (supported in upstream now). + + -- Robert Millan Thu, 1 Nov 2007 13:18:51 +0100 + +grub2 (1.95+20071004-2) unstable; urgency=low + + * Rename debian/grub-of.* to debian/grub-ieee1275.*. + * Add debian/grub-linuxbios.{postinst,dirs,install}. + * rules: Fix/Overrride lintian warnings (unstripped-binary-or-object). + * Remove grub-linuxbios.postinst. + + -- Robert Millan Wed, 10 Oct 2007 23:56:35 +0200 + +grub2 (1.95+20071004-1) unstable; urgency=low + + * New CVS snapshot. + * Add grub-linuxbios package. + - patches/linuxbios.diff + - control + - rules + * Rename grub-of to grub-ieee1275 to match with upstream conventions. + - control + - rules + + -- Robert Millan Thu, 4 Oct 2007 14:42:30 +0200 + +grub2 (1.95+20070829-1) unstable; urgency=low + + * New CVS snapshot. + - Includes fix for parallel builds. + * rules: Append -j flag to $(MAKE) to take advantage of >1 processors. + * Add reference to /usr/share/common-licenses. + - debian/copyright + - debian/control (all packages): Add base-files (>= 4.0.1) dependency. + + -- Robert Millan Sat, 1 Sep 2007 19:00:22 +0200 + +grub2 (1.95+20070828-2) unstable; urgency=low + + * control (grub-of): Make depends on powerpc-ibm-utils versioned as + >= 1.0.6 (older versions don't have -a flag). + + -- Robert Millan Tue, 28 Aug 2007 23:32:32 +0200 + +grub2 (1.95+20070828-1) unstable; urgency=low + + * New CVS snapshot. + - Adds ntfs support. + - Fixes a pair of issues indirectly breaking grub-probe on powerpc. + (Closes: #431488) + - patches/disable_xfs.diff: Resync. + - copyright: License upgraded to GPLv3. + * control (grub-of Depends): Add powerpc-utils (for nvsetenv) and bc. + + -- Robert Millan Tue, 28 Aug 2007 21:24:14 +0200 + +grub2 (1.95+20070626-1) unstable; urgency=low + + * New CVS snapshot. + - More fixes to cope with unreadable /. (Closes: #427289) + - update-grub supports multiple terminals. + * control (Build-Depends): Add genisoimage. + * patches/partmap_fallback.diff: Remove. It didn't archieve anything as + it also needs support for proper identification of raid / lvm (this is + being worked on). + * patches/disable_xfs.diff: Disable xfs in grub-probe. + * grub-rescue-pc.README.Debian: New. Explain how to use the rescue + images. + + -- Robert Millan Tue, 26 Jun 2007 08:39:14 +0200 + +grub2 (1.95+20070614-1) unstable; urgency=low + + * New CVS snapshot. + - update-grub is tollerant to unreadable / (as long as /boot is + accessible). (Closes: #427289) + * grub-pc.postinst: Generate new grub.cfg when menu.lst exists. + * New package grub-rescue-pc. + - control: Add it. + - README.Debian.in: Remove obsolete documentation. + - rules: Build rescue images using grub-mkrescue. + - grub-rescue-pc.dirs: Prepare their directory. + - grub-rescue-pc.install: Install them. + * legacy/update-grub: Fix core.img detection on separate /boot. + + -- Robert Millan Thu, 14 Jun 2007 08:17:21 +0200 + +grub2 (1.95+20070604-1) unstable; urgency=low + + * New CVS snapshot. + - patches/grub_probe_for_everyone.diff: Remove (merged). + - update-grub exports user-defined GRUB_CMDLINE_LINUX. (Closes: #425453) + - Fix those nasty powerpc bugs. (Closes: #422729) + + -- Robert Millan Mon, 4 Jun 2007 21:30:55 +0200 + +grub2 (1.95+20070520-1) unstable; urgency=low + + * New CVS snapshot. + - LVM / RAID fixes. (Closes: #423648, #381150) + - Fix memory management bug. (Closes: #423409) + - patches/efi.diff: Remove (merged). + - patches/grub_probe_for_everyone.diff: Use the new paths for + util/grub-probe.c, util/biosdisk.c, util/getroot.c. Enable + grub-mkdevicemap. (Closes: #424985) + * legacy/update-grub: Get rid of all grub-set-default calls. (Closes: #425054) + * grub-{pc,efi,of}.postinst: Only run update-grub if grub.cfg already exists. + * grub-pc.postinst: Only run GRUB Legacy compat stuff if menu.lst is found. + * patches/partmap_fallback.diff: New. Implement fallback "pc gpt" for partmap + detection failures. (Closes: #423022) + * control: Update XS-Vcs-* fields. Thanks Sam Morris . + (Closes: #425146) + * grub-{pc,efi,of}.{dirs,postinst}: Move unifont.pff to /usr/share/grub. + + -- Robert Millan Sun, 20 May 2007 11:13:03 +0200 + +grub2 (1.95+20070515-1) unstable; urgency=low + + * New CVS snapshot. + - Fix assumptions about /, /boot and /boot/grub being the same device. + (Closes: #423268, #422459) + - Proper sorting of Linux images. (Closes: #422580) + - update-grub lets /etc/default/grub override its variables now. + (Closes: #423649) + - update-grub mentions /etc/default/grub in the grub.cfg header. + (Closes: #423651) + - update-grub sets 800x600x16 as the default gfxmode. (Closes: #422794) + - update-grub runs grub-mkdevicemap before attempting to use grub-probe + (part of #423217) + + [ Otavio Salvador ] + * Add support to DEB_BUILD_OPTIONS=noopt. Thanks to Sam Morris + for the patch. (Closes: #423005) + * Add Robert Millan as uploader. + * Change build-dependency from liblzo-dev to liblzo2-dev. (Closes: #423358) + + [ Robert Millan ] + * grub-pc.postinst: + - Remove /boot/grub/device.map before running grub-install. + (Closes: #422851) + - Always run update-grub after grub-install. (part of #423217) + - Use grub-mkdevicemap instead of removing device.map, since update-grub + needs it but grub-install is not run unconditionaly. + - Redirect grub-install invocation to /dev/null, since it can mislead + users into thinking that MBR was overwritten. (part of #423217) + * default/grub: Stop exporting the variables (update-grub does that now). + * Misc EFI fixes, including new grub-install. + - patches/efi.diff: New. + - patches/grub_probe_for_everyone.diff: Move some bits to efi.diff. + - grub-efi.install: Stop installing dummy grub-install. + - grub-install: Remove. + * grub-pc.postinst: Avoid generating core.img when menu.lst is not present, + to avoid duplicated work (this is specialy important for d-i). (part of + #423217). + * See multiple references above. (Closes: #423217) + * grub-{pc,efi,of}.{dirs,install}: Install presubj in the right directory + to make it work again (oops). + * Add reportbug script to gather debugging information. (Closes: #423218) + - script: New. + - grub-{pc,efi,of}.install: Install it. + * Install the reportbug scripts for grub2 too, since users might still use + it for bugfiling. + - grub2.dirs + - grub2.install + * Fix some lintian warnings. + - control (grub2): Depend on debconf. + - README.Debian.in: Fix mispell. + - grub2.templates: Remove extra dot. + + -- Robert Millan Tue, 15 May 2007 22:08:53 +0200 + +grub2 (1.95+20070507-1) unstable; urgency=low + + [ Robert Millan ] + * New CVS snapshot. + - patches/build_neq_src.diff: Remove (merged). + * Fix debhelper files to ensure each package gets the right thing. + * Enable gfxterm/unifont support. + * On grub-pc, if there's no core.img setup, create one (but do not + risk writing to MBR). + * On grub-pc, if menu.lst is found, regenerate it to include our + core.img. + + [ Otavio Salvador ] + * Move debian/update-grub to debian/legacy/update-grub otherwise the + source gets messy. + + -- Otavio Salvador Mon, 07 May 2007 18:48:14 -0300 + +grub2 (1.95+20070505.1-3) unstable; urgency=low + + * Split postinst into grub2.postinst (with the transition warning) and + postinst.in, with update-grub invocation for grub-{pc,efi,of}. + - postinst.in + - grub2.postinst + - rules + + -- Robert Millan Sun, 6 May 2007 01:20:04 +0200 + +grub2 (1.95+20070505.1-2) unstable; urgency=low + + * Add EFI build of GRUB. + - control: Restructure to provide 3 packages: grub-pc (x86), + grub-efi (x86) and grub-of (powerpc). + - rules: Handle a separate build for each package. + - patches/build_neq_src.diff: Fix builddir == srcdir assumptions. + - patches/grub_probe_for_everyone.diff: New (superceds + powerpc_probe.diff). Enable grub-probe on powerpc and i386-efi. + - grub-install: Dummy informational grub-install for EFI. + - grub-efi.install: Installs it. + + -- Robert Millan Sun, 6 May 2007 00:23:56 +0200 + +grub2 (1.95+20070505.1-1) unstable; urgency=low + + * New CVS snapshot. + * patches/powerpc_probe.diff: Add partmap/gpt.c to grub-probe. + * control (Architecture): Temporarily disable powerpc. Sorry, but runtime + is currently broken and we don't have the hardware to debug it. Will be + re-enabled in next upload. + + -- Robert Millan Sat, 5 May 2007 21:52:49 +0200 + +grub2 (1.95+20070505-1) unstable; urgency=low + + * New CVS snapshot. + - Improved grub.cfg parser. (Closes: #381215) + - patches/fix-grub-install.diff: Remove (merged). + - control (Build-Depends): Remove libncurses5-dev (no longer needed). + - provides update-grub2. (Closes: #419151) + - Supports GPT in PC/BIOS systems. (Closes: #409073) + * control (Build-Depends): Add gcc-multilib to fix FTBFS. + * control (Description): Make it less scary, and more informative. + * postinst: Run update-grub to ensure the latest improvements always are + applied. + * patches/powerpc_probe.diff: Attempt at making grub-probe build/install + on powerpc (and hopefuly update-grub). + + -- Robert Millan Sat, 5 May 2007 01:49:07 +0200 + +grub2 (1.95-5) unstable; urgency=low + + * Fix FTBFS on kFreeBSD. Thanks to Aurelien Jarno + by providing the patch. Closes: #416408 + + -- Otavio Salvador Fri, 30 Mar 2007 19:20:48 -0300 + +grub2 (1.95-4) unstable; urgency=low + + * Fix powerpc grub-install binary path. Closes: #402838 + + -- Otavio Salvador Thu, 22 Mar 2007 23:45:56 -0300 + +grub2 (1.95-3) unstable; urgency=low + + [ Christian Perrier ] + * Switch to po-debconf for debconf templates. Closes: #402972 + * Depend on ${misc:Depends} and not "debconf" to allow cdebconf to be used + * Debconf translations: + - French + - Czech. Closes: #413327 + - Galician. Closes: #413323 + - Swedish. Closes: #413325 + - Portuguese. Closes: #413332 + - German. Closes: #413365 + - Tamil. Closes: #413478 + - Russian. Closes: #413542 + - Italian. Closes: #413904 + - Romanian. Closes: #414443 + + -- Otavio Salvador Tue, 20 Mar 2007 23:46:38 -0300 + +grub2 (1.95-2) unstable; urgency=low + + [ Robert Millan ] + * update-grub: Fix for Xen hypervisor entries, thanks Aaron Schrab. + (Closes: #394706) + * Transition to new numbering scheme for partitions. (Closes: #395019) + - update-grub: Don't substract 1 when converting partition device names to + grub drives. + - Add debconf warning explaining the situation. + * Rewrite Architecture line back to hardcoded list :(. (Closes: #398060) + + -- Otavio Salvador Mon, 11 Dec 2006 05:08:41 -0200 + +grub2 (1.95-1) unstable; urgency=low + + * New upstream release. + - patches/03_revert_partition_numbering.diff: Delete (obsoleted). + + -- Robert Millan Sat, 14 Oct 2006 21:19:21 +0200 + +grub2 (1.94+20061003-1) unstable; urgency=high + + * New CVS snapshot. + + [ Otavio Salvador ] + * Change debhelper compatibility mode to 5: + - debian/compat: setted to 5; + * control (Build-Depends): Add lib32ncurses5-dev for ppc64. + Closes: #389873 + * Set urgency=high since it's experimental stuff and tagged likewise. It + also solved a serious bug on PowerPC that leave users with a black + screen. + + [ Robert Millan ] + * control (Depends): Add powerpc-ibm-utils for powerpc/ppc64. + (Closes: #372186) + + -- Otavio Salvador Tue, 3 Oct 2006 16:49:32 -0300 + +grub2 (1.94+20060926-1) unstable; urgency=high + + * New CVS snapshot. + - Command-line editting fix (Closes: #381214). + - Fixes runtime breakage on amd64 (not in BTS). + - Delete a few patches (merged). + + [ Robert Millan ] + * Set urgency=high. Might seem like a rush, but it can't possibly be worse than + 1.94-5 (broken on systems that use udev, broken on amd64...). + * Pure ppc64 support. + - control (Architecture): Add any-ppc64. + - control (Build-Depends): Add libc6-dev-powerpc [ppc64]. + * rules: Remove moddep.lst install command (no longer needed). + * patches/03_revert_partition_numbering.diff: New. Revert a commit that + broke grub-probefs. + * Add bug template to encourage sending upstream stuff directly to + upstream. + - presubj: New. + + [ Otavio Salvador ] + * Add XS-X-Vcs-Svn on control file and point it to our current svn + repository. + * Add cvs-snapshot to rules. + + -- Otavio Salvador Tue, 26 Sep 2006 16:14:36 -0300 + +grub2 (1.94-6) unstable; urgency=low + + [ Robert Millan ] + * update-grub: Set interpreter to /bin/bash to cope with non-POSIX + extensions. (mentioned in #361929) + * patches/03_avoid_recursing_into_dot_static.diff: New. Avoid recursing into + dotdirs (e.g. ".static"). + * patches/04_mkdevicemap_dont_assume_floppies.diff: New. Don't assume + /dev/fd0 exists when generating device.map. + + -- Otavio Salvador Thu, 14 Sep 2006 16:07:30 -0300 + +grub2 (1.94-5) unstable; urgency=low + + [ Robert Millan ] + * control (Build-Depends): s/any-amd64/amd64 kfreebsd-amd64/g (this seems to + confuse buildds). + * 02_not_remove_menu_lst.patch: New patch. Skip menu.lst removal in + grub-install. (Closes: #372934) + + -- Otavio Salvador Sun, 20 Aug 2006 12:02:13 -0300 + +grub2 (1.94-4) unstable; urgency=low + + [ Otavio Salvador ] + * 01_fix_amd64_building.patch: dropped since it now supports amd64 + native building. + * Remove convert_kernel26 usage since it's not necessary anymore and due + initramfs-tools changes it's bug too. + + [ Robert Millan ] + * Fork update-grub from grub legacy, and tweak a few commands in output to + make it work for grub2. + * Update README.Debian.in with more recent (and easier) install instructions. + * Add grub to Conflicts/Replaces. Too many commands with the same name, + even if they don't use the same path yet (but will likely do in the + future, see #361929). + * Get rid of control.in, which I introduced in 0.6+20040805-1 and turned out + to be an endless source of problems (and forbidden by policy as well). + * Fix FTBFS on amd64. Really closes: #372548. + + -- Otavio Salvador Fri, 18 Aug 2006 15:38:25 -0300 + +grub2 (1.94-3) unstable; urgency=low + + * Fix FTBFS in amd64. Closes: 372548 + + -- Otavio Salvador Sat, 10 Jun 2006 19:57:01 -0300 + +grub2 (1.94-2) unstable; urgency=low + + * Update grub images paths in README.Debian + * 01_fix_grub-install.patch: add to fix a problem with PowerPC + installation. Refs: #371069 + * Fix FTBFS in amd64. Closes: #370803 + + -- Otavio Salvador Fri, 9 Jun 2006 09:29:40 -0300 + +grub2 (1.94-1) unstable; urgency=low + + * New upstream release. + - Fix powerpc building. Closes: #370259 + - 01_fix_grub-install.patch: merged upstream. + - Moved modules to /usr/lib/grub since they are architecture + dependent. + * Leave CDBS set debhelper compatibility level. + * Allow amd64 build to happen. Closes: #364956 + * Enforce building in 32bits while running in x86_64 machines. + * Update Standards version to 3.7.2. No changes need. + + -- Otavio Salvador Mon, 5 Jun 2006 12:49:09 -0300 + +grub2 (1.93-1) unstable; urgency=low + + * New upstream release. + - Added support to PowerPC. Closes: #357853 + - 01_fix_grub-install.patch: rediff. + * Update Standards version to 3.6.2. No changes need. + * Start to use new dpkg architecture definition. Closes: #360134 + + -- Otavio Salvador Sat, 1 Apr 2006 10:07:17 -0300 + +grub2 (1.92-2) unstable; urgency=low + + * Add bison on build-depends field. Closes: #346178 + * Add more fixes in 01_fix_grub-install.patch. Closes: #346177 + + -- Otavio Salvador Fri, 6 Jan 2006 09:48:08 -0200 + +grub2 (1.92-1) unstable; urgency=low + + * New upstream release. + - Add support for GPT partition table format. + - Add a new command "play" to play an audio file on PC. + - Add support for Linux/ADFS partition table format. + - Add support for BASH-like scripting. + - Add support for Apple HFS+ filesystems. + * 01_fix_grub-install.patch: Added. Fix grub-install to use + /bin/grub-mkimage instead of /sbin/grub-mkimage. Closes: #338824 + * Do not use CDBS tarball mode anymore. Closes: #344272 + + -- Otavio Salvador Thu, 5 Jan 2006 15:20:40 -0200 + +grub2 (1.91-0) unstable; urgency=low + + * New upstream release. Closes: #331211 + * debian/watch: added. + * debian/control.in, debian/control: Add libncurses5-dev in + Build-Depends. Closes: #304638 + * Remove Robert Millan as uploader; + * Add myself as uploader; + + -- Otavio Salvador Sat, 12 Nov 2005 16:35:18 -0200 + +grub2 (0.6+20050203-2) unstable; urgency=low + + * Disable for powerpc. Reportedly it fails to boot. + + -- Robert Millan Fri, 4 Feb 2005 01:52:09 +0100 + +grub2 (0.6+20050203-1) unstable; urgency=low + + * New upstream snapshot. + * Install moddep.lst properly in a cpu-independant way. (Closes: #264115) + * Use cdbs debian/control autogeneration. + - Set DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes. + - Move control to control.in. + - Add a @cdbs@ tag and replace Architecture with Cpu/System. + * control.in (Build-Depends): Add ruby. + + -- Robert Millan Thu, 3 Feb 2005 22:33:39 +0100 + +grub2 (0.6+20040805-1) unstable; urgency=low + + * New upstream snapshot. + * Uploading to unstable so that powerpc users can be blessed by GRUB too. + * Use type-handling to generate dpkg arch list. + - control.in + - rules + + -- Robert Millan Thu, 5 Aug 2004 20:50:16 +0200 + +grub2 (0.6+20040502-1) experimental; urgency=low + + * New upstream snapshot. + - Fix FTBFS on powerpc. + + -- Robert Millan Sun, 2 May 2004 18:16:29 +0200 + +grub2 (0.6+20040429-1) experimental; urgency=low + + * New upstream snapshot. + - control (Architecture): Add powerpc. + + -- Robert Millan Thu, 29 Apr 2004 20:41:31 +0200 + +grub2 (0.6+20031125-1) experimental; urgency=low + + * New upstream snapshot. + - patches/multiboot.diff: Nuked. + - install,docs: Update directory name. + * control (Maintainer): Set to pkg-grub-devel mailing list. + * control (Uploaders): Add myself. + * control (Architecture): Add freebsd-i386 and netbsd-i386. + + -- Robert Millan Tue, 25 Nov 2003 23:48:18 +0100 + +grub2 (0.6+20031114-1) experimental; urgency=low + + * New upstream snapshot. + - README.Debian: s/fat/ext2/g (We now have ext2fs support). + * Add multiboot support, thanks to Jeroen Dekkers for his patch. + - patches/multiboot.diff: New. + - control (Architecture): Add hurd-i386 (which needed multiboot). + * Rename package to grub2 (to follow upstream tendency). + - control: Ditto. + - README.Debian: Likewise. + * Switch to tarball mode. + - rules: Ditto. + - docs: Prefix paths in order to workaround dh_installdocs bug. + - install: Likewise, but not because of bug (should be in rules, actualy). + * Fix FTBFS. (Closes: #213868) + - control (Build-Depends): Add autoconf. + - control (Build-Conflicts): Add autoconf2.13. + + -- Robert Millan Fri, 14 Nov 2003 13:16:12 +0100 + +pupa (0.6+20031008-1) experimental; urgency=low + + * New upstream snapshot. + * Uploading to experimental. + * debian/control: Add Jason Thomas to Uploaders. + + -- Robert Millan Wed, 8 Oct 2003 13:22:50 +0000 + +pupa (0.6+20030915-1) unstable; urgency=low + + * Initial Release. (Closes: #211030) + + -- Robert Millan Mon, 15 Sep 2003 14:58:42 +0000 --- grub2-1.98.orig/debian/update-grub +++ grub2-1.98/debian/update-grub @@ -0,0 +1,2 @@ +#!/bin/sh -e +exec grub-mkconfig -o /boot/grub/grub.cfg "$@" --- grub2-1.98.orig/debian/rules +++ grub2-1.98/debian/rules @@ -0,0 +1,162 @@ +#!/usr/bin/make -f +SHELL := bash + +deb_version := $(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p") +upstream_version := $(shell echo $(deb_version) | sed -e "s/-[^-]*$$//") + +package := grub2 + +DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null) + +DEB_STRIP_EXCLUDE := /usr/sbin/grub-emu + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +CFLAGS := -g -Wall + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) +with_check := yes +else +with_check := no +endif + +CC := gcc-4.4 + +# Enable external modules from grub-extras. +export GRUB_CONTRIB := $(CURDIR)/debian/grub-extras + +CONFIGURE = ../../configure CC=$(CC) TARGET_CC=$(CC) \ + --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --includedir="\$${prefix}/include" \ + --mandir="\$${prefix}/share/man" --infodir="\$${prefix}/share/info" --sysconfdir=/etc --localstatedir=/var \ + --libexecdir="\$${prefix}/lib/$(package)" --srcdir=$(CURDIR) \ + --enable-grub-mkfont + +DEB_UPDATE_RCD_PARAMS_grub-common += start 99 2 3 4 5 . + +AUTOGEN_FILES = configure config.h.in conf/*.mk +AUTOGEN_DEB_FILES = docs examples manpages config templates postinst postrm dirs install + +$(AUTOGEN_FILES): autogen.sh configure.ac conf/*.rmk + sed -i configure.ac -e "s/^AC_INIT.*/AC_INIT(\[GRUB\],\[$(deb_version)\],\[bug-grub@gnu.org\])/" + ./autogen.sh + +configure/grub-pc configure/grub-ieee1275 configure/grub-coreboot configure/grub-emu configure/grub-yeeloong:: $(AUTOGEN_FILES) + mkdir -p $(subst configure/,build/,$@) + cd $(subst configure/,build/,$@) && $(CONFIGURE) --with-platform=$(subst configure/grub-,,$@) + +# This name scheme leaves room for things like ia64 or amd32 someday +configure/grub-efi-ia32:: $(AUTOGEN_FILES) + mkdir -p $(subst configure/,build/,$@) + cd $(subst configure/,build/,$@) && $(CONFIGURE) --with-platform=efi --target=i386-pe --program-prefix="" +configure/grub-efi-amd64:: $(AUTOGEN_FILES) + mkdir -p $(subst configure/,build/,$@) + cd $(subst configure/,build/,$@) && $(CONFIGURE) --with-platform=efi --target=amd64-pe --program-prefix="" + +configure/grub-firmware-qemu:: $(AUTOGEN_FILES) + mkdir -p $(subst configure/,build/,$@) + cd $(subst configure/,build/,$@) && $(CONFIGURE) --with-platform=qemu + +configure/grub-common:: $(AUTOGEN_FILES) + mkdir -p $(subst configure/,build/,$@) + cd $(subst configure/,build/,$@) && $(CONFIGURE) + +build/grub-common build/grub-efi-ia32 build/grub-efi-amd64 build/grub-ieee1275 build/grub-coreboot build/grub-emu build/grub-yeeloong:: + $(MAKE) -C $@ + +build/grub-pc:: + $(MAKE) -C $@ +ifeq ($(with_check), yes) + $(MAKE) -C $@ check +endif + +build/grub-firmware-qemu:: + $(MAKE) -C $@ + grub_dir=`mktemp -d` ; \ + grub_memdisk=`mktemp` ; \ + mkdir -p $${grub_dir}/boot/grub ; \ + cp debian/grub-firmware-qemu_grub.cfg $${grub_dir}/boot/grub/grub.cfg ; \ + tar -cf - -C $${grub_dir} boot > $${grub_memdisk} ; \ + $(CURDIR)/$@/grub-mkimage \ + -d $(CURDIR)/$@ \ + $(CURDIR)/$@/*.mod \ + -m $${grub_memdisk} \ + -o $(CURDIR)/$@/grub.bin + +install/grub-pc install/grub-efi-ia32 install/grub-efi-amd64 install/grub-ieee1275 install/grub-coreboot install/grub-emu install/grub-yeeloong:: + $(MAKE) -C $(subst install/,build/,$@) install DESTDIR=$(CURDIR)/debian/$(subst install/,,$@)/ + + # shipped with grub-common + rm -rf $(CURDIR)/debian/$(subst install/,,$@)/etc/grub.d + rm -f $(CURDIR)/debian/$(subst install/,,$@)/usr/{sbin,share/man/man8}/{grub-dumpbios,grub-probe,grub-mkconfig,grub-mkdevicemap,grub-ofpathname}{,.8} + rm -f $(CURDIR)/debian/$(subst install/,,$@)/usr/{bin,share/man/man1}/{grub-bin2h,grub-mkelfimage,grub-mkfont,grub-editenv,grub-mkisofs,grub-mkrescue,grub-mkrelpath,grub-script-check,grub-mkpasswd-pbkdf2,grub-fstest}{,.1} + rm -f $(CURDIR)/debian/$(subst install/,,$@)/usr/lib/grub/{grub-mkconfig_lib,update-grub_lib} + rm -rf $(CURDIR)/debian/$(subst install/,,$@)/usr/share/{grub,info,locale}/ + rm -rf $(CURDIR)/debian/$(subst install/,,$@)/usr/include + + if [ "$@" != "install/grub-emu" ] ; then \ + for i in $(AUTOGEN_DEB_FILES) ; do \ + sed debian/$$i.in \ + -e "s/@PACKAGE@/$(subst install/,,$@)/g" \ + > debian/$(subst install/,,$@).$$i ; \ + done ; \ + fi + + # grub-pc is a bit special. It includes a few overlays for autogen files. + if [ "$@" = "install/grub-pc" ] ; then \ + for i in templates install dirs ; do \ + cat debian/grub-pc.$$i.in >> debian/grub-pc.$$i ; \ + done ; \ + fi + + mkdir -p $(CURDIR)/debian/$(subst install/,,$@)/usr/share/lintian/overrides + echo "$(subst install/,,$@): unstripped-binary-or-object *.mod" \ + >> $(CURDIR)/debian/$(subst install/,,$@)/usr/share/lintian/overrides/$(subst install/,,$@) + if [ "$@" != "install/grub-pc" ] && [ "$(DEB_HOST_ARCH_CPU)" != "sparc" ] && [ "$(DEB_HOST_ARCH_CPU)" != "mipsel" ] ; then \ + cd $(CURDIR)/debian/$(subst install/,,$@) && find ./usr/lib/grub -name kernel.img \ + | sed -e "s%.*%$(subst install/,,$@): statically-linked-binary &%g" \ + >> $(CURDIR)/debian/$(subst install/,,$@)/usr/share/lintian/overrides/$(subst install/,,$@) ; \ + fi + if [ "$@" = "install/grub-efi-amd64" ] && [ "$(DEB_HOST_ARCH_CPU)" = "i386" ] ; then \ + echo "$(subst install/,,$@): binary-from-other-architecture *.mod" \ + >> $(CURDIR)/debian/$(subst install/,,$@)/usr/share/lintian/overrides/$(subst install/,,$@) ; \ + fi + if [ "$@" = "install/grub-pc" ] && [ "$(DEB_HOST_ARCH_CPU)" = "i386" ] ; then \ + echo "$(subst install/,,$@): binary-from-other-architecture *efiemu64.o" \ + >> $(CURDIR)/debian/$(subst install/,,$@)/usr/share/lintian/overrides/$(subst install/,,$@) ; \ + fi + +install/grub-common:: + $(MAKE) -C $(subst install/,build/,$@) install DESTDIR=$(CURDIR)/debian/$(subst install/,,$@)/ + rm -rf $(CURDIR)/debian/$(subst install/,,$@)/usr/lib/grub/{i386,powerpc,sparc64,mipsel}-* + rm -f $(CURDIR)/debian/$(subst install/,,$@)/usr/{sbin,share/man/man8}/{update-grub,grub-install,grub-setup,grub-reboot,grub-set-default}{,.8} + rm -f $(CURDIR)/debian/$(subst install/,,$@)/usr/{bin,share/man/man1}/{grub-mkimage,grub-mkfloppy}{,.1} + rm -f $(CURDIR)/debian/$(subst install/,,$@)/usr/share/info/dir* + install -m 0755 debian/grub-common.pm-sleep $(CURDIR)/debian/$(subst install/,,$@)/etc/pm/sleep.d/10_grub-common + +clean:: debian/legacy/update-grub debian/grub-extras + chmod +x debian/{script,grub.d/*,legacy/*} + + sed -i configure.ac -e "s/^AC_INIT.*/AC_INIT(\[GRUB\],\[0\],\[bug-grub@gnu.org\]) dnl version is filled by debian\/rules/" + + for i in $(AUTOGEN_DEB_FILES) ; do \ + rm -f debian/grub-{pc,efi-*,ieee1275,coreboot,yeeloong}.$$i ; \ + done + -rm -rf build + + # make sure PO files are always up-to-date + debconf-updatepo + +debian/legacy/update-grub: + @echo "Missing $@. Try: \"bzr cat http://bzr.debian.org/bzr/pkg-grub/trunk/grub-legacy/debian/update-grub > $@\"" + exit 1 + +debian/grub-extras: + @echo "Missing $@. Try: \"mkdir -p $@; for extra in 915resolution ntldr-img zfs; do bzr export $@/\$$extra http://bzr.savannah.nongnu.org/r/grub-extras/\$$extra; done\"" + exit 1 --- grub2-1.98.orig/debian/watch +++ grub2-1.98/debian/watch @@ -0,0 +1,2 @@ +version=3 +ftp://alpha.gnu.org/gnu/grub/grub-([a-z0-9.~]+).tar.gz debian uupdate --- grub2-1.98.orig/debian/manpages.in +++ grub2-1.98/debian/manpages.in @@ -0,0 +1,3 @@ +debian/update-grub.8 +debian/update-grub2.8 + --- grub2-1.98.orig/debian/grub-common.preinst +++ grub2-1.98/debian/grub-common.preinst @@ -0,0 +1,51 @@ +#!/bin/bash -e + +# Taken from http://wiki.debian.org/DpkgConffileHandling +# Remove a no-longer used conffile +rm_conffile() { + local PKGNAME="grub-common" + local CONFFILE="$1" + + [ -e "$CONFFILE" ] || return 0 + + local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" + local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ + sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi +} + +case "$1" in + install|upgrade) + if dpkg --compare-versions "$2" lt "1.98~20091229-1" ; then + rm_conffile "/etc/grub.d/10_freebsd" + fi + if dpkg --compare-versions "$2" lt "1.96+20090521-1" ; then + if [[ `dpkg --print-architecture` != hurd-* ]] ; then + rm_conffile "/etc/grub.d/10_hurd" + fi + if [[ `dpkg --print-architecture` = hurd-* ]] || [[ `dpkg --print-architecture` = kfreebsd-* ]] ; then + rm_conffile "/etc/grub.d/10_linux" + fi + fi + ;; + abort-upgrade) + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- grub2-1.98.orig/debian/grub2.install +++ grub2-1.98/debian/grub2.install @@ -0,0 +1,2 @@ +debian/presubj usr/share/bug/grub2 +debian/script usr/share/bug/grub2 --- grub2-1.98.orig/debian/grub-common.install +++ grub2-1.98/debian/grub-common.install @@ -0,0 +1 @@ +debian/presubj usr/share/bug/grub-common --- grub2-1.98.orig/debian/update-grub2 +++ grub2-1.98/debian/update-grub2 @@ -0,0 +1,2 @@ +#!/bin/sh -e +exec update-grub "$@" --- grub2-1.98.orig/debian/grub-pc.templates.in +++ grub2-1.98/debian/grub-pc.templates.in @@ -0,0 +1,126 @@ + +# This file is concatenated. Do not delete the newline above. + +Template: grub-pc/chainload_from_menu.lst +Type: boolean +Default: true +_Description: Chainload from menu.lst? + GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub. + . + In order to replace the Legacy version of GRUB in your system, it is + recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 + from your existing GRUB Legacy setup. This step may be automaticaly + performed now. + . + It's recommended that you accept chainloading GRUB 2 from menu.lst, and + verify that your new GRUB 2 setup is functional for you, before you install + it directly to your MBR (Master Boot Record). + . + In either case, whenever you want GRUB 2 to be loaded directly from MBR, + you can do so by issuing (as root) the following command: + . + upgrade-from-grub-legacy + +Template: grub-pc/install_devices +Type: multiselect +Choices-C: ${RAW_CHOICES} +Choices: ${CHOICES} +# Intentionally not marked for translations yet; will do after a review period +Description: GRUB install devices: + The grub-pc package is being upgraded. This menu allows you to select which + devices you'd like grub-install to be automatically run for, if any. + . + It is recommended that you do this in most situations, to prevent the installed + GRUB from getting out of sync with other components such as grub.cfg or with + newer Linux images it will have to load. + . + If you're unsure which drive is designated as boot drive by your BIOS, it is + often a good idea to install GRUB to all of them. + . + Note: It is possible to install GRUB to partition boot records as well, and + some appropriate partitions are offered here. However, this forces GRUB to + use the blocklist mechanism, which makes it less reliable, and therefore is + not recommended. + +Template: grub-pc/install_devices_disks_changed +Type: multiselect +Choices-C: ${RAW_CHOICES} +Choices: ${CHOICES} +# Intentionally not marked for translations yet; will do after a review period +Description: GRUB install devices: + The GRUB boot loader was previously installed to a disk that is no longer + present, or whose normally unique identifier has changed for some reason. + It is important to make sure that the installed GRUB stays in sync with + other components such as grub.cfg or with newer Linux images it will have + to load, and so you should check again to make sure that GRUB is installed + to the appropriate boot devices. + . + If you're unsure which drive is designated as boot drive by your BIOS, it is + often a good idea to install GRUB to all of them. + . + Note: It is possible to install GRUB to partition boot records as well, and + some appropriate partitions are offered here. However, this forces GRUB to + use the blocklist mechanism, which makes it less reliable, and therefore is + not recommended. + +Template: grub-pc/disk_description +Type: text +# Disk sizes are in decimal megabytes, to match how disk manufacturers +# usually describe them. +_Description: ${DEVICE} (${SIZE} MB, ${MODEL}) + +Template: grub-pc/partition_description +Type: text +# The "-" is used to indicate indentation. Leading spaces may not work. +Description: - ${DEVICE} (${SIZE} MB, ${PATH}) + +Template: grub-pc/install_devices_failed +Type: boolean +Default: false +#flag:translate!:3 +_Description: GRUB installation failed. Continue? + GRUB failed to install to the following devices: + . + ${FAILED_DEVICES} + . + Do you want to continue anyway? If you do, your computer may not start up + properly. + +Template: grub-pc/install_devices_empty +Type: boolean +Default: false +_Description: Continue without installing GRUB? + You chose not to install GRUB to any devices. If you continue, the boot + loader may not be properly configured, and when your computer next starts + up it will use whatever was previously in the boot sector. If there is an + earlier version of GRUB 2 in the boot sector, it may be unable to load + modules or handle the current configuration file. + . + If you are already running a different boot loader and want to carry on + doing so, or if this is a special environment where you do not need a boot + loader, then you should continue anyway. Otherwise, you should install + GRUB somewhere. + +Template: grub-pc/postrm_purge_boot_grub +Type: boolean +Default: false +# This should get reviewed before it can be translated +Description: Remove GRUB 2 from /boot/grub? + Do you want to have all GRUB 2 files removed from /boot/grub? + . + Your system would be then unbootable if you don't install another bootloader. + +Template: grub-pc/kopt_extracted +Type: boolean +Default: false +Description: for internal use + +Template: grub-pc/timeout +Type: string +Default: 10 +Description: GRUB timeout + +Template: grub-pc/hidden_timeout +Type: boolean +Default: true +Description: Hide the GRUB timeout --- grub2-1.98.orig/debian/grub-firmware-qemu_grub.cfg +++ grub2-1.98/debian/grub-firmware-qemu_grub.cfg @@ -0,0 +1,37 @@ +set default=0 +set fallback=1 +set timeout=10 + +menuentry "Search & load /boot/multiboot.img" { + search -s -f /boot/multiboot.img + if multiboot /boot/multiboot.img ; then + boot + fi + unset timeout +} + +# For separate /boot partition. +menuentry "Search & load /multiboot.img" { + search -s -f /multiboot.img + if multiboot /multiboot.img ; then + boot + fi + unset timeout +} + +menuentry "Search & source /boot/grub/grub.cfg" { + search -s -f /boot/grub/grub.cfg + source /boot/grub/grub.cfg + unset timeout +} + +# For separate /boot partition. +menuentry "Search & source /grub/grub.cfg" { + search -s -f /grub/grub.cfg + source /grub/grub.cfg + unset timeout +} + +menuentry "Reboot" { + reboot +} --- grub2-1.98.orig/debian/postrm.in +++ grub2-1.98/debian/postrm.in @@ -0,0 +1,45 @@ +#!/bin/bash -e + +case "$1" in + purge) + rm -f /etc/default/grub + + if which ucf >/dev/null ; then + ucf --purge /etc/default/grub + fi + if which ucfr >/dev/null ; then + ucfr --purge @PACKAGE@ /etc/default/grub + fi + + case @PACKAGE@ in + grub-pc) + # debconf could have been purged + if [ -e /usr/share/debconf/confmodule ] ; then + . /usr/share/debconf/confmodule + fi + + db_input high grub-pc/postrm_purge_boot_grub || true + db_go || true + db_get grub-pc/purge_boot_grub || true + if [ "$RET" = "true" ] ; then + rm -f /boot/grub/{grub.cfg,ascii.pf2,unicode.pf2,moreblue-orbit-grub.png,*.mod,*.lst,*.img,efiemu32.o,efiemu64.o} || true + rmdir --ignore-fail-on-non-empty /boot/grub || true + fi + ;; + esac + + ;; + remove|upgrade|failed-upgrade|abort-upgrade|abort-install) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- grub2-1.98.orig/debian/grub-firmware-qemu.install +++ grub2-1.98/debian/grub-firmware-qemu.install @@ -0,0 +1 @@ +build/grub-firmware-qemu/grub.bin usr/share/qemu --- grub2-1.98.orig/debian/compat +++ grub2-1.98/debian/compat @@ -0,0 +1 @@ +7 --- grub2-1.98.orig/debian/grub-rescue-pc.dirs +++ grub2-1.98/debian/grub-rescue-pc.dirs @@ -0,0 +1 @@ +usr/lib/grub-rescue --- grub2-1.98.orig/debian/grub-common.pm-sleep +++ grub2-1.98/debian/grub-common.pm-sleep @@ -0,0 +1,11 @@ +#!/bin/sh + +# Tell grub that resume was successful + +case "$1" in + thaw) + [ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv + mkdir -p /boot/grub + grub-editenv /boot/grub/grubenv unset recordfail + ;; +esac --- grub2-1.98.orig/debian/grub-common.examples +++ grub2-1.98/debian/grub-common.examples @@ -0,0 +1 @@ +docs/grub.cfg --- grub2-1.98.orig/debian/config.in +++ grub2-1.98/debian/config.in @@ -0,0 +1,69 @@ +#!/bin/sh -e + +case `dpkg --print-architecture` in + kfreebsd-*) + # No migration from GRUB Legacy, no Linux cmdline + exit 0 + ;; +esac + +. /usr/share/debconf/confmodule + +priority=medium + +case @PACKAGE@ in + grub-pc) + if test -e /boot/grub/stage2 && test -e /boot/grub/menu.lst && ! test -e /boot/grub/core.img ; then + + db_input high grub-pc/chainload_from_menu.lst || true + + db_get grub-pc/kopt_extracted || true + # this check ensures we only do this once + if [ "$RET" = "false" ] ; then + kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n" | grep -vx "\(ro\|root=[^ ]*\)" | paste -s -d ' '` || true + db_set grub2/linux_cmdline "${kopt}" || true + db_set grub-pc/kopt_extracted true || true + if [ "${kopt}" = "" ] ; then + # something smells bad. give user a chance to correct it. + priority=high + else + # if we got something from menu.lst, it must be correct? + priority=medium + fi + timeout=`sed -ne "s/^timeout[[:space:]][[:space:]]*//p" /boot/grub/menu.lst` || true + if [ "${timeout}" != "" ]; then + db_set grub-pc/timeout "${timeout}" || true + fi + if grep -q '^hiddenmenu\([[:space:]]\|$\)' /boot/grub/menu.lst; then + db_set grub-pc/hidden_timeout true || true + else + db_set grub-pc/hidden_timeout false || true + fi + fi + fi + ;; +esac + +if test -e /etc/default/grub ; then + . /etc/default/grub + + db_set grub2/linux_cmdline "$GRUB_CMDLINE_LINUX" + db_set grub2/linux_cmdline_default "$GRUB_CMDLINE_LINUX_DEFAULT" + + case @PACKAGE@ in + grub-pc) + if [ "${GRUB_TIMEOUT}" != "" ]; then + db_set grub-pc/timeout "$GRUB_TIMEOUT" + fi + if [ "${GRUB_HIDDEN_TIMEOUT}" != "" ]; then + db_set grub-pc/hidden_timeout true + elif egrep -q '^#?[[:space:]]*GRUB_HIDDEN_TIMEOUT=' /etc/default/grub; then + db_set grub-pc/hidden_timeout false + fi + ;; + esac +fi + +db_input ${priority} grub2/linux_cmdline || true +db_input medium grub2/linux_cmdline_default || true +db_go --- grub2-1.98.orig/debian/docs.in +++ grub2-1.98/debian/docs.in @@ -0,0 +1,3 @@ +build-tree/*/NEWS +build-tree/*/README +build-tree/*/TODO --- grub2-1.98.orig/debian/control +++ grub2-1.98/debian/control @@ -0,0 +1,220 @@ +Source: grub2 +Section: admin +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: GRUB Maintainers +Uploaders: Robert Millan , Felix Zielcke , Jordi Mallach , Colin Watson +DM-Upload-Allowed: yes +Build-Depends: cdbs, + debhelper (>= 7), + patchutils, + autoconf, + automake, + python, + ruby, + bison, + po-debconf, + help2man, + texinfo, + gcc-4.4-multilib [sparc], + gcc-4.4, + libncurses5-dev, + xfonts-unifont, + libfreetype6-dev, + gettext, + libusb-dev, + libdevmapper-dev, +Build-Conflicts: autoconf2.13 +Standards-Version: 3.8.4 +Homepage: http://www.gnu.org/software/grub/grub-2.en.html +XS-Debian-Vcs-Bzr: https://alioth.debian.org/anonscm/bzr/pkg-grub/trunk/grub/ +XS-Debian-Vcs-Browser: http://bzr.debian.org/loggerhead/pkg-grub/ +Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu/lucid/grub2/lucid + + +Package: grub2 +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia powerpc sparc +Depends: grub-pc [i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia] | grub-ieee1275 [powerpc sparc], ${misc:Depends} +Description: GRand Unified Bootloader, version 2 (dummy package) + This is a dummy transitional package to handle GRUB 2 upgrades. It can be + safely removed. + +Package: grub-linuxbios +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia +Depends: grub-coreboot (= ${binary:Version}), ${misc:Depends} +Description: GRand Unified Bootloader, version 2 (dummy package) + This is a dummy transitional package that depends on grub-coreboot. + +Package: grub-efi +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia +Depends: ${misc:Depends}, grub-efi-ia32 [i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 lpia], grub-efi-amd64 [amd64 kfreebsd-amd64] +Description: GRand Unified Bootloader, version 2 (dummy package) + This is a dummy transitional package that depends on either grub-efi-ia32 or + grub-efi-amd64, depending on the architecture. + + +Package: grub-common +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia powerpc sparc mipsel +Depends: base-files (>= 4.0.1~), dpkg (>= 1.15.4) | install-info | dpkg (<= 1.14.25), lsb-base (>= 3.0-6), ${shlibs:Depends}, ${misc:Depends}, gettext-base +Replaces: grub-pc (<< 1.97+20091114-1), grub-ieee1275 (<< 1.96+20080831-1), grub-efi (<< 1.96+20080831-1), grub-coreboot (<< 1.97+20091114-1), grub-linuxbios (<< 1.96+20080831-1) +Recommends: os-prober (>= 1.33) +Suggests: multiboot-doc [i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia], grub-emu +# See bugs #435983 and #455746 +Conflicts: mdadm (<< 2.6.7-2), grub-doc (<< 0.97-29ubuntu60), grub-legacy-doc (<< 0.97-29ubuntu60) +Description: GRand Unified Bootloader, version 2 (common files) + This package contains common files shared by the distinct flavours of GRUB. + +Package: grub-emu +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia powerpc sparc +Depends: ${shlibs:Depends}, base-files (>= 4.0.1~), ${misc:Depends} +Replaces: grub-common (<= 1.97~beta3-1) +Description: GRand Unified Bootloader, version 2 (emulated version) + This package contains grub-emu, an emulated version of GRUB. It is only + provided for debugging purposes. + +Package: grub-pc +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia +Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (= ${binary:Version}), ucf +Replaces: grub, grub-legacy, grub2 (<< ${source:Version}), grub-common (<< 1.97~beta1-1ubuntu4), grub-efi-amd64, grub-efi-ia32, grub-coreboot, grub-ieee1275 +Conflicts: grub (<< 0.97-54), grub-legacy, desktop-base (= 4.0.5), grub-efi-amd64, grub-efi-ia32, grub-coreboot, grub-ieee1275 +Suggests: desktop-base (>= 4.0.6) +Description: GRand Unified Bootloader, version 2 (PC/BIOS version) + GRUB is a portable, powerful bootloader. This version of GRUB is based on a + cleaner design than its predecessors, and provides the following new features: + . + - Scripting in grub.cfg using BASH-like syntax. + - Support for modern partition maps such as GPT. + - Modular generation of grub.cfg via update-grub. Packages providing GRUB + add-ons can plug in their own script rules and trigger updates by invoking + update-grub2. + - VESA-based graphical mode with background image support and complete 24-bit + color set. + - Support for extended charsets. Users can write UTF-8 text to their menu + entries. + . + This package contains a version of GRUB that has been built for use with + traditional PC/BIOS architecture. + +Package: grub-rescue-pc +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia +Depends: ${misc:Depends}, grub-pc (>= 1.97+20091114-1), grub-common (>= 1.97+20091114-1) +Description: GRUB bootable rescue images, version 2 (PC/BIOS version) + This package contains two GRUB rescue images that have been built for use with + traditional PC/BIOS architecture: + . + - grub-rescue-floppy.img: floppy image. + - grub-rescue-cdrom.iso: El Torito CDROM image. + +Package: grub-coreboot +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 +Depends: ${shlibs:Depends}, grub-common (= ${binary:Version}), ${misc:Depends}, ucf +Replaces: grub-legacy, grub2 (<< ${source:Version}), grub-common (<< 1.97~beta1-1ubuntu4), grub-linuxbios, grub-efi-amd64, grub-efi-ia32, grub-pc, grub-ieee1275 +Conflicts: grub (<< 0.97-54), grub-legacy, grub-linuxbios (<< ${source:Version}), grub-efi-amd64, grub-efi-ia32, grub-pc, grub-ieee1275 +Suggests: os-prober +Description: GRand Unified Bootloader, version 2 (Coreboot version) + GRUB is a portable, powerful bootloader. This version of GRUB is based on a + cleaner design than its predecessors, and provides the following new features: + . + - Scripting in grub.cfg using BASH-like syntax. + - Support for modern partition maps such as GPT. + - Modular generation of grub.cfg via update-grub. Packages providing GRUB + add-ons can plug in their own script rules and trigger updates by invoking + update-grub2. + . + This package contains a version of GRUB that has been built for use with + platforms running the Coreboot firmware. + +Package: grub-efi-ia32 +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia +Depends: ${shlibs:Depends}, grub-common (= ${binary:Version}), ${misc:Depends}, ucf +Replaces: grub, grub-legacy, grub2 (<< ${source:Version}), grub-common (<< 1.97~beta1-1ubuntu4), grub-efi, grub-efi-amd64, grub-pc, grub-coreboot, grub-ieee1275 +Conflicts: grub (<< 0.97-54), grub-legacy, grub-efi-amd64, grub-pc, grub-coreboot, grub-ieee1275 +Suggests: os-prober, efibootmgr +Description: GRand Unified Bootloader, version 2 (EFI-IA32 version) + GRUB is a portable, powerful bootloader. This version of GRUB is based on a + cleaner design than its predecessors, and provides the following new features: + . + - Scripting in grub.cfg using BASH-like syntax. + - Support for modern partition maps such as GPT. + - Modular generation of grub.cfg via update-grub. Packages providing GRUB + add-ons can plug in their own script rules and trigger updates by invoking + update-grub2. + . + This package contains a version of GRUB that has been built for use with + EFI-IA32 architecture, such as the one provided by Intel Macs (that is, unless + a BIOS interface has been activated). + +Package: grub-efi-amd64 +Architecture: i386 kopensolaris-i386 amd64 kfreebsd-amd64 +Depends: ${shlibs:Depends}, grub-common (= ${binary:Version}), ${misc:Depends}, ucf +Replaces: grub, grub-legacy, grub2 (<< ${source:Version}), grub-common (<< 1.97~beta1-1ubuntu4), grub-pc, grub-efi-ia32, grub-coreboot, grub-ieee1275 +Conflicts: grub, grub-legacy, grub-efi-ia32, grub-coreboot, grub-ieee1275 +Suggests: os-prober, efibootmgr +Description: GRand Unified Bootloader, version 2 (EFI-AMD64 version) + GRUB is a portable, powerful bootloader. This version of GRUB is based on a + cleaner design than its predecessors, and provides the following new features: + . + - Scripting in grub.cfg using BASH-like syntax. + - Support for modern partition maps such as GPT. + - Modular generation of grub.cfg via update-grub. Packages providing GRUB + add-ons can plug in their own script rules and trigger updates by invoking + update-grub2. + . + This package contains a version of GRUB that has been built for use with + EFI-AMD64 architecture, such as the one provided by Intel Macs (that is, unless + a BIOS interface has been activated). + +Package: grub-ieee1275 +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia powerpc sparc +Depends: ${shlibs:Depends}, grub-common (= ${binary:Version}), + powerpc-ibm-utils [powerpc], powerpc-utils [powerpc], bc [powerpc], ${misc:Depends}, ucf +Replaces: grub-legacy, grub2 (<< ${source:Version}), grub-common (<< 1.97~beta1-1ubuntu4), grub-efi-amd64, grub-efi-ia32, grub-coreboot, grub-pc +Conflicts: grub (<< 0.97-54), grub-legacy, grub-efi-amd64, grub-efi-ia32, grub-coreboot, grub-pc +Suggests: os-prober, genisoimage [powerpc] +Description: GRand Unified Bootloader, version 2 (Open Firmware version) + GRUB is a portable, powerful bootloader. This version of GRUB is based on a + cleaner design than its predecessors, and provides the following new features: + . + - Scripting in grub.cfg using BASH-like syntax. + - Support for modern partition maps such as GPT. + - Modular generation of grub.cfg via update-grub. Packages providing GRUB + add-ons can plug in their own script rules and trigger updates by invoking + update-grub2. + . + This package contains a version of GRUB that has been built for use with + Open Firmware implementations. + +Package: grub-firmware-qemu +Architecture: i386 kfreebsd-i386 hurd-i386 kopensolaris-i386 amd64 kfreebsd-amd64 lpia +Depends: base-files (>= 4.0.1~), ${misc:Depends} +Recommends: qemu +Enhances: qemu +Description: GRUB firmware image for QEMU + This package contains a binary of GRUB that has been built for use as + firmware for QEMU. It can be used as a replacement for the standard + PC BIOS provided by the bochsbios package (bios.bin). + . + In order to make QEMU use this firmware, simply add `-bios grub.bin' when + invoking it. + . + This package behaves in the same way as GRUB for coreboot, but doesn't + contain any code from coreboot itself, and is only suitable for QEMU. If + you want to install GRUB as firmware on real hardware, you need to use the + grub-coreboot package, and manually combine that with coreboot. + +Package: grub-yeeloong +Architecture: mipsel +Depends: ${shlibs:Depends}, grub-common (= ${binary:Version}), ${misc:Depends}, ucf +Suggests: os-prober +Description: GRand Unified Bootloader, version 2 (Yeeloong version) + GRUB is a portable, powerful bootloader. This version of GRUB is based on a + cleaner design than its predecessors, and provides the following new features: + . + - Scripting in grub.cfg using BASH-like syntax. + - Support for modern partition maps such as GPT. + - Modular generation of grub.cfg via update-grub. Packages providing GRUB + add-ons can plug in their own script rules and trigger updates by invoking + update-grub2. + . + This package contains a version of GRUB that has been built for use with + the Lemote Yeeloong laptop. --- grub2-1.98.orig/debian/templates.in +++ grub2-1.98/debian/templates.in @@ -0,0 +1,29 @@ +Template: grub2/linux_cmdline +Type: string +_Description: Linux command line: + The following Linux command line was extracted from /etc/default/grub or the + `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct, + and modify it if necessary. + +Template: grub2/linux_cmdline_default +Type: string +Default: quiet splash +_Description: Linux default command line: + The following string will be used as Linux parameters for the default menu + entry but not for the recovery mode. + +# still unused +Template: grub2/kfreebsd_cmdline +Type: string +_Description: kFreeBSD command line: + The following kFreeBSD command line was extracted from /etc/default/grub or the + `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct, + and modify it if necessary. + +# still unused +Template: grub2/kfreebsd_cmdline_default +Type: string +Default: quiet +_Description: kFreeBSD default command line: + The following string will be used as kFreeBSD parameters for the default menu + entry but not for the recovery mode. --- grub2-1.98.orig/debian/grub-pc.dirs.in +++ grub2-1.98/debian/grub-pc.dirs.in @@ -0,0 +1 @@ +usr/lib/grub-legacy --- grub2-1.98.orig/debian/NEWS +++ grub2-1.98/debian/NEWS @@ -0,0 +1,13 @@ +grub2 (1.96+20090609-1) experimental; urgency=low + + Before this version, grub-efi was 32bit on i386 and 64bit on amd64. + However, EFI can be 32bit even if you have a 64bit CPU, like in the + first MacBook models with Core 2 Duo released in late 2006. Thus, + grub-efi has been split into grub-efi-amd64 and grub-efi-ia32 which are + available on both amd64 and i386. + + If you've experienced problems trying to load grub.efi, please try + again using the package that doesn't match your CPU's architecture. + + -- Felix Zielcke Tue, 09 Jun 2009 19:21:15 +0200 + --- grub2-1.98.orig/debian/grub2.dirs +++ grub2-1.98/debian/grub2.dirs @@ -0,0 +1 @@ +usr/share/bug/grub2 --- grub2-1.98.orig/debian/dirs.in +++ grub2-1.98/debian/dirs.in @@ -0,0 +1,4 @@ +usr/bin +usr/sbin +usr/share/grub +usr/share/bug/@PACKAGE@ --- grub2-1.98.orig/debian/update-grub2.8 +++ grub2-1.98/debian/update-grub2.8 @@ -0,0 +1,16 @@ +.\" Copyright 2009 Felix Zielcke +.\" Lincensed under GPL3+ +.TH UPDATE-GRUB2 "8" "April 2009" +.SH NAME +update-grub2 \- stub for update-grub +.SH SYNOPSIS +.B update-grub2 +.SH DESCRIPTION +.B update-grub2 +is a stub for running +.B update-grub +which itself is a stub for running +.B grub-mkconfig -o /boot/grub/grub.cfg +to generate a grub2 config file. +.SH "SEE ALSO" +.BR update-grub (8), grub-mkconfig (8) --- grub2-1.98.orig/debian/postinst.in +++ grub2-1.98/debian/postinst.in @@ -0,0 +1,472 @@ +#!/bin/bash -e + +merge_debconf_into_conf() +{ + local tmpfile; tmpfile="$1" + local setting; setting="$2" + local template; template="$3" + + db_get "$template" + local value; value="$(echo "$RET" | sed -e 's,[$`"\],\\&,g; s,[\@],\\&,g')" + if grep -q "^${setting}=" "$tmpfile"; then + sed -i -re "s@^(${setting}=).*@\1\"${value}\"@" "$tmpfile" + else + echo >> "$tmpfile" + echo "${setting}=\"${value}\"" >> "$tmpfile" + fi +} + +get_wubi_device() +{ + if [ ! -x /usr/share/lupin-support/grub-mkimage ] || \ + ! /usr/share/lupin-support/grub-mkimage --test; then + return 1 + fi + + local bootdev="$(grub-probe --target=device /boot)" || true + local loop_file= + case $bootdev in + /dev/loop/*|/dev/loop[0-9]) + loop_file="$(losetup "$bootdev" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/")" + # If it's loop-mounted from another device, it isn't Wubi. + case $loop_file in + /dev/*) return 1 ;; + esac + ;; + *) return 1 ;; + esac + + echo "$bootdev" +} + +cached_available_ids= +available_ids() +{ + local id path + + if [ "$cached_available_ids" ]; then + echo "$cached_available_ids" + return + fi + + [ -d /dev/disk/by-id ] || return + cached_available_ids="$( + for path in /dev/disk/by-id/*; do + [ -e "$path" ] || continue + printf '%s %s\n' "$path" "$(readlink -f "$path")" + done | sort -k2 -s -u | cut -d' ' -f1 + )" + echo "$cached_available_ids" +} + +# Returns non-zero and no output if no mapping can be found. +device_to_id() +{ + local id + for id in $(available_ids); do + if [ "$(readlink -f "$id")" = "$(readlink -f "$1")" ]; then + echo "$id" + return 0 + fi + done + return 1 +} + +devices_to_ids() +{ + local device id ids + ids= + for device; do + id="$(device_to_id "$device" || true)" + if [ "$id" ]; then + ids="${ids:+$ids, }$id" + fi + done + echo "$ids" +} + +all_partitions() +{ + local id ids + ids= + for id in $(available_ids); do + if [ "$id" != "$1" ] && [ "${id%-part*}" = "$1" ]; then + ids="${ids:+$ids }$id" + fi + done + echo "$ids" +} + +sysfs_size() +{ + local num_sectors sector_size size + # Try to find out the size without relying on a partitioning tool being + # installed. This isn't too hard on Linux 2.6 with sysfs, but we have to + # try a couple of variants on detection of the sector size. + if [ -e "$1/size" ]; then + num_sectors="$(cat "$1/size")" + sector_size=512 + if [ -e "$1/queue/logical_block_size" ]; then + sector_size="$(cat "$1/queue/logical_block_size")" + elif [ -e "$1/queue/hw_sector_size" ]; then + sector_size="$(cat "$1/queue/hw_sector_size")" + fi + size="$(expr "$num_sectors" \* "$sector_size" / 1000 / 1000)" + fi + [ "$size" ] || size='???' + echo "$size" +} + +# Returns value in $RET, like a debconf command. +describe_disk() +{ + local disk id base size + disk="$1" + id="$2" + + if which udevadm >/dev/null 2>&1; then + size="$(sysfs_size "/sys$(udevadm info -n "$disk" -q path)")" + else + base="${disk#/dev/}" + base="$(printf %s "$base" | sed 's,/,!,g')" + size="$(sysfs_size "/sys/block/$base")" + fi + + model= + if which udevadm >/dev/null 2>&1; then + model="$(udevadm info -n "$disk" -q property | sed -n 's/^ID_MODEL=//p')" + if [ -z "$model" ]; then + model="$(udevadm info -n "$disk" -q property | sed -n 's/^DM_NAME=//p')" + fi + fi + [ "$model" ] || model='???' + + db_subst grub-pc/disk_description DEVICE "$disk" + db_subst grub-pc/disk_description SIZE "$size" + db_subst grub-pc/disk_description MODEL "$model" + db_metaget grub-pc/disk_description description +} + +# Returns value in $RET, like a debconf command. +describe_partition() +{ + local disk part id path diskbase partbase size + disk="$1" + part="$2" + id="$3" + path="$4" + + if which udevadm >/dev/null 2>&1; then + size="$(sysfs_size "/sys$(udevadm info -n "$part" -q path)")" + else + diskbase="${disk#/dev/}" + diskbase="$(printf %s "$diskbase" | sed 's,/,!,g')" + partbase="${part#/dev/}" + partbase="$(printf %s "$partbase" | sed 's,/,!,g')" + size="$(sysfs_size "/sys/block/$diskbase/$partbase")" + fi + + db_subst grub-pc/partition_description DEVICE "$part" + db_subst grub-pc/partition_description SIZE "$size" + db_subst grub-pc/partition_description PATH "$path" + db_metaget grub-pc/partition_description description +} + +usable_partitions() +{ + local last_partition path partition partition_id + + last_partition= + for path in / /boot /boot/grub; do + partition="$(grub-probe -t device "$path" || true)" + if [ -z "$partition" ] || [ "$partition" = "$last_partition" ]; then + continue + fi + partition_id="$(device_to_id "$partition" || true)" + echo "$path:$partition_id" + last_partition="$partition" + done | sort -t: -k2 +} + +get_mountpoint() +{ + local relpath boot_mountpoint + + relpath="$(grub-mkrelpath "$1")" + boot_mountpoint="${1#$relpath}" + echo "${boot_mountpoint:-/}" +} + +case "$1" in + configure) + . /usr/share/debconf/confmodule + + case @PACKAGE@ in + grub-pc) + + if grep -q "[= ]/sbin/update-grub" /etc/kernel-img.conf 2> /dev/null ; then + echo -e "\n/etc/kernel-img.conf still contains /sbin/update-grub in the hooks." >&2 + echo -e "Running sed over it to remove the /sbin/ prefix.\n" >&2 + sed -i /etc/kernel-img.conf -e "s,\(.*\) */sbin/update-grub$,\1 update-grub,g" + fi + mkdir -p /boot/grub + + if test -e /boot/grub/device.map && ! test -e /boot/grub/core.img ; then + # Looks like your device.map was generated by GRUB Legacy, which + # used to generate broken device.map (see #422851). Avoid the risk + # by regenerating it. + grub-mkdevicemap --no-floppy + fi + ;; + esac + + tmp_default_grub="$(mktemp "/tmp/grub.XXXXXXXXXX")" + trap "rm -f ${tmp_default_grub}" EXIT + cp -p /usr/share/grub/default/grub ${tmp_default_grub} + + merge_debconf_into_conf "$tmp_default_grub" GRUB_CMDLINE_LINUX grub2/linux_cmdline + merge_debconf_into_conf "$tmp_default_grub" GRUB_CMDLINE_LINUX_DEFAULT grub2/linux_cmdline_default + + case @PACKAGE@ in + grub-pc) + merge_debconf_into_conf "$tmp_default_grub" GRUB_TIMEOUT grub-pc/timeout + sed -i -e 's/^\(GRUB_TIMEOUT=\)"\([0-9][0-9]*\)"/\1\2/' "$tmp_default_grub" + db_get grub-pc/hidden_timeout + if [ "$RET" = false ]; then + sed -i -e 's/^GRUB_HIDDEN_TIMEOUT=/#&/' "$tmp_default_grub" + fi + ;; + esac + + ucf --three-way --debconf-ok --sum-file=/usr/share/grub/default/grub.md5sum ${tmp_default_grub} /etc/default/grub + package="$(ucfq --with-colons /etc/default/grub | cut -d : -f 2)" + if echo $package | grep -q "^grub-" ; then + ucfr --force @PACKAGE@ /etc/default/grub + else + ucfr @PACKAGE@ /etc/default/grub + fi + + case @PACKAGE@ in + grub-pc) + + # Make sure that Wubi users never see confusing device prompts. + # Wubi is a very specialised hack that does complicated things with + # grub-install diversions to create an image that's chained from the + # Windows boot loader to boot an operating system from a file on a + # Windows file system. In these circumstances, prompting for where + # to install GRUB is not going to help anyone. + wubi_device="$(get_wubi_device)" || true + if [ "$wubi_device" ]; then + db_set grub-pc/install_devices "$wubi_device" + db_fset grub-pc/install_devices seen true + fi + + if test -e /boot/grub/stage2 && test -e /boot/grub/menu.lst && ! test -e /boot/grub/core.img ; then + db_get grub-pc/chainload_from_menu.lst + if $RET ; then + # Create core.img (but do not risk writing to MBR). + # Using grub-probe instead of "(hd0)" avoids (UUID=) hack slowness + # in case /boot/grub is not on (hd0) in device.map. + echo "Generating core.img" >&2 + grub-install --no-floppy --grub-setup=/bin/true "$(grub-probe -t drive /boot/grub)" > /dev/null + + # Update menu.lst to reflect that: + # - core.img is present now + # - core.img has to be the first option + echo "Saving menu.lst backup in /boot/grub/menu.lst_backup_by_grub2_postinst" >&2 + cp /boot/grub/menu.lst{,_backup_by_grub2_postinst} + echo "Running update-grub Legacy to hook our core.img in it" >&2 + LET_US_TRY_GRUB_2=true /usr/lib/grub-legacy/update-grub 2>&1 | sed -e "s/^/ /g" >&2 + # We just hooked GRUB 2 in menu.lst; then also generate grub.cfg. + touch /boot/grub/grub.cfg + fi + elif test -z "$2" || test -e /boot/grub/core.img || \ + test "$UPGRADE_FROM_GRUB_LEGACY" || test "$wubi_device"; then + question=grub-pc/install_devices + device_map="$(grub-mkdevicemap -m - | grep -v '^(fd[0-9]\+)' || true)" + devices="$(echo "$device_map" | cut -f2)" + if dpkg --compare-versions "$2" lt 1.98~20100128-1ubuntu1 && \ + [ -z "$wubi_device" ]; then + # Migrate to new by-id naming scheme. + db_get grub-pc/install_devices + old_devices="$RET" + new_devices= + # Common-case optimisation: if the list of devices is + # identical to the LHS of grub-mkdevicemap's output, then + # there's no point asking again; just install to all disks. + # (This handles e.g. "(hd0)" with one disk.) + if [ "$(echo "$device_map" | cut -f1 | sort)" = \ + "$(echo "$old_devices" | xargs -n1 | sort)" ]; then + new_devices="$(devices_to_ids $devices)" + db_set grub-pc/install_devices "$new_devices" + # Alternatively, we might be installing to a single partition + # on a single disk, and we can deal with that too if there's + # only one available disk and it has an appropriate partition. + # This doesn't necessarily work for multiple disks because now + # the order matters. + elif [ "$(echo "$device_map" | wc -l)" = 1 ] && \ + [ "$(echo "$old_devices" | wc -w)" = 1 ] && \ + echo "$old_devices" | grep -q ,; then + old_device="${old_devices#(}" + old_device="${old_device%)}" + old_disk="${old_device%,*}" + old_partition="${old_device##*,}" + new_device="$(echo "$device_map" | grep "^($old_disk)" | \ + cut -f2)" + new_device="$(device_to_id $new_device)" + if [ "$new_device" ]; then + new_device="$new_device-part$old_partition" + # Run through device_to_id again to check for existence. + new_device="$(device_to_id $new_device)" + fi + if [ "$new_device" ]; then + new_devices="$new_device" + db_set grub-pc/install_devices "$new_device" + fi + fi + if [ -z "$new_devices" ]; then + new_devices="$(devices_to_ids $old_devices)" + db_set grub-pc/install_devices "$new_devices" + # Common-case optimisation: if all devices are translatable + # to by-id and the number of devices there is the same as + # the number of devices GRUB can see, then there's no point + # asking again. (This handles e.g. "/dev/sda" with one + # disk.) + old_devices_count="$(echo "$old_devices" | wc -w)" + new_devices_count="$(echo "$new_devices" | wc -w)" + devices_count="$(echo "$devices" | wc -w)" + if [ "$old_devices_count" != "$new_devices_count" ] || \ + [ "$new_devices_count" != "$devices_count" ]; then + db_fset grub-pc/install_devices seen false + db_fset grub-pc/install_devices_empty seen false + fi + fi + else + db_get grub-pc/install_devices + valid=1 + for device in $RET; do + if [ ! -e "$device" ]; then + valid=0 + break + fi + done + if [ "$valid" = 0 ]; then + question=grub-pc/install_devices_disks_changed + db_set "$question" "$RET" + db_fset "$question" seen false + db_fset grub-pc/install_devices_empty seen false + fi + fi + + while :; do + ids= + descriptions= + partitions="$(usable_partitions)" + for device in $devices; do + disk_id="$(device_to_id "$device" || true)" + if [ "$disk_id" ]; then + ids="${ids:+$ids, }$disk_id" + describe_disk "$device" "$disk_id" + RET="$(printf %s "$RET" | sed 's/,/\\,/g')" + descriptions="${descriptions:+$descriptions, }$RET" + for partition_pair in $partitions; do + partition_id="${partition_pair#*:}" + if [ "${partition_id#$disk_id-part}" != "$partition_id" ]; then + ids="${ids:+$ids, }$partition_id" + describe_partition "$device" "$(readlink -f "$partition_id")" "$partition_id" "$(get_mountpoint "${partition_pair%%:*}")" + RET="$(printf %s "$RET" | sed 's/,/\\,/g')" + descriptions="${descriptions:+$descriptions, }$RET" + fi + done + fi + done + db_subst "$question" RAW_CHOICES "$ids" + db_subst "$question" CHOICES "$descriptions" + db_input high "$question" || true + db_go + db_get "$question" + failed_devices= + for i in `echo $RET | sed -e 's/,/ /g'` ; do + real_device="$(readlink -f "$i")" + if grub-install --force --no-floppy $real_device ; then + # We just installed GRUB 2; then also generate grub.cfg. + touch /boot/grub/grub.cfg + else + failed_devices="$failed_devices $real_device" + fi + done + + if [ "$question" != grub-pc/install_devices ]; then + db_set grub-pc/install_devices "$RET" + db_fset grub-pc/install_devices seen true + fi + + if [ "$failed_devices" ]; then + db_subst grub-pc/install_devices_failed FAILED_DEVICES "$failed_devices" + db_fset grub-pc/install_devices_failed seen false + if db_input critical grub-pc/install_devices_failed; then + db_go + db_get grub-pc/install_devices_failed + if [ "$RET" = true ]; then + break + else + db_fset "$question" seen false + db_fset grub-pc/install_devices_failed seen false + continue + fi + else + break # noninteractive + fi + fi + + db_get grub-pc/install_devices + if [ -z "$RET" ]; then + if db_input critical grub-pc/install_devices_empty; then + db_go + db_get grub-pc/install_devices_empty + if [ "$RET" = true ]; then + break + else + db_fset "$question" seen false + db_fset grub-pc/install_devices_empty seen false + fi + else + break # noninteractive + fi + else + break + fi + done + fi + + # /boot/grub/ has more chances of being accessible by GRUB + if test -e /boot/grub/grub.cfg ; then + for i in /usr/share/grub/unicode.pf2 /usr/share/images/desktop-base/moreblue-orbit-grub.png ; do + if test -e $i ; then + cp $i /boot/grub/ + fi + done + fi + + ;; + esac + + # If grub.cfg has been generated, update it. + if test -e /boot/grub/grub.cfg ; then + update-grub + fi + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- grub2-1.98.orig/debian/grub-firmware-qemu.dirs +++ grub2-1.98/debian/grub-firmware-qemu.dirs @@ -0,0 +1 @@ +usr/share/qemu --- grub2-1.98.orig/debian/copyright +++ grub2-1.98/debian/copyright @@ -0,0 +1,58 @@ +Name: GNU GRUB +Source: http://www.gnu.org/software/grub/grub-2.en.html + +Files: * +Copyright: 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc +License: GPL-3+ + +Files: util/mkisofs/include/prototyp.h + util/mkisofs/include/fctldefs.h + util/mkisofs/include/statdefs.h + util/mkisofs/include/mconfig.h +Copyright: 1995, 1996, 1998 J. Schilling +License: GPL-2+ + +Files: util/mkisofs/iso9660.h + util/mkisofs/rock.c + util/mkisofs/mkisofs.c + util/mkisofs/hash.c + util/mkisofs/write.c + util/mkisofs/name.c + util/mkisofs/tree.c + util/mkisofs/mkisofs.h +Copyright: 1993 Yggdrasil Computing, Incorporated +License: GPL-2+ + +Files: util/mkisofs/rock.c + util/mkisofs/mkisofs.c + util/mkisofs/write.c + util/mkisofs/mkisofs.h +Copyright: 2009 Free Software Foundation, Inc. +License: GPL-3+ + +Files: util/mkisofs/joliet.c +Copyright: 1997 Eric Youngdale +License: GPL-2+ + +Files: util/mkisofs/eltorito.c +Copyright: 1996 RedHat Software, Incorporated +License: GPL-2+ + + +Files: debian/* +Copyright: 2003, 2004, 2005, 2006, 2007, 2008, 2009, Robert Millan + 2005, 2006, 2007, Otavio Salvador + 2008, 2009, Felix Zielcke + 2009, Jordi Mallach +License: GPL-3+ + +Files: debian/grub-extras/* +Copyright: Nathan Coulson + 2003, 2007 Free Software Foundation, Inc + 2003 NIIBE Yutaka +License: GPL-3+ + +License: GPL-3+ + On Debian systems the full text of the GNU General Public + License can be found in the `/usr/share/common-licenses/GPL' + file. --- grub2-1.98.orig/debian/grub-pc.prerm +++ grub2-1.98/debian/grub-pc.prerm @@ -0,0 +1,27 @@ +#!/bin/bash -e + +case "$1" in + remove|deconfigure) + . /usr/share/debconf/confmodule + db_get grub-pc/chainload_from_menu.lst + if $RET && test -e /boot/grub/menu.lst ; then + echo "Saving menu.lst backup in /boot/grub/menu.lst_backup_by_grub2_prerm" >&2 + cp /boot/grub/menu.lst{,_backup_by_grub2_prerm} + echo "Running update-grub Legacy to remove our core.img in it" >&2 + /usr/lib/grub-legacy/update-grub 2>&1 | sed -e "s/^/ /g" >&2 + fi + ;; + failed-upgrade|upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- grub2-1.98.orig/debian/grub-common.dirs +++ grub2-1.98/debian/grub-common.dirs @@ -0,0 +1,2 @@ +usr/sbin +etc/pm/sleep.d --- grub2-1.98.orig/debian/grub-rescue-pc.README.Debian +++ grub2-1.98/debian/grub-rescue-pc.README.Debian @@ -0,0 +1,16 @@ +grub-rescue-pc +~~~~~~~~~~~~~~ + +How to test the images with qemu: + + qemu -fda /usr/lib/grub-rescue/grub-rescue-floppy.img + + qemu -cdrom /usr/lib/grub-rescue/grub-rescue-cdrom.iso + +How to write the images to bootable media: + + sudo dd if=/usr/lib/grub-rescue/grub-rescue-floppy.img of=/dev/fd0 bs=32k + + sudo wodim /usr/lib/grub-rescue/grub-rescue-cdrom.iso + # or just use your favourite CD burning program + --- grub2-1.98.orig/debian/grub-common.init +++ grub2-1.98/debian/grub-common.init @@ -0,0 +1,42 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: grub-common +# Required-Start: $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Record successful boot for GRUB +# Description: GRUB displays the boot menu at the next boot if it +# believes that the previous boot failed. This script +# informs it that the system booted successfully. +### END INIT INFO + +which grub-editenv >/dev/null 2>&1 || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +case $1 in + start|restart|force-reload) + [ "$VERBOSE" != no ] && log_action_msg "Recording successful boot for GRUB" + [ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv + mkdir -p /boot/grub + grub-editenv /boot/grub/grubenv unset recordfail + [ "$VERBOSE" != no ] && log_end_msg $? + ;; + stop) + ;; + status) + exit 0 + ;; + *) + echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +exit 0 --- grub2-1.98.orig/debian/grub-pc.install.in +++ grub2-1.98/debian/grub-pc.install.in @@ -0,0 +1,2 @@ +debian/legacy/update-grub usr/lib/grub-legacy +debian/legacy/upgrade-from-grub-legacy usr/sbin --- grub2-1.98.orig/debian/grub-rescue-pc.postinst +++ grub2-1.98/debian/grub-rescue-pc.postinst @@ -0,0 +1,31 @@ +#!/bin/bash -e + +case "$1" in + configure) + tmpdir=`mktemp -d` + mkdir -p ${tmpdir}/boot/grub + cp /usr/share/doc/grub-common/examples/grub.cfg ${tmpdir}/boot/grub/ + grub-mkrescue --output=/usr/lib/grub-rescue/grub-rescue-cdrom.iso ${tmpdir} + rm -rf ${tmpdir} + + # Truth would be uselessly confusing for users. Let's give 'em what they + # wanted instead. + for flavor in usb floppy ; do + rm -f /usr/lib/grub-rescue/grub-rescue-${flavor}.img + cp -l /usr/lib/grub-rescue/grub-rescue-{cdrom.iso,${flavor}.img} + done + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- grub2-1.98.orig/debian/script +++ grub2-1.98/debian/script @@ -0,0 +1,30 @@ +#!/bin/bash -e + +if test -e /boot/grub/setup_left_core_image_in_filesystem ; then + echo -e "\n*********************** WARNING grub-setup left core.img in filesystem" >&3 +fi + +for i in /proc/mounts ; do + if test -e $i ; then + echo -e "\n*********************** BEGIN $i" >&3 + grep ^/dev/ $i >&3 + echo "*********************** END $i" >&3 + fi +done + +for i in /boot/grub/{device.map,grub.cfg} ; do + if ! test -e $i ; then + continue + fi + echo -e "\n*********************** BEGIN $i" >&3 + if test -r $i ; then + sed $i -e "s/.*password.*/### PASSWORD LINE REMOVED ###/g" >&3 + else + echo "$i is not readable by you. Please enter your root password." + echo "Any password line in it gets removed." + su root -c "sed $i -e 's/.*password.*/### PASSWORD LINE REMOVED ###/g'" >&3 + fi + echo "*********************** END $i" >&3 +done + +exit 0 --- grub2-1.98.orig/debian/update-grub.8 +++ grub2-1.98/debian/update-grub.8 @@ -0,0 +1,14 @@ +.\" Copyright 2009 Felix Zielcke +.\" Lincensed under GPL3+ +.TH UPDATE-GRUB "8" "April 2009" +.SH NAME +update-grub \- stub for grub-mkconfig +.SH SYNOPSIS +.B update-grub +.SH DESCRIPTION +.B update-grub +is a stub for running +.B grub-mkconfig -o /boot/grub/grub.cfg +to generate a grub2 config file. +.SH "SEE ALSO" +.BR grub-mkconfig (8) --- grub2-1.98.orig/debian/examples.in +++ grub2-1.98/debian/examples.in @@ -0,0 +1 @@ +docs/grub.cfg --- grub2-1.98.orig/debian/install.in +++ grub2-1.98/debian/install.in @@ -0,0 +1,6 @@ +debian/presubj usr/share/bug/@PACKAGE@ +debian/script usr/share/bug/@PACKAGE@ +debian/default usr/share/grub +debian/grub.d etc +debian/update-grub2 usr/sbin +debian/update-grub usr/sbin --- grub2-1.98.orig/debian/presubj +++ grub2-1.98/debian/presubj @@ -0,0 +1,23 @@ + +MAKE SURE YOU ARE RUNNING THE LATEST VERSION + +The grub packages never updates the installed version of GRUB +automatically, except if you choose a device in the debconf prompt +`GRUB install devices', which is currently only implemented for grub-pc. + +Because of this, you need to make sure you're running the LATEST VERSION of +GRUB before you report a bug. Use grub-install to update it, and then check +if the bug still applies. Debugging problems we already fixed makes us waste +valuable time, so please try to avoid it. + +IMPORTANT NOTE WHEN SUBMITING PATCHES + +Like many other FSF projects, GRUB upstream has specific requisites for +accepting patches with regard to copyright assignment. If you're going to +submit a patch, it is likely that it will only be accepted in upstream if you're +willing to submit your paperwork as well. + +Because of this, we want to avoid diverging from upstream by adding patches to +the debian package unless we know the copyright issues can be sorted out. We +encourage you to submit your work to upstream directly by sending a mail to the +GRUB maintainers . --- grub2-1.98.orig/debian/grub.d/05_debian_theme +++ grub2-1.98/debian/grub.d/05_debian_theme @@ -0,0 +1,61 @@ +#!/bin/bash -e + +source /usr/lib/grub/grub-mkconfig_lib + +# this allows desktop-base to override our settings +f=/usr/share/desktop-base/grub_background.sh +if test -e ${f} ; then + source ${f} +else + WALLPAPER="/usr/share/images/desktop-base/moreblue-orbit-grub.png" + COLOR_NORMAL="black/black" + COLOR_HIGHLIGHT="magenta/black" +fi + +set_mono_theme() +{ + cat << EOF +set menu_color_normal=white/black +set menu_color_highlight=black/light-gray +EOF +} + +# check for usable backgrounds +use_bg=false +if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then + for i in /boot/grub/`basename ${WALLPAPER}` ${WALLPAPER} ; do + if is_path_readable_by_grub $i ; then + bg=$i + case ${bg} in + *.png) reader=png ;; + *.tga) reader=tga ;; + *.jpg|*.jpeg) reader=jpeg ;; + esac + if test -e /boot/grub/${reader}.mod ; then + echo "Found background image: `basename ${bg}`" >&2 + use_bg=true + break + fi + fi + done +fi + +# set the background if possible +if ${use_bg} ; then + prepare_grub_to_access_device `${grub_probe} --target=device ${bg}` + cat << EOF +insmod ${reader} +if background_image `make_system_path_relative_to_its_root ${bg}` ; then + set color_normal=${COLOR_NORMAL} + set color_highlight=${COLOR_HIGHLIGHT} +else +EOF +fi + +# otherwise, set a monochromatic theme for Ubuntu +if ${use_bg} ; then + set_mono_theme | sed -e "s/^/ /g" + echo "fi" +else + set_mono_theme +fi --- grub2-1.98.orig/debian/patches/977_blacklist_linux_ec2.diff +++ grub2-1.98/debian/patches/977_blacklist_linux_ec2.diff @@ -0,0 +1,30 @@ +Ubuntu: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/671097 +Upstream: not really applicable +Description: Explicitly ignore linux kernels with names ending in -ec2. + These ubuntu kernels are intended only for Amazon EC2 guests where grub2 + will not ever be the loader. + +--- grub2/util/grub.d/10_linux.in 2010-11-04 16:15:51.000000000 -0400 ++++ grub2.new/util/grub.d/10_linux.in 2010-11-04 16:16:00.288879090 -0400 +@@ -110,8 +110,20 @@ + EOF + } + ++blacklisted_kernel() { ++ local r="" ++ case "${1}" in ++ *-ec2) r="linux-ec2";; # LP: #671097 ++ esac ++ [ -n "${r}" ] && { echo "Skipping linux image [$r]: ${1}" >&2; return 0; } ++ return 1; ++} ++ + list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do +- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi ++ if grub_file_is_not_garbage "$i" && ++ ! blacklisted_kernel "$i"; then ++ echo -n "$i "; ++ fi + done` + prepare_boot_cache= + --- grub2-1.98.orig/debian/patches/976_escape_translations.diff +++ grub2-1.98/debian/patches/976_escape_translations.diff @@ -0,0 +1,112 @@ +Description: Fix escaping problems with translations + Enclose all translated strings in grub.cfg in single quotes, and escape + them appropriately. +Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2323 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/552921 +Forwarded: yes +Last-Update: 2010-04-13 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-mkconfig_lib.in grub2.new/util/grub-mkconfig_lib.in +--- grub2/util/grub-mkconfig_lib.in 2010-04-13 14:17:50.000000000 +0100 ++++ grub2.new/util/grub-mkconfig_lib.in 2010-04-13 14:23:12.000000000 +0100 +@@ -211,3 +211,7 @@ + done + echo "$a" + } ++ ++gettext_quoted () { ++ gettext "$@" | sed "s/'/'\\\\''/g" ++} +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_hurd.in grub2.new/util/grub.d/10_hurd.in +--- grub2/util/grub.d/10_hurd.in 2010-04-13 14:17:50.000000000 +0100 ++++ grub2.new/util/grub.d/10_hurd.in 2010-04-13 14:23:12.000000000 +0100 +@@ -76,13 +76,13 @@ + EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF +- echo $(gettext "Loading GNU Mach ...") ++ echo '$(gettext_quoted "Loading GNU Mach ...")' + multiboot ${kernel} root=device:${GRUB_DEVICE#/dev/} + EOF + save_default_entry | sed -e "s/^/\t/" + prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" + cat << EOF +- echo $(gettext "Loading the Hurd ...") ++ echo '$(gettext_quoted "Loading the Hurd ...")' + module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\ + --multiboot-command-line='\${kernel-command-line}' \\ + --host-priv-port='\${host-port}' \\ +@@ -98,13 +98,13 @@ + EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF +- echo $(gettext "Loading GNU Mach ...") ++ echo '$(gettext_quoted "Loading GNU Mach ...")' + multiboot ${kernel} root=device:${GRUB_DEVICE#/dev/} -s + EOF + save_default_entry | sed -e "s/^/\t/" + prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" + cat << EOF +- echo $(gettext "Loading the Hurd ...") ++ echo '$(gettext_quoted "Loading the Hurd ...")' + module /hurd/${hurd_fs}.static ${hurd_fs} \\ + --multiboot-command-line='\${kernel-command-line}' \\ + --host-priv-port='\${host-port}' \\ +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_kfreebsd.in grub2.new/util/grub.d/10_kfreebsd.in +--- grub2/util/grub.d/10_kfreebsd.in 2010-04-13 14:17:50.000000000 +0100 ++++ grub2.new/util/grub.d/10_kfreebsd.in 2010-04-13 14:23:12.000000000 +0100 +@@ -44,15 +44,15 @@ + version="$2" + recovery="$3" # not used yet + args="$4" # not used yet +- title="$(gettext "%s, with kFreeBSD %s")" +- printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" ++ title="$(gettext_quoted "%s, with kFreeBSD %s")" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" + save_default_entry | sed -e "s/^/\t/" + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" + fi + printf '%s\n' "${prepare_boot_cache}" + cat << EOF +- echo $(printf "$(gettext "Loading kernel of FreeBSD %s ...")" ${version}) ++ echo '$(printf "$(gettext_quoted "Loading kernel of FreeBSD %s ...")" ${version})' + kfreebsd ${rel_dirname}/${basename} + EOF + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_linux.in grub2.new/util/grub.d/10_linux.in +--- grub2/util/grub.d/10_linux.in 2010-04-13 14:17:50.000000000 +0100 ++++ grub2.new/util/grub.d/10_linux.in 2010-04-13 14:24:06.000000000 +0100 +@@ -67,11 +67,11 @@ + recovery="$3" + args="$4" + if ${recovery} ; then +- title="$(gettext "%s, with Linux %s (recovery mode)")" ++ title="$(gettext_quoted "%s, with Linux %s (recovery mode)")" + else +- title="$(gettext "%s, with Linux %s")" ++ title="$(gettext_quoted "%s, with Linux %s")" + fi +- printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" ++ printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" + cat << EOF + recordfail + EOF +@@ -89,7 +89,7 @@ + printf '%s\n' "${prepare_boot_cache}" + if [ "x$5" != "xquiet" ]; then + cat << EOF +- echo $(printf "$(gettext "Loading Linux %s ...")" ${version}) ++ echo '$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})' + EOF + fi + cat << EOF +@@ -97,7 +97,7 @@ + EOF + if [ "x$5" != "xquiet" ]; then + cat << EOF +- echo $(gettext "Loading initial ramdisk ...") ++ echo '$(gettext_quoted "Loading initial ramdisk ...")' + EOF + fi + if test -n "${initrd}" ; then --- grub2-1.98.orig/debian/patches/10_crashkernel.patch +++ grub2-1.98/debian/patches/10_crashkernel.patch @@ -0,0 +1,30 @@ +Description: Add crashkernel= options if kdump and makedumpfile are + available. See + https://blueprints.launchpad.net/ubuntu/+spec/foundations-karmic-linux-kernel-crash-dump. +UbuntuSpecific: Ubuntu kernel crash handling; requires several other fairly + distribution-specific pieces to work properly. + +diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090725-1ubuntu1/util/grub.d/10_linux.in grub2-1.96+20090725-1ubuntu1.new/util/grub.d/10_linux.in +--- grub2-1.96+20090725-1ubuntu1/util/grub.d/10_linux.in 2009-07-30 12:29:50.000000000 -0500 ++++ grub2-1.96+20090725-1ubuntu1.new/util/grub.d/10_linux.in 2009-07-30 12:30:44.000000000 -0500 +@@ -42,6 +42,11 @@ + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + fi + ++# add crashkernel option if we have the required tools ++if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then ++ GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M" ++fi ++ + linux_entry () + { + os="$1" +@@ -92,7 +97,7 @@ + fi + + linux_entry "${OS}" "${version}" false \ +- "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" ++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" + if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then + linux_entry "${OS}" "${version}" true \ + "single ${GRUB_CMDLINE_LINUX}" --- grub2-1.98.orig/debian/patches/959_failed_boot_menu.diff +++ grub2-1.98/debian/patches/959_failed_boot_menu.diff @@ -0,0 +1,41 @@ +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/00_header.in grub2.new/util/grub.d/00_header.in +--- grub2/util/grub.d/00_header.in 2010-03-09 16:58:14.000000000 +0000 ++++ grub2.new/util/grub.d/00_header.in 2010-03-09 16:58:16.000000000 +0000 +@@ -57,6 +57,11 @@ + save_env saved_entry + fi + } ++ ++function recordfail { ++ set recordfail=1 ++ if [ -n \${have_grubenv} ]; then if [ -z \${boot_once} ]; then save_env recordfail; fi; fi ++} + EOF + + case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in +@@ -143,7 +148,11 @@ + fi + + cat << EOF +-set timeout=${GRUB_TIMEOUT} ++if [ \${recordfail} = 1 ]; then ++ set timeout=-1 ++else ++ set timeout=${GRUB_TIMEOUT} ++fi + EOF + + # Play an initial tune +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_linux.in grub2.new/util/grub.d/10_linux.in +--- grub2/util/grub.d/10_linux.in 2010-03-09 16:58:14.000000000 +0000 ++++ grub2.new/util/grub.d/10_linux.in 2010-03-09 16:59:38.000000000 +0000 +@@ -72,6 +72,9 @@ + title="$(gettext "%s, with Linux %s")" + fi + printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" ++ cat << EOF ++ recordfail ++EOF + save_default_entry | sed -e "s/^/\t/" + + if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ]; then --- grub2-1.98.orig/debian/patches/958_linux_no_loopmount.diff +++ grub2-1.98/debian/patches/958_linux_no_loopmount.diff @@ -0,0 +1,20 @@ +Ubuntu: needed for Wubi +Description: Ignore devices loop-mounted from files in 10_linux. +UbuntuSpecific: Not inherently, but perhaps we should integrate 10_lupin + properly instead. + +diff -Nur -x '*.orig' -x '*~' grub2-1.97~beta3/util/grub.d/10_linux.in grub2-1.97~beta3.new/util/grub.d/10_linux.in +--- grub2-1.97~beta3/util/grub.d/10_linux.in 2009-09-16 17:41:06.000000000 +0100 ++++ grub2-1.97~beta3.new/util/grub.d/10_linux.in 2009-09-16 17:44:52.000000000 +0100 +@@ -32,6 +32,11 @@ + case ${GRUB_DEVICE} in + /dev/loop/*|/dev/loop[0-9]) + GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` ++ # We can't cope with devices loop-mounted from files here. ++ case ${GRUB_DEVICE} in ++ /dev/*) ;; ++ *) exit 0 ;; ++ esac + ;; + esac + --- grub2-1.98.orig/debian/patches/01_uuids_and_lvm_dont_play_along_nicely.diff +++ grub2-1.98/debian/patches/01_uuids_and_lvm_dont_play_along_nicely.diff @@ -0,0 +1,14 @@ +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index c2da413..cbd9d6b 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -36,7 +36,8 @@ case ${GRUB_DEVICE} in + esac + + if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ +- || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then ++ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ ++ || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} + else + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} --- grub2-1.98.orig/debian/patches/952_normal_quiet.diff +++ grub2-1.98/debian/patches/952_normal_quiet.diff @@ -0,0 +1,56 @@ +Upstream: http://lists.gnu.org/archive/html/grub-devel/2009-09/msg00056.html +Description: Don't display introductory message about line editing unless + we're actually offering a shell prompt. Also, don't clear the screen just + before booting if we never drew the menu in the first place. +UbuntuSpecific: The line editing change is believed to be a workaround for a + different bug. We'll go with this for now, but will drop this in favour of + a better fix upstream if somebody figures out what that is. + +diff -Nur -x '*.orig' -x '*~' grub2/normal/main.c grub2.new/normal/main.c +--- grub2/normal/main.c 2010-02-01 14:33:16.000000000 -0800 ++++ grub2.new/normal/main.c 2010-02-03 14:32:09.000000000 -0800 +@@ -564,6 +564,13 @@ + { + grub_parser_t parser = grub_parser_get_current (); + char *prompt; ++ static int displayed_intro; ++ ++ if (! displayed_intro) ++ { ++ grub_normal_reader_init (nested); ++ displayed_intro = 1; ++ } + + if (cont) + prompt = grub_xasprintf (">"); +@@ -610,8 +617,6 @@ + return; + } + +- grub_normal_reader_init (nested); +- + while (1) + { + char *line; +diff -Nur -x '*.orig' -x '*~' grub2/normal/menu.c grub2.new/normal/menu.c +--- grub2/normal/menu.c 2010-02-01 14:33:16.000000000 -0800 ++++ grub2.new/normal/menu.c 2010-02-03 14:29:46.000000000 -0800 +@@ -540,6 +540,7 @@ + int boot_entry; + grub_menu_entry_t e; + int auto_boot; ++ int initial_timeout = grub_menu_get_timeout (); + + boot_entry = run_menu (menu, nested, &auto_boot); + if (boot_entry < 0) +@@ -549,7 +550,9 @@ + if (! e) + continue; /* Menu is empty. */ + +- grub_cls (); ++ /* Only clear the screen if we drew the menu in the first place. */ ++ if (initial_timeout != 0) ++ grub_cls (); + + if (auto_boot) + { --- grub2-1.98.orig/debian/patches/974_drive_probe.diff +++ grub2-1.98/debian/patches/974_drive_probe.diff @@ -0,0 +1,23 @@ +Description: Probe all devices if we've been asked for a drive name + This allows --target=drive to work properly even without a device.map. + . + Depends on 969_lvm_raid_probe.diff. +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/549980 +Forwarded: no +Last-Update: 2010-04-08 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-probe.c grub2.new/util/grub-probe.c +--- grub2/util/grub-probe.c 2010-04-08 12:02:36.000000000 +0100 ++++ grub2.new/util/grub-probe.c 2010-04-08 12:04:05.000000000 +0100 +@@ -139,7 +139,9 @@ + } + + if (stat (dev_map, &dev_map_stat) == -1 && +- grub_util_get_dev_abstraction (device_name) != GRUB_DEV_ABSTRACTION_NONE) ++ (print == PRINT_DRIVE || ++ grub_util_get_dev_abstraction (device_name) != ++ GRUB_DEV_ABSTRACTION_NONE)) + { + /* If we don't have a device map, then we won't yet know about the + physical volumes underlying this device, so probe all devices. */ --- grub2-1.98.orig/debian/patches/06_olpc_prefix_hack.diff +++ grub2-1.98/debian/patches/06_olpc_prefix_hack.diff @@ -0,0 +1,50 @@ + +This sucks, but it's better than what OFW was giving us. + +Index: kern/ieee1275/init.c +=================================================================== +--- kern/ieee1275/init.c (revision 2615) ++++ kern/ieee1275/init.c (working copy) +@@ -53,6 +53,7 @@ + grub_ieee1275_exit (); + } + ++#ifndef __i386__ + /* Translate an OF filesystem path (separated by backslashes), into a GRUB + path (separated by forward slashes). */ + static void +@@ -67,13 +68,16 @@ + backslash = grub_strchr (filepath, '\\'); + } + } ++#endif + + void + grub_machine_set_prefix (void) + { ++#ifndef __i386__ + char bootpath[64]; /* XXX check length */ + char *filename; + char *prefix; ++#endif + + if (grub_env_get ("prefix")) + /* We already set prefix in grub_machine_init(). */ +@@ -86,6 +90,9 @@ + return; + } + ++#ifdef __i386__ ++ grub_env_set ("prefix", "(sd,1)/"); ++#else + if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, + sizeof (bootpath), 0)) + { +@@ -123,6 +130,7 @@ + + grub_free (filename); + grub_free (prefix); ++#endif + } + + /* Claim some available memory in the first /memory node. */ --- grub2-1.98.orig/debian/patches/969_lvm_raid_probe.diff +++ grub2-1.98/debian/patches/969_lvm_raid_probe.diff @@ -0,0 +1,227 @@ +Description: Fix LVM/RAID probing without device.map + When probing LVM or RAID without a device.map, probe all devices in order + that we will know about the underlying physical volumes. +Bug-Ubuntu: https://bugs.launchpad.net/bugs/525085 +Forwarded: http://lists.gnu.org/archive/html/grub-devel/2010-03/msg00084.html +Last-Update: 2010-03-22 + +diff -Nur -x '*.orig' -x '*~' grub2/conf/common.rmk grub2.new/conf/common.rmk +--- grub2/conf/common.rmk 2010-03-22 13:49:14.000000000 +0000 ++++ grub2.new/conf/common.rmk 2010-03-22 13:53:20.000000000 +0000 +@@ -24,6 +24,7 @@ + util/grub-probe.c_DEPENDENCIES = grub_probe_init.h + grub_probe_SOURCES = gnulib/progname.c util/grub-probe.c \ + util/hostdisk.c util/misc.c util/getroot.c \ ++ util/deviceiter.c \ + kern/device.c kern/disk.c kern/err.c kern/misc.c \ + kern/parser.c kern/partition.c kern/file.c kern/list.c \ + \ +diff -Nur -x '*.orig' -x '*~' grub2/conf/i386-pc.rmk grub2.new/conf/i386-pc.rmk +--- grub2/conf/i386-pc.rmk 2010-03-22 13:49:14.000000000 +0000 ++++ grub2.new/conf/i386-pc.rmk 2010-03-22 13:49:17.000000000 +0000 +@@ -94,7 +94,8 @@ + util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h + grub_setup_SOURCES = gnulib/progname.c \ + util/i386/pc/grub-setup.c util/hostdisk.c \ +- util/misc.c util/getroot.c kern/device.c kern/disk.c \ ++ util/misc.c util/getroot.c util/deviceiter.c \ ++ kern/device.c kern/disk.c \ + kern/err.c kern/misc.c kern/parser.c kern/partition.c \ + kern/file.c kern/fs.c kern/env.c kern/list.c \ + fs/fshelp.c \ +diff -Nur -x '*.orig' -x '*~' grub2/conf/sparc64-ieee1275.rmk grub2.new/conf/sparc64-ieee1275.rmk +--- grub2/conf/sparc64-ieee1275.rmk 2010-03-22 13:49:14.000000000 +0000 ++++ grub2.new/conf/sparc64-ieee1275.rmk 2010-03-22 13:49:17.000000000 +0000 +@@ -68,7 +68,8 @@ + # For grub-setup. + util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h + grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ +- util/misc.c util/getroot.c kern/device.c kern/disk.c \ ++ util/misc.c util/getroot.c util/deviceiter.c \ ++ kern/device.c kern/disk.c \ + kern/err.c kern/misc.c kern/parser.c kern/partition.c \ + kern/file.c kern/fs.c kern/env.c kern/list.c \ + fs/fshelp.c \ +diff -Nur -x '*.orig' -x '*~' grub2/include/grub/util/hostdisk.h grub2.new/include/grub/util/hostdisk.h +--- grub2/include/grub/util/hostdisk.h 2010-03-22 13:47:27.000000000 +0000 ++++ grub2.new/include/grub/util/hostdisk.h 2010-03-22 13:51:33.000000000 +0000 +@@ -22,6 +22,7 @@ + + void grub_util_biosdisk_init (const char *dev_map); + void grub_util_biosdisk_fini (void); ++int grub_util_biosdisk_probe_device (const char *name, int is_floppy); + char *grub_util_biosdisk_get_grub_dev (const char *os_dev); + + #endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */ +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-probe.c grub2.new/util/grub-probe.c +--- grub2/util/grub-probe.c 2010-03-22 13:47:27.000000000 +0000 ++++ grub2.new/util/grub-probe.c 2010-03-22 13:53:10.000000000 +0000 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -106,13 +107,14 @@ + } + + static void +-probe (const char *path, char *device_name) ++probe (const char *path, char *device_name, const char *dev_map) + { + char *drive_name = NULL; + char *grub_path = NULL; + char *filebuf_via_grub = NULL, *filebuf_via_sys = NULL; + grub_device_t dev = NULL; + grub_fs_t fs; ++ struct stat dev_map_stat; + + if (path == NULL) + { +@@ -136,6 +138,22 @@ + goto end; + } + ++ if (stat (dev_map, &dev_map_stat) == -1 && ++ grub_util_get_dev_abstraction (device_name) != GRUB_DEV_ABSTRACTION_NONE) ++ { ++ /* If we don't have a device map, then we won't yet know about the ++ physical volumes underlying this device, so probe all devices. */ ++ grub_util_iterate_devices (grub_util_biosdisk_probe_device, 0); ++ ++ /* Now reinitialise the higher layers. */ ++ grub_lvm_fini (); ++ grub_mdraid_fini (); ++ grub_raid_fini (); ++ grub_raid_init (); ++ grub_mdraid_init (); ++ grub_lvm_init (); ++ } ++ + drive_name = grub_util_get_grub_dev (device_name); + if (! drive_name) + grub_util_error ("cannot find a GRUB drive for %s. Check your device.map", device_name); +@@ -428,9 +446,9 @@ + + /* Do it. */ + if (argument_is_device) +- probe (NULL, argument); ++ probe (NULL, argument, dev_map ? : DEFAULT_DEVICE_MAP); + else +- probe (argument, NULL); ++ probe (argument, NULL, dev_map ? : DEFAULT_DEVICE_MAP); + + /* Free resources. */ + grub_fini_all (); +diff -Nur -x '*.orig' -x '*~' grub2/util/hostdisk.c grub2.new/util/hostdisk.c +--- grub2/util/hostdisk.c 2010-03-22 13:49:14.000000000 +0000 ++++ grub2.new/util/hostdisk.c 2010-03-22 13:51:53.000000000 +0000 +@@ -1237,6 +1237,48 @@ + return i; + } + ++static void ++store_grub_dev (const char *grub_disk, const char *os_disk) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < ARRAY_SIZE (map); i++) ++ if (! map[i].device) ++ break; ++ else if (strcmp (map[i].drive, grub_disk) == 0) ++ { ++ if (strcmp (map[i].device, os_disk) == 0) ++ return; ++ grub_util_error (_("drive `%s' already mapped to `%s'"), ++ map[i].drive, map[i].device); ++ } ++ ++ if (i == ARRAY_SIZE (map)) ++ grub_util_error (_("device count exceeds limit")); ++ ++ map[i].drive = xstrdup (grub_disk); ++ map[i].device = xstrdup (os_disk); ++} ++ ++static int num_hd = 0; ++static int num_fd = 0; ++ ++int ++grub_util_biosdisk_probe_device (const char *name, int is_floppy) ++{ ++ char *grub_disk; ++ ++ if (is_floppy) ++ grub_disk = xasprintf ("fd%d", num_fd++); ++ else ++ grub_disk = xasprintf ("hd%d", num_hd++); ++ ++ store_grub_dev (grub_disk, name); ++ free (grub_disk); ++ ++ return 0; ++} ++ + char * + grub_util_biosdisk_get_grub_dev (const char *os_dev) + { +diff -Nur -x '*.orig' -x '*~' grub2/util/i386/pc/grub-setup.c grub2.new/util/i386/pc/grub-setup.c +--- grub2/util/i386/pc/grub-setup.c 2010-03-22 13:49:13.000000000 +0000 ++++ grub2.new/util/i386/pc/grub-setup.c 2010-03-22 13:53:10.000000000 +0000 +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; + +@@ -646,6 +647,7 @@ + char *core_file = 0; + char *dir = 0; + char *dev_map = 0; ++ struct stat dev_map_stat; + char *root_dev = 0; + char *dest_dev; + int must_embed = 0, force = 0, fs_probe = 1; +@@ -744,6 +746,9 @@ + /* Initialize the emulated biosdisk driver. */ + grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP); + ++ if (stat (dev_map ? : DEFAULT_DEVICE_MAP, &dev_map_stat) == -1) ++ grub_util_iterate_devices (grub_util_biosdisk_probe_device, 0); ++ + /* Initialize all modules. */ + grub_init_all (); + +diff -Nur -x '*.orig' -x '*~' grub2/util/sparc64/ieee1275/grub-setup.c grub2.new/util/sparc64/ieee1275/grub-setup.c +--- grub2/util/sparc64/ieee1275/grub-setup.c 2010-03-22 13:47:27.000000000 +0000 ++++ grub2.new/util/sparc64/ieee1275/grub-setup.c 2010-03-22 13:53:10.000000000 +0000 +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + + #define _GNU_SOURCE 1 + #include +@@ -618,6 +619,7 @@ + main (int argc, char *argv[]) + { + struct grub_setup_info ginfo; ++ struct stat dev_map_stat; + + set_program_name (argv[0]); + +@@ -630,6 +632,9 @@ + /* Initialize the emulated biosdisk driver. */ + grub_util_biosdisk_init (ginfo.dev_map ? ginfo.dev_map : DEFAULT_DEVICE_MAP); + ++ if (stat (ginfo.dev_map ? : DEFAULT_DEVICE_MAP, &dev_map_stat) == -1) ++ grub_util_iterate_devices (grub_util_biosdisk_probe_device, 0); ++ + /* Initialize all modules. */ + grub_init_all (); + --- grub2-1.98.orig/debian/patches/967_quiet_grub_loading.diff +++ grub2-1.98/debian/patches/967_quiet_grub_loading.diff @@ -0,0 +1,100 @@ +Description: Suppress "GRUB loading" message unless Shift is held down. +UbuntuSpecific: yes + +diff -Nur -x '*.orig' -x '*~' grub2/boot/i386/pc/boot.S grub2.new/boot/i386/pc/boot.S +--- grub2/boot/i386/pc/boot.S 2010-03-03 15:10:20.000000000 +0000 ++++ grub2.new/boot/i386/pc/boot.S 2010-03-03 15:10:23.000000000 +0000 +@@ -19,6 +19,7 @@ + + #include + #include ++#include + #include + + /* +@@ -147,9 +148,15 @@ + /* save drive reference first thing! */ + pushw %dx + ++ /* is either shift key held down? */ ++ movw $(GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR + 0x17), %bx ++ andb $3, (%bx) ++ jz 2f ++ + /* print a notification message on the screen */ + MSG(notification_string) + ++2: + /* set %si to the disk address packet */ + movw $disk_address_packet, %si + +diff -Nur -x '*.orig' -x '*~' grub2/boot/i386/pc/diskboot.S grub2.new/boot/i386/pc/diskboot.S +--- grub2/boot/i386/pc/diskboot.S 2010-03-03 15:09:22.000000000 +0000 ++++ grub2.new/boot/i386/pc/diskboot.S 2010-03-03 15:20:29.000000000 +0000 +@@ -17,6 +17,7 @@ + */ + + #include ++#include + #include + + /* +@@ -24,6 +25,7 @@ + */ + + #define MSG(x) movw $x, %si; call LOCAL(message) ++#define SILENT(x) call LOCAL(check_silent); jz LOCAL(x) + + .file "diskboot.S" + +@@ -50,11 +52,14 @@ + /* save drive reference first thing! */ + pushw %dx + ++ SILENT(after_notification_string) ++ + /* print a notification message on the screen */ + pushw %si + MSG(notification_string) + popw %si + ++LOCAL(after_notification_string): + /* this sets up for the first run through "bootloop" */ + movw $(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE), %di + +@@ -279,7 +284,10 @@ + /* restore addressing regs and print a dot with correct DS + (MSG modifies SI, which is saved, and unused AX and BX) */ + popw %ds ++ SILENT(after_notification_step) + MSG(notification_step) ++ ++LOCAL(after_notification_step): + popa + + /* check if finished with this dataset */ +@@ -295,8 +303,11 @@ + /* END OF MAIN LOOP */ + + LOCAL(bootit): ++ SILENT(after_notification_done) + /* print a newline */ + MSG(notification_done) ++ ++LOCAL(after_notification_done): + popw %dx /* this makes sure %dl is our "boot" drive */ + ljmp $0, $(GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200) + +@@ -320,6 +331,12 @@ + /* go here when you need to stop the machine hard after an error condition */ + LOCAL(stop): jmp LOCAL(stop) + ++LOCAL(check_silent): ++ /* is either shift key held down? */ ++ movw $(GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR + 0x17), %bx ++ andb $3, (%bx) ++ ret ++ + notification_string: .asciz "loading" + + notification_step: .asciz "." --- grub2-1.98.orig/debian/patches/902_boot_blocklist_hack.diff +++ grub2-1.98/debian/patches/902_boot_blocklist_hack.diff @@ -0,0 +1,20 @@ +Index: util/i386/pc/grub-setup.c +=================================================================== +--- util/i386/pc/grub-setup.c (revision 1836) ++++ util/i386/pc/grub-setup.c (working copy) +@@ -383,6 +383,15 @@ + grub_disk_cache_invalidate_all (); + + file = grub_file_open (core_path_dev); ++ ++ if (grub_errno == GRUB_ERR_FILE_NOT_FOUND) ++ { ++ /* Clean the previous grub_errno */ ++ grub_errno = GRUB_ERR_NONE; ++ strcpy (core_path_dev, "/grub/core.img"); ++ file = grub_file_open (core_path_dev); ++ } ++ + if (file) + { + if (grub_file_size (file) != core_size) --- grub2-1.98.orig/debian/patches/975_hostdisk_hd.diff +++ grub2-1.98/debian/patches/975_hostdisk_hd.diff @@ -0,0 +1,114 @@ +Description: Adjust hostdisk id for hard disks + This allows grub-setup to use its standard workaround for broken BIOSes. +Author: Colin Watson +Bug: http://savannah.gnu.org/bugs/?29464 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/555500 +Forwarded: http://savannah.gnu.org/bugs/?29464 +Last-Update: 2010-04-08 + +diff -Nur -x '*.orig' -x '*~' grub2/util/hostdisk.c grub2.new/util/hostdisk.c +--- grub2/util/hostdisk.c 2010-04-08 17:09:02.000000000 +0100 ++++ grub2.new/util/hostdisk.c 2010-04-08 17:10:18.000000000 +0100 +@@ -186,6 +186,8 @@ + + disk->has_partitions = 1; + disk->id = drive; ++ if (strncmp (map[drive].drive, "hd", 2) == 0) ++ disk->id += 0x80; + disk->data = data = xmalloc (sizeof (struct grub_util_biosdisk_data)); + data->dev = NULL; + data->access_mode = 0; +@@ -491,9 +493,9 @@ + int is_partition = 0; + char dev[PATH_MAX]; + +- strcpy (dev, map[disk->id].device); ++ strcpy (dev, map[disk->id & 0x7f].device); + if (disk->partition && sector >= disk->partition->start +- && strncmp (map[disk->id].device, "/dev/", 5) == 0) ++ && strncmp (map[disk->id & 0x7f].device, "/dev/", 5) == 0) + is_partition = linux_find_partition (dev, disk->partition->start); + + if (data->dev && strcmp (data->dev, dev) == 0 && +@@ -548,7 +550,7 @@ + } + #endif + +- if (data->dev && strcmp (data->dev, map[disk->id].device) == 0 && ++ if (data->dev && strcmp (data->dev, map[disk->id & 0x7f].device) == 0 && + data->access_mode == (flags & O_ACCMODE)) + { + grub_dprintf ("hostdisk", "reusing open device `%s'\n", data->dev); +@@ -560,10 +562,10 @@ + if (data->fd != -1) + close (data->fd); + +- fd = open (map[disk->id].device, flags); ++ fd = open (map[disk->id & 0x7f].device, flags); + if (fd >= 0) + { +- data->dev = xstrdup (map[disk->id].device); ++ data->dev = xstrdup (map[disk->id & 0x7f].device); + data->access_mode = (flags & O_ACCMODE); + data->fd = fd; + } +@@ -581,12 +583,12 @@ + #if defined(__APPLE__) + /* If we can't have exclusive access, try shared access */ + if (fd < 0) +- fd = open(map[disk->id].device, flags | O_SHLOCK); ++ fd = open(map[disk->id & 0x7f].device, flags | O_SHLOCK); + #endif + + if (fd < 0) + { +- grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id].device); ++ grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id & 0x7f].device); + return -1; + } + #endif /* ! __linux__ */ +@@ -604,7 +606,7 @@ + offset = (loff_t) sector << GRUB_DISK_SECTOR_BITS; + if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) + { +- grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id].device); ++ grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id & 0x7f].device); + close (fd); + return -1; + } +@@ -615,7 +617,7 @@ + + if (lseek (fd, offset, SEEK_SET) != offset) + { +- grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id].device); ++ grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id & 0x7f].device); + close (fd); + return -1; + } +@@ -713,7 +715,7 @@ + parts. -jochen */ + if (nread (fd, buf, GRUB_DISK_SECTOR_SIZE) != GRUB_DISK_SECTOR_SIZE) + { +- grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s'", map[disk->id].device); ++ grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s'", map[disk->id & 0x7f].device); + close (fd); + return grub_errno; + } +@@ -725,7 +727,7 @@ + + if (nread (fd, buf, size << GRUB_DISK_SECTOR_BITS) + != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) +- grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id].device); ++ grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id & 0x7f].device); + + return grub_errno; + } +@@ -759,7 +761,7 @@ + + if (nwrite (fd, buf, size << GRUB_DISK_SECTOR_BITS) + != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) +- grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id].device); ++ grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id & 0x7f].device); + + return grub_errno; + } --- grub2-1.98.orig/debian/patches/03_ubuntu_grub_standards.diff +++ grub2-1.98/debian/patches/03_ubuntu_grub_standards.diff @@ -0,0 +1,15 @@ +Description: Remove GNU/Linux from default distributor string. +UbuntuSpecific: We call it "Ubuntu", not "Ubuntu GNU/Linux". + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_linux.in grub2.new/util/grub.d/10_linux.in +--- grub2/util/grub.d/10_linux.in 2010-03-09 16:55:52.000000000 +0000 ++++ grub2.new/util/grub.d/10_linux.in 2010-03-09 16:56:32.000000000 +0000 +@@ -30,7 +30,7 @@ + if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux + else +- OS="${GRUB_DISTRIBUTOR} GNU/Linux" ++ OS="${GRUB_DISTRIBUTOR}" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}" + fi + --- grub2-1.98.orig/debian/patches/979_ntfs_uuid_uppercase.diff +++ grub2-1.98/debian/patches/979_ntfs_uuid_uppercase.diff @@ -0,0 +1,21 @@ +Description: Make NTFS UUIDs uppercase +Author: Vladimir Serbinenko +Forwarded: yes +Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2925 +Last-Update: 2011-04-06 + +diff -Nur -x '*.orig' -x '*~' grub2//fs/ntfs.c grub2.new//fs/ntfs.c +--- grub2//fs/ntfs.c 2010-06-06 23:58:07.000000000 +0100 ++++ grub2.new//fs/ntfs.c 2011-04-06 16:53:05.000000000 +0100 +@@ -1072,7 +1072,11 @@ + data = grub_ntfs_mount (disk); + if (data) + { ++ char *ptr; + *uuid = grub_xasprintf ("%016llx", (unsigned long long) data->uuid); ++ if (*uuid) ++ for (ptr = *uuid; *ptr; ptr++) ++ *ptr = grub_toupper (*ptr); + } + else + *uuid = NULL; --- grub2-1.98.orig/debian/patches/970_fix_locale_installation.diff +++ grub2-1.98/debian/patches/970_fix_locale_installation.diff @@ -0,0 +1,55 @@ +Description: Copy .mo files from @datadir@/locale + This matches where 'make install' puts them. +Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2265 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/537998 +Forwarded: http://lists.gnu.org/archive/html/grub-devel/2010-03/msg00074.html +Last-Update: 2010-03-22 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-install.in grub2.new/util/grub-install.in +--- grub2/util/grub-install.in 2010-03-22 15:49:32.000000000 +0000 ++++ grub2.new/util/grub-install.in 2010-03-22 15:54:31.000000000 +0000 +@@ -32,6 +32,7 @@ + host_os=@host_os@ + font=@datadir@/@PACKAGE_TARNAME@/ascii.pf2 + pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` ++localedir=@datadir@/locale + + grub_setup=${sbindir}/`echo grub-setup | sed ${transform}` + if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] || [ "${target_cpu}-${platform}" = "mips-yeeloong" ] ; then +@@ -245,9 +246,9 @@ + + # Copy gettext files + mkdir -p ${grubdir}/locale/ +-for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do +- if test -f "$file"; then +- cp -f "$file" ${grubdir}/locale/ ++for dir in ${localedir}/*; do ++ if test -f "$dir/LC_MESSAGES/grub.mo"; then ++ cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo" + fi + done + +diff -Nur -x '*.orig' -x '*~' grub2/util/i386/efi/grub-install.in grub2.new/util/i386/efi/grub-install.in +--- grub2/util/i386/efi/grub-install.in 2010-03-09 16:14:00.000000000 +0000 ++++ grub2.new/util/i386/efi/grub-install.in 2010-03-22 15:54:31.000000000 +0000 +@@ -31,6 +31,7 @@ + platform=@platform@ + host_os=@host_os@ + pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` ++localedir=@datadir@/locale + + grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` + grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` +@@ -182,9 +183,9 @@ + + # Copy gettext files + mkdir -p ${grubdir}/locale/ +-for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do +- if test -f "$file"; then +- cp -f "$file" ${grubdir}/locale/ ++for dir in ${localedir}/*; do ++ if test -f "$dir/LC_MESSAGES/grub.mo"; then ++ cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo" + fi + done + --- grub2-1.98.orig/debian/patches/960_raid_virtio.diff +++ grub2-1.98/debian/patches/960_raid_virtio.diff @@ -0,0 +1,158 @@ +diff -Nur -x '*.orig' -x '*~' grub2/include/grub/util/getroot.h grub2.new/include/grub/util/getroot.h +--- grub2/include/grub/util/getroot.h 2009-11-29 18:42:14.000000000 -0800 ++++ grub2.new/include/grub/util/getroot.h 2010-02-03 14:38:02.000000000 -0800 +@@ -19,12 +19,15 @@ + #ifndef GRUB_UTIL_GETROOT_HEADER + #define GRUB_UTIL_GETROOT_HEADER 1 + ++#include ++ + enum grub_dev_abstraction_types { + GRUB_DEV_ABSTRACTION_NONE, + GRUB_DEV_ABSTRACTION_LVM, + GRUB_DEV_ABSTRACTION_RAID, + }; + ++char *grub_find_device (const char *dir, dev_t dev); + char *grub_guess_root_device (const char *dir); + char *grub_get_prefix (const char *dir); + int grub_util_get_dev_abstraction (const char *os_dev); +diff -Nur -x '*.orig' -x '*~' grub2/util/getroot.c grub2.new/util/getroot.c +--- grub2/util/getroot.c 2010-02-01 14:33:16.000000000 -0800 ++++ grub2.new/util/getroot.c 2010-02-03 14:38:02.000000000 -0800 +@@ -178,8 +178,8 @@ + + #ifdef __MINGW32__ + +-static char * +-find_root_device (const char *dir __attribute__ ((unused)), ++char * ++grub_find_device (const char *dir __attribute__ ((unused)), + dev_t dev __attribute__ ((unused))) + { + return 0; +@@ -187,13 +187,22 @@ + + #elif ! defined(__CYGWIN__) + +-static char * +-find_root_device (const char *dir, dev_t dev) ++char * ++grub_find_device (const char *dir, dev_t dev) + { + DIR *dp; + char *saved_cwd; + struct dirent *ent; + ++ if (! dir) ++ { ++#ifdef __CYGWIN__ ++ return NULL; ++#else ++ dir = "/dev"; ++#endif ++ } ++ + dp = opendir (dir); + if (! dp) + return 0; +@@ -231,7 +240,7 @@ + /* Find it recursively. */ + char *res; + +- res = find_root_device (ent->d_name, dev); ++ res = grub_find_device (ent->d_name, dev); + + if (res) + { +@@ -334,8 +343,8 @@ + return serial; + } + +-static char * +-find_cygwin_root_device (const char *path, dev_t dev) ++char * ++grub_find_device (const char *path, dev_t dev) + { + /* No root device for /cygdrive. */ + if (dev == (DEV_CYGDRIVE_MAJOR << 16)) +@@ -356,7 +365,7 @@ + + /* Cygwin returns the partition serial number in stat.st_dev. + This is never identical to the device number of the emulated +- /dev/sdXN device, so above find_root_device () does not work. ++ /dev/sdXN device, so above grub_find_device () does not work. + Search the partition with the same serial in boot sector instead. */ + char devpath[sizeof ("/dev/sda15") + 13]; /* Size + Paranoia. */ + int d; +@@ -449,12 +458,12 @@ + + #ifdef __CYGWIN__ + /* Cygwin specific function. */ +- os_dev = find_cygwin_root_device (dir, st.st_dev); ++ os_dev = grub_find_device (dir, st.st_dev); + + #else + + /* This might be truly slow, but is there any better way? */ +- os_dev = find_root_device ("/dev", st.st_dev); ++ os_dev = grub_find_device ("/dev", st.st_dev); + #endif + #endif /* !__GNU__ */ + +diff -Nur -x '*.orig' -x '*~' grub2/util/raid.c grub2.new/util/raid.c +--- grub2/util/raid.c 2010-02-01 14:33:15.000000000 -0800 ++++ grub2.new/util/raid.c 2010-02-03 14:39:38.000000000 -0800 +@@ -21,40 +21,19 @@ + #ifdef __linux__ + #include + #include ++#include + + #include + #include + #include + #include ++#include + + #include + #include + #include + #include + +-static char * +-grub_util_getdiskname (int major, int minor) +-{ +- char *name = xmalloc (15); +- +- if (major == LOOP_MAJOR) +- sprintf (name, "/dev/loop%d", minor); +- else if (major == IDE0_MAJOR) +- sprintf (name, "/dev/hd%c", 'a' + minor / 64); +- else if (major == IDE1_MAJOR) +- sprintf (name, "/dev/hd%c", 'c' + minor / 64); +- else if (major == IDE2_MAJOR) +- sprintf (name, "/dev/hd%c", 'e' + minor / 64); +- else if (major == IDE3_MAJOR) +- sprintf (name, "/dev/hd%c", 'g' + minor / 64); +- else if (major == SCSI_DISK0_MAJOR) +- sprintf (name, "/dev/sd%c", 'a' + minor / 16); +- else +- grub_util_error ("unknown device number: %d, %d", major, minor); +- +- return name; +-} +- + char ** + grub_util_raid_getmembers (char *name) + { +@@ -99,7 +78,8 @@ + + if (disk.state & (1 << MD_DISK_ACTIVE)) + { +- devicelist[j] = grub_util_getdiskname (disk.major, disk.minor); ++ devicelist[j] = grub_find_device (NULL, ++ makedev (disk.major, disk.minor)); + j++; + } + } --- grub2-1.98.orig/debian/patches/978_multipath.diff +++ grub2-1.98/debian/patches/978_multipath.diff @@ -0,0 +1,292 @@ +diff -Nur -x '*.orig' -x '*~' grub2/util/deviceiter.c grub2.new/util/deviceiter.c +--- grub2/util/deviceiter.c 2011-01-25 13:23:19.000000000 +0000 ++++ grub2.new/util/deviceiter.c 2011-01-25 13:23:20.000000000 +0000 +@@ -725,9 +725,11 @@ + dmraid_check (node_name, "dm_tree_node_get_name failed\n"); + node_uuid = dm_tree_node_get_uuid (second); + dmraid_check (node_uuid, "dm_tree_node_get_uuid failed\n"); +- if (strncmp (node_uuid, "DMRAID-", 7) != 0) ++ if (strncmp (node_uuid, "DMRAID-", 7) != 0 && ++ strncmp (node_uuid, "mpath-", 6) != 0) + { +- grub_dprintf ("deviceiter", "%s is not DM-RAID\n", node_name); ++ grub_dprintf ("deviceiter", "%s is not DM-RAID or multipath\n", ++ node_name); + goto dmraid_next_child; + } + +diff -Nur -x '*.orig' -x '*~' grub2/util/getroot.c grub2.new/util/getroot.c +--- grub2/util/getroot.c 2011-01-25 13:23:19.000000000 +0000 ++++ grub2.new/util/getroot.c 2011-01-25 13:23:20.000000000 +0000 +@@ -30,12 +30,17 @@ + # define DEV_CYGDRIVE_MAJOR 98 + #endif + ++#ifdef HAVE_DEVICE_MAPPER ++# include ++#endif ++ + #ifdef __GNU__ + #include + #include + #include + #endif + ++#include + #include + #include + #include +@@ -471,30 +476,65 @@ + } + + static int +-grub_util_is_dmraid (const char *os_dev) ++grub_util_is_lvm (const char *os_dev) + { +- if (! strncmp (os_dev, "/dev/mapper/nvidia_", 19)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/isw_", 16)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/hpt37x_", 19)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/hpt45x_", 19)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/via_", 16)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/lsi_", 16)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/pdc_", 16)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/jmicron_", 20)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/asr_", 16)) +- return 1; +- else if (! strncmp (os_dev, "/dev/mapper/sil_", 16)) +- return 1; ++ if ((strncmp ("/dev/mapper/", os_dev, 12) != 0)) ++ return 0; ++ ++#ifdef HAVE_DEVICE_MAPPER ++ { ++ struct dm_tree *tree; ++ uint32_t maj, min; ++ struct dm_tree_node *node = NULL; ++ const char *node_uuid; ++ struct stat st; + +- return 0; ++ if (stat (os_dev, &st) < 0) ++ return 0; ++ ++ tree = dm_tree_create (); ++ if (! tree) ++ { ++ grub_printf ("Failed to create tree\n"); ++ grub_dprintf ("hostdisk", "dm_tree_create failed\n"); ++ return 0; ++ } ++ ++ maj = major (st.st_rdev); ++ min = minor (st.st_rdev); ++ ++ if (! dm_tree_add_dev (tree, maj, min)) ++ { ++ grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); ++ dm_tree_free (tree); ++ return 0; ++ } ++ ++ node = dm_tree_find_node (tree, maj, min); ++ if (! node) ++ { ++ grub_dprintf ("hostdisk", "dm_tree_find_node failed\n"); ++ dm_tree_free (tree); ++ return 0; ++ } ++ node_uuid = dm_tree_node_get_uuid (node); ++ if (! node_uuid) ++ { ++ grub_dprintf ("hostdisk", "%s has no DM uuid\n", os_dev); ++ dm_tree_free (tree); ++ return 0; ++ } ++ if (strncmp (node_uuid, "LVM-", 4) != 0) ++ { ++ dm_tree_free (tree); ++ return 0; ++ } ++ dm_tree_free (tree); ++ return 1; ++ } ++#else ++ return 1; ++#endif /* HAVE_DEVICE_MAPPER */ + } + + int +@@ -502,9 +542,7 @@ + { + #ifdef __linux__ + /* Check for LVM. */ +- if (!strncmp (os_dev, "/dev/mapper/", 12) +- && ! grub_util_is_dmraid (os_dev) +- && strncmp (os_dev, "/dev/mapper/mpath", 17) != 0) ++ if (grub_util_is_lvm (os_dev)) + return GRUB_DEV_ABSTRACTION_LVM; + + /* Check for RAID. */ +diff -Nur -x '*.orig' -x '*~' grub2/util/hostdisk.c grub2.new/util/hostdisk.c +--- grub2/util/hostdisk.c 2011-01-25 13:23:19.000000000 +0000 ++++ grub2.new/util/hostdisk.c 2011-01-25 14:59:32.000000000 +0000 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -948,6 +949,54 @@ + return ret; + } + ++#ifdef HAVE_DEVICE_MAPPER ++static int ++grub_util_get_dm_node_linear_info (const char *dev, ++ int *maj, int *min) ++{ ++ struct dm_task *dmt; ++ void *next = NULL; ++ uint64_t length, start; ++ char *target, *params; ++ char *ptr; ++ int major, minor; ++ ++ dmt = dm_task_create(DM_DEVICE_TABLE); ++ if (!dmt) ++ return 0; ++ ++ if (!dm_task_set_name(dmt, dev)) ++ return 0; ++ dm_task_no_open_count(dmt); ++ if (!dm_task_run(dmt)) ++ return 0; ++ next = dm_get_next_target(dmt, next, &start, &length, ++ &target, ¶ms); ++ if (grub_strcmp (target, "linear") != 0) ++ return 0; ++ major = grub_strtoul (params, &ptr, 10); ++ if (grub_errno) ++ { ++ grub_errno = GRUB_ERR_NONE; ++ return 0; ++ } ++ if (*ptr != ':') ++ return 0; ++ ptr++; ++ minor = grub_strtoul (ptr, 0, 10); ++ if (grub_errno) ++ { ++ grub_errno = GRUB_ERR_NONE; ++ return 0; ++ } ++ if (maj) ++ *maj = major; ++ if (min) ++ *min = minor; ++ return 1; ++} ++#endif ++ + static char * + convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) + { +@@ -1072,15 +1121,13 @@ + /* If this is a DM-RAID device. */ + if ((strncmp ("mapper/", p, 7) == 0)) + { +- static struct dm_tree *tree = NULL; ++ struct dm_tree *tree = NULL; + uint32_t maj, min; + struct dm_tree_node *node, *child; + void *handle; + const char *node_uuid, *mapper_name, *child_uuid, *child_name; + +- if (! tree) +- tree = dm_tree_create (); +- ++ tree = dm_tree_create (); + if (! tree) + { + grub_dprintf ("hostdisk", "dm_tree_create failed\n"); +@@ -1107,10 +1154,41 @@ + grub_dprintf ("hostdisk", "%s has no DM uuid\n", path); + return NULL; + } +- else if (strncmp (node_uuid, "DMRAID-", 7) != 0) ++ if (strncmp (node_uuid, "LVM-", 4) == 0) ++ { ++ grub_dprintf ("hostdisk", "%s is an LVM\n", path); ++ node = NULL; ++ goto devmapper_out; ++ } ++ if (strncmp (node_uuid, "mpath-", 6) == 0) ++ { ++ /* Multipath partitions have partN-mpath-* UUIDs, and are ++ linear mappings so are handled by ++ grub_util_get_dm_node_linear_info. Multipath disks are not ++ linear mappings and must be handled specially. */ ++ grub_dprintf ("hostdisk", "%s is a multipath disk\n", path); ++ mapper_name = dm_tree_node_get_name (node); ++ goto devmapper_out; ++ } ++ if (strncmp (node_uuid, "DMRAID-", 7) != 0) + { ++ int major, minor; ++ const char *node_name; + grub_dprintf ("hostdisk", "%s is not DM-RAID\n", path); +- return NULL; ++ ++ if ((node_name = dm_tree_node_get_name (node)) ++ && grub_util_get_dm_node_linear_info (node_name, ++ &major, &minor)) ++ { ++ if (tree) ++ dm_tree_free (tree); ++ free (path); ++ char *ret = grub_find_device (NULL, (major << 8) | minor); ++ return ret; ++ } ++ ++ node = NULL; ++ goto devmapper_out; + } + + handle = NULL; +@@ -1144,17 +1222,20 @@ + mapper_name = child_name; + + devmapper_out: +- if (! mapper_name) ++ if (! mapper_name && node) + { + /* This is a DM-RAID disk, not a partition. */ + mapper_name = dm_tree_node_get_name (node); + if (! mapper_name) +- { +- grub_dprintf ("hostdisk", "%s has no DM name\n", path); +- return NULL; +- } ++ grub_dprintf ("hostdisk", "%s has no DM name\n", path); + } +- return xasprintf ("/dev/mapper/%s", mapper_name); ++ if (tree) ++ dm_tree_free (tree); ++ free (path); ++ if (mapper_name) ++ return xasprintf ("/dev/mapper/%s", mapper_name); ++ else ++ return NULL; + } + #endif /* HAVE_DEVICE_MAPPER */ + } --- grub2-1.98.orig/debian/patches/957_handle_loopback.diff +++ grub2-1.98/debian/patches/957_handle_loopback.diff @@ -0,0 +1,45 @@ +Ubuntu: needed for Wubi +Description: Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. +UbuntuSpecific: Not inherently. losetup and /proc/mounts are Linux-specific, + though, so we might need to refine this before sending it upstream. + +diff -Nur -x '*.orig' -x '*~' grub2-1.97~beta3/util/grub-mkconfig_lib.in grub2-1.97~beta3.new/util/grub-mkconfig_lib.in +--- grub2-1.97~beta3/util/grub-mkconfig_lib.in 2009-09-15 00:23:50.000000000 +0100 ++++ grub2-1.97~beta3.new/util/grub-mkconfig_lib.in 2009-09-15 00:31:31.000000000 +0100 +@@ -142,6 +142,20 @@ + { + device=$1 + ++ loop_file= ++ case ${device} in ++ /dev/loop/*|/dev/loop[0-9]) ++ loop_file=`losetup ${device} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` ++ case $loop_file in ++ /dev/*) ;; ++ *) ++ loop_device=${device} ++ device=`${grub_probe} --target=device "${loop_file}"` ++ ;; ++ esac ++ ;; ++ esac ++ + # Abstraction modules aren't auto-loaded. + abstraction="`${grub_probe} --device ${device} --target=abstraction`" + for module in ${abstraction} ; do +@@ -159,6 +173,14 @@ + if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then + echo "search --no-floppy --fs-uuid --set ${fs_uuid}" + fi ++ ++ if [ "x${loop_file}" != x ]; then ++ loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)" ++ if [ "x${loop_mountpoint}" != x ]; then ++ echo "loopback loop0 ${loop_file#$loop_mountpoint}" ++ echo "set root=(loop0)" ++ fi ++ fi + } + + grub_file_is_not_garbage () --- grub2-1.98.orig/debian/patches/954_linux_quiet.diff +++ grub2-1.98/debian/patches/954_linux_quiet.diff @@ -0,0 +1,42 @@ +Ubuntu: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/386922 +Upstream: not yet, but probably can and should be +Description: For non-recovery kernel menu entries, suppress progress + messages as the kernel and initrd load. + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_linux.in grub2.new/util/grub.d/10_linux.in +--- grub2/util/grub.d/10_linux.in 2010-01-28 18:22:36.000000000 +0000 ++++ grub2.new/util/grub.d/10_linux.in 2010-01-28 18:26:06.000000000 +0000 +@@ -70,13 +70,21 @@ + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" + fi + printf '%s\n' "${prepare_boot_cache}" +- cat << EOF ++ if [ "x$5" != "xquiet" ]; then ++ cat << EOF + echo $(printf "$(gettext "Loading Linux %s ...")" ${version}) ++EOF ++ fi ++ cat << EOF + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + EOF +- if test -n "${initrd}" ; then ++ if [ "x$5" != "xquiet" ]; then + cat << EOF + echo $(gettext "Loading initial ramdisk ...") ++EOF ++ fi ++ if test -n "${initrd}" ; then ++ cat << EOF + initrd ${rel_dirname}/${initrd} + EOF + fi +@@ -117,7 +125,8 @@ + fi + + linux_entry "${OS}" "${version}" false \ +- "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" ++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \ ++ quiet + if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then + linux_entry "${OS}" "${version}" true \ + "single ${GRUB_CMDLINE_LINUX}" --- grub2-1.98.orig/debian/patches/907_grub.cfg_400.diff +++ grub2-1.98/debian/patches/907_grub.cfg_400.diff @@ -0,0 +1,15 @@ +Index: util/grub-mkconfig.in +=================================================================== +--- util/grub-mkconfig.in (revision 2598) ++++ util/grub-mkconfig.in (working copy) +@@ -261,6 +261,10 @@ for i in ${grub_mkconfig_dir}/* ; do + esac + done + ++if [ "x${grub_cfg}" != "x" ] && ! grep -q "^password " ${grub_cfg}.new ; then ++ chmod 444 ${grub_cfg}.new || true ++fi ++ + if test "x${grub_cfg}" != "x" ; then + # none of the children aborted with error, install the new grub.cfg + mv -f ${grub_cfg}.new ${grub_cfg} --- grub2-1.98.orig/debian/patches/950_quick_boot.diff +++ grub2-1.98/debian/patches/950_quick_boot.diff @@ -0,0 +1,115 @@ +Description: If other operating systems are installed, then automatically + unhide the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus + if available to check whether Shift is pressed. If it is, show the menu, + otherwise boot immediately. If keystatus is not available, then fall back + to a short delay interruptible with Escape. +UbuntuSpecific: May or may not remain Ubuntu-specific, although this is not + obviously wanted upstream. It implements a requirement of + https://wiki.ubuntu.com/DesktopExperienceTeam/KarmicBootExperienceDesignSpec#Bootloader. + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/00_header.in grub2.new/util/grub.d/00_header.in +--- grub2/util/grub.d/00_header.in 2010-03-09 16:14:00.000000000 +0000 ++++ grub2.new/util/grub.d/00_header.in 2010-03-09 16:57:21.000000000 +0000 +@@ -142,22 +142,9 @@ + EOF + fi + +-if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then +- if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then +- verbose= +- else +- verbose=" --verbose" +- fi +- cat << EOF +-if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then +- set timeout=${GRUB_TIMEOUT} +-fi +-EOF +-else +- cat << EOF ++cat << EOF + set timeout=${GRUB_TIMEOUT} + EOF +-fi + + # Play an initial tune + if [ "x${GRUB_INIT_TUNE}" != "x" ] ; then +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/30_os-prober.in grub2.new/util/grub.d/30_os-prober.in +--- grub2/util/grub.d/30_os-prober.in 2010-03-03 20:27:58.000000000 +0000 ++++ grub2.new/util/grub.d/30_os-prober.in 2010-03-09 16:56:58.000000000 +0000 +@@ -22,18 +22,61 @@ + + . ${libdir}/grub/grub-mkconfig_lib + ++found_other_os= ++ ++adjust_timeout () { ++ if [ "x${found_other_os}" = "x" ] ; then ++ if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then ++ if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then ++ verbose= ++ else ++ verbose=" --verbose" ++ fi ++ ++ if [ "x${GRUB_HIDDEN_TIMEOUT}" = "x0" ] ; then ++ cat < /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then + # missing os-prober and/or linux-boot-prober ++ adjust_timeout + exit 0 + fi + + OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`" + if [ -z "${OSPROBED}" ] ; then + # empty os-prober output, nothing doing ++ adjust_timeout + exit 0 + fi + +@@ -99,6 +142,7 @@ + fi + + echo "Found ${LONGNAME} on ${DEVICE}" >&2 ++ found_other_os=1 + + case ${BOOT} in + chain) +@@ -201,3 +245,5 @@ + ;; + esac + done ++ ++adjust_timeout --- grub2-1.98.orig/debian/patches/908_gfxpayload_keep_default.diff +++ grub2-1.98/debian/patches/908_gfxpayload_keep_default.diff @@ -0,0 +1,36 @@ +Description: Disable gfxpayload=keep by default + Setting gfxpayload=keep has been known to cause efifb to be inappropriately + enabled. In any case, with the current Linux kernel the result of this + option is that early kernelspace will be unable to print anything to the + console, so (for example) if boot fails and you end up dumped to an + initramfs prompt, you won't be able to see anything on the screen. As such + it shouldn't be enabled by default in Debian, no matter what kernel options + are enabled. + . + gfxpayload=keep is a good idea but rather ahead of its time ... +Author: Colin Watson +Bug-Debian: http://bugs.debian.org/567245 +Forwarded: no +Last-Update: 2010-03-09 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_linux.in grub2.new/util/grub.d/10_linux.in +--- grub2/util/grub.d/10_linux.in 2010-03-09 11:35:45.000000000 +0000 ++++ grub2.new/util/grub.d/10_linux.in 2010-03-09 11:37:18.000000000 +0000 +@@ -64,16 +64,7 @@ + printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" + save_default_entry | sed -e "s/^/\t/" + +- # Use ELILO's generic "efifb" when it's known to be available. +- # FIXME: We need an interface to select vesafb in case efifb can't be used. +- if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then +- if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \ +- && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then +- cat << EOF +- set gfxpayload=keep +-EOF +- fi +- else ++ if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ]; then + cat << EOF + set gfxpayload=$GRUB_GFXPAYLOAD_LINUX + EOF --- grub2-1.98.orig/debian/patches/973_grub_distributor_spaces.diff +++ grub2-1.98/debian/patches/973_grub_distributor_spaces.diff @@ -0,0 +1,42 @@ +Description: Only use the first word of GRUB_DISTRIBUTOR for --class +Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2296 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/557606 +Forwarded: yes +Last-Update: 2010-04-08 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_hurd.in grub2.new/util/grub.d/10_hurd.in +--- grub2/util/grub.d/10_hurd.in 2010-03-09 16:14:00.000000000 +0000 ++++ grub2.new/util/grub.d/10_hurd.in 2010-04-08 11:04:31.000000000 +0100 +@@ -27,7 +27,7 @@ + OS=GNU + else + OS="${GRUB_DISTRIBUTOR} GNU/Hurd" +- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}" ++ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}" + fi + + at_least_one=false +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_kfreebsd.in grub2.new/util/grub.d/10_kfreebsd.in +--- grub2/util/grub.d/10_kfreebsd.in 2010-03-09 16:14:00.000000000 +0000 ++++ grub2.new/util/grub.d/10_kfreebsd.in 2010-04-08 11:04:31.000000000 +0100 +@@ -30,7 +30,7 @@ + case "${GRUB_DISTRIBUTOR}" in + Debian) + OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD" +- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') --class gnu-kfreebsd --class gnu ${CLASS}" ++ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) --class gnu-kfreebsd --class gnu ${CLASS}" + ;; + *) + OS="FreeBSD" +diff -Nur -x '*.orig' -x '*~' grub2/util/grub.d/10_linux.in grub2.new/util/grub.d/10_linux.in +--- grub2/util/grub.d/10_linux.in 2010-04-08 11:00:30.000000000 +0100 ++++ grub2.new/util/grub.d/10_linux.in 2010-04-08 11:04:49.000000000 +0100 +@@ -31,7 +31,7 @@ + OS=GNU/Linux + else + OS="${GRUB_DISTRIBUTOR}" +- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}" ++ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}" + fi + + # loop-AES arranges things so that /dev/loop/X can be our root device, but --- grub2-1.98.orig/debian/patches/968_hostdisk_speedup.diff +++ grub2-1.98/debian/patches/968_hostdisk_speedup.diff @@ -0,0 +1,310 @@ +Upstream: http://lists.gnu.org/archive/html/grub-devel/2010-03/msg00008.html +Description: Optimise hostdisk device handling + This substantially speeds up grub-probe filesystem reads. + +diff -Nur -x '*.orig' -x '*~' grub2/ChangeLog.hostdisk-speedup grub2.new/ChangeLog.hostdisk-speedup +--- grub2/ChangeLog.hostdisk-speedup 1970-01-01 01:00:00.000000000 +0100 ++++ grub2.new/ChangeLog.hostdisk-speedup 2010-03-03 10:43:43.000000000 +0000 +@@ -0,0 +1,18 @@ ++2010-03-03 Colin Watson ++ ++ * util/hostdisk.c (struct grub_util_biosdisk_data): New structure. ++ (grub_util_biosdisk_open): Initialise disk->data. ++ (struct linux_partition_cache): New structure. ++ (linux_find_partition): Cache partition start positions; these are ++ expensive to compute on every read and write. ++ (open_device): Cache open file descriptor in disk->data, so that we ++ don't have to reopen it and flush the buffer cache for consecutive ++ operations on the same device. ++ (grub_util_biosdisk_close): New function. ++ (grub_util_biosdisk_dev): Set `close' member. ++ ++ * conf/common.rmk (grub_probe_SOURCES): Add kern/list.c. ++ * conf/i386-efi.rmk (grub_setup_SOURCES): Likewise. ++ * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. ++ * conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Likewise. ++ * conf/x86_64-efi.rmk (grub_setup_SOURCES): Likewise. +diff -Nur -x '*.orig' -x '*~' grub2/conf/common.rmk grub2.new/conf/common.rmk +--- grub2/conf/common.rmk 2010-03-03 20:11:04.000000000 +0000 ++++ grub2.new/conf/common.rmk 2010-03-03 20:11:05.000000000 +0000 +@@ -25,7 +25,7 @@ + grub_probe_SOURCES = gnulib/progname.c util/grub-probe.c \ + util/hostdisk.c util/misc.c util/getroot.c \ + kern/device.c kern/disk.c kern/err.c kern/misc.c \ +- kern/parser.c kern/partition.c kern/file.c \ ++ kern/parser.c kern/partition.c kern/file.c kern/list.c \ + \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ +diff -Nur -x '*.orig' -x '*~' grub2/conf/i386-efi.rmk grub2.new/conf/i386-efi.rmk +--- grub2/conf/i386-efi.rmk 2010-03-03 20:08:04.000000000 +0000 ++++ grub2.new/conf/i386-efi.rmk 2010-03-03 20:11:05.000000000 +0000 +@@ -21,7 +21,7 @@ + # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ + # fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \ + # fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ +-# kern/fs.c kern/env.c fs/fshelp.c ++# kern/fs.c kern/env.c kern/list.c fs/fshelp.c + + # Scripts. + sbin_SCRIPTS = grub-install +diff -Nur -x '*.orig' -x '*~' grub2/conf/i386-pc.rmk grub2.new/conf/i386-pc.rmk +--- grub2/conf/i386-pc.rmk 2010-03-03 20:08:04.000000000 +0000 ++++ grub2.new/conf/i386-pc.rmk 2010-03-03 20:11:05.000000000 +0000 +@@ -96,7 +96,8 @@ + util/i386/pc/grub-setup.c util/hostdisk.c \ + util/misc.c util/getroot.c kern/device.c kern/disk.c \ + kern/err.c kern/misc.c kern/parser.c kern/partition.c \ +- kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ ++ kern/file.c kern/fs.c kern/env.c kern/list.c \ ++ fs/fshelp.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ +diff -Nur -x '*.orig' -x '*~' grub2/conf/sparc64-ieee1275.rmk grub2.new/conf/sparc64-ieee1275.rmk +--- grub2/conf/sparc64-ieee1275.rmk 2010-03-03 20:08:04.000000000 +0000 ++++ grub2.new/conf/sparc64-ieee1275.rmk 2010-03-03 20:11:05.000000000 +0000 +@@ -70,7 +70,8 @@ + grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ + util/misc.c util/getroot.c kern/device.c kern/disk.c \ + kern/err.c kern/misc.c kern/parser.c kern/partition.c \ +- kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ ++ kern/file.c kern/fs.c kern/env.c kern/list.c \ ++ fs/fshelp.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ +diff -Nur -x '*.orig' -x '*~' grub2/conf/x86_64-efi.rmk grub2.new/conf/x86_64-efi.rmk +--- grub2/conf/x86_64-efi.rmk 2010-03-03 20:08:04.000000000 +0000 ++++ grub2.new/conf/x86_64-efi.rmk 2010-03-03 20:11:05.000000000 +0000 +@@ -20,7 +20,7 @@ + # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ + # fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \ + # fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ +-# kern/fs.c kern/env.c fs/fshelp.c ++# kern/fs.c kern/env.c kern/list.c fs/fshelp.c + + # Scripts. + sbin_SCRIPTS = grub-install +diff -Nur -x '*.orig' -x '*~' grub2/util/hostdisk.c grub2.new/util/hostdisk.c +--- grub2/util/hostdisk.c 2010-03-03 20:11:04.000000000 +0000 ++++ grub2.new/util/hostdisk.c 2010-03-03 20:11:05.000000000 +0000 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -107,6 +108,13 @@ + char *device; + } map[256]; + ++struct grub_util_biosdisk_data ++{ ++ char *dev; ++ int access_mode; ++ int fd; ++}; ++ + #ifdef __linux__ + /* Check if we have devfs support. */ + static int +@@ -169,6 +177,7 @@ + { + int drive; + struct stat st; ++ struct grub_util_biosdisk_data *data; + + drive = find_grub_drive (name); + if (drive < 0) +@@ -177,6 +186,10 @@ + + disk->has_partitions = 1; + disk->id = drive; ++ disk->data = data = xmalloc (sizeof (struct grub_util_biosdisk_data)); ++ data->dev = NULL; ++ data->access_mode = 0; ++ data->fd = -1; + + /* Get the size. */ + #if defined(__MINGW32__) +@@ -367,6 +380,17 @@ + #endif /* __linux__ || __CYGWIN__ */ + + #ifdef __linux__ ++/* Cache of partition start sectors for each disk. */ ++struct linux_partition_cache ++{ ++ struct linux_partition_cache *next; ++ char *dev; ++ unsigned long start; ++ int partno; ++}; ++ ++struct linux_partition_cache *linux_partition_cache_list; ++ + static int + linux_find_partition (char *dev, unsigned long sector) + { +@@ -375,6 +399,7 @@ + char *p; + int i; + char real_dev[PATH_MAX]; ++ struct linux_partition_cache *cache; + + strcpy(real_dev, dev); + +@@ -394,6 +419,16 @@ + format = "%d"; + } + ++ for (cache = linux_partition_cache_list; cache; cache = cache->next) ++ { ++ if (strcmp (cache->dev, dev) == 0 && cache->start == sector) ++ { ++ sprintf (p, format, cache->partno); ++ strcpy (dev, real_dev); ++ return 1; ++ } ++ } ++ + for (i = 1; i < 10000; i++) + { + int fd; +@@ -412,6 +447,15 @@ + + if (start == sector) + { ++ struct linux_partition_cache *new_cache_item; ++ ++ new_cache_item = xmalloc (sizeof *new_cache_item); ++ new_cache_item->dev = xstrdup (dev); ++ new_cache_item->start = start; ++ new_cache_item->partno = i; ++ grub_list_push (GRUB_AS_LIST_P (&linux_partition_cache_list), ++ GRUB_AS_LIST (new_cache_item)); ++ + strcpy (dev, real_dev); + return 1; + } +@@ -425,6 +469,7 @@ + open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) + { + int fd; ++ struct grub_util_biosdisk_data *data = disk->data; + + #ifdef O_LARGEFILE + flags |= O_LARGEFILE; +@@ -451,18 +496,35 @@ + && strncmp (map[disk->id].device, "/dev/", 5) == 0) + is_partition = linux_find_partition (dev, disk->partition->start); + +- /* Open the partition. */ +- grub_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev); +- fd = open (dev, flags); +- if (fd < 0) ++ if (data->dev && strcmp (data->dev, dev) == 0 && ++ data->access_mode == (flags & O_ACCMODE)) + { +- grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", dev); +- return -1; ++ grub_dprintf ("hostdisk", "reusing open device `%s'\n", dev); ++ fd = data->fd; + } ++ else ++ { ++ free (data->dev); ++ if (data->fd != -1) ++ close (data->fd); ++ ++ /* Open the partition. */ ++ grub_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev); ++ fd = open (dev, flags); ++ if (fd < 0) ++ { ++ grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", dev); ++ return -1; ++ } + +- /* Flush the buffer cache to the physical disk. +- XXX: This also empties the buffer cache. */ +- ioctl (fd, BLKFLSBUF, 0); ++ /* Flush the buffer cache to the physical disk. ++ XXX: This also empties the buffer cache. */ ++ ioctl (fd, BLKFLSBUF, 0); ++ ++ data->dev = xstrdup (dev); ++ data->access_mode = (flags & O_ACCMODE); ++ data->fd = fd; ++ } + + if (is_partition) + sector -= disk->partition->start; +@@ -486,7 +548,26 @@ + } + #endif + +- fd = open (map[disk->id].device, flags); ++ if (data->dev && strcmp (data->dev, map[disk->id].device) == 0 && ++ data->access_mode == (flags & O_ACCMODE)) ++ { ++ grub_dprintf ("hostdisk", "reusing open device `%s'\n", data->dev); ++ fd = data->fd; ++ } ++ else ++ { ++ free (data->dev); ++ if (data->fd != -1) ++ close (data->fd); ++ ++ fd = open (map[disk->id].device, flags); ++ if (fd >= 0) ++ { ++ data->dev = xstrdup (map[disk->id].device); ++ data->access_mode = (flags & O_ACCMODE); ++ data->fd = fd; ++ } ++ } + + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + if (! (sysctl_oldflags & 0x10) +@@ -646,7 +727,6 @@ + != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) + grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id].device); + +- close (fd); + return grub_errno; + } + +@@ -681,17 +761,27 @@ + != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) + grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id].device); + +- close (fd); + return grub_errno; + } + ++static void ++grub_util_biosdisk_close (struct grub_disk *disk) ++{ ++ struct grub_util_biosdisk_data *data = disk->data; ++ ++ free (data->dev); ++ if (data->fd != -1) ++ close (data->fd); ++ free (data); ++} ++ + static struct grub_disk_dev grub_util_biosdisk_dev = + { + .name = "biosdisk", + .id = GRUB_DISK_DEVICE_BIOSDISK_ID, + .iterate = grub_util_biosdisk_iterate, + .open = grub_util_biosdisk_open, +- .close = 0, ++ .close = grub_util_biosdisk_close, + .read = grub_util_biosdisk_read, + .write = grub_util_biosdisk_write, + .next = 0 --- grub2-1.98.orig/debian/patches/951_sleep_shift.diff +++ grub2-1.98/debian/patches/951_sleep_shift.diff @@ -0,0 +1,41 @@ +Upstream: http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00694.html + (in part; see thread) +Description: Allow Shift to interrupt 'sleep --interruptible'. +UbuntuSpecific: Upstream would like to consider this at more length. See + http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00718.html, and the + rest of the thread for context. + +diff -Nur -x '*.orig' -x '*~' grub2-1.96+20090826/commands/sleep.c grub2-1.96+20090826.new/commands/sleep.c +--- grub2-1.96+20090826/commands/sleep.c 2009-08-26 10:01:15.000000000 +0100 ++++ grub2-1.96+20090826.new/commands/sleep.c 2009-08-27 10:02:35.000000000 +0100 +@@ -43,6 +43,20 @@ + grub_printf ("%d ", n); + } + ++static int ++grub_check_keyboard (void) ++{ ++ int mods = grub_getkeystatus (); ++ if (mods >= 0 && (mods & GRUB_TERM_STATUS_SHIFT) != 0) ++ return 1; ++ ++ if (grub_checkkey () >= 0 && ++ GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC) ++ return 1; ++ ++ return 0; ++} ++ + /* Based on grub_millisleep() from kern/generic/millisleep.c. */ + static int + grub_interruptible_millisleep (grub_uint32_t ms) +@@ -52,8 +66,7 @@ + start = grub_get_time_ms (); + + while (grub_get_time_ms () - start < ms) +- if (grub_checkkey () >= 0 && +- GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC) ++ if (grub_check_keyboard ()) + return 1; + + return 0; --- grub2-1.98.orig/debian/patches/904_disable_floppies.diff +++ grub2-1.98/debian/patches/904_disable_floppies.diff @@ -0,0 +1,28 @@ + +Author: Robert Millan + +An ugly kludge. Should this be merged upstream? + +Index: util/hostdisk.c +=================================================================== +--- util/hostdisk.c (revision 1832) ++++ util/hostdisk.c (working copy) +@@ -544,6 +544,18 @@ + continue; + } + ++ if (! strncmp (p, "/dev/fd", sizeof ("/dev/fd") - 1)) ++ { ++ char *q = p + sizeof ("/dev/fd") - 1; ++ if (*q >= '0' && *q <= '9') ++ { ++ free (map[drive].drive); ++ map[drive].drive = NULL; ++ grub_util_info ("`%s' looks like a floppy drive, skipping", p); ++ continue; ++ } ++ } ++ + #ifdef __linux__ + /* On Linux, the devfs uses symbolic links horribly, and that + confuses the interface very much, so use realpath to expand --- grub2-1.98.orig/debian/patches/972_ignore_grub.d_README.diff +++ grub2-1.98/debian/patches/972_ignore_grub.d_README.diff @@ -0,0 +1,17 @@ +Description: Don't run /etc/grub.d/README, in case it ended up executable +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/537123 +Forwarded: no +Last-Update: 2010-03-22 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-mkconfig_lib.in grub2.new/util/grub-mkconfig_lib.in +--- grub2/util/grub-mkconfig_lib.in 2010-03-22 16:27:50.000000000 +0000 ++++ grub2.new/util/grub-mkconfig_lib.in 2010-03-22 16:28:27.000000000 +0000 +@@ -153,6 +153,7 @@ + if test -f "$1" ; then + case "$1" in + *.dpkg-*) return 1 ;; # debian dpkg ++ README*) return 1 ;; # documentation + esac + else + return 1 --- grub2-1.98.orig/debian/patches/953_really_quiet.diff +++ grub2-1.98/debian/patches/953_really_quiet.diff @@ -0,0 +1,52 @@ +Ubuntu: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/386922 +Description: Remove some verbose messages printed before reading the + configuration file. In some ways this is awkward because it makes debugging + harder, but it's a requirement for a smooth-looking boot process; we may be + able to do better in future. +UbuntuSpecific: Removes status messages that are arguably useful for + debugging; we think it looks tidier, but upstream isn't interested. + +diff -Nur -x '*.orig' -x '*~' grub2/kern/main.c grub2.new/kern/main.c +--- grub2/kern/main.c 2010-01-20 01:20:49.000000000 +0000 ++++ grub2.new/kern/main.c 2010-01-26 15:24:32.000000000 +0000 +@@ -152,11 +152,6 @@ + /* First of all, initialize the machine. */ + grub_machine_init (); + +- /* Hello. */ +- grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); +- grub_printf ("Welcome to GRUB!\n\n"); +- grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); +- + /* Load pre-loaded modules and free the space. */ + grub_register_exported_symbols (); + grub_load_modules (); +diff -Nur -x '*.orig' -x '*~' grub2/kern/rescue_reader.c grub2.new/kern/rescue_reader.c +--- grub2/kern/rescue_reader.c 2010-01-20 01:20:48.000000000 +0000 ++++ grub2.new/kern/rescue_reader.c 2010-01-26 15:25:25.000000000 +0000 +@@ -72,8 +72,6 @@ + void + grub_rescue_run (void) + { +- grub_printf ("Entering rescue mode...\n"); +- + while (1) + { + char *line; +diff -Nur -x '*.orig' -x '*~' grub2/normal/menu.c grub2.new/normal/menu.c +--- grub2/normal/menu.c 2010-01-26 15:24:30.000000000 +0000 ++++ grub2.new/normal/menu.c 2010-01-26 15:26:01.000000000 +0000 +@@ -487,12 +487,9 @@ + + /* Callback invoked immediately before a menu entry is executed. */ + static void +-notify_booting (grub_menu_entry_t entry, ++notify_booting (grub_menu_entry_t entry __attribute__((unused)), + void *userdata __attribute__((unused))) + { +- grub_printf (" "); +- grub_printf_ (N_("Booting \'%s\'"), entry->title); +- grub_printf ("\n\n"); + } + + /* Callback invoked when a default menu entry executed because of a timeout --- grub2-1.98.orig/debian/patches/965_reduce_boot_img.diff +++ grub2-1.98/debian/patches/965_reduce_boot_img.diff @@ -0,0 +1,50 @@ +Description: Reduce the size of boot.img a bit, so that we have room for a + key modifier status check. Thanks to Colin King. + +diff -Nur -x '*.orig' -x '*~' grub2/boot/i386/pc/boot.S grub2.new/boot/i386/pc/boot.S +--- grub2/boot/i386/pc/boot.S 2010-02-09 16:59:39.000000000 +0000 ++++ grub2.new/boot/i386/pc/boot.S 2010-02-09 17:00:28.000000000 +0000 +@@ -27,6 +27,7 @@ + + /* Print message string */ + #define MSG(x) movw $x, %si; call LOCAL(message) ++#define ERR(x) movw $x, %si; jmp LOCAL(error_message) + + .file "boot.S" + +@@ -233,7 +234,7 @@ + jz LOCAL(floppy_probe) + + /* Nope, we definitely have a hard disk, and we're screwed. */ +- jmp LOCAL(hd_probe_error) ++ ERR(hd_probe_error_string) + + LOCAL(final_init): + /* set the mode to zero */ +@@ -360,22 +361,15 @@ + * BIOS Geometry translation error (past the end of the disk geometry!). + */ + LOCAL(geometry_error): +- MSG(geometry_error_string) +- jmp LOCAL(general_error) +- +-/* +- * Disk probe failure. +- */ +-LOCAL(hd_probe_error): +- MSG(hd_probe_error_string) +- jmp LOCAL(general_error) ++ ERR(geometry_error_string) + + /* + * Read error on the disk. + */ + LOCAL(read_error): +- MSG(read_error_string) +- ++ movw $read_error_string, %si ++LOCAL(error_message): ++ call LOCAL(message) + LOCAL(general_error): + MSG(general_error_string) + --- grub2-1.98.orig/debian/patches/901_dpkg_version_comparison.diff +++ grub2-1.98/debian/patches/901_dpkg_version_comparison.diff @@ -0,0 +1,24 @@ +Index: util/grub-mkconfig_lib.in +=================================================================== +--- util/grub-mkconfig_lib.in (revision 2482) ++++ util/grub-mkconfig_lib.in (working copy) +@@ -185,8 +185,8 @@ version_test_numeric () + + version_test_gt () + { +- local a=`echo $1 | sed -e "s/[^-]*-//"` +- local b=`echo $2 | sed -e "s/[^-]*-//"` ++ local a=`echo $1 | sed -e "s/[^-]*-//;s/[._-]\(pre\|rc\|test\|git\|old\)/~\1/g"` ++ local b=`echo $2 | sed -e "s/[^-]*-//;s/[._-]\(pre\|rc\|test\|git\|old\)/~\1/g"` + local cmp=gt + if [ "x$b" = "x" ] ; then + return 0 +@@ -196,7 +196,7 @@ version_test_gt () + *.old:*) a=`echo -n $a | sed -e s/\.old$//` ; cmp=gt ;; + *:*.old) b=`echo -n $b | sed -e s/\.old$//` ; cmp=ge ;; + esac +- version_test_numeric $a $cmp $b ++ dpkg --compare-versions "$a" $cmp "$b" + return $? + } + --- grub2-1.98.orig/debian/patches/961_dmraid_probe.diff +++ grub2-1.98/debian/patches/961_dmraid_probe.diff @@ -0,0 +1,650 @@ +Description: Add DM-RAID probing support. +Upstream: Maintained in an upstream branch, + sftp://bzr.sv.gnu.org/srv/bzr/grub/branches/dmraid-probe/; see + http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00345.html + +diff -Nur -x '*.orig' -x '*~' grub2/ChangeLog.dmraid-probe grub2.new/ChangeLog.dmraid-probe +--- grub2/ChangeLog.dmraid-probe 1969-12-31 16:00:00.000000000 -0800 ++++ grub2.new/ChangeLog.dmraid-probe 2010-02-06 10:33:54.000000000 -0800 +@@ -0,0 +1,26 @@ ++2010-01-31 Colin Watson ++ ++ * configure.ac: Check for Linux device-mapper support. ++ ++ * util/hostdisk.c (device_is_mapped): New function. ++ (find_partition_start): New function, partly broken out from ++ linux_find_partition and grub_util_biosdisk_get_grub_dev but with ++ device-mapper support added. ++ (linux_find_partition): Use find_partition_start. ++ (convert_system_partition_to_system_disk): Add `st' argument. ++ Support Linux /dev/mapper/* devices if device-mapper support is ++ available; only DM-RAID devices are understood at present. ++ (find_system_device): Add `st' argument. Pass it to ++ convert_system_partition_to_system_disk. ++ (grub_util_biosdisk_get_grub_dev): Pass stat result to ++ find_system_device and convert_system_partition_to_system_disk. Use ++ find_partition_start. ++ ++ * conf/common.rmk (grub_mkdevicemap_SOURCES): Add kern/env.c, ++ kern/err.c, kern/list.c, and kern/misc.c. ++ * util/deviceiter.c [__linux__]: Define MINOR. ++ (grub_util_iterate_devices): Add support for DM-RAID disk devices. ++ * util/mkdevicemap.c (grub_putchar): New function. ++ (grub_getkey): New function. ++ (grub_refresh): New function. ++ (main): Set debug=all if -v -v is used. +diff -Nur -x '*.orig' -x '*~' grub2/conf/common.rmk grub2.new/conf/common.rmk +--- grub2/conf/common.rmk 2010-02-06 10:32:37.000000000 -0800 ++++ grub2.new/conf/common.rmk 2010-02-06 10:33:54.000000000 -0800 +@@ -3,7 +3,8 @@ + sbin_UTILITIES += grub-mkdevicemap + grub_mkdevicemap_SOURCES = gnulib/progname.c util/grub-mkdevicemap.c \ + util/deviceiter.c \ +- util/misc.c ++ util/misc.c \ ++ kern/env.c kern/err.c kern/list.c kern/misc.c + + ifeq ($(target_cpu)-$(platform), sparc64-ieee1275) + grub_mkdevicemap_SOURCES += util/ieee1275/ofpath.c util/ieee1275/devicemap.c +diff -Nur -x '*.orig' -x '*~' grub2/configure.ac grub2.new/configure.ac +--- grub2/configure.ac 2010-02-06 10:32:49.000000000 -0800 ++++ grub2.new/configure.ac 2010-02-06 10:33:54.000000000 -0800 +@@ -660,6 +660,22 @@ + AC_SUBST([freetype_cflags]) + AC_SUBST([freetype_libs]) + ++AC_ARG_ENABLE([device-mapper], ++ [AS_HELP_STRING([--enable-device-mapper], ++ [enable Linux device-mapper support (default=guessed)])]) ++if test x"$enable_device_mapper" = xno ; then ++ device_mapper_excuse="explicitly disabled" ++fi ++ ++if test x"$device_mapper_excuse" = x ; then ++ # Check for device-mapper library. ++ AC_CHECK_LIB([devmapper], [dm_task_create], ++ [LDFLAGS="$LDFLAGS -ldevmapper" ++ AC_DEFINE([HAVE_DEVICE_MAPPER], [1], ++ [Define to 1 if you have the devmapper library.])], ++ [device_mapper_excuse="need devmapper library"]) ++fi ++ + AC_SUBST(ASFLAGS) + + # Output files. +diff -Nur -x '*.orig' -x '*~' grub2/util/deviceiter.c grub2.new/util/deviceiter.c +--- grub2/util/deviceiter.c 2010-02-06 10:32:37.000000000 -0800 ++++ grub2.new/util/deviceiter.c 2010-02-06 10:33:54.000000000 -0800 +@@ -31,6 +31,8 @@ + + #include + #include ++#include ++#include + + #ifdef __linux__ + # if !defined(__GLIBC__) || \ +@@ -62,12 +64,23 @@ + | ((unsigned int) (__dev >> 32) & ~0xfff); \ + }) + # endif /* ! MAJOR */ ++# ifndef MINOR ++# define MINOR(dev) \ ++ ({ \ ++ unsigned long long __dev = (dev); \ ++ (unsigned) (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); \ ++ }) ++# endif /* ! MINOR */ + # ifndef CDROM_GET_CAPABILITY + # define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ + # endif /* ! CDROM_GET_CAPABILITY */ + # ifndef BLKGETSIZE + # define BLKGETSIZE _IO(0x12,96) /* return device size */ + # endif /* ! BLKGETSIZE */ ++ ++#ifdef HAVE_DEVICE_MAPPER ++# include ++#endif + #endif /* __linux__ */ + + /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with +@@ -411,6 +424,16 @@ + return 1; + } + ++#ifdef __linux__ ++# ifdef HAVE_DEVICE_MAPPER ++struct dmraid_seen ++{ ++ struct dmraid_seen *next; ++ const char *name; ++}; ++# endif /* HAVE_DEVICE_MAPPER */ ++#endif /* __linux__ */ ++ + void + grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), + int floppy_disks) +@@ -643,6 +666,123 @@ + return; + } + } ++ ++# ifdef HAVE_DEVICE_MAPPER ++# define dmraid_check(cond, ...) \ ++ if (! (cond)) \ ++ { \ ++ grub_dprintf ("deviceiter", __VA_ARGS__); \ ++ goto dmraid_end; \ ++ } ++ ++ /* DM-RAID. */ ++ { ++ struct dm_tree *tree = NULL; ++ struct dm_task *task = NULL; ++ struct dm_names *names = NULL; ++ unsigned int next = 0; ++ void *top_handle, *second_handle; ++ struct dm_tree_node *root, *top, *second; ++ struct dmraid_seen *seen = NULL; ++ ++ /* Build DM tree for all devices. */ ++ tree = dm_tree_create (); ++ dmraid_check (tree, "dm_tree_create failed\n"); ++ task = dm_task_create (DM_DEVICE_LIST); ++ dmraid_check (task, "dm_task_create failed\n"); ++ dmraid_check (dm_task_run (task), "dm_task_run failed\n"); ++ names = dm_task_get_names (task); ++ dmraid_check (names, "dm_task_get_names failed\n"); ++ dmraid_check (names->dev, "No DM devices found\n"); ++ do ++ { ++ names = (void *) names + next; ++ dmraid_check (dm_tree_add_dev (tree, MAJOR (names->dev), ++ MINOR (names->dev)), ++ "dm_tree_add_dev (%s) failed\n", names->name); ++ next = names->next; ++ } ++ while (next); ++ ++ /* Walk the second-level children of the inverted tree; that is, devices ++ which are directly composed of non-DM devices such as hard disks. ++ This class includes all DM-RAID disks and excludes all DM-RAID ++ partitions. */ ++ root = dm_tree_find_node (tree, 0, 0); ++ top_handle = NULL; ++ top = dm_tree_next_child (&top_handle, root, 1); ++ while (top) ++ { ++ second_handle = NULL; ++ second = dm_tree_next_child (&second_handle, top, 1); ++ while (second) ++ { ++ const char *node_name, *node_uuid; ++ char *name; ++ struct dmraid_seen *seen_elt; ++ ++ node_name = dm_tree_node_get_name (second); ++ dmraid_check (node_name, "dm_tree_node_get_name failed\n"); ++ node_uuid = dm_tree_node_get_uuid (second); ++ dmraid_check (node_uuid, "dm_tree_node_get_uuid failed\n"); ++ if (strncmp (node_uuid, "DMRAID-", 7) != 0) ++ { ++ grub_dprintf ("deviceiter", "%s is not DM-RAID\n", node_name); ++ goto dmraid_next_child; ++ } ++ ++ /* Have we already seen this node? There are typically very few ++ DM-RAID disks, so a list should be fast enough. */ ++ if (grub_named_list_find (GRUB_AS_NAMED_LIST (seen), node_name)) ++ { ++ grub_dprintf ("deviceiter", "Already seen DM device %s\n", ++ node_name); ++ goto dmraid_next_child; ++ } ++ ++ name = xasprintf ("/dev/mapper/%s", node_name); ++ if (check_device (name)) ++ { ++ if (hook (name, 0)) ++ { ++ free (name); ++ while (seen) ++ { ++ struct dmraid_seen *seen_elt = ++ grub_list_pop (GRUB_AS_LIST_P (&seen)); ++ free (seen_elt); ++ } ++ if (task) ++ dm_task_destroy (task); ++ if (tree) ++ dm_tree_free (tree); ++ return; ++ } ++ } ++ free (name); ++ ++ seen_elt = xmalloc (sizeof *seen_elt); ++ seen_elt->name = node_name; ++ grub_list_push (GRUB_AS_LIST_P (&seen), GRUB_AS_LIST (seen_elt)); ++ ++dmraid_next_child: ++ second = dm_tree_next_child (&second_handle, top, 1); ++ } ++ top = dm_tree_next_child (&top_handle, root, 1); ++ } ++ ++dmraid_end: ++ while (seen) ++ { ++ struct dmraid_seen *seen_elt = grub_list_pop (GRUB_AS_LIST_P (&seen)); ++ free (seen_elt); ++ } ++ if (task) ++ dm_task_destroy (task); ++ if (tree) ++ dm_tree_free (tree); ++ } ++# endif /* HAVE_DEVICE_MAPPER */ + #endif /* __linux__ */ + } + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-mkdevicemap.c grub2.new/util/grub-mkdevicemap.c +--- grub2/util/grub-mkdevicemap.c 2010-02-06 10:32:37.000000000 -0800 ++++ grub2.new/util/grub-mkdevicemap.c 2010-02-06 10:33:54.000000000 -0800 +@@ -31,6 +31,7 @@ + + #include + #include ++#include + #include + + #define _GNU_SOURCE 1 +@@ -38,6 +39,24 @@ + + #include "progname.h" + ++void ++grub_putchar (int c) ++{ ++ putchar (c); ++} ++ ++int ++grub_getkey (void) ++{ ++ return -1; ++} ++ ++void ++grub_refresh (void) ++{ ++ fflush (stdout); ++} ++ + static void + make_device_map (const char *device_map, int floppy_disks) + { +@@ -158,6 +177,9 @@ + } + } + ++ if (verbosity > 1) ++ grub_env_set ("debug", "all"); ++ + make_device_map (dev_map ? : DEFAULT_DEVICE_MAP, floppy_disks); + + free (dev_map); +diff -Nur -x '*.orig' -x '*~' grub2/util/hostdisk.c grub2.new/util/hostdisk.c +--- grub2/util/hostdisk.c 2010-02-06 10:32:55.000000000 -0800 ++++ grub2.new/util/hostdisk.c 2010-02-06 10:33:54.000000000 -0800 +@@ -97,6 +97,10 @@ + # include + #endif + ++#ifdef HAVE_DEVICE_MAPPER ++# include ++#endif ++ + struct + { + char *drive; +@@ -253,6 +257,115 @@ + return GRUB_ERR_NONE; + } + ++#ifdef HAVE_DEVICE_MAPPER ++static int ++device_is_mapped (const char *dev) ++{ ++ struct stat st; ++ ++ if (stat (dev, &st) < 0) ++ return 0; ++ ++ return dm_is_dm_major (major (st.st_rdev)); ++} ++#endif /* HAVE_DEVICE_MAPPER */ ++ ++#if defined(__linux__) || defined(__CYGWIN__) ++static grub_disk_addr_t ++find_partition_start (const char *dev) ++{ ++ int fd; ++ struct hd_geometry hdg; ++ ++#ifdef HAVE_DEVICE_MAPPER ++ if (device_is_mapped (dev)) { ++ struct dm_task *task = NULL; ++ grub_uint64_t start, length; ++ char *target_type, *params, *space; ++ grub_disk_addr_t partition_start; ++ ++ /* If any device-mapper operation fails, we fall back silently to ++ HDIO_GETGEO. */ ++ task = dm_task_create (DM_DEVICE_TABLE); ++ if (! task) ++ { ++ grub_dprintf ("hostdisk", "dm_task_create failed\n"); ++ goto devmapper_fail; ++ } ++ ++ if (! dm_task_set_name (task, dev)) ++ { ++ grub_dprintf ("hostdisk", "dm_task_set_name failed\n"); ++ goto devmapper_fail; ++ } ++ ++ if (! dm_task_run (task)) ++ { ++ grub_dprintf ("hostdisk", "dm_task_run failed\n"); ++ goto devmapper_fail; ++ } ++ ++ dm_get_next_target (task, NULL, &start, &length, &target_type, ¶ms); ++ if (! target_type) ++ { ++ grub_dprintf ("hostdisk", "no dm target\n"); ++ goto devmapper_fail; ++ } ++ if (strcmp (target_type, "linear") != 0) ++ { ++ grub_dprintf ("hostdisk", "ignoring dm target %s (not linear)\n", ++ target_type); ++ goto devmapper_fail; ++ } ++ if (! params) ++ { ++ grub_dprintf ("hostdisk", "no dm params\n"); ++ goto devmapper_fail; ++ } ++ ++ /* The params string for a linear target looks like this: ++ DEVICE-NAME START-SECTOR ++ Parse this out. */ ++ space = strchr (params, ' '); ++ if (! space) ++ goto devmapper_fail; ++ errno = 0; ++ partition_start = strtoull (space + 1, NULL, 10); ++ if (errno == 0) ++ { ++ grub_dprintf ("hostdisk", "dm %s starts at %llu\n", ++ dev, partition_start); ++ dm_task_destroy (task); ++ return partition_start; ++ } ++ ++devmapper_fail: ++ if (task) ++ dm_task_destroy (task); ++ } ++#endif /* HAVE_DEVICE_MAPPER */ ++ ++ fd = open (dev, O_RDONLY); ++ if (fd == -1) ++ { ++ grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk geometry", dev); ++ return 0; ++ } ++ ++ if (ioctl (fd, HDIO_GETGEO, &hdg)) ++ { ++ grub_error (GRUB_ERR_BAD_DEVICE, ++ "cannot get geometry of `%s'", dev); ++ close (fd); ++ return 0; ++ } ++ ++ close (fd); ++ ++ return hdg.start; ++} ++#endif /* __linux__ || __CYGWIN__ */ ++ + #ifdef __linux__ + static int + linux_find_partition (char *dev, unsigned long sector) +@@ -284,22 +397,20 @@ + for (i = 1; i < 10000; i++) + { + int fd; +- struct hd_geometry hdg; ++ grub_disk_addr_t start; + + sprintf (p, format, i); ++ + fd = open (real_dev, O_RDONLY); + if (fd == -1) + return 0; +- +- if (ioctl (fd, HDIO_GETGEO, &hdg)) +- { +- close (fd); +- return 0; +- } +- + close (fd); + +- if (hdg.start == sector) ++ start = find_partition_start (real_dev); ++ /* We don't care about errors here. */ ++ grub_errno = GRUB_ERR_NONE; ++ ++ if (start == sector) + { + strcpy (dev, real_dev); + return 1; +@@ -711,7 +822,7 @@ + } + + static char * +-convert_system_partition_to_system_disk (const char *os_dev) ++convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) + { + #if defined(__linux__) + char *path = xmalloc (PATH_MAX); +@@ -829,6 +940,96 @@ + p[4] = '\0'; + return path; + } ++ ++#ifdef HAVE_DEVICE_MAPPER ++ /* If this is a DM-RAID device. */ ++ if ((strncmp ("mapper/", p, 7) == 0)) ++ { ++ static struct dm_tree *tree = NULL; ++ uint32_t maj, min; ++ struct dm_tree_node *node, *child; ++ void *handle; ++ const char *node_uuid, *mapper_name, *child_uuid, *child_name; ++ ++ if (! tree) ++ tree = dm_tree_create (); ++ ++ if (! tree) ++ { ++ grub_dprintf ("hostdisk", "dm_tree_create failed\n"); ++ return NULL; ++ } ++ ++ maj = major (st->st_rdev); ++ min = minor (st->st_rdev); ++ if (! dm_tree_add_dev (tree, maj, min)) ++ { ++ grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); ++ return NULL; ++ } ++ ++ node = dm_tree_find_node (tree, maj, min); ++ if (! node) ++ { ++ grub_dprintf ("hostdisk", "dm_tree_find_node failed\n"); ++ return NULL; ++ } ++ node_uuid = dm_tree_node_get_uuid (node); ++ if (! node_uuid) ++ { ++ grub_dprintf ("hostdisk", "%s has no DM uuid\n", path); ++ return NULL; ++ } ++ else if (strncmp (node_uuid, "DMRAID-", 7) != 0) ++ { ++ grub_dprintf ("hostdisk", "%s is not DM-RAID\n", path); ++ return NULL; ++ } ++ ++ handle = NULL; ++ mapper_name = NULL; ++ /* Counter-intuitively, device-mapper refers to the disk-like ++ device containing a DM-RAID partition device as a "child" of ++ the partition device. */ ++ child = dm_tree_next_child (&handle, node, 0); ++ if (! child) ++ { ++ grub_dprintf ("hostdisk", "%s has no DM children\n", path); ++ goto devmapper_out; ++ } ++ child_uuid = dm_tree_node_get_uuid (child); ++ if (! child_uuid) ++ { ++ grub_dprintf ("hostdisk", "%s child has no DM uuid\n", path); ++ goto devmapper_out; ++ } ++ else if (strncmp (child_uuid, "DMRAID-", 7) != 0) ++ { ++ grub_dprintf ("hostdisk", "%s child is not DM-RAID\n", path); ++ goto devmapper_out; ++ } ++ child_name = dm_tree_node_get_name (child); ++ if (! child_name) ++ { ++ grub_dprintf ("hostdisk", "%s child has no DM name\n", path); ++ goto devmapper_out; ++ } ++ mapper_name = child_name; ++ ++devmapper_out: ++ if (! mapper_name) ++ { ++ /* This is a DM-RAID disk, not a partition. */ ++ mapper_name = dm_tree_node_get_name (node); ++ if (! mapper_name) ++ { ++ grub_dprintf ("hostdisk", "%s has no DM name\n", path); ++ return NULL; ++ } ++ } ++ return xasprintf ("/dev/mapper/%s", mapper_name); ++ } ++#endif /* HAVE_DEVICE_MAPPER */ + } + + return path; +@@ -884,12 +1085,12 @@ + #endif + + static int +-find_system_device (const char *os_dev) ++find_system_device (const char *os_dev, struct stat *st) + { + unsigned int i; + char *os_disk; + +- os_disk = convert_system_partition_to_system_disk (os_dev); ++ os_disk = convert_system_partition_to_system_disk (os_dev, st); + if (! os_disk) + return -1; + +@@ -923,7 +1124,7 @@ + return 0; + } + +- drive = find_system_device (os_dev); ++ drive = find_system_device (os_dev, &st); + if (drive < 0) + { + grub_error (GRUB_ERR_BAD_DEVICE, +@@ -931,8 +1132,8 @@ + return 0; + } + +- if (grub_strcmp (os_dev, convert_system_partition_to_system_disk (os_dev)) +- == 0) ++ if (grub_strcmp (os_dev, ++ convert_system_partition_to_system_disk (os_dev, &st)) == 0) + return make_device_name (drive, -1, -1); + + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) +@@ -954,8 +1155,7 @@ + { + char *name; + grub_disk_t disk; +- int fd; +- struct hd_geometry hdg; ++ grub_disk_addr_t start; + int dos_part = -1; + int bsd_part = -1; + auto int find_partition (grub_disk_t disk, +@@ -985,7 +1185,7 @@ + partition->index, partition->start); + } + +- if (hdg.start == partition->start) ++ if (start == partition->start) + { + if (pcdata) + { +@@ -1008,28 +1208,16 @@ + if (MAJOR (st.st_rdev) == FLOPPY_MAJOR) + return name; + +- fd = open (os_dev, O_RDONLY); +- if (fd == -1) +- { +- grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk geometry", os_dev); +- free (name); +- return 0; +- } +- +- if (ioctl (fd, HDIO_GETGEO, &hdg)) ++ start = find_partition_start (os_dev); ++ if (grub_errno != GRUB_ERR_NONE) + { +- grub_error (GRUB_ERR_BAD_DEVICE, +- "cannot get geometry of `%s'", os_dev); +- close (fd); + free (name); + return 0; + } + +- close (fd); +- +- grub_util_info ("%s starts from %lu", os_dev, hdg.start); ++ grub_util_info ("%s starts from %lu", os_dev, start); + +- if (hdg.start == 0 && device_is_wholedisk (os_dev)) ++ if (start == 0 && device_is_wholedisk (os_dev)) + return name; + + grub_util_info ("opening the device %s", name); --- grub2-1.98.orig/debian/patches/07_core_in_fs.diff +++ grub2-1.98/debian/patches/07_core_in_fs.diff @@ -0,0 +1,31 @@ +Index: util/i386/pc/grub-setup.c +=================================================================== +--- util/i386/pc/grub-setup.c (revision 2220) ++++ util/i386/pc/grub-setup.c (working copy) +@@ -53,6 +53,7 @@ static const grub_gpt_part_type_t grub_g + + #define DEFAULT_BOOT_FILE "boot.img" + #define DEFAULT_CORE_FILE "core.img" ++#define CORE_IMG_IN_FS "setup_left_core_image_in_filesystem" + + /* This is the blocklist used in the diskboot image. */ + struct boot_blocklist +@@ -388,6 +389,8 @@ setup (const char *dir, + boot_img)) + grub_util_error ("%s", grub_errmsg); + ++ unlink (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS); ++ + goto finish; + + unable_to_embed: +@@ -402,6 +405,9 @@ unable_to_embed: + if (! force) + grub_util_error ("If you really want blocklists, use --force."); + ++ fp = fopen (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, "w"); ++ fclose (fp); ++ + /* Make sure that GRUB reads the identical image as the OS. */ + tmp_img = xmalloc (core_size); + core_path_dev = grub_util_get_path (dir, core_file); --- grub2-1.98.orig/debian/patches/971_langpacks.diff +++ grub2-1.98/debian/patches/971_langpacks.diff @@ -0,0 +1,30 @@ +Description: Prefer translations from language packs +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/537998 +Forwarded: not-needed +Last-Update: 2010-03-22 + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-install.in grub2.new/util/grub-install.in +--- grub2/util/grub-install.in 2010-03-22 15:58:16.000000000 +0000 ++++ grub2.new/util/grub-install.in 2010-03-22 15:59:04.000000000 +0000 +@@ -246,7 +246,7 @@ + + # Copy gettext files + mkdir -p ${grubdir}/locale/ +-for dir in ${localedir}/*; do ++for dir in ${localedir}/* ${localedir}-langpack/*; do + if test -f "$dir/LC_MESSAGES/grub.mo"; then + cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo" + fi +diff -Nur -x '*.orig' -x '*~' grub2/util/i386/efi/grub-install.in grub2.new/util/i386/efi/grub-install.in +--- grub2/util/i386/efi/grub-install.in 2010-03-22 15:58:16.000000000 +0000 ++++ grub2.new/util/i386/efi/grub-install.in 2010-03-22 15:59:17.000000000 +0000 +@@ -183,7 +183,7 @@ + + # Copy gettext files + mkdir -p ${grubdir}/locale/ +-for dir in ${localedir}/*; do ++for dir in ${localedir}/* ${localedir}-langpack/*; do + if test -f "$dir/LC_MESSAGES/grub.mo"; then + cp -f "$dir/LC_MESSAGES/grub.mo" "${grubdir}/locale/${dir##*/}.mo" + fi --- grub2-1.98.orig/debian/patches/962_no_device_map.diff +++ grub2-1.98/debian/patches/962_no_device_map.diff @@ -0,0 +1,112 @@ +Ubuntu: Don't generate a device map by default. + +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-install.in grub2.new/util/grub-install.in +--- grub2/util/grub-install.in 2010-03-22 14:11:42.000000000 +0000 ++++ grub2.new/util/grub-install.in 2010-03-22 16:23:14.000000000 +0000 +@@ -39,7 +39,6 @@ + else + grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}` + fi +-grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` + grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` + grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}` + rootdir= +@@ -74,7 +73,6 @@ + instead of the root directory + --grub-setup=FILE use FILE as grub-setup + --grub-mkimage=FILE use FILE as grub-mkimage +- --grub-mkdevicemap=FILE use FILE as grub-mkdevicemap + --grub-probe=FILE use FILE as grub-probe + --no-floppy do not probe any floppy drive + --recheck probe a device map even if it already exists +@@ -124,7 +122,7 @@ + --grub-mkimage=*) + grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; + --grub-mkdevicemap=*) +- grub_mkdevicemap=`echo "$option" | sed 's/--grub-mkdevicemap=//'` ;; ++ : ;; # compatibility only + --grub-probe=*) + grub_probe=`echo "$option" | sed 's/--grub-probe=//'` ;; + --no-floppy) +@@ -209,14 +207,6 @@ + exit 1 + fi + +-set $grub_mkdevicemap dummy +-if test -f "$1"; then +- : +-else +- echo "$1: Not found." 1>&2 +- exit 1 +-fi +- + # Create the GRUB directory if it is not present. + test -d "$bootdir" || mkdir "$bootdir" || exit 1 + test -d "$grubdir" || mkdir "$grubdir" || exit 1 +@@ -226,22 +216,14 @@ + rm -f $device_map + fi + +-# Create the device map file if it is not present. ++# Make sure that there is no duplicated entry in the device map. + if test -f "$device_map"; then +- : +-else +- # Create a safe temporary file. +- test -n "$mklog" && log_file=`$mklog` +- +- $grub_mkdevicemap --device-map=$device_map $no_floppy || exit 1 +-fi +- +-# Make sure that there is no duplicated entry. +-tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \ +- | sort | uniq -d | sed -n 1p` +-if test -n "$tmp"; then +- echo "The drive $tmp is defined multiple times in the device map $device_map" 1>&2 +- exit 1 ++ tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \ ++ | sort | uniq -d | sed -n 1p` ++ if test -n "$tmp"; then ++ echo "The drive $tmp is defined multiple times in the device map $device_map" 1>&2 ++ exit 1 ++ fi + fi + + # Copy the GRUB images to the GRUB directory. +diff -Nur -x '*.orig' -x '*~' grub2/util/grub-mkconfig.in grub2.new/util/grub-mkconfig.in +--- grub2/util/grub-mkconfig.in 2010-03-22 16:23:13.000000000 +0000 ++++ grub2.new/util/grub-mkconfig.in 2010-03-22 16:23:57.000000000 +0000 +@@ -31,7 +31,6 @@ + grub_cfg="" + grub_mkconfig_dir=${sysconfdir}/grub.d + +-grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` + grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` + + # Usage: usage +@@ -96,14 +95,6 @@ + fi + fi + +-set $grub_mkdevicemap dummy +-if test -f "$1"; then +- : +-else +- echo "$1: Not found." 1>&2 +- exit 1 +-fi +- + set $grub_probe dummy + if test -f "$1"; then + : +@@ -114,10 +105,6 @@ + + mkdir -p ${grub_prefix} + +-if test -e ${grub_prefix}/device.map ; then : ; else +- ${grub_mkdevicemap} +-fi +- + # Device containing our userland. Typically used for root= parameter. + GRUB_DEVICE="`${grub_probe} --target=device /`" + GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true --- grub2-1.98.orig/debian/patches/956_loopback_root.diff +++ grub2-1.98/debian/patches/956_loopback_root.diff @@ -0,0 +1,145 @@ +Upstream: http://lists.gnu.org/archive/html/grub-devel/2009-09/msg00210.html +Description: If you set root after running loopback, any attempts to open + files on the loopback device resolve the loopback file name relative to the + *new* root, not the root at the time loopback was invoked, and so the above + recurses until it runs out of stack. This causes problems for Wubi. I think + it's fairly clear that only the root that was in place when you ran + loopback should be relevant to the loopback file name. + +diff -Nur -x '*.orig' -x '*~' grub2-1.97~beta2/disk/loopback.c grub2-1.97~beta2.new/disk/loopback.c +--- grub2-1.97~beta2/disk/loopback.c 2010-06-06 23:58:07.000000000 +0100 ++++ grub2-1.97~beta2.new/disk/loopback.c 2011-04-05 19:52:35.000000000 +0100 +@@ -29,6 +29,7 @@ + { + char *devname; + char *filename; ++ grub_file_t file; + int has_partitions; + struct grub_loopback *next; + }; +@@ -62,6 +63,7 @@ + /* Remove the device from the list. */ + *prev = dev->next; + ++ grub_file_close (dev->file); + grub_free (dev->devname); + grub_free (dev->filename); + grub_free (dev); +@@ -91,9 +93,6 @@ + if (! file) + return grub_errno; + +- /* Close the file, the only reason for opening it is validation. */ +- grub_file_close (file); +- + /* First try to replace the old device. */ + for (newdev = loopback_list; newdev; newdev = newdev->next) + if (grub_strcmp (newdev->devname, args[0]) == 0) +@@ -103,10 +102,12 @@ + { + char *newname = grub_strdup (args[1]); + if (! newname) +- return grub_errno; ++ goto fail; + + grub_free (newdev->filename); + newdev->filename = newname; ++ grub_file_close (newdev->file); ++ newdev->file = file; + + /* Set has_partitions when `--partitions' was used. */ + newdev->has_partitions = state[1].set; +@@ -117,13 +118,13 @@ + /* Unable to replace it, make a new entry. */ + newdev = grub_malloc (sizeof (struct grub_loopback)); + if (! newdev) +- return grub_errno; ++ goto fail; + + newdev->devname = grub_strdup (args[0]); + if (! newdev->devname) + { + grub_free (newdev); +- return grub_errno; ++ goto fail; + } + + newdev->filename = grub_strdup (args[1]); +@@ -131,9 +132,11 @@ + { + grub_free (newdev->devname); + grub_free (newdev); +- return grub_errno; ++ goto fail; + } + ++ newdev->file = file; ++ + /* Set has_partitions when `--partitions' was used. */ + newdev->has_partitions = state[1].set; + +@@ -142,6 +145,10 @@ + loopback_list = newdev; + + return 0; ++ ++fail: ++ grub_file_close (file); ++ return grub_errno; + } + + +@@ -160,7 +167,6 @@ + static grub_err_t + grub_loopback_open (const char *name, grub_disk_t disk) + { +- grub_file_t file; + struct grub_loopback *dev; + + for (dev = loopback_list; dev; dev = dev->next) +@@ -170,34 +176,22 @@ + if (! dev) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device"); + +- file = grub_file_open (dev->filename); +- if (! file) +- return grub_errno; +- + /* Use the filesize for the disk size, round up to a complete sector. */ +- disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1) ++ disk->total_sectors = ((dev->file->size + GRUB_DISK_SECTOR_SIZE - 1) + / GRUB_DISK_SECTOR_SIZE); + disk->id = (unsigned long) dev; + + disk->has_partitions = dev->has_partitions; +- disk->data = file; ++ disk->data = dev; + + return 0; + } + +-static void +-grub_loopback_close (grub_disk_t disk) +-{ +- grub_file_t file = (grub_file_t) disk->data; +- +- grub_file_close (file); +-} +- + static grub_err_t + grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) + { +- grub_file_t file = (grub_file_t) disk->data; ++ grub_file_t file = ((struct grub_loopback *) disk->data)->file; + grub_off_t pos; + + grub_file_seek (file, sector << GRUB_DISK_SECTOR_BITS); +@@ -234,7 +228,6 @@ + .id = GRUB_DISK_DEVICE_LOOPBACK_ID, + .iterate = grub_loopback_iterate, + .open = grub_loopback_open, +- .close = grub_loopback_close, + .read = grub_loopback_read, + .write = grub_loopback_write, + .next = 0 --- grub2-1.98.orig/debian/po/gl.po +++ grub2-1.98/debian/po/gl.po @@ -0,0 +1,183 @@ +# Galician translation of grub2's debconf templates +# This file is distributed under the same license as the grub2 package. +# Jacobo Tarrio , 2007, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2008-05-28 17:15+0100\n" +"Last-Translator: Jacobo Tarrio \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "¿Cargar en cadea desde menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Os scripts de actualización de GRUB detectaron unha configuración do GRUB " +"antigo en /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Para substituír a versión antiga de GRUB do sistema, recoméndase axustar /" +"boot/grub/menu.lst para cargar GRUB 2 en cadea desde a configuración " +"existente do GRUB antigo. Pódese realizar este paso automaticamente agora." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Recoméndase que acepte cargar en cadea GRUB 2 desde menu.lst, e que " +"verifique que a nova configuración de GRUB 2 funciona para vostede, antes de " +"instalalo directamente no MBR (rexistro mestre de inicio)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"En calquera caso, cando queira cargar GRUB 2 directamente desde o MBR, pode " +"facelo executando (coma administrador) a seguinte orde:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" --- grub2-1.98.orig/debian/po/pt_BR.po +++ grub2-1.98/debian/po/pt_BR.po @@ -0,0 +1,233 @@ +# grub2 Brazilian Portuguese translation +# Copyright (C) 2009 THE grub2'S COPYRIGHT HOLDER +# This file is distributed under the same license as the grub2 package. +# Flamarion Jorge , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 20:45-0300\n" +"Last-Translator: Flamarion Jorge \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"pt_BR utf-8\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Carregar em cadeia a partir do menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Os scripts de atualização do GRUB detectaram uma configuração do GRUB Legado " +"em /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"A fim de substituir a versão Legada do GRUB no seu sistema, é recomendável " +"que o /boot/grub/menu.lst seja ajustado para carregar em cadeia o GRUB 2 a " +"partir da sua configuração existente do GRUB Legado. Este passo pode ser " +"executado automaticamente agora." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"É recomendado que você aceite o carregamento em cadeia do GRUB 2 a partir do " +"menu.lst, e verifique que sua nova configuração do GRUB 2 está funcional " +"para você, antes de instalá-lo diretamente no seu MBR (\"Master Boot Record" +"\")." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Em todo caso, sempre que você quiser que o GRUB 2 seja carregado diretamente " +"do MBR, você pode fazê-lo (como root) através do seguinte comando:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linha de comando Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"A linha de comando Linux a seguir foi extraída de /etc/default/grub ou do " +"parâmetro `kopt' do menu.lst do Grub Legado. Por favor, verifique se ela " +"está correta, e modifique-a se necessário." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linha de comando padrão Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"A seguinte string será usada como um parâmetro Linux para a entrada no menu " +"padrão, mas não para o modo de recuperação." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Linha de comando kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"A linha de comando kFreeBSD a seguir foi extraída de /etc/default/grub ou do " +"parâmetro `kopt' do menu.lst do Grub Legado. Por favor, verifique se ela " +"está correta, e modifique-a se necessário." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Linha de comando padrão kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"A seguinte string será usada como um parâmetro kFreeBSD para a entrada no " +"menu padrão, mas não para o modo de recuperação." + +#~ msgid "GRUB 1.95 numbering scheme transition" +#~ msgstr "Transição do esquema de numeração do GRUB 1.95" + +#~ msgid "" +#~ "As of version 1.95, GRUB 2 has changed its numbering scheme. Partitions " +#~ "are now counted starting from 1 rather than 0. This is to make it " +#~ "consistent with device names of Linux and the other kernels used in " +#~ "Debian. For example, when using Linux as the kernel, \"(hd0,1)\" refers " +#~ "to the same partition as the /dev/sda1 device node." +#~ msgstr "" +#~ "A partir da versão 1.95, o GRUB 2 mudou seu esquema de numeração. Agora " +#~ "partições são contadas a partir de 1 em vez de 0. Isto é para torná-lo " +#~ "consistente com nomes de dispositivos do Linux e de outros kernels usados " +#~ "no Debian. Por exemplo, quando se usa o Linux como kernel, \"(hd0,1)\" se " +#~ "refere à mesma partição que o nó de dispositivo /dev/sda1." + +#~ msgid "" +#~ "Because of this, there's a chance your system becomes unbootable if " +#~ "update-grub(8) is run before GRUB is updated, generating a grub.cfg file " +#~ "that your installed GRUB won't yet be able to parse correctly. To ensure " +#~ "your system will be able to boot, you have to:" +#~ msgstr "" +#~ "Por causa disso, existe uma chance de seu sistema tornar-se não " +#~ "inicializável se o update-grub(8) for executado antes do GRUB ser " +#~ "atualizado, gerando um arquivo grub.cfg que o GRUB instalado ainda não " +#~ "será capaz de analisar corretamente. Para garantir que seu sistema será " +#~ "capaz de inicializar, você tem que:" + +#~ msgid "" +#~ " - Reinstall GRUB (typically, by running grub-install).\n" +#~ " - Rerun update-grub to generate a new grub.cfg." +#~ msgstr "" +#~ " - Reinstalar o GRUB (tipicamente, executando grub-install).\n" +#~ " - Re-executar update-grub para gerar um novo grub.cfg." --- grub2-1.98.orig/debian/po/cs.po +++ grub2-1.98/debian/po/cs.po @@ -0,0 +1,196 @@ +# Czech translation of grub2 debconf messages. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the grub2 package. +# Miroslav Kure , 2008, 2009 +# +msgid "" +msgstr "" +"Project-Id-Version: grub2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 18:47+0200\n" +"Last-Translator: Miroslav Kure \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Zavést přes menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Aktualizační skripty GRUBu rozpoznaly v /boot/grub nastavení pro předchozí " +"verzi GRUBu (tzv. GRUB Legacy)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Abyste na svém systému nahradili zastaralou verzi GRUBu, je doporučeno " +"upravit /boot/grub/menu.lst tak, aby zavedl GRUB 2 pomocí stávajícího GRUB " +"Legacy. Tento krok je nyní možné provést automaticky." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Před instalací GRUBu 2 přímo do MBR (Master Boot Record) se doporučuje " +"nejprve vyzkoušet zavedení GRUBu 2 skrze menu.lst a teprve po ověření, že " +"vše funguje očekávaným způsobem, zkusit instalaci do MBR." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Až se rozhodnete zavádět GRUB 2 přímo z MBR, stačí jako uživatel root " +"spustit příkaz:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Parametry pro Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Následující řádka s parametry pro Linux byla získána ze starého souboru menu." +"lst z parametru „kopt“ nebo ze souboru /etc/default/grub. Zkontrolujte " +"prosím, zda jsou parametry v pořádku a případně je upravte do požadované " +"podoby." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Výchozí parametry pro Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Následující parametry pro Linux se použijí pro výchozí položku menu, ale ne " +"pro záchranný režim." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Parametry pro kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Následující řádka s parametry pro kFreeBSD byla získána ze starého souboru " +"menu.lst z parametru „kopt“ nebo ze souboru /etc/default/grub. Zkontrolujte " +"prosím, zda jsou parametry v pořádku a případně je upravte do požadované " +"podoby." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Výchozí parametry pro kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Následující parametry pro kFreeBSD se použijí pro výchozí položku menu, ale " +"ne pro záchranný režim." --- grub2-1.98.orig/debian/po/it.po +++ grub2-1.98/debian/po/it.po @@ -0,0 +1,195 @@ +# Italian (it) translation of debconf templates for grub2 +# This file is distributed under the same license as the grub2 package. +# Luca Monducci , 2007-2009. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96+20090829-2 italian debconf templates\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-09-04 10:37+0200\n" +"Last-Translator: Luca Monducci \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Effettuare il caricamento in cascata da menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Gli script di aggiornamento hanno rilevato una configurazione del vecchio " +"GRUB in /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Per sostituire la vecchia versione di GRUB sul proprio sistema, si " +"raccomanda di correggere il file /boot/grub/menu.lst in modo da caricare " +"GRUB 2 in cascata dalla versione di GRUB esistente. Questa modifica può " +"essere effettuata automaticamente adesso." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Si raccomanda di accettare il caricamento in cascata di GRUB 2 da menu.lst e " +"di verificare che la nuova configurazione di GRUB 2 sia adatta alle proprie " +"necessità prima di procedere con l'installazione diretta sul MBR (Master " +"Boot Record)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"In ogni caso, per caricare GRUB 2 direttamente dal MBR, è necessario " +"eseguire (da root) il seguente comando:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Riga di comando Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La seguente riga di comando Linux è stata estratta da /etc/default/grub " +"oppure dal parametro \"kopt\" presente nel file menu.lst del vecchio GRUB. " +"Controllare che sia corretta e modificarla se necessario." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Riga di comando Linux predefinita:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Questa stringa verrà usata come parametri per Linux nella voce di menu " +"predefinita ma non nella modalità di ripristino." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Riga di comando kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La seguente riga di comando kFreeBSD è stata estratta da /etc/default/grub " +"oppure dal parametro \"kopt\" presente nel file menu.lst del vecchio GRUB. " +"Controllare che sia corretta e modificarla se necessario." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Riga di comando kFreeBSD predefinita:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Questa stringa verrà usata come parametri per kFreeBSD nella voce di menu " +"predefinita ma non nella modalità di ripristino." --- grub2-1.98.orig/debian/po/nl.po +++ grub2-1.98/debian/po/nl.po @@ -0,0 +1,196 @@ +# translation of grub2.pot to Dutch +# Copyright (C) 2008-2009 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the grub2 package. +# +# Paul Gevers , 2008-2009. +msgid "" +msgstr "" +"Project-Id-Version: grub2_1.96+20099829_nl\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-09-01 22:46+0100\n" +"Last-Translator: Paul Gevers \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Doorschakelen vanuit menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"GRUB's opwaardeerscripts hebben een oude-stijl GRUB opstelling in /boot/grub " +"gedetecteerd." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Om de oude-stijl versie van GRUB op uw systeem te vervangen wordt het " +"aangeraden om het /boot/grub/menu.lst bestand zo te laten aanpassen dat naar " +"GRUB2 wordt doorgeschakeld (chainloading) vanuit uw bestaande oude-stijl " +"GRUB opstelling. Deze stap kan nu automatisch worden uitgevoerd." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"U wordt aangeraden om het doorschakelen van GRUB2 vanuit menu.lst te " +"accepteren, en daarna te verifiëren dat uw nieuwe GRUB2 opstelling werkt " +"voordat u het in de MBR (Master Boot Record) installeert." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Waar u ook voor kiest, als u GRUB2 direct in de MBR wilt laden kunt u dat " +"doen door het volgende commando uit te voeren (met beheerdersrechten (root)):" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linux-commandoregel:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"De volgende Linux-commandoregel is gebaseerd op /etc/default/grub of op de " +"'kopt'-parameter gevonden in het menu.lst bestand van de oude-stijl GRUB. " +"Wilt u deze op correctheid controleren en indien nodig aanpassen?" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Standaard Linux-commandoregel:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"De volgende regel zal, behalve in de herstelmodus, gebruikt worden voor de " +"Linux parameters in de standaard menuoptie." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "kFreeBSD-commandoregel:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"De volgende kFreeBSD-commandoregel is gebaseerd /etc/default/grub of op de " +"'kopt'-parameter gevonden in het menu.lst bestand van de oude-stijl GRUB. " +"Wilt u deze op correctheid controleren en indien nodig aanpassen?" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Standaard kFreeBSD-commandoregel:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"De volgende regel zal, behalve in de herstelmodus, gebruikt worden voor de " +"kFreeBSD parameters in de standaard menuoptie." --- grub2-1.98.orig/debian/po/eu.po +++ grub2-1.98/debian/po/eu.po @@ -0,0 +1,207 @@ +# translation of eu.po to Basque +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Piarres Beobide , 2008. +# Iñaki Larrañaga Murgoitio , 2008, 2009. +msgid "" +msgstr "" +"Project-Id-Version: eu\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-04-04 14:29+0200\n" +"Last-Translator: Iñaki Larrañaga Murgoitio \n" +"Language-Team: Basque \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Kargatu menu.lst fitxategitik?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"GRUB eguneratzeko skriptek GRUB zahar baten konfigurazioa aurkitu dute /boot/" +"grub-en." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"GRUB zaharraren bertsioa behar bezala ordezkatzeko, gomendagarria da /boot/" +"grub/menu.lst doitzea GRUB 2 dagoeneko instalaturik duzun GRUB zaharraren " +"bidez kargatzeko. Urrats hau automatikoki egin daiteke orain." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Gomendagarria da GRUB 2 menu.lst bidez kargatzea onartzea, GRUB 2 " +"konfigurazioak zure beharrak betetzen dituela egiatzatzeko MBR-ran (Master " +"Boot Record) zuzenean instalatu aurretik." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Edozein kasutan, GRUB 2 zuzenean MBR-tik kargatzea nahi duzunean exekutatu " +"honako komandoa (root gisa):" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linux-eko komando-lerroa:" + +#. Type: string +#. Description +#: ../templates.in:1001 +#, fuzzy +#| msgid "" +#| "The following Linux command line was extracted from the `kopt' parameter " +#| "in GRUB Legacy's menu.lst. Please verify that it is correct, and modify " +#| "it if necessary." +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Linux-eko komando-lerro hau GRUB zaharraren menu.lst fitxategiko 'kopt' " +"parametrotik atera da. Egiaztatu zuzena dela, eta eraldatu behar izanez gero." + +#. Type: string +#. Description +#: ../templates.in:2001 +#, fuzzy +#| msgid "Linux command line:" +msgid "Linux default command line:" +msgstr "Linux-eko komando-lerroa:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD command line:" +msgstr "Linux-eko komando-lerroa:" + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "" +#| "The following Linux command line was extracted from the `kopt' parameter " +#| "in GRUB Legacy's menu.lst. Please verify that it is correct, and modify " +#| "it if necessary." +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Linux-eko komando-lerro hau GRUB zaharraren menu.lst fitxategiko 'kopt' " +"parametrotik atera da. Egiaztatu zuzena dela, eta eraldatu behar izanez gero." + +#. Type: string +#. Description +#: ../templates.in:4001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD default command line:" +msgstr "Linux-eko komando-lerroa:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" --- grub2-1.98.orig/debian/po/pt.po +++ grub2-1.98/debian/po/pt.po @@ -0,0 +1,209 @@ +# Portuguese translation for grub2's debconf messages +# Copyright (C) 2007 Miguel Figueiredo +# This file is distributed under the same license as the grub2 package. +# Miguel Figueiredo , 2007. +# Ricardo Silva , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96+20081005-1\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2008-11-02 11:07+0000\n" +"Last-Translator: Ricardo Silva \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Carregar a partir do menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Os scripts de actualização do GRUB detectaram uma configuração do GRUB " +"Legacy em /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Para substituir a versão Legacy do GRUB no seu sistema, é recomendado que o /" +"boot/grub/menu.lst seja ajustado para carregar o GRUB 2 a partir da sua " +"configuração do GRUB Legacy existente. Este passo pode ser executado agora " +"automaticamente." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"É recomendado que aceite carregar o GRUB 2 a partir do menu.lst, e verifique " +"que a sua nova configuração do GRUB 2 está funcional, antes de o instalar " +"directamente no seu MBR (Master Boot Record)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Em qualquer dos casos, quando quiser que o GRUB 2 seja carregado " +"directamente a partir do MBR, pode fazê-lo correndo o seguinte comando (como " +"root):" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linha de comandos do Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +#, fuzzy +#| msgid "" +#| "The following Linux command line was extracted from the `kopt' parameter " +#| "in GRUB Legacy's menu.lst. Please verify that it is correct, and modify " +#| "it if necessary." +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"A linha de comandos do Linux que se segue foi obtida a partir do parâmetro " +"`kopt' no ficheiro menu.lst do GRUB Legacy. Por favor verifique que ela está " +"correcta, e modifique-a se necessário." + +#. Type: string +#. Description +#: ../templates.in:2001 +#, fuzzy +#| msgid "Linux command line:" +msgid "Linux default command line:" +msgstr "Linha de comandos do Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD command line:" +msgstr "Linha de comandos do Linux:" + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "" +#| "The following Linux command line was extracted from the `kopt' parameter " +#| "in GRUB Legacy's menu.lst. Please verify that it is correct, and modify " +#| "it if necessary." +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"A linha de comandos do Linux que se segue foi obtida a partir do parâmetro " +"`kopt' no ficheiro menu.lst do GRUB Legacy. Por favor verifique que ela está " +"correcta, e modifique-a se necessário." + +#. Type: string +#. Description +#: ../templates.in:4001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD default command line:" +msgstr "Linha de comandos do Linux:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" --- grub2-1.98.orig/debian/po/fr.po +++ grub2-1.98/debian/po/fr.po @@ -0,0 +1,199 @@ +# translation of fr.po to French +# Translation of grub2 debconf templates to French +# Copyright (C) 2008 Christian Perrier +# This file is distributed under the same license as the grub2 package. +# +# Christian Perrier , 2007, 2008, 2009. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 15:58+0200\n" +"Last-Translator: Christian Perrier \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Faut-il enchaîner le chargement depuis menu.lst ?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "Une installation standard de GRUB a été détectée dans /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Afin de remplacer cette installation, il est recommandé de modifier /boot/" +"grub/menu.lst pour enchaîner le chargement de GRUB 2 depuis l'installation " +"standard de GRUB (« chainload »). Veuillez choisir si vous souhaitez " +"effectuer cette modification." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Il est recommandé de choisir cette option pour pouvoir confirmer le bon " +"fonctionnement de GRUB 2 avant de l'installer directement sur le secteur " +"d'amorçage (MBR : « Master Boot Record »)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Dans tous les cas, pour charger GRUB 2 directement depuis le secteur " +"d'amorçage, vous devrez utiliser la commande suivante avec les privilèges du " +"superutilisateur :" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Ligne de commande de Linux :" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La ligne de commande de Linux suivante a été récupérée via le fichier /etc/" +"default/grub ou le paramètre « kopt » du fichier menu.lst utilisé par la " +"version originelle de GRUB. Veuillez contrôler qu'elle est correcte et la " +"modifier si nécessaire." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Ligne de commande par défaut de Linux :" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Les paramètres indiqués seront utilisés pour le noyau Linux de l'entrée de " +"menu par défaut mais pas pour le mode de secours." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Ligne de commande de kFreeBSD :" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La ligne de commande de kFreeBSD suivante a été récupérée via le fichier /" +"etc/default/grub ou le paramètre « kopt » du fichier menu.lst utilisé par la " +"version originelle de GRUB. Veuillez contrôler qu'elle est correcte et la " +"modifier si nécessaire." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Ligne de commande par défaut de kFreeBSD :" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Les paramètres indiqués seront utilisés pour le noyau kFreeBSD de l'entrée " +"de menu par défaut mais pas pour le mode de secours." --- grub2-1.98.orig/debian/po/ca.po +++ grub2-1.98/debian/po/ca.po @@ -0,0 +1,201 @@ +# translation of ca.po to catalan +# Catalan translation of grub2's debconf messages +# Copyright © 2009 Free Software Foundation, Inc. +# This file is distributed under the same license as the grub2 package. +# +# Jordi Mallach , 2009. +# Juan Andrés Gimeno Crespo , 2009. +msgid "" +msgstr "" +"Project-Id-Version: ca\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-09-02 18:12+0200\n" +"Last-Translator: Juan Andrés Gimeno Crespo \n" +"Language-Team: catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Voleu carregar en cadena des del menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Els scripts d'actualització del GRUB han detectat una configuració del GRUB " +"Legacy en /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"A l'hora de reemplaçar la versió Legacy del GRUB que hi ha al sistema, és " +"recomanable que es modifique /boot/grub/menu.lst per a carregar el GRUB 2 en " +"cadena des de la vostra configuració del GRUB Legacy existent. Aquest pas es " +"pot dur a terme ara." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"És recomanable que accepteu la càrrega en cadena del GRUB 2 des del menu." +"lst, per a verificar que la nova configuració del GRUB 2 funciona " +"correctament, abans de que l'instal·leu directament al vostre registre " +"mestre d'arrencada (MBR)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"En qualsevol cas, quan vulgueu que es carregue el GRUB 2 directament des de " +"l'MBR, podeu fer-ho executant (com a root) l'ordre següent:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Línia d'ordres de Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La següent línia d'ordres de Linux ha sigut extreta de /etc/default/grub o " +"del paràmetre «kopt» del fitxer menu.lst del GRUB Legacy. Per favor verifique " +"que és correcta, i modifiqueu-la si és necessari." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Línia d'ordres de Linux per defecte:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"La següent cadena serà emprada com a paràmetre Linux per al menú d'entrada " +"per defecte però no per al mode de recuperació." + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD command line:" +msgstr "Línia d'ordres de Linux:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La següent línia d'ordres de kFreeBSD ha sigut extreta de /etc/default/grub " +"o del paràmetre «kopt» del fitxer menu.lst del GRUB Legacy. Per favor " +"verifique que és correcta, i modifiqueu-la si és necessari." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Línia d'ordres de kFreeBSD per defecte:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"La següent cadena serà emprada com a paràmetre kFreeBSD per al menú " +"d'entrada per defecte però no per al mode de recuperació." --- grub2-1.98.orig/debian/po/de.po +++ grub2-1.98/debian/po/de.po @@ -0,0 +1,195 @@ +# Translation of grub2 debconf templates to German +# Copyright (C) Helge Kreutzmann , 2007-2009. +# This file is distributed under the same license as the grub2 package. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96+20090829-2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 21:42+0200\n" +"Last-Translator: Helge Kreutzmann \n" +"Language-Team: de \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Chainload (Kettenladen) aus menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Die Upgrade-Skripte von GRUB haben eine GRUB Legacy-Installation in /boot/" +"grub erkannt." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Um die Legacy-Version von GRUB auf Ihrem System zu ersetzen, wird empfohlen, " +"dass /boot/grub/menu.lst angepasst wird, so dass GRUB 2 aus Ihrer " +"existierenden GRUB Legacy-Einrichtung heraus geladen wird. Dieser Schritt " +"kann jetzt automatisch vollzogen werden." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Es wird empfohlen, dass Sie dem Chainloading von GRUB 2 aus der menu.lst " +"zustimmen und berprfen, dass die GRUB 2-Installation fr Sie " +"funktioniert, bevor Sie diese direkt in Ihren MBR (Master Boot Record) " +"installieren." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Auf jeden Fall knnen Sie den folgenden Befehl (als root) eingeben, wenn Sie " +"mchten, dass GRUB 2 direkt vom MBR geladen wird:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linux-Kommandozeile:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Die folgende Linux-Kommandozeile wurde aus /etc/default/grub oder dem " +"Parameter kopt in GRUB Legacys menu.lst extrahiert. Bitte berprfen Sie, " +"ob diese korrekt ist und passen Sie sie falls notwendig an." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linux Standard-Kommandozeile:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Die folgende Zeichenkette wird als Linux-Parameter fr den " +"Standardmeneintrag, nicht aber fr den Rettungsmodus verwandt." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "kFreeBSD-Kommandozeile:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Die folgende kFreeBSD-Kommandozeile wurde aus /etc/default/grub oder dem " +"Parameter kopt in GRUB Legacys menu.lst extrahiert. Bitte berprfen Sie, " +"ob diese korrekt ist und passen Sie sie falls notwendig an." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "kFreeBSD Standard-Kommandozeile:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Die folgende Zeichenkette wird als kFreeBSD-Parameter fr den " +"Standardmeneintrag, nicht aber fr den Rettungsmodus verwandt." --- grub2-1.98.orig/debian/po/be.po +++ grub2-1.98/debian/po/be.po @@ -0,0 +1,233 @@ +# Belarusian translation of grub2 templates +# Copyright (C) 2009 respective translators (see below) +# This file is distributed under the same license as the grub2 package. +# Hleb Rubanau , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: be\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-31 10:50+0200\n" +"Last-Translator: Hleb Rubanau \n" +"Language-Team: Debian Belarusian (Official spelling) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Ланцуговая загрузка з menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Скрыпты абнаўлення GRUB выявілі папярэднюю версію GRUB, усталяваную ў /boot/" +"grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Каб замяніць папярэднюю версію GRUB у Вашай сістэме, раім выправіць файл /" +"boot/grub/menu.lst такім чынам, каб GRUB 2 загружаўся праз механізм " +"ланцуговай загрузкі (chainload) з існуючай папярэдняй версіі GRUB. Зараз " +"можна зрабіць гэтую наладку аўтаматычна. " + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Раім абраць опцыю ланцуговай загрузкі GRUB 2 з menu.lst, каб праверыць, ці " +"прыдатны для Вас нанова ўсталяваны GRUB 2, перад тым як усталёўваць яго " +"непасрэдна ў галоўны загрузачны запіс (MBR, Master Boot Record)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Калі ж Вы хочаце, каб GRUB 2 запускаўся непасрэдна з MBR, дастаткова " +"запусціць з правамі карыстальніка root наступную каманду:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "update-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Радок камандаў для ядра Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Гэты радок камандаў для ядра Linux узяты з файлу /etc/default/grub або з " +"параметру `kopt' у файле наладак (menu.lst) папярэдняй версіі GRUB. Калі " +"ласка, пераканайцеся, што каманды запісаныя правільна, або папраўце іх, калі " +"трэба." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Прадвызначаны радок камандаў для ядра Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Наступны радок будзе выкарыстаны ў якасці параметраў ядра Linux для " +"прадвызначанага пункту меню (але не для рэжыму аднаўлення)." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Радок камандаў для ядра kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Гэты радок камандаў для kFreeBSD узяты з файлу /etc/default/grub або з " +"параметру `kopt' у файле наладак (menu.lst) папярэдняй версіі GRUB. Калі " +"ласка, пераканайцеся, што каманды запісаныя правільна, або папраўце іх, калі " +"трэба." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Прадвызначаны радок камандаў для ядра kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Наступны радок будзе выкарыстаны ў якасці параметраў ядра kFreeBSD для " +"прадвызначанага пункту меню (але не для рэжыму аднаўлення)." + +#~ msgid "GRUB 1.95 numbering scheme transition" +#~ msgstr "Змена схемы нумарацыі GRUB 1.95" + +#~ msgid "" +#~ "As of version 1.95, GRUB 2 has changed its numbering scheme. Partitions " +#~ "are now counted starting from 1 rather than 0. This is to make it " +#~ "consistent with device names of Linux and the other kernels used in " +#~ "Debian. For example, when using Linux as the kernel, \"(hd0,1)\" refers " +#~ "to the same partition as the /dev/sda1 device node." +#~ msgstr "" +#~ "Схема нумарацыі ў GRUB 2 змянілася ў параўнанні з версіяй 1.95 . Зараз " +#~ "падзелы дыску адлічваюцца пачынаючы з 1 замест 0. Гэта зроблена, каб " +#~ "адпавядаць назвам прыладаў у Linux і іншых ядрах, якія выкарыстоўваюцца ў " +#~ "Debian. Напрыклад, калі ў якасці ядра выкарыстоўваецца Linux, радок " +#~ "\"(hd0,1)\" датычыцца таго самага падзелу дыску, як і файл прылады /dev/" +#~ "sda1." + +#~ msgid "" +#~ "Because of this, there's a chance your system becomes unbootable if " +#~ "update-grub(8) is run before GRUB is updated, generating a grub.cfg file " +#~ "that your installed GRUB won't yet be able to parse correctly. To ensure " +#~ "your system will be able to boot, you have to:" +#~ msgstr "" +#~ "З гэтай прычыны Ваша сістэма можа стаць няздольнай да загрузкі, калі " +#~ "праграма update-grub(8), запушчаная да абнаўлення GRUB, стварыла файл " +#~ "grub.cfg, які немагчыма карэктна апрацаваць усталяваным GRUB. Каб " +#~ "пераканацца, што Ваша сістэма здольная да загрузкі, варта: " + +#~ msgid "" +#~ " - Reinstall GRUB (typically, by running grub-install).\n" +#~ " - Rerun update-grub to generate a new grub.cfg." +#~ msgstr "" +#~ " - Пераўсталяваць GRUB (звычайна, праз запуск grub-install).\n" +#~ " - Перазапусціць update-grub, каб стварыць новы grub.cfg." --- grub2-1.98.orig/debian/po/ka.po +++ grub2-1.98/debian/po/ka.po @@ -0,0 +1,198 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 18:05+0400\n" +"Last-Translator: Aiet Kolkhi \n" +"Language-Team: Georgian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: georgian\n" +"X-Poedit-Country: GEORGIA\n" +"X-Poedit-SourceCharset: utf-8\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "გსურთ Chainload ჩატვირთვა menu.lst-დან?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"GRUB-ის განახლების სკრიფტები GRUB-ის ძველ ინსტალაციას გადააწყდა /boot/grub " +"მდებარეობაში." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"იმისათვის, რომ თქვენს სისტემაზე ჩანაცვლდეს ძველი GRUB-ის ინსტალაცია, " +"სასურველია /boot/grub/menu.lst ჩასწორდეს, რომ შეასრულოს GRUB 2-ის chainload " +"ჩატვირთვა თქვენი არსებული GRUB-ის ძველი ინსტალაციიდან. ეს საფეხური " +"შესაძლებელია ახლა შესრულდეს ავტომატურად." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"სასურველია მიიღოთ menu.lst-დან GRUB 2-ის chainload მეთოდით ჩატვირთვა, ასევე " +"გადაამოწმოთ, რომ თქვენი ახალი GRUB 2-ის ინსტალაცია ფუნქციონირებდეს, სანამ " +"მას პირდაპირ Master Boot Record (MBR)-ში ჩაწერდეთ." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"ნებისმიერ შემთხვევაში, როდესაც მოისურვებთ GRUB 2 პირდაპირ MBR-დან " +"ჩაიტვირთოს, ამისათვის გაუშვით შემდეგი ბრძანება (root პრივილეგიებით):" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "ლინუქსის ბრძანების სტრიქონი:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"ლინუქსის შემდეგი ბრძანება მოძიებულ იქნა /etc/default/grub-დან ან `kopt' " +"პარამეტრიდან ძველი GRUB-ის menu.lst-ში. გადაამოწმეთ, რომ იგი სწორია, ან " +"შეცვალეთ შესაბამისად." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "ლინუქსის სტანდარტული ბრძანების სტრიქონი:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"შემდეგი სტრიქონი გამოყენებულ იქნება როგორც ლინუქსის პარამეტრები მენიუს " +"სტანდარტული შენატანისათვის, მაგრამ არა აღდგენის რეჟიმისათვის." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "kFreeBSD ბრძანების სტრიქონი:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"შემდეგი kFreeBSD-ის ბრძანების სტრიქონი ამოღებულ იქნა /etc/default/grub-დან " +"ან `kopt' პარამეტრიდან ძველი GRUB-ის menu.lst-ში. გადაამოწმეთ, რომ იგი " +"სწორია, ან შეცვალეთ შესაბამისად." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "kFreeBSD-ის სტანდარტული ბრძანების სტრიქონი:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"შემდეგი სტრიქონი გამოყენებულ იქნება როგორც kFreeBSD-ს პარამეტრები მენიუს " +"სტანდარტული შენატანისათვის, მაგრამ არა აღდგენის რეჟიმისათვის." --- grub2-1.98.orig/debian/po/ru.po +++ grub2-1.98/debian/po/ru.po @@ -0,0 +1,199 @@ +# translation of ru.po to Russian +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Yuri Kozlov , 2007, 2008. +# Yuri Kozlov , 2009. +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96+1.96+20090829-2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 19:10+0400\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Включить загрузку по цепочке (chainload) в menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Сценарии обновления обнаружили установку GRUB предыдущего поколения в /boot/" +"grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Чтобы заменить в системе версию GRUB предыдущего поколения, рекомендуется " +"исправить /boot/grub/menu.lst так, чтобы GRUB 2 загружался по цепочке из " +"существующей установки GRUB предыдущего поколения. Это может быть сделано " +"автоматически прямо сейчас." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Рекомендуется ответить утвердительно и проверить, что новая настройка GRUB 2 " +"работает так как нужно, перед тем как устанавливать её непосредственно в MBR " +"(главную загрузочную запись)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"В любом случае, если вы хотите, чтобы GRUB 2 загружался непосредственно из " +"MBR, выполните следующую команду (имея права суперпользователя):" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Строка команд Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Представленная ниже строка команд Linux была извлечена из /etc/default/grub " +"или параметра `kopt' старого файла GRUB menu.lst. Проверьте, что всё " +"правильно, или измените её, если требуется." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Строка команд Linux по умолчанию:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Данная строка будет использоваться в качестве параметров Linux в меню в " +"записи по умолчанию, кроме режима восстановления." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Строка команд kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Представленная ниже строка команд kFreeBSD была извлечена из /etc/default/" +"grub или параметра `kopt' старого файла GRUB menu.lst. Проверьте, что всё " +"правильно, или измените её, если требуется." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Строка команд kFreeBSD по умолчанию:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Данная строка будет использоваться в качестве параметров kFreeBSD в меню в " +"записи по умолчанию, кроме режима восстановления." --- grub2-1.98.orig/debian/po/ro.po +++ grub2-1.98/debian/po/ro.po @@ -0,0 +1,246 @@ +# translation of ro.po to Romanian +# Romanian translations for grub package +# Traducerea în limba română pentru pachetul grub. +# Copyright (C) 2007 THE grub'S COPYRIGHT HOLDER +# This file is distributed under the same license as the grub package. +# +# Eddy Petrișor , 2007,2008. +msgid "" +msgstr "" +"Project-Id-Version: ro\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2008-11-13 10:41+0200\n" +"Last-Translator: Eddy Petrișor \n" +"Language-Team: Romanian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2;\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Încărcare înlănțuită din menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Scripturile de înnoire ale lui GRUB au detectat în /boot/grub o configurație " +"pentru vechiul GRUB." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Pentru a înlocui vechea versiune a lui GRUB, se recomandă modificarea lui /" +"boot/grub/menu.lst astfel încât GRUB 2 sa fie încărcat prin înlănțuire din " +"vechea configurare. Acest pas poate fi făcut chiar acum în mod automat." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Este recomandat să acceptați înlănțuirea lui GRUB 2 din menu.lst și să " +"verificați că noua configurație pentru GRUB 2 funcționează, înainte de a o " +"instala în înregistrarea „Master Boot” (MBR)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Oricum, atunci când veți dori ca GRUB 2 sa fie încărcat direct din MBR, " +"puteți rula (ca root) comanda următoare:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linia de comandă Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +#, fuzzy +#| msgid "" +#| "The following Linux command line was extracted from the `kopt' parameter " +#| "in GRUB Legacy's menu.lst. Please verify that it is correct, and modify " +#| "it if necessary." +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Această linie de comandă Linux a fost extrasă din parametrul „kopt” din " +"fișierul menu.lst al vechiului GRUB. Verificați corectitudinea acesteia și " +"corectați-o, dacă este nevoie." + +#. Type: string +#. Description +#: ../templates.in:2001 +#, fuzzy +#| msgid "Linux command line:" +msgid "Linux default command line:" +msgstr "Linia de comandă Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD command line:" +msgstr "Linia de comandă Linux:" + +#. Type: string +#. Description +#: ../templates.in:3001 +#, fuzzy +#| msgid "" +#| "The following Linux command line was extracted from the `kopt' parameter " +#| "in GRUB Legacy's menu.lst. Please verify that it is correct, and modify " +#| "it if necessary." +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Această linie de comandă Linux a fost extrasă din parametrul „kopt” din " +"fișierul menu.lst al vechiului GRUB. Verificați corectitudinea acesteia și " +"corectați-o, dacă este nevoie." + +#. Type: string +#. Description +#: ../templates.in:4001 +#, fuzzy +#| msgid "Linux command line:" +msgid "kFreeBSD default command line:" +msgstr "Linia de comandă Linux:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" + +#~ msgid "GRUB 1.95 numbering scheme transition" +#~ msgstr "Tranziția la schema de numerotare pentru GRUB 1.95" + +#~ msgid "" +#~ "As of version 1.95, GRUB 2 has changed its numbering scheme. Partitions " +#~ "are now counted starting from 1 rather than 0. This is to make it " +#~ "consistent with device names of Linux and the other kernels used in " +#~ "Debian. For example, when using Linux as the kernel, \"(hd0,1)\" refers " +#~ "to the same partition as the /dev/sda1 device node." +#~ msgstr "" +#~ "Începând cu versiunea 1.95, GRUB 2 și-a schimbat schema de numerotare. " +#~ "Partițiile sunt acum numerotate începând de la 1 (în loc de 0). Acest " +#~ "lucru este consecvent cu numele de dispozitive ale Linux-ului și a altor " +#~ "nuclee folosite în Debian. De exemplu, când se folosește nucleul Linux, " +#~ "„(hd0,1)” se referă la aceiași partiție ca și nodul de dispozitiv /dev/" +#~ "sda1." + +#~ msgid "" +#~ "Because of this, there's a chance your system becomes unbootable if " +#~ "update-grub(8) is run before GRUB is updated, generating a grub.cfg file " +#~ "that your installed GRUB won't yet be able to parse correctly. To ensure " +#~ "your system will be able to boot, you have to:" +#~ msgstr "" +#~ "De aceea, există riscul ca sistemul să nu mai pornească dacă update-grub" +#~ "(8) este rulat înainte ca GRUB să fie actualizat, generând astfel un " +#~ "fișier grub.cfg pe care GRUB-ul instalat nu-l va putea încă analiza " +#~ "corect. Pentru a vă asigura că sistemul va putea porni, va trebui să:" + +#~ msgid "" +#~ " - Reinstall GRUB (typically, by running grub-install).\n" +#~ " - Rerun update-grub to generate a new grub.cfg." +#~ msgstr "" +#~ " - Reinstalați GRUB (în mod normal, prin rularea lui grub-install).\n" +#~ " - Rulați din nou update-grub pentru a genera un nou grub.cfg." --- grub2-1.98.orig/debian/po/ast.po +++ grub2-1.98/debian/po/ast.po @@ -0,0 +1,195 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 15:50+0100\n" +"Last-Translator: Marcos \n" +"Language-Team: Asturian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "¿Cadena de carga dende menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"El scripts d'actualización GRUB detectó una configuración GRUB Legacy en /" +"boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Col fin de camudar la versión Legacy de GRUB nel to sistema, ye recomendable " +"que /boot/grub/menu.lst seya axustáu a la cadena de carga GRUB 2 dende la to " +"configuración Legacy GRUB existente. Esti pasu puede ser fechu " +"automáticamente agora." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Ye recomendable que aceptes la cadena de carga GRUB 2 dende'l menu.lst, y " +"compruebes que la to nueva configuración de GRUB 2 ye funcional pa ti, " +"anantes de que lo instales directamente nel to MBR (Master Boot Record)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"En cualisquier casu, cuando quieras que GRUB 2 seya cargáu directamente " +"dende'l MBR, puedes facelo col siguiente comandu (como root):" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linia comandos Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La siguiente llinia de comandu Linux fue estrayía dende /etc/default/grub o " +"del parámetru `kopt' nel menú Legacy GRUB menu.lst. Por favor, comprueba que " +"ye correuto, y modificalo si ye necesario." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linia comandos por defeutu de Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"La siguiente cadena será usada como parámetros Linux pa la entrada del menú " +"por defeutu, pero non pal mou recuperación." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Linia comandos kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La siguiente llinia de comandu kFreeBSD fue estrayía dende /etc/default/grub " +"o del parámetru `kopt' nel menú Legacy GRUB menu.lst. Por favor, comprueba " +"que ye correuto, y modificalo si ye necesario." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Llínia comandos por defeutu kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"La siguiente cadena será usada cómo parametros kFreeBSD pa la entrada del " +"menú por defeutu, pero non pal mou recuperación." --- grub2-1.98.orig/debian/po/ar.po +++ grub2-1.98/debian/po/ar.po @@ -0,0 +1,193 @@ +# translation of grub.ar.po to Arabic +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Ossama M. Khayat , 2008, 2009. +msgid "" +msgstr "" +"Project-Id-Version: grub.ar\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-31 13:11+0300\n" +"Last-Translator: Ossama M. Khayat \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "تفعيل التحميل التسلسلي من menu.lst؟" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "عثرت بريمجيات ترقية GRUB على إعداد سابق في /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"لتستبدل النسخة السابقة من GRUB في نظامك، يُستحسن تعديل الملف /boot/grub/menu." +"lst لتحميل GRUB 2 تسلسلياً من إعداد GRUB السابق. ويمكن تنفيذ هذه الخطوة " +"تلقائياً الآن." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"يُستحسن أن تقبل التحميل التسلسلي لمدير الإقلاع GRUB من خلال الملف menu.lst، " +"وتحقق من أن إعداد GRUB 2 صالح لاستخدامك، قبل أن تُبّته مباشرة على سجل الإقلاع " +"الرئيسي MBR الخاص بك." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"في أي من الحالتين، متى ما أردت تحميل GRUB 2 مباشرة من سجل الإقلاع الرئيسي " +"MBR، يمكنك ذلك بإصدار الأمر التالي كمُستخدم root:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "سطر أوامر لينكس:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"سطر أوامر لينكس التالي تم استخراجه من /etc/default/grub أو\n" +"مُعطى `kopt' في ملف menu.lst الخاص بحزمة GRUB القديمة. رجاءً تحقق من\n" +"صحته وقم بتعديله إن كانت هناك ضرورة." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "سطر أوامر لينكس الافتراضي:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"سيتم استخدام سلسلة الحروف التالية كمُعطيات لتشغيل النظام لمُدخل القائمة\n" +"الافتراضي ولكن ليس لوضع الإنقاذ." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "سطر أوامر KFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"سطر أوامر KFreeBSD التالي تم استخراجه من /etc/default/grub أو\n" +"مُعطى `kopt' في ملف menu.lst الخاص بحزمة GRUB القديمة. رجاءً تحقق من صحته وقم " +"بتعديله إن كانت هناك ضرورة." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "سطر أوامر KFreeBSD الافتراضي:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"سيتم استخدام النص التالي كمُعطى KFreeBSD لمُدخل القائمة\n" +"الافتراضي ولكن ليس لوضع الإنقاذ." --- grub2-1.98.orig/debian/po/ja.po +++ grub2-1.98/debian/po/ja.po @@ -0,0 +1,193 @@ +# Copyright (C) 2008-2009 GRUB Maintainers +# This file is distributed under the same license as the grub2 package. +# Hideki Yamane (Debian-JP) , 2008-2009. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96+20080724-4\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-10-05 02:07+0900\n" +"Last-Translator: Hideki Yamane (Debian-JP) \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "menu.lst から続けて起動 (チェーンロード)しますか?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"GRUB のアップグレードプログラムは GRUB Legacy の設定が /boot/grub にあるのを" +"検出しました。" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"システム中に存在している以前のバージョンの GRUB を置き換えるためには、/boot/" +"grub/menu.lst にある GRUB Legacy の設定を使って GRUB2 をチェーンロードするよ" +"うに調整するのがお勧めです。この作業は自動的に実行されます。" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"MBR (マスタブートレコード) に直接インストールする前に、GRUB 2 が menu.lst か" +"らチェーンロードするように設定し、新しい GRUB 2 の設定が動作するかどうかを確" +"認する事をお勧めします。" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"いずれにせよ、GRUB 2 を MBR から直接起動したくなった時いつでも (root にて) 以" +"下のコマンドを入力することで対応できます:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linux コマンド:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"以下の Linux のコマンドラインは /etc/default/grub か GRUB Legacy の menu.lst " +"上の「kopt」パラメータから取得されています。これが正しいものであるかを確認し" +"て、必要であれば修正してください。" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linux デフォルトコマンドライン:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"以下の文字列はリカバリーモードではない通常のメニューエントリでの Linux パラ" +"メータとして使われます。" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "kFreeBSD コマンドライン:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"以下の kFreeBSD のコマンドラインは /etc/default/grub か GRUB Legacy の menu." +"lst 上の「kopt」パラメータから取得されています。これが正しいものであるかを確" +"認して、必要であれば修正してください。" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "kFreeBSD デフォルトコマンドライン:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"以下の文字列はリカバリーモードではない通常のメニューエントリでの kFreeBSD パ" +"ラメータとして使われます。" --- grub2-1.98.orig/debian/po/POTFILES.in +++ grub2-1.98/debian/po/POTFILES.in @@ -0,0 +1,2 @@ +[type: gettext/rfc822deb] grub-pc.templates.in +[type: gettext/rfc822deb] templates.in --- grub2-1.98.orig/debian/po/fi.po +++ grub2-1.98/debian/po/fi.po @@ -0,0 +1,194 @@ +# Esko Arajärvi , 2009. +msgid "" +msgstr "" +"Project-Id-Version: grub2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-10-21 21:25+0300\n" +"Last-Translator: Esko Arajärvi \n" +"Language-Team: Finnish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Finnish\n" +"X-Poedit-Country: FINLAND\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Ladataanko ketjutettuna tiedostosta menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"GRUBin päivityskomentosarjat ovat löytäneet vanhoja GRUB-asetuksia " +"tiedostosta /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Järjestelmässä olevan vanhan GRUB-version korvaamiseksi on suositeltavaa " +"muokata tiedostoa /boot/grub/menu.lst siten, että GRUB 2 ladataan olemassa " +"olevista vanhoista GRUB-asetuksista. Tämä voidaan tehdä automaattisesti nyt." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"On suositeltavaa, että hyväksyt GRUB 2:n ketjutetun lataamisen tiedostosta " +"menu.lst, ja varmistat uusien GRUB 2 -asetusten toimivuuden ennen kuin " +"asennat ne pääkäynnistyslohkoon (MBR)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Kun haluat asentaa GRUB 2:n latautumaan suoraan pääkäynnistyslohkosta, voit " +"joka tapauksessa tehdä sen ajamalla pääkäyttäjänä seuraavan komennon:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linuxin komentorivi:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"GRUB Legacyn tiedoston menu.lst parametrista ”kopt” tai tiedostosta /etc/" +"default/grub löydettiin seuraava Linuxin komentorivi. Varmista, että se on " +"kunnossa ja muuta sitä tarvittaessa." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linuxin oletuskomentorivi:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Seuraavaa merkkijonoa käytetään Linuxin käynnistysvalikon oletusvalinnan " +"parametreina, mutta ei toipumistilassa." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "kFreeBSD:n komentorivi:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"GRUB Legacyn tiedoston menu.lst parametrista ”kopt” tai tiedostosta /etc/" +"default/grub löydettiin seuraava kFreeBSD:n komentorivi. Varmista, että se " +"on kunnossa ja muuta sitä tarvittaessa." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "kFreeBSD:n oletuskomentorivi:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Seuraavaa merkkijonoa käytetään kFreeBSD:n käynnistysvalikon oletusvalinnan " +"parametreina, mutta ei toipumistilassa." --- grub2-1.98.orig/debian/po/es.po +++ grub2-1.98/debian/po/es.po @@ -0,0 +1,257 @@ +# grub2 po-debconf translation to Spanish +# Copyright (C) 2007, 2009 Software in the Public Interest +# This file is distributed under the same license as the grub2 package. +# +# Changes: +# - Initial translation +# Maria Germana Oliveira Blazetic, 2007 +# +# - Updates +# Gary Ariel Sandi Vigabriel , 2009 +# Francisco Javier Cuadrado , 2009 +# +# Traductores, si no conocen el formato PO, merece la pena leer la +# documentación de gettext, especialmente las secciones dedicadas a este +# formato, por ejemplo ejecutando: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Equipo de traducción al español, por favor lean antes de traducir +# los siguientes documentos: +# +# - El proyecto de traducción de Debian al español +# http://www.debian.org/intl/spanish/ +# especialmente las notas y normas de traducción en +# http://www.debian.org/intl/spanish/notas +# +# - La guía de traducción de po's de debconf: +# /usr/share/doc/po-debconf/README-trans +# o http://www.debian.org/intl/l10n/po-debconf/README-trans +# +msgid "" +msgstr "" +"Project-Id-Version: grub2 1.96+20090829-2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-08-30 19:42+0100\n" +"Last-Translator: Francisco Javier Cuadrado \n" +"Language-Team: Debian l10n Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "¿Desea realizar la carga en cadena desde el archivo «menu.lst»?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"Los scripts de actualización han detectado en «/boot/grub» una configuración " +"heredada de una versión anterior de GRUB." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Para reemplazar la versión anterior de GRUB en el sistema, se recomienda que " +"se configure «/boot/grub/menu.lst» para que cargue en cadena GRUB 2 a partir " +"de la configuración heredada de GRUB. Este paso se debería hacer de forma " +"automática." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Antes de instalar GRUB 2 directamente en el MBR («Master Boot Record») se " +"recomienda que acepte cargarlo en cadena desde el archivo «menu.lst» y que " +"verifique que puede utilizar la nueva configuración de GRUB 2." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"En cualquier caso, cuando quiera que GRUB 2 se cargue directamente desde el " +"MBR, puede hacerlo ejecutando (como usuario «root») la siguiente orden:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linea de órdenes de Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La siguiente linea de órdenes de Linux se extrajo del archivo «/etc/default/" +"grub» o del parámetro «kopt» en el archivo «menu.lst» de la versión anterior " +"de GRUB. Por favor, compruebe que esto es correcto y modifíquelo si es " +"necesario." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linea de órdenes predeterminada de Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"La siguiente cadena se utilizará como parámetros de Linux para la entrada " +"predeterminada del menú pero no para el modo de recuperación." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Linea de órdenes de kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"La siguiente linea de órdenes de kFreeBSD se extrajo del archivo «/etc/" +"default/grub» o del parámetro «kopt» en el archivo «menu.lst» de la versión " +"anterior de GRUB. Por favor, compruebe que esto es correcto y modifíquelo si " +"es necesario." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Linea de órdenes predeterminada de kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"La siguiente cadena se utilizará como parámetros de kFreeBSD para la entrada " +"predeterminada del menú pero no para el modo de recuperación." + +#~ msgid "GRUB 1.95 numbering scheme transition" +#~ msgstr "Esquema de transición numérica de GRUB 1.95" + +#~ msgid "" +#~ "As of version 1.95, GRUB 2 has changed its numbering scheme. Partitions " +#~ "are now counted starting from 1 rather than 0. This is to make it " +#~ "consistent with device names of Linux and the other kernels used in " +#~ "Debian. For example, when using Linux as the kernel, \"(hd0,1)\" refers " +#~ "to the same partition as the /dev/sda1 device node." +#~ msgstr "" +#~ "GRUB 2 ha cambiado el esquema de numeración, como en la versión 1.95. " +#~ "Ahora las particiones comienzan en el número 1 en vez de en el número 0. " +#~ "Esto sirve para hacerlo consistente con los nombres de dispositivos de " +#~ "Linux y otros núcleos que se usan en Debian. Por ejemplo, cuando se usa " +#~ "Linux como núcleo, «(hd0, 1)» se refiere a la misma partición que el " +#~ "dispositivo «/dev/sda1»." + +#~ msgid "" +#~ "Because of this, there's a chance your system becomes unbootable if " +#~ "update-grub(8) is run before GRUB is updated, generating a grub.cfg file " +#~ "that your installed GRUB won't yet be able to parse correctly. To ensure " +#~ "your system will be able to boot, you have to:" +#~ msgstr "" +#~ "Por este motivo, existe la posibilidad de que su sistema no sea capaz de " +#~ "arrancar si se ejecuta update-grub(8) antes de actualizar GRUB, ya que se " +#~ "generaría un archivo «grub.cfg» que la versión instalada de GRUB no podría " +#~ "leer correctamente. Para asegurarse de que el sistema arrancará, debe:" + +#~ msgid "" +#~ " - Reinstall GRUB (typically, by running grub-install).\n" +#~ " - Rerun update-grub to generate a new grub.cfg." +#~ msgstr "" +#~ " - Reinstalar GRUB (normalmente, ejecutando grub-install).\n" +#~ "- Volver a ejecutar update-grub para generar un nuevo archivo «grub.cfg»." --- grub2-1.98.orig/debian/po/templates.pot +++ grub2-1.98/debian/po/templates.pot @@ -0,0 +1,175 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" --- grub2-1.98.orig/debian/po/zh_TW.po +++ grub2-1.98/debian/po/zh_TW.po @@ -0,0 +1,186 @@ +# Copyright (C) 2009 Tetralet +# This file is distributed under the same license as the grub2 package. +# +msgid "" +msgstr "" +"Project-Id-Version: grub2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-02-02 12:05+0800\n" +"Last-Translator: Tetralet \n" +"Language-Team: Debian-user in Chinese [Big5] \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "是否使用來自 menu.list 的 chainload 項目?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "GRUB 昇級程式已在 /boot/grub 裡找到了 GRUB 的 Legacy 設定。" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"為了要能取代您系統上 Legacy 版的 GRUB,建議能修改 /boot/grub/menu.lst 來讓您" +"原本的 GRUB Legacy 設定能以 chainload 的方式啟動 GRUB 2。現在將要自動進行這個" +"步驟。" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"在直接將 GRUB 2 安裝到 MBR(主要開機記錄)之前,建議您能同意在 menu.lst 裡先" +"以 chainload 的方式啟動 GRUB 2,來確認您新的 GRUB 2 設定的能正常運作。" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"不管您要採取何種方式,當您想讓 GRUB 2 可以由 MBR 直接啟動的話,您可以(以 " +"root 身份)執行以下的指令:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Linux 命令列:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"以下的 Linux 命令列是由 /etc/default/grub,或是由 GRUB Legacy 的 menu.lst 中" +"的 `kopt' 參數所擷取出來的。請確認它是否正確,若有必要請加以修改。" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Linux 預設命令列:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"以下的字串將會用在預設的選單項目中做為 Linux 參數,但不會用於回復模式。" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "kFreeBSD 命令列:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"以下的 kFreeBSD 命令列是由 /etc/default/grub,或是由 GRUB Legacy 的 menu.lst " +"中的 `kopt' 參數所擷取出來的。請確認它是否正確,若有必要請加以修改。" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "kFreeBSD 預設命令列:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"以下的字串將會用在預設的選單項目中做為 kFreeBSD 參數,但不會用於回復模式。" --- grub2-1.98.orig/debian/po/bg.po +++ grub2-1.98/debian/po/bg.po @@ -0,0 +1,192 @@ +# Bulgarian translation of grub2 debconf messages. +# Copyright (C) grub2 packagers. +# This file is distributed under the same license as the grub2 package. +# Damyan Ivanov , 2009. +# Damyan Ivanov , 2009. +msgid "" +msgstr "" +"Project-Id-Version: grub2\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-11-26 07:24+0200\n" +"Last-Translator: Damyan Ivanov \n" +"Language-Team: Bulgarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Каскадно зареждане от menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "Открита е стара инсталация на GRUB в /boot/grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"За замяна на старата инсталация на GRUB се препоръчва настройване на /boot/" +"grub/menu.lst за каскадно зареждане на GRUB2 от съществуващата инсталация на " +"GRUB. Това може да стане автоматично." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Каскадното зареждане на GRUB2 от menu.lst се препоръчва за проверка дали " +"настройката на GRUB2 е правилна преди инсталирането му в записа за начално " +"зареждане (MBR)." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"Когато речите да инсталирате GRUB 2 в записа за начално зареждане, изпълнете " +"следната команда като администратор:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Команден ред за Линукс:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Следния команден ред за зареждане на Линукс беше извлечен от /etc/default/" +"grub или от параметъра „kopt“ от файла menu.lst на стария GRUB. Проверете го " +"и ако е нужно го коригирайте." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Параметри на Линукс по подразбиране:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Следните параметри ще бъдат използвани по подразбиране при зареждане на " +"Линукс, освен в авариен режим." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Команден ред за kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Следния команден ред за зареждане на kFreeBSD беше извлечен от /etc/default/" +"grub или от параметъра „kopt“ от файла menu.lst на стария GRUB. Проверете го " +"и ако е нужно го коригирайте." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Параметри на Линукс по подразбиране:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Следните параметри ще бъдат използвани по подразбиране при зареждане на " +"kFreeBSD, освен в авариен режим." --- grub2-1.98.orig/debian/po/sv.po +++ grub2-1.98/debian/po/sv.po @@ -0,0 +1,198 @@ +# translation of grub2_sv.po to Swedish +# Swedish translation for grub2. +# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is distributed under the same license as the grub2 package. +# +# Daniel Nylander , 2007. +# Martin Ågren , 2008, 2009. +msgid "" +msgstr "" +"Project-Id-Version: grub2_sv\n" +"Report-Msgid-Bugs-To: grub2@packages.debian.org\n" +"POT-Creation-Date: 2010-02-02 22:17-0800\n" +"PO-Revision-Date: 2009-09-02 20:53+0200\n" +"Last-Translator: Martin Ågren \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "Chainload from menu.lst?" +msgstr "Kedjeladda från menu.lst?" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub." +msgstr "" +"GRUB:s uppgraderingsskript har upptäckt en gammal GRUB-inställning i /boot/" +"grub." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In order to replace the Legacy version of GRUB in your system, it is " +"recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from " +"your existing GRUB Legacy setup. This step may be automaticaly performed " +"now." +msgstr "" +"Om du vill ersätta den gamla versionen av GRUB i systemet, rekommenderas " +"att /boot/grub/menu.lst justeras till att kedjeladda GRUB 2 från din " +"existerande, gamla GRUB-inställning. Detta steg kan nu utföras automatiskt." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"It's recommended that you accept chainloading GRUB 2 from menu.lst, and " +"verify that your new GRUB 2 setup is functional for you, before you install " +"it directly to your MBR (Master Boot Record)." +msgstr "" +"Det rekommenderas att GRUB 2 kedjeladdas från menu.lst så att det kan " +"säkerställas att den nya GRUB 2-inställningen fungerar innan den installeras " +"direkt till huvudstartsektorn." + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "" +"In either case, whenever you want GRUB 2 to be loaded directly from MBR, you " +"can do so by issuing (as root) the following command:" +msgstr "" +"När GRUB 2 ska laddas direkt från huvudstartsektorn, kan detta åstadkommas " +"genom att (som root) köra följande kommando:" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:2001 +msgid "upgrade-from-grub-legacy" +msgstr "upgrade-from-grub-legacy" + +#. Type: text +#. Description +#. Disk sizes are in decimal megabytes, to match how disk manufacturers +#. usually describe them. +#: ../grub-pc.templates.in:5001 +msgid "${DEVICE} (${SIZE} MB, ${MODEL})" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB installation failed. Continue?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "GRUB failed to install to the following devices:" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:7001 +msgid "" +"Do you want to continue anyway? If you do, your computer may not start up " +"properly." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "Continue without installing GRUB?" +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"You chose not to install GRUB to any devices. If you continue, the boot " +"loader may not be properly configured, and when your computer next starts up " +"it will use whatever was previously in the boot sector. If there is an " +"earlier version of GRUB 2 in the boot sector, it may be unable to load " +"modules or handle the current configuration file." +msgstr "" + +#. Type: boolean +#. Description +#: ../grub-pc.templates.in:8001 +msgid "" +"If you are already running a different boot loader and want to carry on " +"doing so, or if this is a special environment where you do not need a boot " +"loader, then you should continue anyway. Otherwise, you should install GRUB " +"somewhere." +msgstr "" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "Linux command line:" +msgstr "Kommandorad för Linux:" + +#. Type: string +#. Description +#: ../templates.in:1001 +msgid "" +"The following Linux command line was extracted from /etc/default/grub or the " +"`kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Följande Linux-kommandorad hämtades från /etc/default/grub eller 'kopt'-" +"parametern i gamla GRUB:s menu.lst. Verifiera att den är korrekt och " +"modifiera den om nödvändigt." + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "Linux default command line:" +msgstr "Standardkommandorad för Linux:" + +#. Type: string +#. Description +#: ../templates.in:2001 +msgid "" +"The following string will be used as Linux parameters for the default menu " +"entry but not for the recovery mode." +msgstr "" +"Följande sträng kommer användas som Linux-parametrar för standardmenyvalet " +"men inte för återhämtningsläge (eng. recovery)." + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "kFreeBSD command line:" +msgstr "Kommandorad för kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:3001 +msgid "" +"The following kFreeBSD command line was extracted from /etc/default/grub or " +"the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is " +"correct, and modify it if necessary." +msgstr "" +"Följande kFreeBSD-kommandorad hämtades från /etc/default/grub eller 'kopt'-" +"parametern i gamla GRUB:s menu.lst. Verifiera att den är korrekt och " +"modifiera den om nödvändigt." + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "kFreeBSD default command line:" +msgstr "Standardkommandorad för kFreeBSD:" + +#. Type: string +#. Description +#: ../templates.in:4001 +msgid "" +"The following string will be used as kFreeBSD parameters for the default " +"menu entry but not for the recovery mode." +msgstr "" +"Följande sträng kommer användas som Linux-parametrar för standardmenyvalet " +"men inte för återhämtningsläge (eng. recovery)." --- grub2-1.98.orig/debian/grub-extras/zfs/COPYING +++ grub2-1.98/debian/grub-extras/zfs/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. --- grub2-1.98.orig/debian/grub-extras/zfs/zfs_fletcher.c +++ grub2-1.98/debian/grub-extras/zfs/zfs_fletcher.c @@ -0,0 +1,86 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright 2007 Sun Microsystems, Inc. + * Copyright (C) 2009 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void +fletcher_2(const void *buf, grub_uint64_t size, grub_zfs_endian_t endian, + zio_cksum_t *zcp) +{ + const grub_uint64_t *ip = buf; + const grub_uint64_t *ipend = ip + (size / sizeof (grub_uint64_t)); + grub_uint64_t a0, b0, a1, b1; + + for (a0 = b0 = a1 = b1 = 0; ip < ipend; ip += 2) + { + a0 += grub_zfs_to_cpu64 (ip[0], endian); + a1 += grub_zfs_to_cpu64 (ip[1], endian); + b0 += a0; + b1 += a1; + } + + zcp->zc_word[0] = grub_cpu_to_zfs64 (a0, endian); + zcp->zc_word[1] = grub_cpu_to_zfs64 (a1, endian); + zcp->zc_word[2] = grub_cpu_to_zfs64 (b0, endian); + zcp->zc_word[3] = grub_cpu_to_zfs64 (b1, endian); +} + +void +fletcher_4 (const void *buf, grub_uint64_t size, grub_zfs_endian_t endian, + zio_cksum_t *zcp) +{ + const grub_uint32_t *ip = buf; + const grub_uint32_t *ipend = ip + (size / sizeof (grub_uint32_t)); + grub_uint64_t a, b, c, d; + + for (a = b = c = d = 0; ip < ipend; ip++) + { + a += grub_zfs_to_cpu32 (ip[0], endian);; + b += a; + c += b; + d += c; + } + + zcp->zc_word[0] = grub_cpu_to_zfs64 (a, endian); + zcp->zc_word[1] = grub_cpu_to_zfs64 (b, endian); + zcp->zc_word[2] = grub_cpu_to_zfs64 (c, endian); + zcp->zc_word[3] = grub_cpu_to_zfs64 (d, endian); +} + --- grub2-1.98.orig/debian/grub-extras/zfs/zfsinfo.c +++ grub2-1.98/debian/grub-extras/zfs/zfsinfo.c @@ -0,0 +1,414 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright 2008 Sun Microsystems, Inc. + * Copyright (C) 2009 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static inline void +print_tabs (int n) +{ + int i; + + for (i = 0; i < n; i++) + grub_printf (" "); +} + +static grub_err_t +print_state (char *nvlist, int tab) +{ + grub_uint64_t ival; + int isok = 1; + + print_tabs (tab); + grub_printf ("State: "); + + if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_REMOVED, &ival)) + { + grub_printf ("removed "); + isok = 0; + } + + if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival)) + { + grub_printf ("faulted "); + isok = 0; + } + + if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_OFFLINE, &ival)) + { + grub_printf ("offline "); + isok = 0; + } + + if (grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_FAULTED, &ival)) + grub_printf ("degraded "); + + if (isok) + grub_printf ("online"); + grub_printf ("\n"); + + return GRUB_ERR_NONE; +} + +static grub_err_t +print_vdev_info (char *nvlist, int tab) +{ + char *type = 0; + + type = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); + + if (!type) + { + print_tabs (tab); + grub_printf ("Incorrect VDEV: no type available\n"); + return grub_errno; + } + + if (grub_strcmp (type, VDEV_TYPE_DISK) == 0) + { + char *bootpath = 0; + char *path = 0; + char *devid = 0; + + print_tabs (tab); + grub_printf ("Leaf VDEV\n"); + + print_state (nvlist, tab); + + bootpath = + grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_PHYS_PATH); + print_tabs (tab); + if (!bootpath) + grub_printf ("Bootpath: unavailable\n"); + else + grub_printf ("Bootpath: %s\n", bootpath); + + path = grub_zfs_nvlist_lookup_string (nvlist, "path"); + print_tabs (tab); + if (!path) + grub_printf ("Path: unavailable\n"); + else + grub_printf ("Path: %s\n", path); + + devid = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID); + print_tabs (tab); + if (!devid) + grub_printf ("Devid: unavailable\n"); + else + grub_printf ("Devid: %s\n", devid); + grub_free (bootpath); + grub_free (devid); + grub_free (path); + return GRUB_ERR_NONE; + } + + if (grub_strcmp (type, VDEV_TYPE_MIRROR) == 0) + { + int nelm, i; + + nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm + (nvlist, ZPOOL_CONFIG_CHILDREN); + + print_tabs (tab); + if (nelm <= 0) + { + grub_printf ("Incorrect mirror VDEV\n"); + return GRUB_ERR_NONE; + } + grub_printf ("Mirror VDEV with %d children\n", nelm); + print_state (nvlist, tab); + + for (i = 0; i < nelm; i++) + { + char *child; + + child = grub_zfs_nvlist_lookup_nvlist_array + (nvlist, ZPOOL_CONFIG_CHILDREN, i); + + print_tabs (tab); + if (!child) + { + grub_printf ("Mirror VDEV element %d isn't correct\n", i); + continue; + } + + grub_printf ("Mirror VDEV element %d:\n", i); + print_vdev_info (child, tab + 1); + + grub_free (child); + } + } + + print_tabs (tab); + grub_printf ("Unknown VDEV type: %s\n", type); + + return GRUB_ERR_NONE; +} + +static grub_err_t +get_bootpath (char *nvlist, char **bootpath, char **devid) +{ + char *type = 0; + + type = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_TYPE); + + if (!type) + return grub_errno; + + if (grub_strcmp (type, VDEV_TYPE_DISK) == 0) + { + *bootpath = grub_zfs_nvlist_lookup_string (nvlist, + ZPOOL_CONFIG_PHYS_PATH); + *devid = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_DEVID); + if (!*bootpath || !*devid) + { + grub_free (*bootpath); + grub_free (*devid); + *bootpath = 0; + *devid = 0; + } + return GRUB_ERR_NONE; + } + + if (grub_strcmp (type, VDEV_TYPE_MIRROR) == 0) + { + int nelm, i; + + nelm = grub_zfs_nvlist_lookup_nvlist_array_get_nelm + (nvlist, ZPOOL_CONFIG_CHILDREN); + + for (i = 0; i < nelm; i++) + { + char *child; + + child = grub_zfs_nvlist_lookup_nvlist_array (nvlist, + ZPOOL_CONFIG_CHILDREN, + i); + + get_bootpath (child, bootpath, devid); + + grub_free (child); + + if (*bootpath && *devid) + return GRUB_ERR_NONE; + } + } + + return GRUB_ERR_NONE; +} + +static char *poolstates[] = { + [POOL_STATE_ACTIVE] = "active", + [POOL_STATE_EXPORTED] = "exported", + [POOL_STATE_DESTROYED] = "destroyed", + [POOL_STATE_SPARE] = "reserved for hot spare", + [POOL_STATE_L2CACHE] = "level 2 ARC device", + [POOL_STATE_UNINITIALIZED] = "uninitialized", + [POOL_STATE_UNAVAIL] = "unavailable", + [POOL_STATE_POTENTIALLY_ACTIVE] = "potentially active" +}; + +static grub_err_t +grub_cmd_zfsinfo (grub_command_t cmd __attribute__ ((unused)), int argc, + char **args) +{ + grub_device_t dev; + char *devname; + grub_err_t err; + char *nvlist = 0; + char *nv = 0; + char *poolname; + grub_uint64_t guid; + grub_uint64_t pool_state; + int found; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + + if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') + { + devname = grub_strdup (args[0] + 1); + if (devname) + devname[grub_strlen (devname) - 1] = 0; + } + else + devname = grub_strdup (args[0]); + if (!devname) + return grub_errno; + + dev = grub_device_open (devname); + grub_free (devname); + if (!dev) + return grub_errno; + + err = grub_zfs_fetch_nvlist (dev, &nvlist); + + grub_device_close (dev); + + if (err) + return err; + + poolname = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); + if (!poolname) + grub_printf ("Pool name: unavailable\n"); + else + grub_printf ("Pool name: %s\n", poolname); + + found = + grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, &guid); + if (!found) + grub_printf ("Pool GUID: unavailable\n"); + else + grub_printf ("Pool GUID: %016llx\n", (long long unsigned) guid); + + found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE, + &pool_state); + if (!found) + grub_printf ("Unable to retrieve pool state\n"); + else if (pool_state >= ARRAY_SIZE (poolstates)) + grub_printf ("Unrecognized pool state\n"); + else + grub_printf ("Pool state: %s\n", poolstates[pool_state]); + + nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); + + if (!nv) + grub_printf ("No vdev tree available\n"); + else + print_vdev_info (nv, 1); + + grub_free (nv); + grub_free (nvlist); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc, + char **args) +{ + grub_device_t dev; + char *devname; + grub_err_t err; + char *nvlist = 0; + char *nv = 0; + char *bootpath = 0, *devid = 0; + char *fsname; + char *bootfs; + char *poolname; + grub_uint64_t mdnobj; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "filesystem name required"); + + devname = grub_file_get_device_name (args[0]); + if (grub_errno) + return grub_errno; + + dev = grub_device_open (devname); + grub_free (devname); + if (!dev) + return grub_errno; + + err = grub_zfs_fetch_nvlist (dev, &nvlist); + + fsname = grub_strchr (args[0], ')'); + if (fsname) + fsname++; + else + fsname = args[0]; + + if (!err) + err = grub_zfs_getmdnobj (dev, fsname, &mdnobj); + + grub_device_close (dev); + + if (err) + return err; + + poolname = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); + if (!poolname) + { + if (!grub_errno) + grub_error (GRUB_ERR_BAD_FS, "No poolname found"); + return grub_errno; + } + + nv = grub_zfs_nvlist_lookup_nvlist (nvlist, ZPOOL_CONFIG_VDEV_TREE); + + if (nv) + get_bootpath (nv, &bootpath, &devid); + + grub_free (nv); + grub_free (nvlist); + + if (bootpath && devid) + { + bootfs = grub_xasprintf ("zfs-bootfs=%s/%llu bootpath=%s diskdevid=%s", + poolname, (unsigned long long) mdnobj, + bootpath, devid); + if (!bootfs) + return grub_errno; + } + else + { + bootfs = grub_xasprintf ("zfs-bootfs=%s/%llu", + poolname, (unsigned long long) mdnobj); + if (!bootfs) + return grub_errno; + } + if (argc >= 2) + grub_env_set (args[1], bootfs); + else + grub_printf ("%s\n", bootfs); + + grub_free (bootfs); + grub_free (poolname); + grub_free (bootpath); + grub_free (devid); + + return GRUB_ERR_NONE; +} + + +static grub_command_t cmd_info, cmd_bootfs; + +GRUB_MOD_INIT (zfsinfo) +{ + cmd_info = grub_register_command ("zfsinfo", grub_cmd_zfsinfo, + "zfsinfo DEVICE", + "Print ZFS info about DEVICE."); + cmd_bootfs = grub_register_command ("zfs-bootfs", grub_cmd_zfs_bootfs, + "zfs-bootfs FILESYSTEM [VARIABLE]", + "Print ZFS-BOOTFSOBJ or set it to VARIABLE"); +} + +GRUB_MOD_FINI (zfsinfo) +{ + grub_unregister_command (cmd_info); + grub_unregister_command (cmd_bootfs); +} --- grub2-1.98.orig/debian/grub-extras/zfs/zfs_sha256.c +++ grub2-1.98/debian/grub-extras/zfs/zfs_sha256.c @@ -0,0 +1,145 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright 2007 Sun Microsystems, Inc. + * Copyright (C) 2009 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * SHA-256 checksum, as specified in FIPS 180-2, available at: + * http://csrc.nist.gov/cryptval + * + * This is a very compact implementation of SHA-256. + * It is designed to be simple and portable, not to be fast. + */ + +/* + * The literal definitions according to FIPS180-2 would be: + * + * Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) + * Maj(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) + * + * We use logical equivalents which require one less op. + */ +#define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) +#define Rot32(x, s) (((x) >> s) | ((x) << (32 - s))) +#define SIGMA0(x) (Rot32(x, 2) ^ Rot32(x, 13) ^ Rot32(x, 22)) +#define SIGMA1(x) (Rot32(x, 6) ^ Rot32(x, 11) ^ Rot32(x, 25)) +#define sigma0(x) (Rot32(x, 7) ^ Rot32(x, 18) ^ ((x) >> 3)) +#define sigma1(x) (Rot32(x, 17) ^ Rot32(x, 19) ^ ((x) >> 10)) + +static const grub_uint32_t SHA256_K[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +static void +SHA256Transform(grub_uint32_t *H, const grub_uint8_t *cp) +{ + grub_uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64]; + + for (t = 0; t < 16; t++, cp += 4) + W[t] = (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3]; + + for (t = 16; t < 64; t++) + W[t] = sigma1(W[t - 2]) + W[t - 7] + + sigma0(W[t - 15]) + W[t - 16]; + + a = H[0]; b = H[1]; c = H[2]; d = H[3]; + e = H[4]; f = H[5]; g = H[6]; h = H[7]; + + for (t = 0; t < 64; t++) { + T1 = h + SIGMA1(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; + T2 = SIGMA0(a) + Maj(a, b, c); + h = g; g = f; f = e; e = d + T1; + d = c; c = b; b = a; a = T1 + T2; + } + + H[0] += a; H[1] += b; H[2] += c; H[3] += d; + H[4] += e; H[5] += f; H[6] += g; H[7] += h; +} + +void +zio_checksum_SHA256(const void *buf, grub_uint64_t size, + grub_zfs_endian_t endian, zio_cksum_t *zcp) +{ + grub_uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; + grub_uint8_t pad[128]; + unsigned padsize = size & 63; + unsigned i; + + for (i = 0; i < size - padsize; i += 64) + SHA256Transform(H, (grub_uint8_t *)buf + i); + + for (i = 0; i < padsize; i++) + pad[i] = ((grub_uint8_t *)buf)[i]; + + for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) + pad[padsize] = 0; + + for (i = 0; i < 8; i++) + pad[padsize++] = (size << 3) >> (56 - 8 * i); + + for (i = 0; i < padsize; i += 64) + SHA256Transform(H, pad + i); + + zcp->zc_word[0] = grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1], + endian); + zcp->zc_word[1] = grub_cpu_to_zfs64 ((grub_uint64_t)H[2] << 32 | H[3], + endian); + zcp->zc_word[2] = grub_cpu_to_zfs64 ((grub_uint64_t)H[4] << 32 | H[5], + endian); + zcp->zc_word[3] = grub_cpu_to_zfs64 ((grub_uint64_t)H[6] << 32 | H[7], + endian); +} --- grub2-1.98.orig/debian/grub-extras/zfs/README +++ grub2-1.98/debian/grub-extras/zfs/README @@ -0,0 +1,11 @@ + +grub-extras is meant to be used as an overlay on grub2 source tree. + +Build instructions: + + - Copy grub-extras in a subdirectory of your grub2 checkout. + For example, "grub-extras". + + - Export GRUB_CONTRIB environment variable to point to this directory. + + - Build GRUB as usual. --- grub2-1.98.orig/debian/grub-extras/zfs/zfs_lzjb.c +++ grub2-1.98/debian/grub-extras/zfs/zfs_lzjb.c @@ -0,0 +1,95 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright 2007 Sun Microsystems, Inc. + * Copyright (C) 2009 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MATCH_BITS 6 +#define MATCH_MIN 3 +#define OFFSET_MASK ((1 << (16 - MATCH_BITS)) - 1) + +/* + * Decompression Entry - lzjb + */ +#ifndef NBBY +#define NBBY 8 +#endif + +grub_err_t +lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len, + grub_size_t d_len); + +grub_err_t +lzjb_decompress (void *s_start, void *d_start, grub_size_t s_len, + grub_size_t d_len) +{ + grub_uint8_t *src = s_start; + grub_uint8_t *dst = d_start; + grub_uint8_t *d_end = (grub_uint8_t *) d_start + d_len; + grub_uint8_t *s_end = (grub_uint8_t *) s_start + s_len; + grub_uint8_t *cpy, copymap = 0; + int copymask = 1 << (NBBY - 1); + + while (dst < d_end && src < s_end) + { + if ((copymask <<= 1) == (1 << NBBY)) + { + copymask = 1; + copymap = *src++; + } + if (src >= s_end) + return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed"); + if (copymap & copymask) + { + int mlen = (src[0] >> (NBBY - MATCH_BITS)) + MATCH_MIN; + int offset = ((src[0] << NBBY) | src[1]) & OFFSET_MASK; + src += 2; + cpy = dst - offset; + if (src > s_end || cpy < (grub_uint8_t *) d_start) + return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed"); + while (--mlen >= 0 && dst < d_end) + *dst++ = *cpy++; + } + else + *dst++ = *src++; + } + if (dst < d_end) + return grub_error (GRUB_ERR_BAD_FS, "lzjb decompression failed"); + return GRUB_ERR_NONE; +} --- grub2-1.98.orig/debian/grub-extras/zfs/zfs.c +++ grub2-1.98/debian/grub-extras/zfs/zfs.c @@ -0,0 +1,2482 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright 2008 Sun Microsystems, Inc. + * Copyright (C) 2009 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * The zfs plug-in routines for GRUB are: + * + * zfs_mount() - locates a valid uberblock of the root pool and reads + * in its MOS at the memory address MOS. + * + * zfs_open() - locates a plain file object by following the MOS + * and places its dnode at the memory address DNODE. + * + * zfs_read() - read in the data blocks pointed by the DNODE. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ZPOOL_PROP_BOOTFS "bootfs" + +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + +/* + * For nvlist manipulation. (from nvpair.h) + */ +#define NV_ENCODE_NATIVE 0 +#define NV_ENCODE_XDR 1 +#define NV_BIG_ENDIAN 0 +#define NV_LITTLE_ENDIAN 1 +#define DATA_TYPE_UINT64 8 +#define DATA_TYPE_STRING 9 +#define DATA_TYPE_NVLIST 19 +#define DATA_TYPE_NVLIST_ARRAY 20 + +#ifndef GRUB_UTIL +static grub_dl_t my_mod; +#endif + +#define P2PHASE(x, align) ((x) & ((align) - 1)) +#define DVA_OFFSET_TO_PHYS_SECTOR(offset) \ + ((offset + VDEV_LABEL_START_SIZE) >> SPA_MINBLOCKSHIFT) + +/* + * FAT ZAP data structures + */ +#define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */ +#define ZAP_HASH_IDX(hash, n) (((n) == 0) ? 0 : ((hash) >> (64 - (n)))) +#define CHAIN_END 0xffff /* end of the chunk chain */ + +/* + * The amount of space within the chunk available for the array is: + * chunk size - space for type (1) - space for next pointer (2) + */ +#define ZAP_LEAF_ARRAY_BYTES (ZAP_LEAF_CHUNKSIZE - 3) + +#define ZAP_LEAF_HASH_SHIFT(bs) (bs - 5) +#define ZAP_LEAF_HASH_NUMENTRIES(bs) (1 << ZAP_LEAF_HASH_SHIFT(bs)) +#define LEAF_HASH(bs, h) \ + ((ZAP_LEAF_HASH_NUMENTRIES(bs)-1) & \ + ((h) >> (64 - ZAP_LEAF_HASH_SHIFT(bs)-l->l_hdr.lh_prefix_len))) + +/* + * The amount of space available for chunks is: + * block size shift - hash entry size (2) * number of hash + * entries - header space (2*chunksize) + */ +#define ZAP_LEAF_NUMCHUNKS(bs) \ + (((1<l_hash + ZAP_LEAF_HASH_NUMENTRIES(bs)))[idx] +#define ZAP_LEAF_ENTRY(l, bs, idx) (&ZAP_LEAF_CHUNK(l, bs, idx).l_entry) + + +/* + * Decompression Entry - lzjb + */ +#ifndef NBBY +#define NBBY 8 +#endif + +extern grub_err_t lzjb_decompress (void *, void *, grub_size_t, grub_size_t); + +typedef grub_err_t zfs_decomp_func_t (void *s_start, void *d_start, + grub_size_t s_len, grub_size_t d_len); +typedef struct decomp_entry +{ + char *name; + zfs_decomp_func_t *decomp_func; +} decomp_entry_t; + +typedef struct dnode_end +{ + dnode_phys_t dn; + grub_zfs_endian_t endian; +} dnode_end_t; + +struct grub_zfs_data +{ + /* cache for a file block of the currently zfs_open()-ed file */ + char *file_buf; + grub_uint64_t file_start; + grub_uint64_t file_end; + + /* cache for a dnode block */ + dnode_phys_t *dnode_buf; + dnode_phys_t *dnode_mdn; + grub_uint64_t dnode_start; + grub_uint64_t dnode_end; + grub_zfs_endian_t dnode_endian; + + uberblock_t current_uberblock; + grub_disk_t disk; + + dnode_end_t mos; + dnode_end_t mdn; + dnode_end_t dnode; + + grub_disk_addr_t vdev_phys_sector; +}; + +decomp_entry_t decomp_table[ZIO_COMPRESS_FUNCTIONS] = { + {"inherit", 0}, /* ZIO_COMPRESS_INHERIT */ + {"on", lzjb_decompress}, /* ZIO_COMPRESS_ON */ + {"off", 0}, /* ZIO_COMPRESS_OFF */ + {"lzjb", lzjb_decompress}, /* ZIO_COMPRESS_LZJB */ + {"empty", 0} /* ZIO_COMPRESS_EMPTY */ +}; + +static grub_err_t zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, + void *buf, struct grub_zfs_data *data); + +/* + * Our own version of log2(). Same thing as highbit()-1. + */ +static int +zfs_log2 (grub_uint64_t num) +{ + int i = 0; + + while (num > 1) + { + i++; + num = num >> 1; + } + + return (i); +} + +/* Checksum Functions */ +static void +zio_checksum_off (const void *buf __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_zfs_endian_t endian __attribute__ ((unused)), + zio_cksum_t * zcp) +{ + ZIO_SET_CHECKSUM (zcp, 0, 0, 0, 0); +} + +/* Checksum Table and Values */ +zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = { + {NULL, 0, 0, "inherit"}, + {NULL, 0, 0, "on"}, + {zio_checksum_off, 0, 0, "off"}, + {zio_checksum_SHA256, 1, 1, "label"}, + {zio_checksum_SHA256, 1, 1, "gang_header"}, + {fletcher_2, 0, 1, "zilog"}, + {fletcher_2, 0, 0, "fletcher2"}, + {fletcher_4, 1, 0, "fletcher4"}, + {zio_checksum_SHA256, 1, 0, "SHA256"}, +}; + +/* + * zio_checksum_verify: Provides support for checksum verification. + * + * Fletcher2, Fletcher4, and SHA256 are supported. + * + */ +static grub_err_t +zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum, + grub_zfs_endian_t endian, char *buf, int size) +{ + zio_block_tail_t *zbt = (zio_block_tail_t *) (buf + size) - 1; + zio_checksum_info_t *ci = &zio_checksum_table[checksum]; + zio_cksum_t actual_cksum, expected_cksum; + + if (checksum >= ZIO_CHECKSUM_FUNCTIONS || ci->ci_func == NULL) + { + grub_dprintf ("zfs", "unknown checksum function %d\n", checksum); + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "unknown checksum function %d", checksum); + } + + if (ci->ci_zbt) + { + expected_cksum = zbt->zbt_cksum; + zbt->zbt_cksum = zc; + ci->ci_func (buf, size, endian, &actual_cksum); + zbt->zbt_cksum = expected_cksum; + zc = expected_cksum; + } + else + ci->ci_func (buf, size, endian, &actual_cksum); + + if ((actual_cksum.zc_word[0] != zc.zc_word[0]) + || (actual_cksum.zc_word[1] != zc.zc_word[1]) + || (actual_cksum.zc_word[2] != zc.zc_word[2]) + || (actual_cksum.zc_word[3] != zc.zc_word[3])) + { + grub_dprintf ("zfs", "checksum %d verification failed\n", checksum); + grub_dprintf ("zfs", "actual checksum %16llx %16llx %16llx %16llx\n", + (unsigned long long) actual_cksum.zc_word[0], + (unsigned long long) actual_cksum.zc_word[1], + (unsigned long long) actual_cksum.zc_word[2], + (unsigned long long) actual_cksum.zc_word[3]); + grub_dprintf ("zfs", "expected checksum %16llx %16llx %16llx %16llx\n", + (unsigned long long) zc.zc_word[0], + (unsigned long long) zc.zc_word[1], + (unsigned long long) zc.zc_word[2], + (unsigned long long) zc.zc_word[3]); + return grub_error (GRUB_ERR_BAD_FS, "checksum verification failed"); + } + + return GRUB_ERR_NONE; +} + +/* + * vdev_uberblock_compare takes two uberblock structures and returns an integer + * indicating the more recent of the two. + * Return Value = 1 if ub2 is more recent + * Return Value = -1 if ub1 is more recent + * The most recent uberblock is determined using its transaction number and + * timestamp. The uberblock with the highest transaction number is + * considered "newer". If the transaction numbers of the two blocks match, the + * timestamps are compared to determine the "newer" of the two. + */ +static int +vdev_uberblock_compare (uberblock_t * ub1, uberblock_t * ub2) +{ + grub_zfs_endian_t ub1_endian, ub2_endian; + if (grub_zfs_to_cpu64 (ub1->ub_magic, LITTLE_ENDIAN) == UBERBLOCK_MAGIC) + ub1_endian = LITTLE_ENDIAN; + else + ub1_endian = BIG_ENDIAN; + if (grub_zfs_to_cpu64 (ub2->ub_magic, LITTLE_ENDIAN) == UBERBLOCK_MAGIC) + ub2_endian = LITTLE_ENDIAN; + else + ub2_endian = BIG_ENDIAN; + + if (grub_zfs_to_cpu64 (ub1->ub_txg, ub1_endian) + < grub_zfs_to_cpu64 (ub2->ub_txg, ub2_endian)) + return (-1); + if (grub_zfs_to_cpu64 (ub1->ub_txg, ub1_endian) + > grub_zfs_to_cpu64 (ub2->ub_txg, ub2_endian)) + return (1); + + if (grub_zfs_to_cpu64 (ub1->ub_timestamp, ub1_endian) + < grub_zfs_to_cpu64 (ub2->ub_timestamp, ub2_endian)) + return (-1); + if (grub_zfs_to_cpu64 (ub1->ub_timestamp, ub1_endian) + > grub_zfs_to_cpu64 (ub2->ub_timestamp, ub2_endian)) + return (1); + + return (0); +} + +/* + * Three pieces of information are needed to verify an uberblock: the magic + * number, the version number, and the checksum. + * + * Currently Implemented: version number, magic number + * Need to Implement: checksum + * + */ +static grub_err_t +uberblock_verify (uberblock_phys_t * ub, int offset) +{ + uberblock_t *uber = &ub->ubp_uberblock; + grub_err_t err; + grub_zfs_endian_t endian = UNKNOWN_ENDIAN; + zio_cksum_t zc; + + if (grub_zfs_to_cpu64 (uber->ub_magic, LITTLE_ENDIAN) == UBERBLOCK_MAGIC + && grub_zfs_to_cpu64 (uber->ub_version, LITTLE_ENDIAN) > 0 + && grub_zfs_to_cpu64 (uber->ub_version, LITTLE_ENDIAN) <= SPA_VERSION) + endian = LITTLE_ENDIAN; + + if (grub_zfs_to_cpu64 (uber->ub_magic, BIG_ENDIAN) == UBERBLOCK_MAGIC + && grub_zfs_to_cpu64 (uber->ub_version, BIG_ENDIAN) > 0 + && grub_zfs_to_cpu64 (uber->ub_version, BIG_ENDIAN) <= SPA_VERSION) + endian = BIG_ENDIAN; + + if (endian == UNKNOWN_ENDIAN) + return grub_error (GRUB_ERR_BAD_FS, "invalid uberblock magic"); + + grub_memset (&zc, 0, sizeof (zc)); + + zc.zc_word[0] = grub_cpu_to_zfs64 (offset, endian); + err = zio_checksum_verify (zc, ZIO_CHECKSUM_LABEL, endian, + (char *) ub, UBERBLOCK_SIZE); + + return err; +} + +/* + * Find the best uberblock. + * Return: + * Success - Pointer to the best uberblock. + * Failure - NULL + */ +static uberblock_phys_t * +find_bestub (uberblock_phys_t * ub_array, grub_disk_addr_t sector) +{ + uberblock_phys_t *ubbest = NULL; + int i; + grub_disk_addr_t offset; + grub_err_t err = GRUB_ERR_NONE; + + for (i = 0; i < (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT); i++) + { + offset = (sector << SPA_MINBLOCKSHIFT) + VDEV_PHYS_SIZE + + (i << VDEV_UBERBLOCK_SHIFT); + + err = uberblock_verify (&ub_array[i], offset); + if (err) + { + grub_errno = GRUB_ERR_NONE; + continue; + } + if (ubbest == NULL + || vdev_uberblock_compare (&(ub_array[i].ubp_uberblock), + &(ubbest->ubp_uberblock)) > 0) + ubbest = &ub_array[i]; + } + if (!ubbest) + grub_errno = err; + + return (ubbest); +} + +static inline grub_size_t +get_psize (blkptr_t * bp, grub_zfs_endian_t endian) +{ + return ((((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) >> 16) & 0xffff) + 1) + << SPA_MINBLOCKSHIFT); +} + +static grub_uint64_t +dva_get_offset (dva_t * dva, grub_zfs_endian_t endian) +{ + grub_dprintf ("zfs", "dva=%llx, %llx\n", + (unsigned long long) dva->dva_word[0], + (unsigned long long) dva->dva_word[1]); + return grub_zfs_to_cpu64 ((dva)->dva_word[1], + endian) << SPA_MINBLOCKSHIFT; +} + + +/* + * Read a block of data based on the gang block address dva, + * and put its data in buf. + * + */ +static grub_err_t +zio_read_gang (blkptr_t * bp, grub_zfs_endian_t endian, dva_t * dva, void *buf, + struct grub_zfs_data *data) +{ + zio_gbh_phys_t *zio_gb; + grub_uint64_t offset, sector; + unsigned i; + grub_err_t err; + zio_cksum_t zc; + + grub_memset (&zc, 0, sizeof (zc)); + + zio_gb = grub_malloc (SPA_GANGBLOCKSIZE); + if (!zio_gb) + return grub_errno; + grub_dprintf ("zfs", endian == LITTLE_ENDIAN ? "little-endian gang\n" + :"big-endian gang\n"); + offset = dva_get_offset (dva, endian); + sector = DVA_OFFSET_TO_PHYS_SECTOR (offset); + grub_dprintf ("zfs", "offset=%llx\n", (unsigned long long) offset); + + /* read in the gang block header */ + err = grub_disk_read (data->disk, sector, 0, SPA_GANGBLOCKSIZE, + (char *) zio_gb); + if (err) + { + grub_free (zio_gb); + return err; + } + + /* XXX */ + /* self checksuming the gang block header */ + ZIO_SET_CHECKSUM (&zc, DVA_GET_VDEV (dva), + dva_get_offset (dva, endian), bp->blk_birth, 0); + err = zio_checksum_verify (zc, ZIO_CHECKSUM_GANG_HEADER, endian, + (char *) zio_gb, SPA_GANGBLOCKSIZE); + if (err) + { + grub_free (zio_gb); + return err; + } + + endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + + for (i = 0; i < SPA_GBH_NBLKPTRS; i++) + { + if (zio_gb->zg_blkptr[i].blk_birth == 0) + continue; + + err = zio_read_data (&zio_gb->zg_blkptr[i], endian, buf, data); + if (err) + { + grub_free (zio_gb); + return err; + } + buf = (char *) buf + get_psize (&zio_gb->zg_blkptr[i], endian); + } + grub_free (zio_gb); + return GRUB_ERR_NONE; +} + +/* + * Read in a block of raw data to buf. + */ +static grub_err_t +zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian, void *buf, + struct grub_zfs_data *data) +{ + int i, psize; + grub_err_t err = GRUB_ERR_NONE; + + psize = get_psize (bp, endian); + + /* pick a good dva from the block pointer */ + for (i = 0; i < SPA_DVAS_PER_BP; i++) + { + grub_uint64_t offset, sector; + + if (bp->blk_dva[i].dva_word[0] == 0 && bp->blk_dva[i].dva_word[1] == 0) + continue; + + if ((grub_zfs_to_cpu64 (bp->blk_dva[i].dva_word[1], endian)>>63) & 1) + err = zio_read_gang (bp, endian, &bp->blk_dva[i], buf, data); + else + { + /* read in a data block */ + offset = dva_get_offset (&bp->blk_dva[i], endian); + sector = DVA_OFFSET_TO_PHYS_SECTOR (offset); + err = grub_disk_read (data->disk, sector, 0, psize, buf); + } + if (!err) + return GRUB_ERR_NONE; + grub_errno = GRUB_ERR_NONE; + } + + if (!err) + err = grub_error (GRUB_ERR_BAD_FS, "couldn't find a valid DVA"); + grub_errno = err; + + return err; +} + +/* + * Read in a block of data, verify its checksum, decompress if needed, + * and put the uncompressed data in buf. + */ +static grub_err_t +zio_read (blkptr_t * bp, grub_zfs_endian_t endian, void **buf, + grub_size_t *size, struct grub_zfs_data *data) +{ + grub_size_t lsize, psize; + int comp; + char *compbuf; + grub_err_t err; + zio_cksum_t zc = bp->blk_cksum; + grub_uint32_t checksum; + + checksum = (grub_zfs_to_cpu64((bp)->blk_prop, endian) >> 40) & 0xff; + comp = (grub_zfs_to_cpu64((bp)->blk_prop, endian)>>32) & 0xff; + lsize = (BP_IS_HOLE(bp) ? 0 : + (((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) & 0xffff) + 1) + << SPA_MINBLOCKSHIFT)); + psize = get_psize (bp, endian); + + if (size) + *size = lsize; + + if ((unsigned int) comp >= ZIO_COMPRESS_FUNCTIONS || + (comp != ZIO_COMPRESS_OFF && decomp_table[comp].decomp_func == NULL)) + { + grub_dprintf ("zfs", "comp=%d\n", comp); + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "compression algorithm not supported\n"); + } + + if (comp != ZIO_COMPRESS_OFF) + { + compbuf = grub_malloc (psize); + if (! compbuf) + return grub_errno; + } + else + compbuf = *buf = grub_malloc (lsize); + + grub_dprintf ("zfs", "endian = %d\n", endian); + err = zio_read_data (bp, endian, compbuf, data); + if (err) + { + grub_free (compbuf); + return err; + } + + err = zio_checksum_verify (zc, checksum, endian, compbuf, psize); + if (err) + { + grub_dprintf ("zfs", "incorrect checksum\n"); + grub_free (compbuf); + return err; + } + + if (comp != ZIO_COMPRESS_OFF) + { + *buf = grub_malloc (lsize); + err = decomp_table[comp].decomp_func (compbuf, *buf, psize, lsize); + grub_free (compbuf); + if (err) + return err; + } + + return GRUB_ERR_NONE; +} + +/* + * Get the block from a block id. + * push the block onto the stack. + * + */ +static grub_err_t +dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf, + grub_zfs_endian_t *endian_out, struct grub_zfs_data *data) +{ + int idx, level; + blkptr_t *bp_array = dn->dn.dn_blkptr; + int epbs = dn->dn.dn_indblkshift - SPA_BLKPTRSHIFT; + blkptr_t *bp, *tmpbuf = 0; + grub_zfs_endian_t endian; + grub_err_t err = GRUB_ERR_NONE; + + bp = grub_malloc (sizeof (blkptr_t)); + if (!bp) + return grub_errno; + + endian = dn->endian; + for (level = dn->dn.dn_nlevels - 1; level >= 0; level--) + { + grub_dprintf ("zfs", "endian = %d\n", endian); + idx = (blkid >> (epbs * level)) & ((1 << epbs) - 1); + *bp = bp_array[idx]; + if (bp_array != dn->dn.dn_blkptr) + { + grub_free (bp_array); + bp_array = 0; + } + + if (BP_IS_HOLE (bp)) + { + grub_size_t size = grub_zfs_to_cpu16 (dn->dn.dn_datablkszsec, + dn->endian) + << SPA_MINBLOCKSHIFT; + *buf = grub_malloc (size); + if (*buf) + { + err = grub_errno; + break; + } + grub_memset (*buf, 0, size); + endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + break; + } + if (level == 0) + { + grub_dprintf ("zfs", "endian = %d\n", endian); + err = zio_read (bp, endian, buf, 0, data); + endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + break; + } + grub_dprintf ("zfs", "endian = %d\n", endian); + err = zio_read (bp, endian, (void **) &tmpbuf, 0, data); + endian = (grub_zfs_to_cpu64 (bp->blk_prop, endian) >> 63) & 1; + if (err) + break; + bp_array = tmpbuf; + } + if (bp_array != dn->dn.dn_blkptr) + grub_free (bp_array); + if (endian_out) + *endian_out = endian; + + grub_free (bp); + return err; +} + +/* + * mzap_lookup: Looks up property described by "name" and returns the value + * in "value". + */ +static grub_err_t +mzap_lookup (mzap_phys_t * zapobj, grub_zfs_endian_t endian, + int objsize, char *name, grub_uint64_t * value) +{ + int i, chunks; + mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; + + chunks = objsize / MZAP_ENT_LEN - 1; + for (i = 0; i < chunks; i++) + { + if (grub_strcmp (mzap_ent[i].mze_name, name) == 0) + { + *value = grub_zfs_to_cpu64 (mzap_ent[i].mze_value, endian); + return GRUB_ERR_NONE; + } + } + + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't find %s", name); +} + +static int +mzap_iterate (mzap_phys_t * zapobj, grub_zfs_endian_t endian, int objsize, + int NESTED_FUNC_ATTR (*hook) (const char *name, + grub_uint64_t val)) +{ + int i, chunks; + mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk; + + chunks = objsize / MZAP_ENT_LEN - 1; + for (i = 0; i < chunks; i++) + { + grub_dprintf ("zfs", "zap: name = %s, value = %llx, cd = %x\n", + mzap_ent[i].mze_name, (long long)mzap_ent[i].mze_value, + (int)mzap_ent[i].mze_cd); + if (hook (mzap_ent[i].mze_name, + grub_zfs_to_cpu64 (mzap_ent[i].mze_value, endian))) + return 1; + } + + return 0; +} + +static grub_uint64_t +zap_hash (grub_uint64_t salt, const char *name) +{ + static grub_uint64_t table[256]; + const grub_uint8_t *cp; + grub_uint8_t c; + grub_uint64_t crc = salt; + + if (table[128] == 0) + { + grub_uint64_t *ct; + int i, j; + for (i = 0; i < 256; i++) + { + for (ct = table + i, *ct = i, j = 8; j > 0; j--) + *ct = (*ct >> 1) ^ (-(*ct & 1) & ZFS_CRC64_POLY); + } + } + + for (cp = (const grub_uint8_t *) name; (c = *cp) != '\0'; cp++) + crc = (crc >> 8) ^ table[(crc ^ c) & 0xFF]; + + /* + * Only use 28 bits, since we need 4 bits in the cookie for the + * collision differentiator. We MUST use the high bits, since + * those are the onces that we first pay attention to when + * chosing the bucket. + */ + crc &= ~((1ULL << (64 - ZAP_HASHBITS)) - 1); + + return (crc); +} + +/* + * Only to be used on 8-bit arrays. + * array_len is actual len in bytes (not encoded le_value_length). + * buf is null-terminated. + */ +/* XXX */ +static int +zap_leaf_array_equal (zap_leaf_phys_t * l, grub_zfs_endian_t endian, + int blksft, int chunk, int array_len, const char *buf) +{ + int bseen = 0; + + while (bseen < array_len) + { + struct zap_leaf_array *la = &ZAP_LEAF_CHUNK (l, blksft, chunk).l_array; + int toread = MIN (array_len - bseen, ZAP_LEAF_ARRAY_BYTES); + + if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft)) + return (0); + + if (grub_memcmp (la->la_array, buf + bseen, toread) != 0) + break; + chunk = grub_zfs_to_cpu16 (la->la_next, endian); + bseen += toread; + } + return (bseen == array_len); +} + +/* XXX */ +static grub_err_t +zap_leaf_array_get (zap_leaf_phys_t * l, grub_zfs_endian_t endian, int blksft, + int chunk, int array_len, char *buf) +{ + int bseen = 0; + + while (bseen < array_len) + { + struct zap_leaf_array *la = &ZAP_LEAF_CHUNK (l, blksft, chunk).l_array; + int toread = MIN (array_len - bseen, ZAP_LEAF_ARRAY_BYTES); + + if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft)) + /* Don't use grub_error because this error is to be ignored. */ + return GRUB_ERR_BAD_FS; + + grub_memcpy (buf + bseen,la->la_array, toread); + chunk = grub_zfs_to_cpu16 (la->la_next, endian); + bseen += toread; + } + return GRUB_ERR_NONE; +} + + +/* + * Given a zap_leaf_phys_t, walk thru the zap leaf chunks to get the + * value for the property "name". + * + */ +/* XXX */ +static grub_err_t +zap_leaf_lookup (zap_leaf_phys_t * l, grub_zfs_endian_t endian, + int blksft, grub_uint64_t h, + const char *name, grub_uint64_t * value) +{ + grub_uint16_t chunk; + struct zap_leaf_entry *le; + + /* Verify if this is a valid leaf block */ + if (grub_zfs_to_cpu64 (l->l_hdr.lh_block_type, endian) != ZBT_LEAF) + return grub_error (GRUB_ERR_BAD_FS, "invalid leaf type"); + if (grub_zfs_to_cpu32 (l->l_hdr.lh_magic, endian) != ZAP_LEAF_MAGIC) + return grub_error (GRUB_ERR_BAD_FS, "invalid leaf magic"); + + for (chunk = grub_zfs_to_cpu16 (l->l_hash[LEAF_HASH (blksft, h)], endian); + chunk != CHAIN_END; chunk = le->le_next) + { + + if (chunk >= ZAP_LEAF_NUMCHUNKS (blksft)) + return grub_error (GRUB_ERR_BAD_FS, "invalid chunk number"); + + le = ZAP_LEAF_ENTRY (l, blksft, chunk); + + /* Verify the chunk entry */ + if (le->le_type != ZAP_CHUNK_ENTRY) + return grub_error (GRUB_ERR_BAD_FS, "invalid chunk entry"); + + if (grub_zfs_to_cpu64 (le->le_hash,endian) != h) + continue; + + grub_dprintf ("zfs", "fzap: length %d\n", (int) le->le_name_length); + + if (zap_leaf_array_equal (l, endian, blksft, + grub_zfs_to_cpu16 (le->le_name_chunk,endian), + grub_zfs_to_cpu16 (le->le_name_length, endian), + name)) + { + struct zap_leaf_array *la; + grub_uint8_t *ip; + + if (le->le_int_size != 8 || le->le_value_length != 1) + return grub_error (GRUB_ERR_BAD_FS, "invalid leaf chunk entry"); + + /* get the uint64_t property value */ + la = &ZAP_LEAF_CHUNK (l, blksft, le->le_value_chunk).l_array; + ip = la->la_array; + + *value = grub_be_to_cpu64 (*(grub_uint64_t *)la->la_array); + + return GRUB_ERR_NONE; + } + } + + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't find %s", name); +} + +/* + * Fat ZAP lookup + * + */ +/* XXX */ +static grub_err_t +fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap, + char *name, grub_uint64_t * value, struct grub_zfs_data *data) +{ + zap_leaf_phys_t *l; + grub_uint64_t hash, idx, blkid; + int blksft = zfs_log2 (grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + zap_dnode->endian) << DNODE_SHIFT); + grub_err_t err; + grub_zfs_endian_t leafendian; + + /* Verify if this is a fat zap header block */ + if (zap->zap_magic != (grub_uint64_t) ZAP_MAGIC) + return grub_error (GRUB_ERR_BAD_FS, "bad ZAP magic"); + + if (zap->zap_salt == 0) + return grub_error (GRUB_ERR_BAD_FS, "bad ZAP salt"); + hash = zap_hash (zap->zap_salt, name); + + /* get block id from index */ + if (zap->zap_ptrtbl.zt_numblks != 0) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "external pointer tables not supported"); + idx = ZAP_HASH_IDX (hash, zap->zap_ptrtbl.zt_shift); + blkid = ((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))]; + + /* Get the leaf block */ + if ((1U << blksft) < sizeof (zap_leaf_phys_t)) + return grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small"); + err = dmu_read (zap_dnode, blkid, (void **) &l, &leafendian, data); + if (err) + return err; + + err = zap_leaf_lookup (l, leafendian, blksft, hash, name, value); + grub_free (l); + return err; +} + +/* XXX */ +static int +fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap, + int NESTED_FUNC_ATTR (*hook) (const char *name, + grub_uint64_t val), + struct grub_zfs_data *data) +{ + zap_leaf_phys_t *l; + grub_uint64_t idx, blkid; + grub_uint16_t chunk; + int blksft = zfs_log2 (grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + zap_dnode->endian) << DNODE_SHIFT); + grub_err_t err; + grub_zfs_endian_t endian; + + /* Verify if this is a fat zap header block */ + if (zap->zap_magic != (grub_uint64_t) ZAP_MAGIC) + { + grub_error (GRUB_ERR_BAD_FS, "bad ZAP magic"); + return 0; + } + + /* get block id from index */ + if (zap->zap_ptrtbl.zt_numblks != 0) + { + grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "external pointer tables not supported"); + return 0; + } + /* Get the leaf block */ + if ((1U << blksft) < sizeof (zap_leaf_phys_t)) + { + grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small"); + return 0; + } + for (idx = 0; idx < zap->zap_ptrtbl.zt_numblks; idx++) + { + blkid = ((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))]; + + err = dmu_read (zap_dnode, blkid, (void **) &l, &endian, data); + if (err) + { + grub_errno = GRUB_ERR_NONE; + continue; + } + + /* Verify if this is a valid leaf block */ + if (grub_zfs_to_cpu64 (l->l_hdr.lh_block_type, endian) != ZBT_LEAF) + { + grub_free (l); + continue; + } + if (grub_zfs_to_cpu32 (l->l_hdr.lh_magic, endian) != ZAP_LEAF_MAGIC) + { + grub_free (l); + continue; + } + + for (chunk = 0; chunk < ZAP_LEAF_NUMCHUNKS (blksft); chunk++) + { + char *buf; + struct zap_leaf_array *la; + struct zap_leaf_entry *le; + grub_uint64_t val; + le = ZAP_LEAF_ENTRY (l, blksft, chunk); + + /* Verify the chunk entry */ + if (le->le_type != ZAP_CHUNK_ENTRY) + continue; + + buf = grub_malloc (grub_zfs_to_cpu16 (le->le_name_length, endian) + + 1); + if (zap_leaf_array_get (l, endian, blksft, le->le_name_chunk, + le->le_name_length, buf)) + { + grub_free (buf); + continue; + } + buf[le->le_name_length] = 0; + + if (le->le_int_size != 8 + || grub_zfs_to_cpu16 (le->le_value_length, endian) != 1) + continue; + + /* get the uint64_t property value */ + la = &ZAP_LEAF_CHUNK (l, blksft, le->le_value_chunk).l_array; + val = grub_be_to_cpu64 (*(grub_uint64_t *)la->la_array); + if (hook (buf, val)) + return 1; + grub_free (buf); + } + } + return 0; +} + + +/* + * Read in the data of a zap object and find the value for a matching + * property name. + * + */ +static grub_err_t +zap_lookup (dnode_end_t * zap_dnode, char *name, grub_uint64_t * val, + struct grub_zfs_data *data) +{ + grub_uint64_t block_type; + int size; + void *zapbuf; + grub_err_t err; + grub_zfs_endian_t endian; + + grub_dprintf ("zfs", "looking for '%s'\n", name); + + /* Read in the first block of the zap object data. */ + size = grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, + zap_dnode->endian) << SPA_MINBLOCKSHIFT; + err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data); + if (err) + return err; + block_type = grub_zfs_to_cpu64 (*((grub_uint64_t *) zapbuf), endian); + + grub_dprintf ("zfs", "zap read\n"); + + if (block_type == ZBT_MICRO) + { + grub_dprintf ("zfs", "micro zap\n"); + err = (mzap_lookup (zapbuf, endian, size, name, val)); + grub_dprintf ("zfs", "returned %d\n", err); + grub_free (zapbuf); + return err; + } + else if (block_type == ZBT_HEADER) + { + grub_dprintf ("zfs", "fat zap\n"); + /* this is a fat zap */ + err = (fzap_lookup (zap_dnode, zapbuf, name, val, data)); + grub_dprintf ("zfs", "returned %d\n", err); + grub_free (zapbuf); + return err; + } + + return grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type"); +} + +static int +zap_iterate (dnode_end_t * zap_dnode, + int NESTED_FUNC_ATTR (*hook) (const char *name, grub_uint64_t val), + struct grub_zfs_data *data) +{ + grub_uint64_t block_type; + int size; + void *zapbuf; + grub_err_t err; + int ret; + grub_zfs_endian_t endian; + + /* Read in the first block of the zap object data. */ + size = grub_zfs_to_cpu16 (zap_dnode->dn.dn_datablkszsec, zap_dnode->endian) << SPA_MINBLOCKSHIFT; + err = dmu_read (zap_dnode, 0, &zapbuf, &endian, data); + if (err) + return 0; + block_type = grub_zfs_to_cpu64 (*((grub_uint64_t *) zapbuf), endian); + + grub_dprintf ("zfs", "zap read\n"); + + if (block_type == ZBT_MICRO) + { + grub_dprintf ("zfs", "micro zap\n"); + ret = mzap_iterate (zapbuf, endian, size, hook); + grub_free (zapbuf); + return ret; + } + else if (block_type == ZBT_HEADER) + { + grub_dprintf ("zfs", "fat zap\n"); + /* this is a fat zap */ + ret = fzap_iterate (zap_dnode, zapbuf, hook, data); + grub_free (zapbuf); + return ret; + } + grub_error (GRUB_ERR_BAD_FS, "unknown ZAP type"); + return 0; +} + + +/* + * Get the dnode of an object number from the metadnode of an object set. + * + * Input + * mdn - metadnode to get the object dnode + * objnum - object number for the object dnode + * buf - data buffer that holds the returning dnode + */ +static grub_err_t +dnode_get (dnode_end_t * mdn, grub_uint64_t objnum, grub_uint8_t type, + dnode_end_t * buf, struct grub_zfs_data *data) +{ + grub_uint64_t blkid, blksz; /* the block id this object dnode is in */ + int epbs; /* shift of number of dnodes in a block */ + int idx; /* index within a block */ + dnode_phys_t *dnbuf; + grub_err_t err; + grub_zfs_endian_t endian; + + blksz = grub_zfs_to_cpu16 (mdn->dn.dn_datablkszsec, + mdn->endian) << SPA_MINBLOCKSHIFT; + epbs = zfs_log2 (blksz) - DNODE_SHIFT; + blkid = objnum >> epbs; + idx = objnum & ((1 << epbs) - 1); + + if (data->dnode_buf != NULL && grub_memcmp (data->dnode_mdn, mdn, + sizeof (*mdn)) == 0 + && objnum >= data->dnode_start && objnum < data->dnode_end) + { + grub_memmove (&(buf->dn), &(data->dnode_buf)[idx], DNODE_SIZE); + buf->endian = data->dnode_endian; + if (type && buf->dn.dn_type != type) + return grub_error(GRUB_ERR_BAD_FS, "incorrect dnode type"); + return GRUB_ERR_NONE; + } + + grub_dprintf ("zfs", "endian = %d, blkid=%llx\n", mdn->endian, + (unsigned long long) blkid); + err = dmu_read (mdn, blkid, (void **) &dnbuf, &endian, data); + if (err) + return err; + grub_dprintf ("zfs", "alive\n"); + + grub_free (data->dnode_buf); + grub_free (data->dnode_mdn); + data->dnode_mdn = grub_malloc (sizeof (*mdn)); + if (! data->dnode_mdn) + { + grub_errno = GRUB_ERR_NONE; + data->dnode_buf = 0; + } + else + { + grub_memcpy (data->dnode_mdn, mdn, sizeof (*mdn)); + data->dnode_buf = dnbuf; + data->dnode_start = blkid << epbs; + data->dnode_end = (blkid + 1) << epbs; + data->dnode_endian = endian; + } + + grub_memmove (&(buf->dn), &dnbuf[idx], DNODE_SIZE); + buf->endian = endian; + if (type && buf->dn.dn_type != type) + return grub_error(GRUB_ERR_BAD_FS, "incorrect dnode type"); + + return GRUB_ERR_NONE; +} + +/* + * Get the file dnode for a given file name where mdn is the meta dnode + * for this ZFS object set. When found, place the file dnode in dn. + * The 'path' argument will be mangled. + * + */ +static grub_err_t +dnode_get_path (dnode_end_t * mdn, const char *path_in, dnode_end_t * dn, + struct grub_zfs_data *data) +{ + grub_uint64_t objnum, version; + char *cname, ch; + grub_err_t err = GRUB_ERR_NONE; + char *path, *path_buf; + struct dnode_chain + { + struct dnode_chain *next; + dnode_end_t dn; + }; + struct dnode_chain *dnode_path = 0, *dn_new, *root; + + dn_new = grub_malloc (sizeof (*dn_new)); + if (! dn_new) + return grub_errno; + dn_new->next = 0; + dnode_path = root = dn_new; + + err = dnode_get (mdn, MASTER_NODE_OBJ, DMU_OT_MASTER_NODE, + &(dnode_path->dn), data); + if (err) + { + grub_free (dn_new); + return err; + } + + err = zap_lookup (&(dnode_path->dn), ZPL_VERSION_STR, &version, data); + if (err) + { + grub_free (dn_new); + return err; + } + if (version > ZPL_VERSION) + { + grub_free (dn_new); + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "too new ZPL version"); + } + + err = zap_lookup (&(dnode_path->dn), ZFS_ROOT_OBJ, &objnum, data); + if (err) + { + grub_free (dn_new); + return err; + } + + err = dnode_get (mdn, objnum, 0, &(dnode_path->dn), data); + if (err) + { + grub_free (dn_new); + return err; + } + + path = path_buf = grub_strdup (path_in); + if (!path_buf) + { + grub_free (dn_new); + return grub_errno; + } + + while (1) + { + /* skip leading slashes */ + while (*path == '/') + path++; + if (!*path) + break; + /* get the next component name */ + cname = path; + while (*path && *path != '/') + path++; + /* Skip dot. */ + if (cname + 1 == path && cname[0] == '.') + continue; + /* Handle double dot. */ + if (cname + 2 == path && cname[0] == '.' && cname[1] == '.') + { + if (dn_new->next) + { + dn_new = dnode_path; + dnode_path = dn_new->next; + grub_free (dn_new); + } + else + { + err = grub_error (GRUB_ERR_FILE_NOT_FOUND, + "can't resolve .."); + break; + } + continue; + } + + ch = *path; + *path = 0; /* ensure null termination */ + + if (dnode_path->dn.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS) + { + grub_free (path_buf); + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); + } + err = zap_lookup (&(dnode_path->dn), cname, &objnum, data); + if (err) + break; + + dn_new = grub_malloc (sizeof (*dn_new)); + if (! dn_new) + { + err = grub_errno; + break; + } + dn_new->next = dnode_path; + dnode_path = dn_new; + + objnum = ZFS_DIRENT_OBJ (objnum); + err = dnode_get (mdn, objnum, 0, &(dnode_path->dn), data); + if (err) + break; + + *path = ch; + if (((grub_zfs_to_cpu64(((znode_phys_t *) &dnode_path->dn.dn.dn_bonus)->zp_mode, dnode_path->dn.endian) >> 12) & 0xf) == 0xa && ch) + { + char *oldpath = path, *oldpathbuf = path_buf; + path = path_buf + = grub_malloc (sizeof (dnode_path->dn.dn.dn_bonus) + - sizeof (znode_phys_t) + grub_strlen (oldpath) + 1); + if (!path_buf) + { + grub_free (oldpathbuf); + return grub_errno; + } + grub_memcpy (path, + (char *) &dnode_path->dn.dn.dn_bonus[sizeof (znode_phys_t)], + sizeof (dnode_path->dn.dn.dn_bonus) - sizeof (znode_phys_t)); + path [sizeof (dnode_path->dn.dn.dn_bonus) - sizeof (znode_phys_t)] = 0; + grub_memcpy (path + grub_strlen (path), oldpath, + grub_strlen (oldpath) + 1); + + grub_free (oldpathbuf); + if (path[0] != '/') + { + dn_new = dnode_path; + dnode_path = dn_new->next; + grub_free (dn_new); + } + else while (dnode_path != root) + { + dn_new = dnode_path; + dnode_path = dn_new->next; + grub_free (dn_new); + } + } + } + + if (!err) + grub_memcpy (dn, &(dnode_path->dn), sizeof (*dn)); + + while (dnode_path) + { + dn_new = dnode_path->next; + grub_free (dnode_path); + dnode_path = dn_new; + } + grub_free (path_buf); + return err; +} + +#if 0 +/* + * Get the default 'bootfs' property value from the rootpool. + * + */ +static grub_err_t +get_default_bootfsobj (dnode_phys_t * mosmdn, grub_uint64_t * obj, + struct grub_zfs_data *data) +{ + grub_uint64_t objnum = 0; + dnode_phys_t *dn; + if (!dn) + return grub_errno; + + if ((grub_errno = dnode_get (mosmdn, DMU_POOL_DIRECTORY_OBJECT, + DMU_OT_OBJECT_DIRECTORY, dn, data))) + { + grub_free (dn); + return (grub_errno); + } + + /* + * find the object number for 'pool_props', and get the dnode + * of the 'pool_props'. + */ + if (zap_lookup (dn, DMU_POOL_PROPS, &objnum, data)) + { + grub_free (dn); + return (GRUB_ERR_BAD_FS); + } + if ((grub_errno = dnode_get (mosmdn, objnum, DMU_OT_POOL_PROPS, dn, data))) + { + grub_free (dn); + return (grub_errno); + } + if (zap_lookup (dn, ZPOOL_PROP_BOOTFS, &objnum, data)) + { + grub_free (dn); + return (GRUB_ERR_BAD_FS); + } + + if (!objnum) + { + grub_free (dn); + return (GRUB_ERR_BAD_FS); + } + + *obj = objnum; + return (0); +} +#endif +/* + * Given a MOS metadnode, get the metadnode of a given filesystem name (fsname), + * e.g. pool/rootfs, or a given object number (obj), e.g. the object number + * of pool/rootfs. + * + * If no fsname and no obj are given, return the DSL_DIR metadnode. + * If fsname is given, return its metadnode and its matching object number. + * If only obj is given, return the metadnode for this object number. + * + */ +static grub_err_t +get_filesystem_dnode (dnode_end_t * mosmdn, char *fsname, + dnode_end_t * mdn, struct grub_zfs_data *data) +{ + grub_uint64_t objnum; + grub_err_t err; + + grub_dprintf ("zfs", "endian = %d\n", mosmdn->endian); + + err = dnode_get (mosmdn, DMU_POOL_DIRECTORY_OBJECT, + DMU_OT_OBJECT_DIRECTORY, mdn, data); + if (err) + return err; + + grub_dprintf ("zfs", "alive\n"); + + err = zap_lookup (mdn, DMU_POOL_ROOT_DATASET, &objnum, data); + if (err) + return err; + + grub_dprintf ("zfs", "alive\n"); + + err = dnode_get (mosmdn, objnum, DMU_OT_DSL_DIR, mdn, data); + if (err) + return err; + + grub_dprintf ("zfs", "alive\n"); + + while (*fsname) + { + grub_uint64_t childobj; + char *cname, ch; + + while (*fsname == '/') + fsname++; + + if (! *fsname || *fsname == '@') + break; + + cname = fsname; + while (*fsname && !grub_isspace (*fsname) && *fsname != '/') + fsname++; + ch = *fsname; + *fsname = 0; + + childobj = grub_zfs_to_cpu64(((dsl_dir_phys_t *) &(mdn->dn.dn_bonus))->dd_child_dir_zapobj, mdn->endian); + err = dnode_get (mosmdn, childobj, + DMU_OT_DSL_DIR_CHILD_MAP, mdn, data); + if (err) + return err; + + err = zap_lookup (mdn, cname, &objnum, data); + if (err) + return err; + + err = dnode_get (mosmdn, objnum, DMU_OT_DSL_DIR, mdn, data); + if (err) + return err; + + *fsname = ch; + } + return GRUB_ERR_NONE; +} + +static grub_err_t +make_mdn (dnode_end_t * mdn, struct grub_zfs_data *data) +{ + objset_phys_t *osp; + blkptr_t *bp; + grub_size_t ospsize; + grub_err_t err; + + grub_dprintf ("zfs", "endian = %d\n", mdn->endian); + + bp = &((dsl_dataset_phys_t *) &(mdn->dn.dn_bonus))->ds_bp; + err = zio_read (bp, mdn->endian, (void **) &osp, &ospsize, data); + if (err) + return err; + if (ospsize < sizeof (objset_phys_t)) + { + grub_free (osp); + return grub_error (GRUB_ERR_BAD_FS, "too small osp"); + } + + mdn->endian = (grub_zfs_to_cpu64 (bp->blk_prop, mdn->endian)>>63) & 1; + grub_memmove ((char *) &(mdn->dn), (char *) &osp->os_meta_dnode, DNODE_SIZE); + grub_free (osp); + return GRUB_ERR_NONE; +} + +static grub_err_t +dnode_get_fullpath (const char *fullpath, dnode_end_t * mdn, + grub_uint64_t *mdnobj, dnode_end_t * dn, int *isfs, + struct grub_zfs_data *data) +{ + char *fsname, *snapname; + const char *ptr_at, *filename; + grub_uint64_t headobj; + grub_err_t err; + + ptr_at = grub_strchr (fullpath, '@'); + if (! ptr_at) + { + *isfs = 1; + filename = 0; + snapname = 0; + fsname = grub_strdup (fullpath); + } + else + { + const char *ptr_slash = grub_strchr (ptr_at, '/'); + + *isfs = 0; + fsname = grub_malloc (ptr_at - fullpath + 1); + if (!fsname) + return grub_errno; + grub_memcpy (fsname, fullpath, ptr_at - fullpath); + fsname[ptr_at - fullpath] = 0; + if (ptr_at[1] && ptr_at[1] != '/') + { + snapname = grub_malloc (ptr_slash - ptr_at); + if (!snapname) + { + grub_free (fsname); + return grub_errno; + } + grub_memcpy (snapname, ptr_at + 1, ptr_slash - ptr_at - 1); + snapname[ptr_slash - ptr_at - 1] = 0; + } + else + snapname = 0; + if (ptr_slash) + filename = ptr_slash; + else + filename = "/"; + grub_dprintf ("zfs", "fsname = '%s' snapname='%s' filename = '%s'\n", + fsname, snapname, filename); + } + grub_dprintf ("zfs", "alive\n"); + err = get_filesystem_dnode (&(data->mos), fsname, dn, data); + if (err) + { + grub_free (fsname); + grub_free (snapname); + return err; + } + + grub_dprintf ("zfs", "alive\n"); + + headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) &(dn->dn.dn_bonus))->dd_head_dataset_obj, dn->endian); + + grub_dprintf ("zfs", "endian = %d\n", mdn->endian); + + err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, mdn, data); + if (err) + { + grub_free (fsname); + grub_free (snapname); + return err; + } + grub_dprintf ("zfs", "endian = %d\n", mdn->endian); + + if (snapname) + { + grub_uint64_t snapobj; + + snapobj = grub_zfs_to_cpu64 (((dsl_dataset_phys_t *) &(mdn->dn.dn_bonus))->ds_snapnames_zapobj, mdn->endian); + + err = dnode_get (&(data->mos), snapobj, + DMU_OT_DSL_DS_SNAP_MAP, mdn, data); + if (!err) + err = zap_lookup (mdn, snapname, &headobj, data); + if (!err) + err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, mdn, data); + if (err) + { + grub_free (fsname); + grub_free (snapname); + return err; + } + } + + if (mdnobj) + *mdnobj = headobj; + + make_mdn (mdn, data); + + grub_dprintf ("zfs", "endian = %d\n", mdn->endian); + + if (*isfs) + { + grub_free (fsname); + grub_free (snapname); + return GRUB_ERR_NONE; + } + err = dnode_get_path (mdn, filename, dn, data); + grub_free (fsname); + grub_free (snapname); + return err; +} + +/* + * For a given XDR packed nvlist, verify the first 4 bytes and move on. + * + * An XDR packed nvlist is encoded as (comments from nvs_xdr_create) : + * + * encoding method/host endian (4 bytes) + * nvl_version (4 bytes) + * nvl_nvflag (4 bytes) + * encoded nvpairs: + * encoded size of the nvpair (4 bytes) + * decoded size of the nvpair (4 bytes) + * name string size (4 bytes) + * name string data (sizeof(NV_ALIGN4(string)) + * data type (4 bytes) + * # of elements in the nvpair (4 bytes) + * data + * 2 zero's for the last nvpair + * (end of the entire list) (8 bytes) + * + */ + +static int +nvlist_find_value (char *nvlist, char *name, int valtype, char **val, + grub_size_t *size_out, grub_size_t *nelm_out) +{ + int name_len, type, encode_size; + char *nvpair, *nvp_name; + + /* Verify if the 1st and 2nd byte in the nvlist are valid. */ + /* NOTE: independently of what endianness header announces all + subsequent values are big-endian. */ + if (nvlist[0] != NV_ENCODE_XDR || (nvlist[1] != NV_LITTLE_ENDIAN + && nvlist[1] != NV_BIG_ENDIAN)) + { + grub_dprintf ("zfs", "incorrect nvlist header\n"); + grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist"); + return 0; + } + + /* skip the header, nvl_version, and nvl_nvflag */ + nvlist = nvlist + 4 * 3; + /* + * Loop thru the nvpair list + * The XDR representation of an integer is in big-endian byte order. + */ + while ((encode_size = grub_be_to_cpu32 (*(grub_uint32_t *) nvlist))) + { + int nelm; + + nvpair = nvlist + 4 * 2; /* skip the encode/decode size */ + + name_len = grub_be_to_cpu32 (*(grub_uint32_t *) nvpair); + nvpair += 4; + + nvp_name = nvpair; + nvpair = nvpair + ((name_len + 3) & ~3); /* align */ + + type = grub_be_to_cpu32 (*(grub_uint32_t *) nvpair); + nvpair += 4; + + nelm = grub_be_to_cpu32 (*(grub_uint32_t *) nvpair); + if (nelm < 1) + return grub_error (GRUB_ERR_BAD_FS, "empty nvpair"); + + nvpair += 4; + + if ((grub_strncmp (nvp_name, name, name_len) == 0) && type == valtype) + { + *val = nvpair; + *size_out = encode_size; + if (nelm_out) + *nelm_out = nelm; + return 1; + } + + nvlist += encode_size; /* goto the next nvpair */ + } + return 0; +} + +int +grub_zfs_nvlist_lookup_uint64 (char *nvlist, char *name, grub_uint64_t * out) +{ + char *nvpair; + grub_size_t size; + int found; + + found = nvlist_find_value (nvlist, name, DATA_TYPE_UINT64, &nvpair, &size, 0); + if (!found) + return 0; + if (size < sizeof (grub_uint64_t)) + { + grub_error (GRUB_ERR_BAD_FS, "invalid uint64"); + return 0; + } + + *out = grub_be_to_cpu64 (*(grub_uint64_t *) nvpair); + return 1; +} + +char * +grub_zfs_nvlist_lookup_string (char *nvlist, char *name) +{ + char *nvpair; + char *ret; + grub_size_t slen; + grub_size_t size; + int found; + + found = nvlist_find_value (nvlist, name, DATA_TYPE_STRING, &nvpair, &size, 0); + if (!found) + return 0; + if (size < 4) + { + grub_error (GRUB_ERR_BAD_FS, "invalid string"); + return 0; + } + slen = grub_be_to_cpu32 (*(grub_uint32_t *) nvpair); + if (slen > size - 4) + slen = size - 4; + ret = grub_malloc (slen + 1); + if (!ret) + return 0; + grub_memcpy (ret, nvpair + 4, slen); + ret[slen] = 0; + return ret; +} + +char * +grub_zfs_nvlist_lookup_nvlist (char *nvlist, char *name) +{ + char *nvpair; + char *ret; + grub_size_t size; + int found; + + found = nvlist_find_value (nvlist, name, DATA_TYPE_NVLIST, &nvpair, + &size, 0); + if (!found) + return 0; + ret = grub_zalloc (size + 3 * sizeof (grub_uint32_t)); + if (!ret) + return 0; + grub_memcpy (ret, nvlist, sizeof (grub_uint32_t)); + + grub_memcpy (ret + sizeof (grub_uint32_t), nvpair, size); + return ret; +} + +int +grub_zfs_nvlist_lookup_nvlist_array_get_nelm (char *nvlist, char *name) +{ + char *nvpair; + grub_size_t nelm, size; + int found; + + found = nvlist_find_value (nvlist, name, DATA_TYPE_NVLIST, &nvpair, + &size, &nelm); + if (! found) + return -1; + return nelm; +} + +char * +grub_zfs_nvlist_lookup_nvlist_array (char *nvlist, char *name, + grub_size_t index) +{ + char *nvpair, *nvpairptr; + int found; + char *ret; + grub_size_t size; + unsigned i; + grub_size_t nelm; + + found = nvlist_find_value (nvlist, name, DATA_TYPE_NVLIST, &nvpair, + &size, &nelm); + if (!found) + return 0; + if (index >= nelm) + { + grub_error (GRUB_ERR_OUT_OF_RANGE, "trying to lookup past nvlist array"); + return 0; + } + + nvpairptr = nvpair; + + for (i = 0; i < index; i++) + { + grub_uint32_t encode_size; + + /* skip the header, nvl_version, and nvl_nvflag */ + nvpairptr = nvpairptr + 4 * 2; + + while (nvpairptr < nvpair + size + && (encode_size = grub_be_to_cpu32 (*(grub_uint32_t *) nvpairptr))) + nvlist += encode_size; /* goto the next nvpair */ + + nvlist = nvlist + 4 * 2; /* skip the ending 2 zeros - 8 bytes */ + } + + if (nvpairptr >= nvpair + size + || nvpairptr + grub_be_to_cpu32 (*(grub_uint32_t *) (nvpairptr + 4 * 2)) + >= nvpair + size) + { + grub_error (GRUB_ERR_BAD_FS, "incorrect nvlist array"); + return 0; + } + + ret = grub_zalloc (grub_be_to_cpu32 (*(grub_uint32_t *) (nvpairptr + 4 * 2)) + + 3 * sizeof (grub_uint32_t)); + if (!ret) + return 0; + grub_memcpy (ret, nvlist, sizeof (grub_uint32_t)); + + grub_memcpy (ret + sizeof (grub_uint32_t), nvpairptr, size); + return ret; +} + +static grub_err_t +zfs_fetch_nvlist (struct grub_zfs_data * data, char **nvlist) +{ + grub_err_t err; + + *nvlist = grub_malloc (VDEV_PHYS_SIZE); + /* Read in the vdev name-value pair list (112K). */ + err = grub_disk_read (data->disk, data->vdev_phys_sector, 0, + VDEV_PHYS_SIZE, *nvlist); + if (err) + { + grub_free (*nvlist); + *nvlist = 0; + return err; + } + return GRUB_ERR_NONE; +} + +/* + * Check the disk label information and retrieve needed vdev name-value pairs. + * + */ +static grub_err_t +check_pool_label (struct grub_zfs_data *data) +{ + grub_uint64_t pool_state, txg = 0; + char *nvlist; +#if 0 + char *nv; +#endif + grub_uint64_t diskguid; + grub_uint64_t version; + int found; + grub_err_t err; + + err = zfs_fetch_nvlist (data, &nvlist); + if (err) + return err; + + grub_dprintf ("zfs", "check 2 passed\n"); + + found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_STATE, + &pool_state); + if (! found) + { + grub_free (nvlist); + if (! grub_errno) + grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_POOL_STATE " not found"); + return grub_errno; + } + grub_dprintf ("zfs", "check 3 passed\n"); + + if (pool_state == POOL_STATE_DESTROYED) + { + grub_free (nvlist); + return grub_error (GRUB_ERR_BAD_FS, "zpool is marked as destroyed"); + } + grub_dprintf ("zfs", "check 4 passed\n"); + + found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_TXG, &txg); + if (!found) + { + grub_free (nvlist); + if (! grub_errno) + grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_POOL_TXG " not found"); + return grub_errno; + } + grub_dprintf ("zfs", "check 6 passed\n"); + + /* not an active device */ + if (txg == 0) + { + grub_free (nvlist); + return grub_error (GRUB_ERR_BAD_FS, "zpool isn't active"); + } + grub_dprintf ("zfs", "check 7 passed\n"); + + found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_VERSION, + &version); + if (! found) + { + grub_free (nvlist); + if (! grub_errno) + grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_VERSION " not found"); + return grub_errno; + } + grub_dprintf ("zfs", "check 8 passed\n"); + + if (version > SPA_VERSION) + { + grub_free (nvlist); + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "too new version %llu > %llu", + (unsigned long long) version, + (unsigned long long) SPA_VERSION); + } + grub_dprintf ("zfs", "check 9 passed\n"); +#if 0 + if (nvlist_lookup_value (nvlist, ZPOOL_CONFIG_VDEV_TREE, &nv, + DATA_TYPE_NVLIST, NULL)) + { + grub_free (vdev); + return (GRUB_ERR_BAD_FS); + } + grub_dprintf ("zfs", "check 10 passed\n"); +#endif + + found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_GUID, &diskguid); + if (! found) + { + grub_free (nvlist); + if (! grub_errno) + grub_error (GRUB_ERR_BAD_FS, ZPOOL_CONFIG_GUID " not found"); + return grub_errno; + } + grub_dprintf ("zfs", "check 11 passed\n"); + + grub_free (nvlist); + + return GRUB_ERR_NONE; +} + +static void +zfs_unmount (struct grub_zfs_data *data) +{ + grub_free (data->dnode_buf); + grub_free (data->dnode_mdn); + grub_free (data->file_buf); + grub_free (data); +} + +/* + * zfs_mount() locates a valid uberblock of the root pool and read in its MOS + * to the memory address MOS. + * + */ +static struct grub_zfs_data * +zfs_mount (grub_device_t dev) +{ + struct grub_zfs_data *data = 0; + int label = 0; + uberblock_phys_t *ub_array, *ubbest = NULL; + vdev_boot_header_t *bh; + objset_phys_t *osp = 0; + grub_size_t ospsize; + grub_err_t err; + int vdevnum; + + if (! dev->disk) + { + grub_error (GRUB_ERR_BAD_DEVICE, "not a disk"); + return 0; + } + + data = grub_malloc (sizeof (*data)); + if (!data) + return 0; + grub_memset (data, 0, sizeof (*data)); +#if 0 + /* if it's our first time here, zero the best uberblock out */ + if (data->best_drive == 0 && data->best_part == 0 && find_best_root) + grub_memset (¤t_uberblock, 0, sizeof (uberblock_t)); +#endif + + data->disk = dev->disk; + + ub_array = grub_malloc (VDEV_UBERBLOCK_RING); + if (!ub_array) + { + zfs_unmount (data); + return 0; + } + + bh = grub_malloc (VDEV_BOOT_HEADER_SIZE); + if (!bh) + { + zfs_unmount (data); + grub_free (ub_array); + return 0; + } + + vdevnum = VDEV_LABELS; + + /* Don't check back labels on CDROM. */ + if (! data->disk->partition + && data->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID + && data->disk->id >= 0xc0) + vdevnum = VDEV_LABELS / 2; + + for (label = 0; ubbest == NULL && label < vdevnum; label++) + { + grub_zfs_endian_t ub_endian = UNKNOWN_ENDIAN; + grub_dprintf ("zfs", "label %d\n", label); + + data->vdev_phys_sector + = label * (sizeof (vdev_label_t) >> SPA_MINBLOCKSHIFT) + + ((VDEV_SKIP_SIZE + VDEV_BOOT_HEADER_SIZE) >> SPA_MINBLOCKSHIFT) + + (label < VDEV_LABELS / 2 ? 0 : grub_disk_get_size (dev->disk) + - VDEV_LABELS * (sizeof (vdev_label_t) >> SPA_MINBLOCKSHIFT)); + + /* Read in the uberblock ring (128K). */ + err = grub_disk_read (data->disk, data->vdev_phys_sector + + (VDEV_PHYS_SIZE >> SPA_MINBLOCKSHIFT), + 0, VDEV_UBERBLOCK_RING, (char *) ub_array); + if (err) + { + grub_errno = GRUB_ERR_NONE; + continue; + } + grub_dprintf ("zfs", "label ok %d\n", label); + + ubbest = find_bestub (ub_array, data->vdev_phys_sector); + if (!ubbest) + { + grub_dprintf ("zfs", "No uberblock found\n"); + grub_errno = GRUB_ERR_NONE; + continue; + } + ub_endian = (grub_zfs_to_cpu64 (ubbest->ubp_uberblock.ub_magic, + LITTLE_ENDIAN) == UBERBLOCK_MAGIC + ? LITTLE_ENDIAN : BIG_ENDIAN); + err = zio_read (&ubbest->ubp_uberblock.ub_rootbp, + ub_endian, + (void **) &osp, &ospsize, data); + if (err) + { + grub_dprintf ("zfs", "couldn't zio_read\n"); + grub_errno = GRUB_ERR_NONE; + continue; + } + + if (ospsize < sizeof (objset_phys_t)) + { + grub_dprintf ("zfs", "osp too small\n"); + grub_free (osp); + continue; + } + grub_dprintf ("zfs", "ubbest %p\n", ubbest); + + err = check_pool_label (data); + if (err) + { + grub_errno = GRUB_ERR_NONE; + continue; + } +#if 0 + if (find_best_root && + vdev_uberblock_compare (&ubbest->ubp_uberblock, + &(current_uberblock)) <= 0) + continue; +#endif + /* Got the MOS. Save it at the memory addr MOS. */ + grub_memmove (&(data->mos.dn), &osp->os_meta_dnode, DNODE_SIZE); + data->mos.endian = (grub_zfs_to_cpu64 (ubbest->ubp_uberblock.ub_rootbp.blk_prop, ub_endian) >> 63) & 1; + grub_memmove (&(data->current_uberblock), + &ubbest->ubp_uberblock, sizeof (uberblock_t)); + grub_free (ub_array); + grub_free (bh); + grub_free (osp); + return data; + } + grub_error (GRUB_ERR_BAD_FS, "couldn't find a valid label"); + zfs_unmount (data); + grub_free (ub_array); + grub_free (bh); + grub_free (osp); + + return 0; +} + +grub_err_t +grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist) +{ + struct grub_zfs_data *zfs; + grub_err_t err; + + zfs = zfs_mount (dev); + if (!zfs) + return grub_errno; + err = zfs_fetch_nvlist (zfs, nvlist); + zfs_unmount (zfs); + return err; +} + +static grub_err_t +zfs_label (grub_device_t device, char **label) +{ + char *nvlist; + grub_err_t err; + struct grub_zfs_data *data; + + data = zfs_mount (device); + if (! data) + return grub_errno; + + err = zfs_fetch_nvlist (data, &nvlist); + if (err) + { + zfs_unmount (data); + return err; + } + + *label = grub_zfs_nvlist_lookup_string (nvlist, ZPOOL_CONFIG_POOL_NAME); + grub_free (nvlist); + zfs_unmount (data); + return grub_errno; +} + +static grub_err_t +zfs_uuid (grub_device_t device, char **uuid) +{ + char *nvlist; + int found; + struct grub_zfs_data *data; + grub_uint64_t guid; + grub_err_t err; + + *uuid = 0; + + data = zfs_mount (device); + if (! data) + return grub_errno; + + err = zfs_fetch_nvlist (data, &nvlist); + if (err) + { + zfs_unmount (data); + return err; + } + + found = grub_zfs_nvlist_lookup_uint64 (nvlist, ZPOOL_CONFIG_POOL_GUID, &guid); + if (! found) + return grub_errno; + grub_free (nvlist); + *uuid = grub_xasprintf ("%016llx", (long long unsigned) guid); + zfs_unmount (data); + if (! *uuid) + return grub_errno; + return GRUB_ERR_NONE; +} + +/* + * zfs_open() locates a file in the rootpool by following the + * MOS and places the dnode of the file in the memory address DNODE. + */ +static grub_err_t +grub_zfs_open (struct grub_file *file, const char *fsfilename) +{ + struct grub_zfs_data *data; + grub_err_t err; + int isfs; + + data = zfs_mount (file->device); + if (! data) + return grub_errno; + + err = dnode_get_fullpath (fsfilename, &(data->mdn), 0, + &(data->dnode), &isfs, data); + if (err) + { + zfs_unmount (data); + return err; + } + + if (isfs) + { + zfs_unmount (data); + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Missing @ or / separator"); + } + + /* We found the dnode for this file. Verify if it is a plain file. */ + if (data->dnode.dn.dn_type != DMU_OT_PLAIN_FILE_CONTENTS) + { + zfs_unmount (data); + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a file"); + } + + /* get the file size and set the file position to 0 */ + file->data = data; + file->offset = 0; + file->size = grub_zfs_to_cpu64 (((znode_phys_t *) &(data->dnode.dn.dn_bonus))->zp_size, data->dnode.endian); + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + return GRUB_ERR_NONE; +} + +static grub_ssize_t +grub_zfs_read (grub_file_t file, char *buf, grub_size_t len) +{ + struct grub_zfs_data *data = (struct grub_zfs_data *) file->data; + int blksz, movesize; + grub_size_t length; + grub_size_t read; + grub_err_t err; + + if (data->file_buf == NULL) + { + data->file_buf = grub_malloc (SPA_MAXBLOCKSIZE); + if (!data->file_buf) + return -1; + data->file_start = data->file_end = 0; + } + + /* + * If offset is in memory, move it into the buffer provided and return. + */ + if (file->offset >= data->file_start + && file->offset + len <= data->file_end) + { + grub_memmove (buf, data->file_buf + file->offset - data->file_start, + len); + return len; + } + + blksz = grub_zfs_to_cpu16 (data->dnode.dn.dn_datablkszsec, + data->dnode.endian) << SPA_MINBLOCKSHIFT; + + /* + * Entire Dnode is too big to fit into the space available. We + * will need to read it in chunks. This could be optimized to + * read in as large a chunk as there is space available, but for + * now, this only reads in one data block at a time. + */ + length = len; + read = 0; + while (length) + { + /* + * Find requested blkid and the offset within that block. + */ + grub_uint64_t blkid = grub_divmod64 (file->offset + read, blksz, 0); + grub_free (data->file_buf); + data->file_buf = 0; + + err = dmu_read (&(data->dnode), blkid, (void **) &(data->file_buf), + 0, data); + if (err) + return -1; + + data->file_start = blkid * blksz; + data->file_end = data->file_start + blksz; + + movesize = MIN (length, data->file_end - (int) file->offset - read); + + grub_memmove (buf, data->file_buf + file->offset + read + - data->file_start, movesize); + buf += movesize; + length -= movesize; + read += movesize; + } + + return len; +} + +static grub_err_t +grub_zfs_close (grub_file_t file) +{ + zfs_unmount ((struct grub_zfs_data *) file->data); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename, + grub_uint64_t *mdnobj) +{ + struct grub_zfs_data *data; + grub_err_t err; + int isfs; + + data = zfs_mount (dev); + if (! data) + return grub_errno; + + err = dnode_get_fullpath (fsfilename, &(data->mdn), mdnobj, + &(data->dnode), &isfs, data); + zfs_unmount (data); + return err; +} + +static void +fill_fs_info (struct grub_dirhook_info *info, + dnode_end_t mdn, struct grub_zfs_data *data) +{ + grub_err_t err; + dnode_end_t dn; + grub_uint64_t objnum; + grub_uint64_t headobj; + + grub_memset (info, 0, sizeof (*info)); + + info->dir = 1; + + if (mdn.dn.dn_type == DMU_OT_DSL_DIR) + { + headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) &(mdn.dn.dn_bonus))->dd_head_dataset_obj, mdn.endian); + + err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &mdn, data); + if (err) + { + grub_dprintf ("zfs", "failed here\n"); + return; + } + } + make_mdn (&mdn, data); + err = dnode_get (&mdn, MASTER_NODE_OBJ, DMU_OT_MASTER_NODE, + &dn, data); + if (err) + { + grub_dprintf ("zfs", "failed here\n"); + return; + } + + err = zap_lookup (&dn, ZFS_ROOT_OBJ, &objnum, data); + if (err) + { + grub_dprintf ("zfs", "failed here\n"); + return; + } + + err = dnode_get (&mdn, objnum, 0, &dn, data); + if (err) + { + grub_dprintf ("zfs", "failed here\n"); + return; + } + + info->mtimeset = 1; + info->mtime = grub_zfs_to_cpu64 (((znode_phys_t *) &dn.dn.dn_bonus)->zp_mtime[0], dn.endian); + return; +} + +static grub_err_t +grub_zfs_dir (grub_device_t device, const char *path, + int (*hook) (const char *, const struct grub_dirhook_info *)) +{ + struct grub_zfs_data *data; + grub_err_t err; + int isfs; + auto int NESTED_FUNC_ATTR iterate_zap (const char *name, grub_uint64_t val); + auto int NESTED_FUNC_ATTR iterate_zap_fs (const char *name, + grub_uint64_t val); + auto int NESTED_FUNC_ATTR iterate_zap_snap (const char *name, + grub_uint64_t val); + + int NESTED_FUNC_ATTR iterate_zap (const char *name, grub_uint64_t val) + { + struct grub_dirhook_info info; + dnode_end_t dn; + grub_memset (&info, 0, sizeof (info)); + + dnode_get (&(data->mdn), val, 0, &dn, data); + info.mtimeset = 1; + info.mtime = grub_zfs_to_cpu64 (((znode_phys_t *) &dn.dn.dn_bonus)->zp_mtime[0], dn.endian); + info.dir = (dn.dn.dn_type == DMU_OT_DIRECTORY_CONTENTS); + grub_dprintf ("zfs", "type=%d, name=%s\n", + (int)dn.dn.dn_type, (char *)name); + return hook (name, &info); + } + + int NESTED_FUNC_ATTR iterate_zap_fs (const char *name, grub_uint64_t val) + { + struct grub_dirhook_info info; + dnode_end_t mdn; + err = dnode_get (&(data->mos), val, 0, &mdn, data); + if (err) + return 0; + if (mdn.dn.dn_type != DMU_OT_DSL_DIR) + return 0; + + fill_fs_info (&info, mdn, data); + return hook (name, &info); + } + int NESTED_FUNC_ATTR iterate_zap_snap (const char *name, grub_uint64_t val) + { + struct grub_dirhook_info info; + char *name2; + int ret; + dnode_end_t mdn; + + err = dnode_get (&(data->mos), val, 0, &mdn, data); + if (err) + return 0; + + if (mdn.dn.dn_type != DMU_OT_DSL_DATASET) + return 0; + + fill_fs_info (&info, mdn, data); + + name2 = grub_malloc (grub_strlen (name) + 2); + name2[0] = '@'; + grub_memcpy (name2 + 1, name, grub_strlen (name) + 1); + ret = hook (name2, &info); + grub_free (name2); + return ret; + } + + data = zfs_mount (device); + if (! data) + return grub_errno; + err = dnode_get_fullpath (path, &(data->mdn), 0, &(data->dnode), &isfs, data); + if (err) + { + zfs_unmount (data); + return err; + } + if (isfs) + { + grub_uint64_t childobj, headobj; + grub_uint64_t snapobj; + dnode_end_t dn; + struct grub_dirhook_info info; + + fill_fs_info (&info, data->dnode, data); + hook ("@", &info); + + childobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) &(data->dnode.dn.dn_bonus))->dd_child_dir_zapobj, data->dnode.endian); + headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) &(data->dnode.dn.dn_bonus))->dd_head_dataset_obj, data->dnode.endian); + err = dnode_get (&(data->mos), childobj, + DMU_OT_DSL_DIR_CHILD_MAP, &dn, data); + if (err) + { + zfs_unmount (data); + return err; + } + + zap_iterate (&dn, iterate_zap_fs, data); + + err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &dn, data); + if (err) + { + zfs_unmount (data); + return err; + } + + snapobj = grub_zfs_to_cpu64 (((dsl_dataset_phys_t *) &dn.dn.dn_bonus)->ds_snapnames_zapobj, dn.endian); + + err = dnode_get (&(data->mos), snapobj, + DMU_OT_DSL_DS_SNAP_MAP, &dn, data); + if (err) + { + zfs_unmount (data); + return err; + } + + zap_iterate (&dn, iterate_zap_snap, data); + } + else + { + if (data->dnode.dn.dn_type != DMU_OT_DIRECTORY_CONTENTS) + { + zfs_unmount (data); + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); + } + zap_iterate (&(data->dnode), iterate_zap, data); + } + zfs_unmount (data); + return grub_errno; +} + +static struct grub_fs grub_zfs_fs = { + .name = "zfs", + .dir = grub_zfs_dir, + .open = grub_zfs_open, + .read = grub_zfs_read, + .close = grub_zfs_close, + .label = zfs_label, + .uuid = zfs_uuid, + .mtime = 0, + .next = 0 +}; + +GRUB_MOD_INIT (zfs) +{ + grub_fs_register (&grub_zfs_fs); +#ifndef GRUB_UTIL + my_mod = mod; +#endif +} + +GRUB_MOD_FINI (zfs) +{ + grub_fs_unregister (&grub_zfs_fs); +} --- grub2-1.98.orig/debian/grub-extras/zfs/conf/common.mk +++ grub2-1.98/debian/grub-extras/zfs/conf/common.mk @@ -0,0 +1,312 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! + +COMMON_CFLAGS += -I$(GRUB_CONTRIB)/zfs/include + +pkglib_MODULES += zfs.mod +zfs_mod_SOURCES = $(GRUB_CONTRIB)/zfs/zfs.c $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $(GRUB_CONTRIB)/zfs/zfs_sha256.c $(GRUB_CONTRIB)/zfs/zfs_fletcher.c + +clean-module-zfs.mod.1: + rm -f zfs.mod mod-zfs.o mod-zfs.c pre-zfs.o zfs_mod-__GRUB_CONTRIB__zfs_zfs.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.o und-zfs.lst + +CLEAN_MODULE_TARGETS += clean-module-zfs.mod.1 + +clean-module-zfs.mod-symbol.1: + rm -f def-zfs.lst + +CLEAN_MODULE_TARGETS += clean-module-zfs.mod-symbol.1 +DEFSYMFILES += def-zfs.lst +mostlyclean-module-zfs.mod.1: + rm -f zfs_mod-__GRUB_CONTRIB__zfs_zfs.d zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.d zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.d zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.d + +MOSTLYCLEAN_MODULE_TARGETS += mostlyclean-module-zfs.mod.1 +UNDSYMFILES += und-zfs.lst + +ifneq ($(TARGET_APPLE_CC),1) +zfs.mod: pre-zfs.o mod-zfs.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(zfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-zfs.o mod-zfs.o + if test ! -z "$(TARGET_OBJ2ELF)"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ +else +zfs.mod: pre-zfs.o mod-zfs.o $(TARGET_OBJ2ELF) + -rm -f $@ + -rm -f $@.bin + $(TARGET_CC) $(zfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@.bin pre-zfs.o mod-zfs.o + $(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@ + -rm -f $@.bin +endif + +pre-zfs.o: $(zfs_mod_DEPENDENCIES) zfs_mod-__GRUB_CONTRIB__zfs_zfs.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.o + -rm -f $@ + $(TARGET_CC) $(zfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ zfs_mod-__GRUB_CONTRIB__zfs_zfs.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.o zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.o + +mod-zfs.o: mod-zfs.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -c -o $@ $< + +mod-zfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'zfs' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(TARGET_APPLE_CC),1) +def-zfs.lst: pre-zfs.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 zfs/' > $@ +else +def-zfs.lst: pre-zfs.o + $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed 's/^\([^ ]*\).*/\1 zfs/' > $@ +endif + +und-zfs.lst: pre-zfs.o + echo 'zfs' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +zfs_mod-__GRUB_CONTRIB__zfs_zfs.o: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -MD -c -o $@ $< +-include zfs_mod-__GRUB_CONTRIB__zfs_zfs.d + +clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs-extra.1: + rm -f cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst video-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst + +CLEAN_MODULE_TARGETS += clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs-extra.1 + +COMMANDFILES += cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst +FSFILES += fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst +PARTTOOLFILES += parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst +PARTMAPFILES += partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst +HANDLERFILES += handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst +TERMINALFILES += terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst +VIDEOFILES += video-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst + +cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh zfs > $@ || (rm -f $@; exit 1) + +fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh zfs > $@ || (rm -f $@; exit 1) + +parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) genparttoollist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genparttoollist.sh zfs > $@ || (rm -f $@; exit 1) + +partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh zfs > $@ || (rm -f $@; exit 1) + +handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) genhandlerlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genhandlerlist.sh zfs > $@ || (rm -f $@; exit 1) + +terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) genterminallist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genterminallist.sh zfs > $@ || (rm -f $@; exit 1) + +video-zfs_mod-__GRUB_CONTRIB__zfs_zfs.lst: $(GRUB_CONTRIB)/zfs/zfs.c $($(GRUB_CONTRIB)/zfs/zfs.c_DEPENDENCIES) genvideolist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genvideolist.sh zfs > $@ || (rm -f $@; exit 1) + +zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.o: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -MD -c -o $@ $< +-include zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.d + +clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb-extra.1: + rm -f cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst + +CLEAN_MODULE_TARGETS += clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb-extra.1 + +COMMANDFILES += cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst +FSFILES += fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst +PARTTOOLFILES += parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst +PARTMAPFILES += partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst +HANDLERFILES += handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst +TERMINALFILES += terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst +VIDEOFILES += video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst + +cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh zfs > $@ || (rm -f $@; exit 1) + +fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh zfs > $@ || (rm -f $@; exit 1) + +parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) genparttoollist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genparttoollist.sh zfs > $@ || (rm -f $@; exit 1) + +partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh zfs > $@ || (rm -f $@; exit 1) + +handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) genhandlerlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genhandlerlist.sh zfs > $@ || (rm -f $@; exit 1) + +terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) genterminallist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genterminallist.sh zfs > $@ || (rm -f $@; exit 1) + +video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_lzjb.lst: $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $($(GRUB_CONTRIB)/zfs/zfs_lzjb.c_DEPENDENCIES) genvideolist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genvideolist.sh zfs > $@ || (rm -f $@; exit 1) + +zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.o: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -MD -c -o $@ $< +-include zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.d + +clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256-extra.1: + rm -f cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst + +CLEAN_MODULE_TARGETS += clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256-extra.1 + +COMMANDFILES += cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst +FSFILES += fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst +PARTTOOLFILES += parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst +PARTMAPFILES += partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst +HANDLERFILES += handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst +TERMINALFILES += terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst +VIDEOFILES += video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst + +cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh zfs > $@ || (rm -f $@; exit 1) + +fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh zfs > $@ || (rm -f $@; exit 1) + +parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) genparttoollist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genparttoollist.sh zfs > $@ || (rm -f $@; exit 1) + +partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh zfs > $@ || (rm -f $@; exit 1) + +handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) genhandlerlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genhandlerlist.sh zfs > $@ || (rm -f $@; exit 1) + +terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) genterminallist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genterminallist.sh zfs > $@ || (rm -f $@; exit 1) + +video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_sha256.lst: $(GRUB_CONTRIB)/zfs/zfs_sha256.c $($(GRUB_CONTRIB)/zfs/zfs_sha256.c_DEPENDENCIES) genvideolist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genvideolist.sh zfs > $@ || (rm -f $@; exit 1) + +zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.o: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -MD -c -o $@ $< +-include zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.d + +clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher-extra.1: + rm -f cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst + +CLEAN_MODULE_TARGETS += clean-module-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher-extra.1 + +COMMANDFILES += cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst +FSFILES += fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst +PARTTOOLFILES += parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst +PARTMAPFILES += partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst +HANDLERFILES += handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst +TERMINALFILES += terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst +VIDEOFILES += video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst + +cmd-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh zfs > $@ || (rm -f $@; exit 1) + +fs-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh zfs > $@ || (rm -f $@; exit 1) + +parttool-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) genparttoollist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genparttoollist.sh zfs > $@ || (rm -f $@; exit 1) + +partmap-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh zfs > $@ || (rm -f $@; exit 1) + +handler-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) genhandlerlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genhandlerlist.sh zfs > $@ || (rm -f $@; exit 1) + +terminal-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) genterminallist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genterminallist.sh zfs > $@ || (rm -f $@; exit 1) + +video-zfs_mod-__GRUB_CONTRIB__zfs_zfs_fletcher.lst: $(GRUB_CONTRIB)/zfs/zfs_fletcher.c $($(GRUB_CONTRIB)/zfs/zfs_fletcher.c_DEPENDENCIES) genvideolist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfs_mod_CFLAGS) -E $< | sh $(srcdir)/genvideolist.sh zfs > $@ || (rm -f $@; exit 1) + +zfs_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-error +zfs_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += zfsinfo.mod +zfsinfo_mod_SOURCES = $(GRUB_CONTRIB)/zfs/zfsinfo.c + +clean-module-zfsinfo.mod.1: + rm -f zfsinfo.mod mod-zfsinfo.o mod-zfsinfo.c pre-zfsinfo.o zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.o und-zfsinfo.lst + +CLEAN_MODULE_TARGETS += clean-module-zfsinfo.mod.1 + +clean-module-zfsinfo.mod-symbol.1: + rm -f def-zfsinfo.lst + +CLEAN_MODULE_TARGETS += clean-module-zfsinfo.mod-symbol.1 +DEFSYMFILES += def-zfsinfo.lst +mostlyclean-module-zfsinfo.mod.1: + rm -f zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.d + +MOSTLYCLEAN_MODULE_TARGETS += mostlyclean-module-zfsinfo.mod.1 +UNDSYMFILES += und-zfsinfo.lst + +ifneq ($(TARGET_APPLE_CC),1) +zfsinfo.mod: pre-zfsinfo.o mod-zfsinfo.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(zfsinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-zfsinfo.o mod-zfsinfo.o + if test ! -z "$(TARGET_OBJ2ELF)"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ +else +zfsinfo.mod: pre-zfsinfo.o mod-zfsinfo.o $(TARGET_OBJ2ELF) + -rm -f $@ + -rm -f $@.bin + $(TARGET_CC) $(zfsinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@.bin pre-zfsinfo.o mod-zfsinfo.o + $(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@ + -rm -f $@.bin +endif + +pre-zfsinfo.o: $(zfsinfo_mod_DEPENDENCIES) zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.o + -rm -f $@ + $(TARGET_CC) $(zfsinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.o + +mod-zfsinfo.o: mod-zfsinfo.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -c -o $@ $< + +mod-zfsinfo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'zfsinfo' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(TARGET_APPLE_CC),1) +def-zfsinfo.lst: pre-zfsinfo.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 zfsinfo/' > $@ +else +def-zfsinfo.lst: pre-zfsinfo.o + $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed 's/^\([^ ]*\).*/\1 zfsinfo/' > $@ +endif + +und-zfsinfo.lst: pre-zfsinfo.o + echo 'zfsinfo' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.o: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -MD -c -o $@ $< +-include zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.d + +clean-module-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo-extra.1: + rm -f cmd-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst fs-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst partmap-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst handler-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst parttool-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst video-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst terminal-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst + +CLEAN_MODULE_TARGETS += clean-module-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo-extra.1 + +COMMANDFILES += cmd-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst +FSFILES += fs-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst +PARTTOOLFILES += parttool-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst +PARTMAPFILES += partmap-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst +HANDLERFILES += handler-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst +TERMINALFILES += terminal-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst +VIDEOFILES += video-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst + +cmd-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +fs-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +parttool-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) genparttoollist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genparttoollist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +partmap-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +handler-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) genhandlerlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genhandlerlist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +terminal-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) genterminallist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genterminallist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +video-zfsinfo_mod-__GRUB_CONTRIB__zfs_zfsinfo.lst: $(GRUB_CONTRIB)/zfs/zfsinfo.c $($(GRUB_CONTRIB)/zfs/zfsinfo.c_DEPENDENCIES) genvideolist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/zfs -I$(srcdir)/$(GRUB_CONTRIB)/zfs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(zfsinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genvideolist.sh zfsinfo > $@ || (rm -f $@; exit 1) + +zfsinfo_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-error +zfsinfo_mod_LDFLAGS = $(COMMON_LDFLAGS) --- grub2-1.98.orig/debian/grub-extras/zfs/conf/common.rmk +++ grub2-1.98/debian/grub-extras/zfs/conf/common.rmk @@ -0,0 +1,13 @@ +# -*- makefile -*- + +COMMON_CFLAGS += -I$(GRUB_CONTRIB)/zfs/include + +pkglib_MODULES += zfs.mod +zfs_mod_SOURCES = $(GRUB_CONTRIB)/zfs/zfs.c $(GRUB_CONTRIB)/zfs/zfs_lzjb.c $(GRUB_CONTRIB)/zfs/zfs_sha256.c $(GRUB_CONTRIB)/zfs/zfs_fletcher.c +zfs_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-error +zfs_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += zfsinfo.mod +zfsinfo_mod_SOURCES = $(GRUB_CONTRIB)/zfs/zfsinfo.c +zfsinfo_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-error +zfsinfo_mod_LDFLAGS = $(COMMON_LDFLAGS) --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/dsl_dataset.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/dsl_dataset.h @@ -0,0 +1,53 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_DSL_DATASET_H +#define _SYS_DSL_DATASET_H + +typedef struct dsl_dataset_phys { + grub_uint64_t ds_dir_obj; + grub_uint64_t ds_prev_snap_obj; + grub_uint64_t ds_prev_snap_txg; + grub_uint64_t ds_next_snap_obj; + grub_uint64_t ds_snapnames_zapobj; /* zap obj of snaps; ==0 for snaps */ + grub_uint64_t ds_num_children; /* clone/snap children; ==0 for head */ + grub_uint64_t ds_creation_time; /* seconds since 1970 */ + grub_uint64_t ds_creation_txg; + grub_uint64_t ds_deadlist_obj; + grub_uint64_t ds_used_bytes; + grub_uint64_t ds_compressed_bytes; + grub_uint64_t ds_uncompressed_bytes; + grub_uint64_t ds_unique_bytes; /* only relevant to snapshots */ + /* + * The ds_fsid_guid is a 56-bit ID that can change to avoid + * collisions. The ds_guid is a 64-bit ID that will never + * change, so there is a small probability that it will collide. + */ + grub_uint64_t ds_fsid_guid; + grub_uint64_t ds_guid; + grub_uint64_t ds_flags; + blkptr_t ds_bp; + grub_uint64_t ds_pad[8]; /* pad out to 320 bytes for good measure */ +} dsl_dataset_phys_t; + +#endif /* _SYS_DSL_DATASET_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zap_leaf.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zap_leaf.h @@ -0,0 +1,100 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_ZAP_LEAF_H +#define _SYS_ZAP_LEAF_H + +#define ZAP_LEAF_MAGIC 0x2AB1EAF + +/* chunk size = 24 bytes */ +#define ZAP_LEAF_CHUNKSIZE 24 + +/* + * The amount of space within the chunk available for the array is: + * chunk size - space for type (1) - space for next pointer (2) + */ +#define ZAP_LEAF_ARRAY_BYTES (ZAP_LEAF_CHUNKSIZE - 3) + +typedef enum zap_chunk_type { + ZAP_CHUNK_FREE = 253, + ZAP_CHUNK_ENTRY = 252, + ZAP_CHUNK_ARRAY = 251, + ZAP_CHUNK_TYPE_MAX = 250 +} zap_chunk_type_t; + +/* + * TAKE NOTE: + * If zap_leaf_phys_t is modified, zap_leaf_byteswap() must be modified. + */ +typedef struct zap_leaf_phys { + struct zap_leaf_header { + grub_uint64_t lh_block_type; /* ZBT_LEAF */ + grub_uint64_t lh_pad1; + grub_uint64_t lh_prefix; /* hash prefix of this leaf */ + grub_uint32_t lh_magic; /* ZAP_LEAF_MAGIC */ + grub_uint16_t lh_nfree; /* number free chunks */ + grub_uint16_t lh_nentries; /* number of entries */ + grub_uint16_t lh_prefix_len; /* num bits used to id this */ + +/* above is accessable to zap, below is zap_leaf private */ + + grub_uint16_t lh_freelist; /* chunk head of free list */ + grub_uint8_t lh_pad2[12]; + } l_hdr; /* 2 24-byte chunks */ + + /* + * The header is followed by a hash table with + * ZAP_LEAF_HASH_NUMENTRIES(zap) entries. The hash table is + * followed by an array of ZAP_LEAF_NUMCHUNKS(zap) + * zap_leaf_chunk structures. These structures are accessed + * with the ZAP_LEAF_CHUNK() macro. + */ + + grub_uint16_t l_hash[1]; +} zap_leaf_phys_t; + +typedef union zap_leaf_chunk { + struct zap_leaf_entry { + grub_uint8_t le_type; /* always ZAP_CHUNK_ENTRY */ + grub_uint8_t le_int_size; /* size of ints */ + grub_uint16_t le_next; /* next entry in hash chain */ + grub_uint16_t le_name_chunk; /* first chunk of the name */ + grub_uint16_t le_name_length; /* bytes in name, incl null */ + grub_uint16_t le_value_chunk; /* first chunk of the value */ + grub_uint16_t le_value_length; /* value length in ints */ + grub_uint32_t le_cd; /* collision differentiator */ + grub_uint64_t le_hash; /* hash value of the name */ + } l_entry; + struct zap_leaf_array { + grub_uint8_t la_type; /* always ZAP_CHUNK_ARRAY */ + grub_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES]; + grub_uint16_t la_next; /* next blk or CHAIN_END */ + } l_array; + struct zap_leaf_free { + grub_uint8_t lf_type; /* always ZAP_CHUNK_FREE */ + grub_uint8_t lf_pad[ZAP_LEAF_ARRAY_BYTES]; + grub_uint16_t lf_next; /* next in free list, or CHAIN_END */ + } l_free; +} zap_leaf_chunk_t; + +#endif /* _SYS_ZAP_LEAF_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/vdev_impl.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/vdev_impl.h @@ -0,0 +1,70 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_VDEV_IMPL_H +#define _SYS_VDEV_IMPL_H + +#define VDEV_SKIP_SIZE (8 << 10) +#define VDEV_BOOT_HEADER_SIZE (8 << 10) +#define VDEV_PHYS_SIZE (112 << 10) +#define VDEV_UBERBLOCK_RING (128 << 10) + +/* ZFS boot block */ +#define VDEV_BOOT_MAGIC 0x2f5b007b10cULL +#define VDEV_BOOT_VERSION 1 /* version number */ + +typedef struct vdev_boot_header { + grub_uint64_t vb_magic; /* VDEV_BOOT_MAGIC */ + grub_uint64_t vb_version; /* VDEV_BOOT_VERSION */ + grub_uint64_t vb_offset; /* start offset (bytes) */ + grub_uint64_t vb_size; /* size (bytes) */ + char vb_pad[VDEV_BOOT_HEADER_SIZE - 4 * sizeof (grub_uint64_t)]; +} vdev_boot_header_t; + +typedef struct vdev_phys { + char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_block_tail_t)]; + zio_block_tail_t vp_zbt; +} vdev_phys_t; + +typedef struct vdev_label { + char vl_pad[VDEV_SKIP_SIZE]; /* 8K */ + vdev_boot_header_t vl_boot_header; /* 8K */ + vdev_phys_t vl_vdev_phys; /* 112K */ + char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */ +} vdev_label_t; /* 256K total */ + +/* + * Size and offset of embedded boot loader region on each label. + * The total size of the first two labels plus the boot area is 4MB. + */ +#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) +#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ + +/* + * Size of label regions at the start and end of each leaf device. + */ +#define VDEV_LABEL_START_SIZE (2 * sizeof (vdev_label_t) + VDEV_BOOT_SIZE) +#define VDEV_LABEL_END_SIZE (2 * sizeof (vdev_label_t)) +#define VDEV_LABELS 4 + +#endif /* _SYS_VDEV_IMPL_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zio.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zio.h @@ -0,0 +1,83 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _ZIO_H +#define _ZIO_H + +#include + +#define ZBT_MAGIC 0x210da7ab10c7a11ULL /* zio data bloc tail */ + +typedef struct zio_block_tail { + grub_uint64_t zbt_magic; /* for validation, endianness */ + zio_cksum_t zbt_cksum; /* 256-bit checksum */ +} zio_block_tail_t; + +/* + * Gang block headers are self-checksumming and contain an array + * of block pointers. + */ +#define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE +#define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \ + sizeof (zio_block_tail_t)) / sizeof (blkptr_t)) +#define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \ + sizeof (zio_block_tail_t) - \ + (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\ + sizeof (grub_uint64_t)) + +#define ZIO_GET_IOSIZE(zio) \ + (BP_IS_GANG((zio)->io_bp) ? \ + SPA_GANGBLOCKSIZE : BP_GET_PSIZE((zio)->io_bp)) + +typedef struct zio_gbh { + blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS]; + grub_uint64_t zg_filler[SPA_GBH_FILLER]; + zio_block_tail_t zg_tail; +} zio_gbh_phys_t; + +enum zio_checksum { + ZIO_CHECKSUM_INHERIT = 0, + ZIO_CHECKSUM_ON, + ZIO_CHECKSUM_OFF, + ZIO_CHECKSUM_LABEL, + ZIO_CHECKSUM_GANG_HEADER, + ZIO_CHECKSUM_ZILOG, + ZIO_CHECKSUM_FLETCHER_2, + ZIO_CHECKSUM_FLETCHER_4, + ZIO_CHECKSUM_SHA256, + ZIO_CHECKSUM_FUNCTIONS +}; + +#define ZIO_CHECKSUM_ON_VALUE ZIO_CHECKSUM_FLETCHER_2 +#define ZIO_CHECKSUM_DEFAULT ZIO_CHECKSUM_ON + +enum zio_compress { + ZIO_COMPRESS_INHERIT = 0, + ZIO_COMPRESS_ON, + ZIO_COMPRESS_OFF, + ZIO_COMPRESS_LZJB, + ZIO_COMPRESS_EMPTY, + ZIO_COMPRESS_FUNCTIONS +}; + +#endif /* _ZIO_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/spa.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/spa.h @@ -0,0 +1,281 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright 2007 Sun Microsystems, Inc. + * Copyright (C) 2009 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GRUB_ZFS_SPA_HEADER +#define GRUB_ZFS_SPA_HEADER 1 + +typedef enum grub_zfs_endian + { + UNKNOWN_ENDIAN = -2, + LITTLE_ENDIAN = -1, + BIG_ENDIAN = 0 + } grub_zfs_endian_t; + +#define grub_zfs_to_cpu16(x,a) (((a) == BIG_ENDIAN) ? grub_be_to_cpu16(x) \ + : grub_le_to_cpu16(x)) +#define grub_cpu_to_zfs16(x,a) (((a) == BIG_ENDIAN) ? grub_cpu_to_be16(x) \ + : grub_cpu_to_le16(x)) + +#define grub_zfs_to_cpu32(x,a) (((a) == BIG_ENDIAN) ? grub_be_to_cpu32(x) \ + : grub_le_to_cpu32(x)) +#define grub_cpu_to_zfs32(x,a) (((a) == BIG_ENDIAN) ? grub_cpu_to_be32(x) \ + : grub_cpu_to_le32(x)) + +#define grub_zfs_to_cpu64(x,a) (((a) == BIG_ENDIAN) ? grub_be_to_cpu64(x) \ + : grub_le_to_cpu64(x)) +#define grub_cpu_to_zfs64(x,a) (((a) == BIG_ENDIAN) ? grub_cpu_to_be64(x) \ + : grub_cpu_to_le64(x)) + +/* + * General-purpose 32-bit and 64-bit bitfield encodings. + */ +#define BF32_DECODE(x, low, len) P2PHASE((x) >> (low), 1U << (len)) +#define BF64_DECODE(x, low, len) P2PHASE((x) >> (low), 1ULL << (len)) +#define BF32_ENCODE(x, low, len) (P2PHASE((x), 1U << (len)) << (low)) +#define BF64_ENCODE(x, low, len) (P2PHASE((x), 1ULL << (len)) << (low)) + +#define BF32_GET(x, low, len) BF32_DECODE(x, low, len) +#define BF64_GET(x, low, len) BF64_DECODE(x, low, len) + +#define BF32_SET(x, low, len, val) \ + ((x) ^= BF32_ENCODE((x >> low) ^ (val), low, len)) +#define BF64_SET(x, low, len, val) \ + ((x) ^= BF64_ENCODE((x >> low) ^ (val), low, len)) + +#define BF32_GET_SB(x, low, len, shift, bias) \ + ((BF32_GET(x, low, len) + (bias)) << (shift)) +#define BF64_GET_SB(x, low, len, shift, bias) \ + ((BF64_GET(x, low, len) + (bias)) << (shift)) + +#define BF32_SET_SB(x, low, len, shift, bias, val) \ + BF32_SET(x, low, len, ((val) >> (shift)) - (bias)) +#define BF64_SET_SB(x, low, len, shift, bias, val) \ + BF64_SET(x, low, len, ((val) >> (shift)) - (bias)) + +/* + * We currently support nine block sizes, from 512 bytes to 128K. + * We could go higher, but the benefits are near-zero and the cost + * of COWing a giant block to modify one byte would become excessive. + */ +#define SPA_MINBLOCKSHIFT 9 +#define SPA_MAXBLOCKSHIFT 17 +#define SPA_MINBLOCKSIZE (1ULL << SPA_MINBLOCKSHIFT) +#define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT) + +#define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) + +/* + * The DVA size encodings for LSIZE and PSIZE support blocks up to 32MB. + * The ASIZE encoding should be at least 64 times larger (6 more bits) + * to support up to 4-way RAID-Z mirror mode with worst-case gang block + * overhead, three DVAs per bp, plus one more bit in case we do anything + * else that expands the ASIZE. + */ +#define SPA_LSIZEBITS 16 /* LSIZE up to 32M (2^16 * 512) */ +#define SPA_PSIZEBITS 16 /* PSIZE up to 32M (2^16 * 512) */ +#define SPA_ASIZEBITS 24 /* ASIZE up to 64 times larger */ + +/* + * All SPA data is represented by 128-bit data virtual addresses (DVAs). + * The members of the dva_t should be considered opaque outside the SPA. + */ +typedef struct dva { + grub_uint64_t dva_word[2]; +} dva_t; + +/* + * Each block has a 256-bit checksum -- strong enough for cryptographic hashes. + */ +typedef struct zio_cksum { + grub_uint64_t zc_word[4]; +} zio_cksum_t; + +/* + * Each block is described by its DVAs, time of birth, checksum, etc. + * The word-by-word, bit-by-bit layout of the blkptr is as follows: + * + * 64 56 48 40 32 24 16 8 0 + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 0 | vdev1 | GRID | ASIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 1 |G| offset1 | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 2 | vdev2 | GRID | ASIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 3 |G| offset2 | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 4 | vdev3 | GRID | ASIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 5 |G| offset3 | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 6 |E| lvl | type | cksum | comp | PSIZE | LSIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 7 | padding | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 8 | padding | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 9 | padding | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * a | birth txg | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * b | fill count | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * c | checksum[0] | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * d | checksum[1] | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * e | checksum[2] | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * f | checksum[3] | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * + * Legend: + * + * vdev virtual device ID + * offset offset into virtual device + * LSIZE logical size + * PSIZE physical size (after compression) + * ASIZE allocated size (including RAID-Z parity and gang block headers) + * GRID RAID-Z layout information (reserved for future use) + * cksum checksum function + * comp compression function + * G gang block indicator + * E endianness + * type DMU object type + * lvl level of indirection + * birth txg transaction group in which the block was born + * fill count number of non-zero blocks under this bp + * checksum[4] 256-bit checksum of the data this bp describes + */ +typedef struct blkptr { + dva_t blk_dva[3]; /* 128-bit Data Virtual Address */ + grub_uint64_t blk_prop; /* size, compression, type, etc */ + grub_uint64_t blk_pad[3]; /* Extra space for the future */ + grub_uint64_t blk_birth; /* transaction group at birth */ + grub_uint64_t blk_fill; /* fill count */ + zio_cksum_t blk_cksum; /* 256-bit checksum */ +} blkptr_t; + +#define SPA_BLKPTRSHIFT 7 /* blkptr_t is 128 bytes */ +#define SPA_DVAS_PER_BP 3 /* Number of DVAs in a bp */ + +/* + * Macros to get and set fields in a bp or DVA. + */ +#define DVA_GET_ASIZE(dva) \ + BF64_GET_SB((dva)->dva_word[0], 0, 24, SPA_MINBLOCKSHIFT, 0) +#define DVA_SET_ASIZE(dva, x) \ + BF64_SET_SB((dva)->dva_word[0], 0, 24, SPA_MINBLOCKSHIFT, 0, x) + +#define DVA_GET_GRID(dva) BF64_GET((dva)->dva_word[0], 24, 8) +#define DVA_SET_GRID(dva, x) BF64_SET((dva)->dva_word[0], 24, 8, x) + +#define DVA_GET_VDEV(dva) BF64_GET((dva)->dva_word[0], 32, 32) +#define DVA_SET_VDEV(dva, x) BF64_SET((dva)->dva_word[0], 32, 32, x) + +#define DVA_GET_GANG(dva) BF64_GET((dva)->dva_word[1], 63, 1) +#define DVA_SET_GANG(dva, x) BF64_SET((dva)->dva_word[1], 63, 1, x) + +#define BP_GET_LSIZE(bp) \ + (BP_IS_HOLE(bp) ? 0 : \ + BF64_GET_SB((bp)->blk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1)) +#define BP_SET_LSIZE(bp, x) \ + BF64_SET_SB((bp)->blk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1, x) + +#define BP_GET_COMPRESS(bp) BF64_GET((bp)->blk_prop, 32, 8) +#define BP_SET_COMPRESS(bp, x) BF64_SET((bp)->blk_prop, 32, 8, x) + +#define BP_GET_CHECKSUM(bp) BF64_GET((bp)->blk_prop, 40, 8) +#define BP_SET_CHECKSUM(bp, x) BF64_SET((bp)->blk_prop, 40, 8, x) + +#define BP_GET_TYPE(bp) BF64_GET((bp)->blk_prop, 48, 8) +#define BP_SET_TYPE(bp, x) BF64_SET((bp)->blk_prop, 48, 8, x) + +#define BP_GET_LEVEL(bp) BF64_GET((bp)->blk_prop, 56, 5) +#define BP_SET_LEVEL(bp, x) BF64_SET((bp)->blk_prop, 56, 5, x) + +#define BP_GET_BYTEORDER(bp) (0 - BF64_GET((bp)->blk_prop, 63, 1)) +#define BP_SET_BYTEORDER(bp, x) BF64_SET((bp)->blk_prop, 63, 1, x) + +#define BP_GET_ASIZE(bp) \ + (DVA_GET_ASIZE(&(bp)->blk_dva[0]) + DVA_GET_ASIZE(&(bp)->blk_dva[1]) + \ + DVA_GET_ASIZE(&(bp)->blk_dva[2])) + +#define BP_GET_UCSIZE(bp) \ + ((BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata) ? \ + BP_GET_PSIZE(bp) : BP_GET_LSIZE(bp)); + +#define BP_GET_NDVAS(bp) \ + (!!DVA_GET_ASIZE(&(bp)->blk_dva[0]) + \ + !!DVA_GET_ASIZE(&(bp)->blk_dva[1]) + \ + !!DVA_GET_ASIZE(&(bp)->blk_dva[2])) + +#define BP_COUNT_GANG(bp) \ + (DVA_GET_GANG(&(bp)->blk_dva[0]) + \ + DVA_GET_GANG(&(bp)->blk_dva[1]) + \ + DVA_GET_GANG(&(bp)->blk_dva[2])) + +#define DVA_EQUAL(dva1, dva2) \ + ((dva1)->dva_word[1] == (dva2)->dva_word[1] && \ + (dva1)->dva_word[0] == (dva2)->dva_word[0]) + +#define ZIO_CHECKSUM_EQUAL(zc1, zc2) \ + (0 == (((zc1).zc_word[0] - (zc2).zc_word[0]) | \ + ((zc1).zc_word[1] - (zc2).zc_word[1]) | \ + ((zc1).zc_word[2] - (zc2).zc_word[2]) | \ + ((zc1).zc_word[3] - (zc2).zc_word[3]))) + + +#define DVA_IS_VALID(dva) (DVA_GET_ASIZE(dva) != 0) + +#define ZIO_SET_CHECKSUM(zcp, w0, w1, w2, w3) \ +{ \ + (zcp)->zc_word[0] = w0; \ + (zcp)->zc_word[1] = w1; \ + (zcp)->zc_word[2] = w2; \ + (zcp)->zc_word[3] = w3; \ +} + +#define BP_IDENTITY(bp) (&(bp)->blk_dva[0]) +#define BP_IS_GANG(bp) DVA_GET_GANG(BP_IDENTITY(bp)) +#define BP_IS_HOLE(bp) ((bp)->blk_birth == 0) +#define BP_IS_OLDER(bp, txg) (!BP_IS_HOLE(bp) && (bp)->blk_birth < (txg)) + +#define BP_ZERO(bp) \ +{ \ + (bp)->blk_dva[0].dva_word[0] = 0; \ + (bp)->blk_dva[0].dva_word[1] = 0; \ + (bp)->blk_dva[1].dva_word[0] = 0; \ + (bp)->blk_dva[1].dva_word[1] = 0; \ + (bp)->blk_dva[2].dva_word[0] = 0; \ + (bp)->blk_dva[2].dva_word[1] = 0; \ + (bp)->blk_prop = 0; \ + (bp)->blk_pad[0] = 0; \ + (bp)->blk_pad[1] = 0; \ + (bp)->blk_pad[2] = 0; \ + (bp)->blk_birth = 0; \ + (bp)->blk_fill = 0; \ + ZIO_SET_CHECKSUM(&(bp)->blk_cksum, 0, 0, 0, 0); \ +} + +#define BP_SPRINTF_LEN 320 + +#endif /* ! GRUB_ZFS_SPA_HEADER */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/dmu.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/dmu.h @@ -0,0 +1,105 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_DMU_H +#define _SYS_DMU_H + +/* + * This file describes the interface that the DMU provides for its + * consumers. + * + * The DMU also interacts with the SPA. That interface is described in + * dmu_spa.h. + */ +typedef enum dmu_object_type { + DMU_OT_NONE, + /* general: */ + DMU_OT_OBJECT_DIRECTORY, /* ZAP */ + DMU_OT_OBJECT_ARRAY, /* UINT64 */ + DMU_OT_PACKED_NVLIST, /* UINT8 (XDR by nvlist_pack/unpack) */ + DMU_OT_PACKED_NVLIST_SIZE, /* UINT64 */ + DMU_OT_BPLIST, /* UINT64 */ + DMU_OT_BPLIST_HDR, /* UINT64 */ + /* spa: */ + DMU_OT_SPACE_MAP_HEADER, /* UINT64 */ + DMU_OT_SPACE_MAP, /* UINT64 */ + /* zil: */ + DMU_OT_INTENT_LOG, /* UINT64 */ + /* dmu: */ + DMU_OT_DNODE, /* DNODE */ + DMU_OT_OBJSET, /* OBJSET */ + /* dsl: */ + DMU_OT_DSL_DIR, /* UINT64 */ + DMU_OT_DSL_DIR_CHILD_MAP, /* ZAP */ + DMU_OT_DSL_DS_SNAP_MAP, /* ZAP */ + DMU_OT_DSL_PROPS, /* ZAP */ + DMU_OT_DSL_DATASET, /* UINT64 */ + /* zpl: */ + DMU_OT_ZNODE, /* ZNODE */ + DMU_OT_ACL, /* ACL */ + DMU_OT_PLAIN_FILE_CONTENTS, /* UINT8 */ + DMU_OT_DIRECTORY_CONTENTS, /* ZAP */ + DMU_OT_MASTER_NODE, /* ZAP */ + DMU_OT_UNLINKED_SET, /* ZAP */ + /* zvol: */ + DMU_OT_ZVOL, /* UINT8 */ + DMU_OT_ZVOL_PROP, /* ZAP */ + /* other; for testing only! */ + DMU_OT_PLAIN_OTHER, /* UINT8 */ + DMU_OT_UINT64_OTHER, /* UINT64 */ + DMU_OT_ZAP_OTHER, /* ZAP */ + /* new object types: */ + DMU_OT_ERROR_LOG, /* ZAP */ + DMU_OT_SPA_HISTORY, /* UINT8 */ + DMU_OT_SPA_HISTORY_OFFSETS, /* spa_his_phys_t */ + DMU_OT_POOL_PROPS, /* ZAP */ + + DMU_OT_NUMTYPES +} dmu_object_type_t; + +typedef enum dmu_objset_type { + DMU_OST_NONE, + DMU_OST_META, + DMU_OST_ZFS, + DMU_OST_ZVOL, + DMU_OST_OTHER, /* For testing only! */ + DMU_OST_ANY, /* Be careful! */ + DMU_OST_NUMTYPES +} dmu_objset_type_t; + +/* + * The names of zap entries in the DIRECTORY_OBJECT of the MOS. + */ +#define DMU_POOL_DIRECTORY_OBJECT 1 +#define DMU_POOL_CONFIG "config" +#define DMU_POOL_ROOT_DATASET "root_dataset" +#define DMU_POOL_SYNC_BPLIST "sync_bplist" +#define DMU_POOL_ERRLOG_SCRUB "errlog_scrub" +#define DMU_POOL_ERRLOG_LAST "errlog_last" +#define DMU_POOL_SPARES "spares" +#define DMU_POOL_DEFLATE "deflate" +#define DMU_POOL_HISTORY "history" +#define DMU_POOL_PROPS "pool_props" +#define DMU_POOL_L2CACHE "l2cache" + +#endif /* _SYS_DMU_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/dsl_dir.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/dsl_dir.h @@ -0,0 +1,49 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_DSL_DIR_H +#define _SYS_DSL_DIR_H + +typedef struct dsl_dir_phys { + grub_uint64_t dd_creation_time; /* not actually used */ + grub_uint64_t dd_head_dataset_obj; + grub_uint64_t dd_parent_obj; + grub_uint64_t dd_clone_parent_obj; + grub_uint64_t dd_child_dir_zapobj; + /* + * how much space our children are accounting for; for leaf + * datasets, == physical space used by fs + snaps + */ + grub_uint64_t dd_used_bytes; + grub_uint64_t dd_compressed_bytes; + grub_uint64_t dd_uncompressed_bytes; + /* Administrative quota setting */ + grub_uint64_t dd_quota; + /* Administrative reservation setting */ + grub_uint64_t dd_reserved; + grub_uint64_t dd_props_zapobj; + grub_uint64_t dd_deleg_zapobj; /* dataset permissions */ + grub_uint64_t dd_pad[20]; /* pad out to 256 bytes for good measure */ +} dsl_dir_phys_t; + +#endif /* _SYS_DSL_DIR_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/uberblock_impl.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/uberblock_impl.h @@ -0,0 +1,61 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_UBERBLOCK_IMPL_H +#define _SYS_UBERBLOCK_IMPL_H + +/* + * The uberblock version is incremented whenever an incompatible on-disk + * format change is made to the SPA, DMU, or ZAP. + * + * Note: the first two fields should never be moved. When a storage pool + * is opened, the uberblock must be read off the disk before the version + * can be checked. If the ub_version field is moved, we may not detect + * version mismatch. If the ub_magic field is moved, applications that + * expect the magic number in the first word won't work. + */ +#define UBERBLOCK_MAGIC 0x00bab10c /* oo-ba-bloc! */ +#define UBERBLOCK_SHIFT 10 /* up to 1K */ + +typedef struct uberblock { + grub_uint64_t ub_magic; /* UBERBLOCK_MAGIC */ + grub_uint64_t ub_version; /* ZFS_VERSION */ + grub_uint64_t ub_txg; /* txg of last sync */ + grub_uint64_t ub_guid_sum; /* sum of all vdev guids */ + grub_uint64_t ub_timestamp; /* UTC time of last sync */ + blkptr_t ub_rootbp; /* MOS objset_phys_t */ +} uberblock_t; + +#define UBERBLOCK_SIZE (1ULL << UBERBLOCK_SHIFT) +#define VDEV_UBERBLOCK_SHIFT UBERBLOCK_SHIFT + +/* XXX Uberblock_phys_t is no longer in the kernel zfs */ +typedef struct uberblock_phys { + uberblock_t ubp_uberblock; + char ubp_pad[UBERBLOCK_SIZE - sizeof (uberblock_t) - + sizeof (zio_block_tail_t)]; + zio_block_tail_t ubp_zbt; +} uberblock_phys_t; + + +#endif /* _SYS_UBERBLOCK_IMPL_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zil.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zil.h @@ -0,0 +1,51 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_ZIL_H +#define _SYS_ZIL_H + +/* + * Intent log format: + * + * Each objset has its own intent log. The log header (zil_header_t) + * for objset N's intent log is kept in the Nth object of the SPA's + * intent_log objset. The log header points to a chain of log blocks, + * each of which contains log records (i.e., transactions) followed by + * a log block trailer (zil_trailer_t). The format of a log record + * depends on the record (or transaction) type, but all records begin + * with a common structure that defines the type, length, and txg. + */ + +/* + * Intent log header - this on disk structure holds fields to manage + * the log. All fields are 64 bit to easily handle cross architectures. + */ +typedef struct zil_header { + grub_uint64_t zh_claim_txg; /* txg in which log blocks were claimed */ + grub_uint64_t zh_replay_seq; /* highest replayed sequence number */ + blkptr_t zh_log; /* log chain */ + grub_uint64_t zh_claim_seq; /* highest claimed sequence number */ + grub_uint64_t zh_pad[5]; +} zil_header_t; + +#endif /* _SYS_ZIL_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zfs_acl.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zfs_acl.h @@ -0,0 +1,60 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_FS_ZFS_ACL_H +#define _SYS_FS_ZFS_ACL_H + +#ifndef _UID_T +#define _UID_T +typedef unsigned int uid_t; /* UID type */ +#endif /* _UID_T */ + +typedef struct zfs_oldace { + grub_uint32_t z_fuid; /* "who" */ + grub_uint32_t z_access_mask; /* access mask */ + grub_uint16_t z_flags; /* flags, i.e inheritance */ + grub_uint16_t z_type; /* type of entry allow/deny */ +} zfs_oldace_t; + +#define ACE_SLOT_CNT 6 + +typedef struct zfs_znode_acl_v0 { + grub_uint64_t z_acl_extern_obj; /* ext acl pieces */ + grub_uint32_t z_acl_count; /* Number of ACEs */ + grub_uint16_t z_acl_version; /* acl version */ + grub_uint16_t z_acl_pad; /* pad */ + zfs_oldace_t z_ace_data[ACE_SLOT_CNT]; /* 6 standard ACEs */ +} zfs_znode_acl_v0_t; + +#define ZFS_ACE_SPACE (sizeof (zfs_oldace_t) * ACE_SLOT_CNT) + +typedef struct zfs_znode_acl { + grub_uint64_t z_acl_extern_obj; /* ext acl pieces */ + grub_uint32_t z_acl_size; /* Number of bytes in ACL */ + grub_uint16_t z_acl_version; /* acl version */ + grub_uint16_t z_acl_count; /* ace count */ + grub_uint8_t z_ace_data[ZFS_ACE_SPACE]; /* space for embedded ACEs */ +} zfs_znode_acl_t; + + +#endif /* _SYS_FS_ZFS_ACL_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zap_impl.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zap_impl.h @@ -0,0 +1,110 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_ZAP_IMPL_H +#define _SYS_ZAP_IMPL_H + +#define ZAP_MAGIC 0x2F52AB2ABULL + +#define ZAP_HASHBITS 28 +#define MZAP_ENT_LEN 64 +#define MZAP_NAME_LEN (MZAP_ENT_LEN - 8 - 4 - 2) +#define MZAP_MAX_BLKSHIFT SPA_MAXBLOCKSHIFT +#define MZAP_MAX_BLKSZ (1 << MZAP_MAX_BLKSHIFT) + +typedef struct mzap_ent_phys { + grub_uint64_t mze_value; + grub_uint32_t mze_cd; + grub_uint16_t mze_pad; /* in case we want to chain them someday */ + char mze_name[MZAP_NAME_LEN]; +} mzap_ent_phys_t; + +typedef struct mzap_phys { + grub_uint64_t mz_block_type; /* ZBT_MICRO */ + grub_uint64_t mz_salt; + grub_uint64_t mz_pad[6]; + mzap_ent_phys_t mz_chunk[1]; + /* actually variable size depending on block size */ +} mzap_phys_t; + +/* + * The (fat) zap is stored in one object. It is an array of + * 1<= 6] [zap_leaf_t] [ptrtbl] ... + * + */ + +#define ZBT_LEAF ((1ULL << 63) + 0) +#define ZBT_HEADER ((1ULL << 63) + 1) +#define ZBT_MICRO ((1ULL << 63) + 3) +/* any other values are ptrtbl blocks */ + +/* + * the embedded pointer table takes up half a block: + * block size / entry size (2^3) / 2 + */ +#define ZAP_EMBEDDED_PTRTBL_SHIFT(zap) (FZAP_BLOCK_SHIFT(zap) - 3 - 1) + +/* + * The embedded pointer table starts half-way through the block. Since + * the pointer table itself is half the block, it starts at (64-bit) + * word number (1<zap_f.zap_phys) \ + [(idx) + (1< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Use is subject to license terms. + */ + +#ifndef GRUB_ZFS_HEADER +#define GRUB_ZFS_HEADER 1 + +#include +#include + +/* + * On-disk version number. + */ +#define SPA_VERSION 14ULL + +/* + * The following are configuration names used in the nvlist describing a pool's + * configuration. + */ +#define ZPOOL_CONFIG_VERSION "version" +#define ZPOOL_CONFIG_POOL_NAME "name" +#define ZPOOL_CONFIG_POOL_STATE "state" +#define ZPOOL_CONFIG_POOL_TXG "txg" +#define ZPOOL_CONFIG_POOL_GUID "pool_guid" +#define ZPOOL_CONFIG_CREATE_TXG "create_txg" +#define ZPOOL_CONFIG_TOP_GUID "top_guid" +#define ZPOOL_CONFIG_VDEV_TREE "vdev_tree" +#define ZPOOL_CONFIG_TYPE "type" +#define ZPOOL_CONFIG_CHILDREN "children" +#define ZPOOL_CONFIG_ID "id" +#define ZPOOL_CONFIG_GUID "guid" +#define ZPOOL_CONFIG_PATH "path" +#define ZPOOL_CONFIG_DEVID "devid" +#define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array" +#define ZPOOL_CONFIG_METASLAB_SHIFT "metaslab_shift" +#define ZPOOL_CONFIG_ASHIFT "ashift" +#define ZPOOL_CONFIG_ASIZE "asize" +#define ZPOOL_CONFIG_DTL "DTL" +#define ZPOOL_CONFIG_STATS "stats" +#define ZPOOL_CONFIG_WHOLE_DISK "whole_disk" +#define ZPOOL_CONFIG_ERRCOUNT "error_count" +#define ZPOOL_CONFIG_NOT_PRESENT "not_present" +#define ZPOOL_CONFIG_SPARES "spares" +#define ZPOOL_CONFIG_IS_SPARE "is_spare" +#define ZPOOL_CONFIG_NPARITY "nparity" +#define ZPOOL_CONFIG_PHYS_PATH "phys_path" +#define ZPOOL_CONFIG_L2CACHE "l2cache" +/* + * The persistent vdev state is stored as separate values rather than a single + * 'vdev_state' entry. This is because a device can be in multiple states, such + * as offline and degraded. + */ +#define ZPOOL_CONFIG_OFFLINE "offline" +#define ZPOOL_CONFIG_FAULTED "faulted" +#define ZPOOL_CONFIG_DEGRADED "degraded" +#define ZPOOL_CONFIG_REMOVED "removed" + +#define VDEV_TYPE_ROOT "root" +#define VDEV_TYPE_MIRROR "mirror" +#define VDEV_TYPE_REPLACING "replacing" +#define VDEV_TYPE_RAIDZ "raidz" +#define VDEV_TYPE_DISK "disk" +#define VDEV_TYPE_FILE "file" +#define VDEV_TYPE_MISSING "missing" +#define VDEV_TYPE_SPARE "spare" +#define VDEV_TYPE_L2CACHE "l2cache" + +/* + * pool state. The following states are written to disk as part of the normal + * SPA lifecycle: ACTIVE, EXPORTED, DESTROYED, SPARE, L2CACHE. The remaining + * states are software abstractions used at various levels to communicate pool + * state. + */ +typedef enum pool_state { + POOL_STATE_ACTIVE = 0, /* In active use */ + POOL_STATE_EXPORTED, /* Explicitly exported */ + POOL_STATE_DESTROYED, /* Explicitly destroyed */ + POOL_STATE_SPARE, /* Reserved for hot spare use */ + POOL_STATE_L2CACHE, /* Level 2 ARC device */ + POOL_STATE_UNINITIALIZED, /* Internal spa_t state */ + POOL_STATE_UNAVAIL, /* Internal libzfs state */ + POOL_STATE_POTENTIALLY_ACTIVE /* Internal libzfs state */ +} pool_state_t; + +struct grub_zfs_data; + +grub_err_t grub_zfs_fetch_nvlist (grub_device_t dev, char **nvlist); +grub_err_t grub_zfs_getmdnobj (grub_device_t dev, const char *fsfilename, + grub_uint64_t *mdnobj); + +char *grub_zfs_nvlist_lookup_string (char *nvlist, char *name); +char *grub_zfs_nvlist_lookup_nvlist (char *nvlist, char *name); +int grub_zfs_nvlist_lookup_uint64 (char *nvlist, char *name, + grub_uint64_t *out); +char *grub_zfs_nvlist_lookup_nvlist_array (char *nvlist, char *name, + grub_size_t index); +int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (char *nvlist, char *name); + +#endif /* ! GRUB_ZFS_HEADER */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zfs_znode.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zfs_znode.h @@ -0,0 +1,70 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_FS_ZFS_ZNODE_H +#define _SYS_FS_ZFS_ZNODE_H + +#include + +#define MASTER_NODE_OBJ 1 +#define ZFS_ROOT_OBJ "ROOT" +#define ZPL_VERSION_STR "VERSION" + +#define ZPL_VERSION 3ULL + +#define ZFS_DIRENT_OBJ(de) BF64_GET(de, 0, 48) + +/* + * This is the persistent portion of the znode. It is stored + * in the "bonus buffer" of the file. Short symbolic links + * are also stored in the bonus buffer. + */ +typedef struct znode_phys { + grub_uint64_t zp_atime[2]; /* 0 - last file access time */ + grub_uint64_t zp_mtime[2]; /* 16 - last file modification time */ + grub_uint64_t zp_ctime[2]; /* 32 - last file change time */ + grub_uint64_t zp_crtime[2]; /* 48 - creation time */ + grub_uint64_t zp_gen; /* 64 - generation (txg of creation) */ + grub_uint64_t zp_mode; /* 72 - file mode bits */ + grub_uint64_t zp_size; /* 80 - size of file */ + grub_uint64_t zp_parent; /* 88 - directory parent (`..') */ + grub_uint64_t zp_links; /* 96 - number of links to file */ + grub_uint64_t zp_xattr; /* 104 - DMU object for xattrs */ + grub_uint64_t zp_rdev; /* 112 - dev_t for VBLK & VCHR files */ + grub_uint64_t zp_flags; /* 120 - persistent flags */ + grub_uint64_t zp_uid; /* 128 - file owner */ + grub_uint64_t zp_gid; /* 136 - owning group */ + grub_uint64_t zp_pad[4]; /* 144 - future */ + zfs_znode_acl_t zp_acl; /* 176 - 263 ACL */ + /* + * Data may pad out any remaining bytes in the znode buffer, eg: + * + * |<---------------------- dnode_phys (512) ------------------------>| + * |<-- dnode (192) --->|<----------- "bonus" buffer (320) ---------->| + * |<---- znode (264) ---->|<---- data (56) ---->| + * + * At present, we only use this space to store symbolic links. + */ +} znode_phys_t; + +#endif /* _SYS_FS_ZFS_ZNODE_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/dnode.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/dnode.h @@ -0,0 +1,78 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_DNODE_H +#define _SYS_DNODE_H + +#include + +/* + * Fixed constants. + */ +#define DNODE_SHIFT 9 /* 512 bytes */ +#define DN_MIN_INDBLKSHIFT 10 /* 1k */ +#define DN_MAX_INDBLKSHIFT 14 /* 16k */ +#define DNODE_BLOCK_SHIFT 14 /* 16k */ +#define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ +#define DN_MAX_OBJECT_SHIFT 48 /* 256 trillion (zfs_fid_t limit) */ +#define DN_MAX_OFFSET_SHIFT 64 /* 2^64 bytes in a dnode */ + +/* + * Derived constants. + */ +#define DNODE_SIZE (1 << DNODE_SHIFT) +#define DN_MAX_NBLKPTR ((DNODE_SIZE - DNODE_CORE_SIZE) >> SPA_BLKPTRSHIFT) +#define DN_MAX_BONUSLEN (DNODE_SIZE - DNODE_CORE_SIZE - (1 << SPA_BLKPTRSHIFT)) +#define DN_MAX_OBJECT (1ULL << DN_MAX_OBJECT_SHIFT) + +#define DNODES_PER_BLOCK_SHIFT (DNODE_BLOCK_SHIFT - DNODE_SHIFT) +#define DNODES_PER_BLOCK (1ULL << DNODES_PER_BLOCK_SHIFT) +#define DNODES_PER_LEVEL_SHIFT (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT) + +#define DN_BONUS(dnp) ((void*)((dnp)->dn_bonus + \ + (((dnp)->dn_nblkptr - 1) * sizeof (blkptr_t)))) + +typedef struct dnode_phys { + grub_uint8_t dn_type; /* dmu_object_type_t */ + grub_uint8_t dn_indblkshift; /* ln2(indirect block size) */ + grub_uint8_t dn_nlevels; /* 1=dn_blkptr->data blocks */ + grub_uint8_t dn_nblkptr; /* length of dn_blkptr */ + grub_uint8_t dn_bonustype; /* type of data in bonus buffer */ + grub_uint8_t dn_checksum; /* ZIO_CHECKSUM type */ + grub_uint8_t dn_compress; /* ZIO_COMPRESS type */ + grub_uint8_t dn_flags; /* DNODE_FLAG_* */ + grub_uint16_t dn_datablkszsec; /* data block size in 512b sectors */ + grub_uint16_t dn_bonuslen; /* length of dn_bonus */ + grub_uint8_t dn_pad2[4]; + + /* accounting is protected by dn_dirty_mtx */ + grub_uint64_t dn_maxblkid; /* largest allocated block ID */ + grub_uint64_t dn_used; /* bytes (or sectors) of disk space */ + + grub_uint64_t dn_pad3[4]; + + blkptr_t dn_blkptr[1]; + grub_uint8_t dn_bonus[DN_MAX_BONUSLEN]; +} dnode_phys_t; + +#endif /* _SYS_DNODE_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/dmu_objset.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/dmu_objset.h @@ -0,0 +1,37 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_DMU_OBJSET_H +#define _SYS_DMU_OBJSET_H + +#include + +typedef struct objset_phys { + dnode_phys_t os_meta_dnode; + zil_header_t os_zil_header; + grub_uint64_t os_type; + char os_pad[1024 - sizeof (dnode_phys_t) - sizeof (zil_header_t) - + sizeof (grub_uint64_t)]; +} objset_phys_t; + +#endif /* _SYS_DMU_OBJSET_H */ --- grub2-1.98.orig/debian/grub-extras/zfs/include/grub/zfs/zio_checksum.h +++ grub2-1.98/debian/grub-extras/zfs/include/grub/zfs/zio_checksum.h @@ -0,0 +1,50 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_ZIO_CHECKSUM_H +#define _SYS_ZIO_CHECKSUM_H + +/* + * Signature for checksum functions. + */ +typedef void zio_checksum_t(const void *data, grub_uint64_t size, + grub_zfs_endian_t endian, zio_cksum_t *zcp); + +/* + * Information about each checksum function. + */ +typedef struct zio_checksum_info { + zio_checksum_t *ci_func; /* checksum function for each byteorder */ + int ci_correctable; /* number of correctable bits */ + int ci_zbt; /* uses zio block tail? */ + char *ci_name; /* descriptive name */ +} zio_checksum_info_t; + +extern void zio_checksum_SHA256 (const void *, grub_uint64_t, + grub_zfs_endian_t endian, zio_cksum_t *); +extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian, + zio_cksum_t *); +extern void fletcher_4 (const void *, grub_uint64_t, grub_zfs_endian_t endian, + zio_cksum_t *); + +#endif /* _SYS_ZIO_CHECKSUM_H */ --- grub2-1.98.orig/debian/grub-extras/ntldr-img/COPYING +++ grub2-1.98/debian/grub-extras/ntldr-img/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. --- grub2-1.98.orig/debian/grub-extras/ntldr-img/utils.h +++ grub2-1.98/debian/grub-extras/ntldr-img/utils.h @@ -0,0 +1,59 @@ +/* + * GRUB Utilities -- Utilities for GRUB Legacy, GRUB2 and GRUB for DOS + * Copyright (C) 2007 Bean (bean123@126.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __UTILS_H +#define __UTILS_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#define MAX_DISKS 10 +#define MAX_PARTS 30 + +#define FST_OTHER 0 +#define FST_MBR 1 +#define FST_FAT16 2 +#define FST_FAT32 3 +#define FST_NTFS 4 +#define FST_EXT2 5 + +typedef struct { + unsigned char cur; // Current partition number + unsigned char nxt; // Next partition number + unsigned char dfs; // File system flag + unsigned char pad; // Padding + unsigned long bse; // Partition start address + unsigned long len; // Partition length + unsigned long ebs; // Base address for the extended partition +} xde_t; + +#define valueat(buf,ofs,type) *((type*)(((char*)&buf)+ofs)) + +extern int mbr_nhd, mbr_spt; +int go_sect(int,unsigned long); +int xd_enum(int,xde_t*); +int get_fstype(unsigned char*); +char* fst2str(int); +char* dfs2str(int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif +#endif /* __UTILS_H */ --- grub2-1.98.orig/debian/grub-extras/ntldr-img/grldrstart.S +++ grub2-1.98/debian/grub-extras/ntldr-img/grldrstart.S @@ -0,0 +1,5753 @@ +/* + * grldrstart.S -- Startup code for GRLDR + * Copyright (C) 2004-2007 Tinybit(tinybit@tom.com) + * Copyright (C) 2007 Bean(bean@windrv.net) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * This program is used to generate the GRLDR file. + * + * Use the following shell command to generate the GRLDR file: + * + * cat grldrstart pre_stage2 > grldr + * + */ + +#ifndef STAGE1_5 +//#include +#else +#error cannot compile with STAGE1_5 +#endif + +#ifdef GRLDR_MBR + .file "mbrstart.S" +#elif defined(GRLDR_INSTALL) + .file "bootlacestart.S" +#else + .file "grldrstart.S" +#endif + +#ifdef GRLDR_INSTALL + //.data +#else + .text + + .globl start, _start + +start: +_start: +#endif + +_start1: + + /* Tell GAS to generate 16-bit real mode instructions */ + + .code16 + + . = _start1 + 0x00 + + /* 1 byte at offset 0x00 will be overwritten for the EBIOS indicator + * later. This is safe because the jmp instruction only get executed + * once. The write happens after the jmp instruction have got + * executed. + * + * The value written would be 0x42 for EBIOS present(LBA) and 0x02 + * for non-present(CHS). + * + */ + + /* No cli, we use stack! BIOS or caller usually sets SS:SP=0000:0400 */ + + jmp 1f /* FAT32/NTFS routine comes to offset 0 */ + + . = _start1 + 0x02 + + .byte 0x80 /* bit0=1: disable GRLDR search on floppy */ + /* bit1=1: disable the boot of the previous MBR with + * invalid partition table */ + /* bit2=1: disable the feature of unconditional + * entrance to the command-line */ + /* bit7=1: disable the boot of the previous MBR prior + to the search for GRLDR */ + + /* GRLDR.MBR uses offset 0x03 to indicate a timer counter. */ + + /* 0xff indicates waiting forever, + * other value specifies the time in seconds to wait */ + + . = _start1 + 0x03 + + .byte 5 + + /* a key press to wait. if AX returned from int16 equals this word, + * the desired action will occur. */ + + . = _start1 + 0x04 + + .word 0x3920 /* the space bar */ + + . = _start1 + 0x06 + + .byte 0xff /* preferred boot drive number, 0xff for no-drive(i.e., drive not defined) */ + .byte 0xff /* preferred partition number, 0xff for whole drive(a floppy that has no partition table) */ + + . = _start1 + 8 + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + /* filled in by mkisofs using the -boot-info-table option */ + +#;bi_pvd: .long 0xDEADBEEF /* LBA of primary volume descript */ +#;bi_file: .long 0xDEADBEEF /* LBA of boot file */ +#;bi_length: .long 0xDEADBEEF /* Length of boot file */ +#;bi_csum: .long 0xDEADBEEF /* Checksum of boot file */ +#;bi_reserved: .space (10*4) /* Reserved */ + + . = _start1 + 0x40 + +#else + + /* filled in with BPB in case the drive(typically USB) is treated as floppy by buggy BIOSes */ + + . = _start1 + 0x60 + +#endif /* ! defined(GRLDR_MBR) && (! defined(GRLDR_INSTALL)) */ + +1: + call 1f + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + . = _start1 + 0x43 + +#else + + . = _start1 + 0x63 + +#endif /* ! defined(GRLDR_MBR) && (! defined(GRLDR_INSTALL)) */ + +1: + popw %bx /* Instruction Pointer of 1b */ + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + subw $(1b - _start1), %bx /* CS:BX=_start1 */ + +#else + + subw $(1b - _start1), %bx /* CS:BX=_start1 */ + +#endif /* ! defined(GRLDR_MBR) && (! defined(GRLDR_INSTALL)) */ + + shrw $4, %bx + movw %cs, %ax + addw %ax, %bx /* BX:0000=_start1 */ + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + /* we are booted from BOOT.INI, or whole GRLDR image already loaded */ + + pushw %bx /* BX:0000=_start1 */ + addw $((grldr_signature - _start1 + 4 + STAGE2_SIZE - 4) >> 4), %bx + movw %bx, %ds + + cmpl $0xCE1A02B0, ((STAGE2_SIZE - 4) & 0x0F) + popw %ds /* DS:0000=_start1 */ + je grldr_real_start /* whole image loaded. boot it! */ + + /* bad! we might be loaded by a buggy BIOS with a no-emulation-mode + * bootable CD. The buggy BIOS might load only 1 CD-ROM sector(2048 + * bytes) of our grldr image. So we need this check. + */ + + /* Our cdrom_check code begins at 0x1BE and overlaps the partition + * table. Just in case someone replace it with a partition table and + * use this sector as an MBR, we do this additional test for safety. + */ + + /* We should avoid using opcode 0x00 and 0x80 at cdrom_check. */ + + /* Note that if cdrom_check code is present, then we are booting from + * no-emulation mode cdrom. + */ + + testb $0x7F, cdrom_check - _start1 /* is it 0x00 or 0x80? */ + jz 1f /* yes, cdrom_check not found */ + call cdrom_check /* no, cdrom_check is present */ +1: + /* DS:0000=_start1 */ + + /* Let CS:0000=_start1 */ + pushw %ds + + #;pushw $(1f - _start1) + .byte 0x6A, (1f - _start1) + + lret + . = . - (. - _start1) / 0x80 +1: +#else + /* BX:0000=_start1 */ + + movw %bx, %ds + + /* Let CS:0000=_start1 */ + pushw %bx + + #;pushw $(1f - _start1) + .byte 0x6A, (1f - _start1) + + lret + . = . - (. - _start1) / 0x80 +1: + testb $0x04, 0x02 + jz 1f + + /* set the DUCE indicator */ + xorw %ax, %ax + movw %ax, %es + movw $0x5FC, %di + movl $0x45435544, %eax + stosl +1: +#endif + + /* CS:0000=DS:0000=_start1 */ + + /* we are loaded by BIOS or another boot loader */ + +#define GRLDR_CS 0x2000 /* grldr code segment */ + /* hope this segment never be used by all */ + /* subsequent partition boot records */ +#if 0 + /* for single sector boot record */ +#define MONITOR 0x7e10 +#else + /* for 4-sector NTFS boot record */ +#define MONITOR 0x8410 +#endif + +// cli + pushw $GRLDR_CS + popw %ss + movw $0x9000, %sp /* SS:SP=0x9d000, keep away from EBDA data */ +// sti + + /* Extended BIOS Data Area should not take up space below 0x9d000 */ + + /* + * 0x07c00-0x07dff This sector. Another boot loader load us here + * 0x0d000-0x14dff partition/floppy boot track(bootsector,etc) + * 0x94000-0x9bdff master boot track(MBR,etc,usually 63 sectors) + * 0x9be00-0x9c3ff 3 sectors for temp extended partition entries + * 0x9c400-0x9cfff 6 sectors for stack + */ + +#define FS_BOOT 0xd00 /* segment of partition boot track */ + + xorw %cx, %cx + pushw %cx /* CX=0 */ + movw $0x0080, %dx + pushw %dx + movb $8, %ah /* read drive parameters changes DX,ES,DI */ + stc + int $0x13 + popw %dx + popw %ax /* AX=0 */ + + pushw %ss /* SS=0x9400 */ + popw %es /* ES=0x9400 */ + + jc Error1 + + andb $63, %cl /* AL=sectors per track, CF cleared */ + + stc + jz Error1 + + xchgw %ax, %cx /* this moves CL to AL, and CX=0 */ + movb $0x02, %ah + movw %ax, %bp /* save AX to BP: read 1 track */ + xorw %bx, %bx /* ES already has a known value of 0x9400 */ + incw %cx + pushw %dx + stc + int $0x13 /* read master boot track to ES:0000 */ + popw %dx + jc Error1 + negb %ah /* set CF=1 if non-zero */ +Error1: + pushw %cs /* DS=0 */ + popw %ds /* DS=CS */ + pushfw /* CF=1 on error */ + + /* CS=DS=old segment. ES=SS=new segment. */ + + /* Move the code and error messages from DS:0000 to 9400:0000, do not + * touch the partition table + */ + xorw %si, %si + xorw %di, %di + movw $223, %cx /* 223 words = 446 bytes = 0x1be bytes */ + cld + repz movsw /* SI=DI=0x1be, CX=0 */ + + movw $(grldr_signature - _start1), %bx + + /* if the boot loader has loaded more than one sector, we use them */ + movl $0xAA555247, %eax /* "GR" 0x55 0xAA */ +//#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + cmpl %eax, (%bx) /* DS=old segment! */ + jne 1f + + /* The MOVE_HELPER code is in the old segment! */ + + call move_helper /* SI=0x1be, CX=0 */ +1: +//#endif + + /* Jump to new segment! */ +#if 1 + ljmp $GRLDR_CS, $(1f - _start1) +#else + pushw %ss /* 0x9400 */ + + //pushw $(1f - _start1) + .byte 0x6A, (1f - _start1) + + lret + . = . - (. - _start1) / 0x80 +#endif +1: + + /* We are at the new segment. CS=ES=SS=new segment. */ + + /* But DS is still old segment. */ + + pushw %ss + popw %ds + + /* CS=DS=ES=SS=new segment. */ + + //movw $0x01be, %si + + /* check the existence of helper */ + cmpl %eax, (%bx) + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + jne Error_or_prev_MBR /* Missing helper */ + +#else + + je 1f + + /* try to load helper from floppy */ + + pushal + + movw 0x18, %ax /* BPB sectors per track at offset 0x18 */ + + cmpw $0x3F, %ax + ja 3f + + cmpb $((pre_stage2_start - _start1) >> 9), %al + jb 3f + + decw %ax /* skip the first sector already loaded */ + + movw $3, %di /* retry 3 times on read failure */ +2: + movb $2, %ah /* BIOS disk read */ + cwd /* DX=0 for floppy head 0 */ + movw $0x200, %bx /* ES:BX immediately follow this sector */ + movw $2, %cx /* skip the first sector already loaded */ + + pushaw + int $0x13 + popaw + + jnc 3f + + pushaw + xorw %ax, %ax + int $0x13 + popaw + + decw %di + jnz 2b +3: + popal + cmpl %eax, (%bx) /* helper loaded? */ + + jne Error_or_prev_MBR /* Missing helper */ + +1: +#endif + + popfw /* CF=1 on error */ + jc try_floppy /* harddisk (hd0) failed, try floppy (fd0) */ +1: + pushw %cs + popw %ds + lodsw + movb %ah, %dh /* head number */ + lodsw + movw %ax, %cx /* sector and cylinder number */ + andb $63, %al + //stc + jz helper_call_c + + /* use BP to calculate the sectors to read within 1 track */ + subw %bp, %ax + decw %ax /* decb %al */ + negb %al /* AL=sectors upto the end of the track */ +7: + movw $3, %di /* retry 3 times on read failure */ +2: + movb $2, %ah + pushw $FS_BOOT + popw %es /* ES=FS_BOOT */ + xorw %bx, %bx + + pushaw + int $0x13 /* read partition boot track to FS_BOOT:0000 */ + popaw + + jnc helper_call + + pushaw + xorw %ax, %ax + int $0x13 + popaw + + decw %di + jnz 2b + +helper_call_c: + + stc + +helper_call: + /* find GRLDR in this partition + * before the call: + * CF=1 : indicates an invalid or corrupt entry + * CF=0 : indicates a valid entry + * + * on return: + * CF=1 : means "below", try next entry + * CF=0,ZF=1 : means "equal", helper did nothing, so we need + * a further try to boot via NT bootsector + * CF=0,ZF=0 : means "above", helper succeeded, boot it now + */ + call helper_start /* change to jmp 6f if helper not present */ + ja filesystem_boot /* helper succeeded, directly boot it */ +6: + +add_sub_si: + + /* extended partition check routine will adjust this to + * + * 0x83, 0xEE, 0x04 for "subw $4, %si" + * + * or + * + * 0x83, 0xC6, 0xFC for "addw $-4, %si" + * + * so that SI keeps the value 0x1fe. + */ + addw $12, %si /* 0x83, 0xC6, 0x0C */ + + . = add_sub_si + 3 + + /* extended partition check routine will adjust the word 0x1fe at + * (add_sub_si + 5). The value 0x1ff or greater indicates there are + * entries need to be treated. The value 0x1fe indicates no entries + * left, and the floppy should be checked. + */ + + cmpw $0x01fe, %si /* 0x81, 0xFE, 0xfe, 0x01 */ + /* All entries checked done? */ + jb 1b /* No, check the next entry */ + ja 5f /* floppy already checked. Fail and hang */ + +try_floppy: + + movw $0x31b2, %si /* a value big enough */ + movb $0x08, %ah /* read drive parameters changes DX,ES,DI */ + cwd /* DL=0 for floppy */ + pushw %dx /* DX=0 */ + int $0x13 + popw %ax /* AX=0 */ + jc 5f /* floppy failure, issue "Error" and hang */ + cwd /* DX=0 */ + xchgw %ax, %cx /* this moves CL to AL, and CX=0 */ + andb $63, %al /* AL=sectors per track */ + jz 5f /* invalid value. floppy failure. hangs */ + //movw $1, %cx + incw %cx + jmp 7b + +5: +Error_or_prev_MBR: + + /* GRLDR not found, print "Error" or launch previous MBR */ + movw $(message_string - _start1), %si +Error2: + call print_message /* CS:SI points to message string */ +3: jmp 3b + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) +filesystem_boot: + /* The partition boot record successfully modified, just boot it */ + + /* + * The boot might fail, but we want to take back the control. + * So we save the registers now. + */ + pushw %ds + pushw %es + pushal + + /* DS=CS=GRLDR_CS, ES=FS_BOOT */ + + /* save GRLDR_CS */ + + movw %es, %bx # save old ES to BX + + cli + lgdt gdt - _start1 + movl %cr0, %eax + orb $1, %al + movl %eax, %cr0 + + movw $8, %si + movw %si, %es + + xorl %esi, %esi + xorl %edi, %edi + movl $(0x9000 / 4), %ecx + + cld + repz movsl + + movw $16, %si + movw %si, %es + + andb $0xfe, %al + movl %eax, %cr0 + + movw %bx, %es # restore ES from BX + + /* move FS_BOOT:0000 to 0:7c00 */ +#if 0 + /* for single sector boot record */ + movw $0x0200, %cx /* move 2 sectors, the old FS_BOOT:0000 will + * keep untouched. */ +#else + /* for 4-sector NTFS boot record */ + movw $0x0400, %cx /* move 4 sectors, the old FS_BOOT:0000 will + * keep untouched. */ +#endif + xorw %si, %si + pushw %si /* SI=0, for the segment of 0000:7c00 */ + movw $0x7c00, %di + pushw %di /* DI=0x7c00, for the offset of 0000:7c00 */ + pushw %es /* ES=FS_BOOT */ + popw %ds /* DS=FS_BOOT */ + pushw %si /* SI=0 */ + popw %es /* ES=0 */ + cld + repz movsw + + movw $MONITOR, %di + movw $(restore_GRLDR_CS - _start1), %si + movw $((gdt_end - restore_GRLDR_CS) / 4), %cx + cld + repz cs movsl /* CS segment override prefix(=0x2E) */ + + pushw %es /* ES=0 */ + popw %ds /* DS=0 */ + sti + lret //ljmp $0, $0x7c00 +#endif + +try_next_partition: + + cli + movw $GRLDR_CS, %ax + movw %ax, %ss + movw $(0x9000-36), %sp + sti + + /* restore the registers and continue */ + popal + popw %es + popw %ds + jmp add_sub_si + + /* prints string CS:SI (modifies AX BX SI) */ +3: + //xorw %bx, %bx /* video page 0 */ + movb $0x0e, %ah /* print char in AL */ + int $0x10 /* via TTY mode */ + +print_message: + + lodsb %cs:(%si), %al /* get token */ + cmpb $0, %al /* end of string? */ + jne 3b + ret + +message_string: + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + .ascii "\r\nMissing helper.\0" +#else + .ascii "\r\nMissing MBR-helper.\0" +#endif + +#;buggy_bios_string: +#; +#; .ascii "\r\nBuggy BIOS!\0" + + /* Make sure the above code does not occupy the partition table */ + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + /* offset value here must be less than or equal to 0x1be */ + . = . - ((. - _start1) / 0x1bf) +#else + /* offset value here must be less than or equal to 0x1b8 */ + . = . - ((. - _start1) / 0x1b9) +#endif + + /* The following code may occupy the same area as the partition table */ + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + /* we are not booted from MBR. So we can reuse the area of partition + * table for our code. + */ + + . = _start1 + 0x1be + +cdrom_check: + + /* DS points to the sector start, but CS does not. */ + + /* BX segment points to near the end of GRLDR image. */ + + popw %ax /* old return IP */ + + /* set BX as the new safe stack. */ + movw %bx, %ss + movw $0xFFF0, %sp + + pushw %ax /* old return IP */ + + /* check if DL is no-emulation-mode bootable CDROM. */ + pushw %ds + + cmpb $0x80, %dl + jb 1f /* not a valid no-emulation-mode cdrom drive number */ + + cmpw $0xAA55, 0x7FE /* 2048 bytes loaded? */ + jne 1f + +// cmpw $0xAA55, 0x5FE /* 2048 bytes loaded? */ +// jne 1f + + movw $0x0180, %si + movw $0x4B01, %ax + pushw $0x0040 + //.byte 0x6A, 0x40 + popw %ds + pushw %ds + popw %es + movb $0x13, (%si) + int $0x13 + + /* ignore CF */ +#; jc 2f /* not in emulation mode */ + xorl %eax, %eax + xorw %bp, %bp + testb $0x0F, 1(%si) /* boot media type is No Emulation? */ + jnz 2f /* no, it simulates floppy or hard disk. */ + cmpb %dl, 2(%si) /* drive number */ + jnz 2f /* invalid drive */ + + /* OK! it is no-emulation-mode cdrom drive. */ + movl 4(%si), %eax /* LBA of GRLDR */ + incw %bp + +2: + jmp cdrom_helper +1: + popw %ds + ret + + +#endif /* ! defined(GRLDR_MBR) && (! defined(GRLDR_INSTALL)) */ + + . = _start1 + 0x1fe /* boot signature */ + +/* partition entries in the extended partitions will overwrite code here upto + * 0x3fd. + * + * the extended partition entries will occupy a temp area at 0x9be00-0x9c3ff + */ + +#if (defined(GRLDR_MBR)) || (defined(GRLDR_INSTALL)) + .word 0xaa55 +#endif + + . = _start1 + 0x200 + +/* if it is in the Master Boot Track, the second sector can be used to backup + * the previously working MBR, typically, the MS MBR. if the backup copy of + * the MBR cannot boot(because, e.g., it depends on another sector of code + * that does not exist for now), then please do not set the ending signature + * to 0xAA55, that is to say, if the signature is already 0xAA55, you should + * change it to another value(for example, 0x0000). + */ + +#if (! defined(GRLDR_INSTALL)) +#if 0 +print_cl: + pushaw + + movw %cx, %ax + movb $16, %cl + divb %cl # quo=AL, rem=AH + orw $0x3030, %ax + + cmpb $0x39, %ah + jbe 1f + addb $7, %ah +1: + cmpb $0x39, %al + jbe 1f + addb $7, %al +1: + movb %ah, %cl + + xorw %bx, %bx + + movb $0x0e, %ah + int $0x10 + + movb $0x0e, %ah + movb %cl, %al + int $0x10 + + movw $0x0e20, %ax + int $0x10 + + popaw + ret +#else +#if 0 + .word 5, 0x47, 0x52, 0x4c, 0x44, 0x52, 4, 0x24 + .word 0x49, 0x33, 0x30, 0xe000, 0, 0x3000, 0, 0 +#else + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 +#endif + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 +#endif + . = _start1 + 0x256 /* cmdcons comes here */ + +#if 0 + jmp 1f +#else + .byte 0x90, 0x90 +#endif + + . = _start1 + 0x258 + + .byte 0x90, 0x90 + + . = _start1 + 0x25a + + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + .byte 0x90, 0x90 + + . = _start1 + 0x26a +1: + //movw %cs, %ax + //movw %ax, %ds + //jmp single_boot_sector + + /* a value < 0x80 here means we are not booted from no-emulation-mode + * bootable CD. + */ + movb $0x7F, %dl + jmp _start1 + +#endif /* (! defined(GRLDR_INSTALL)) */ + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) +cdrom_helper: + + /* IP and old_DS is on the stack. */ + + /* DS=ES=40h */ + + /* Stack is high and safe. */ + + /* EAX is LBA. if EAX==0, LBA is unknown. */ + + /* check if the first sector is the same as the current one */ + + /* load the first sector onto the sector immediately follows */ +1: + popw %bx /* BX = old_DS = load_segment */ + pushw %bx + movw %bx, %es + addw $0x0080, %bx /* buffer segment */ + call load_cd_sector + + /* compare the two sectors */ + movw $0x200, %cx + movw %bx, %ds + xorw %si, %si + xorw %di, %di + cld + repz cmpsl + je load_the_rest /* 1st sector is ok, continue */ +not_grldr: + testw %bp, %bp + jz 2f + xorw %bp, %bp + xorl %eax, %eax +2: + incl %eax + jnz 1b /* try next */ + +cd_no_grldr: + + popw %ds /* DS=load_segment */ + + # Here we use error message and routine in FAT32 boot sector + # which is also inside the 2048-byte CD sector. + + movw $(msg_BootError_32 - _start1), %si + jmp boot_error_32 + +load_cd_sector: + /* input: EAX LBA + * BX buffer segment(buffer offset=0) + * DS 0x40 (or another safe one) + */ + + movw $0x1A0, %si + + /* disk address packet */ + movl $0x00010010, (%si) /* load 1 sector each time. */ + movw $0, 4(%si) /* buffer offset=0 */ + movw %bx, 6(%si) /* buffer segment */ + movl %eax, 8(%si) /* LBA lo 32 bits */ + movl $0, 12(%si) /* LBA hi 32 bits */ + + pushal + movb $0x42, %ah + int $0x13 + popal + ret + +load_the_rest: + + /* load all sectors (except the first one) */ + + /* EAX = first sector(LBA) of GRLDR */ + + popw %bx /* BX = old_DS = load_segment */ + pushw %bx + movw %bx, %es + /* 6144 = 0x1800 = 3 sectors > 4KB, this is for the additional 4KB-preset-menu at the end of grldr */ + movw $((grldr_signature - _start1 + 4 + STAGE2_SIZE - 1 + 6144) / 2048), %cx /* sectors to load */ +1: + incl %eax /* next sector */ + addw $0x0080, %bx /* buffer segment */ + + call load_cd_sector + + loop 1b + + /* loading is completed. BX=segment of the last sector. */ + + subw $0x0181, %bx /* decw %bx */ + movw %bx, %ds + + /* check the ending signature */ + cmpl $0xCE1A02B0, ((grldr_signature - _start1 + 4 + STAGE2_SIZE - 1) % 2048) + 13 + jne not_grldr +#; je grldr_real_start /* yes. boot it! */ + +#; /* it is not our grldr image, return and use MBR-helper. */ +#; +#;4: +#; //jmp grldr_real_start +#; popw %ds +#; ret + +grldr_real_start: + + #; FAT_12_16 no longer be used. So comment out. + #;je 1f /* jc 1f */ + #;//ZF=0 /* CF cleared, so we are coming from FAT_12_16 */ + #;popw %dx /* discard the cluster number */ + #;popw %dx /* this is our boot_drive/boot_partition */ + #;1: + + #; The partition number for no-emulation-mode bootable CDROM will be + #; set to 0xFF later(in common.c). So comment out. + #;cli + #;movw %cs, %ax + #;cmpw $0x1000, %ax + #;jne 1f + #; + #;/* CS=0x1000, may be booted from ext2 or no-emulation-mode CDROM */ + #; + #;cmpw $0x1000, %di + #;jne 2f + #;cmpw $0x7c00, %bp + #;jne 2f + #;movw %es, %ax + #;cmpw $0x1000, %ax + #;jbe 2f + #;cmpw $0x7c00, %si + #;jbe 2f + #;movl %edx, %eax + #;shrl $16, %eax + #;jnz 2f + #;jecxz 1f // booted from ext2 partition + #;2: + #;// booted from no-emulation-mode bootable CDROM + #;movb $0xff, %dh // partition 0xff means whole drive(for CDROM) + #; #; if needed, 0xfe can be used as an indicator + #; #; here for the bootable CDROM and changed to + #; #; 0xff later. + #;1: + #; + #;//if not booted from CDROM, don't touch the boot partition number(dh) + + cli + xorw %ax, %ax + movw %ax, %ss + movw $0x0400, %sp /* tmp use real-mode IDT as stack */ + movw %cs, %bp /* save CS to BP */ + call 1f +1: + popw %bx /* BX=Instruction Pointer of 1b */ + subw $(1b - _start1), %bx + movw %bx, %cx + shrw $4, %bx + addw %bp, %bx + pushw %bx /* new CS */ + andw $0x000f, %cx + addw $(1f - _start1), %cx + pushw %cx /* new IP */ + lret +1: + pushw %cs + popw %ds + + /* CS=DS=BX, CS:0000 = _start1 */ + + addw $((pre_stage2_start - _start1) >> 4), %bx + + /* BX:0000 = pre_stage2_start */ + + cmpw $0x820, %bx + jb 2f + + movw $((0x8200 - (pre_stage2_start - _start1) - 0x400) >> 4), %cx + + /* Now CS(=DS) >= CX+0x40 */ + + movw %cx, %es + xorw %di, %di + xorw %si, %si + + ///////////////////////////////////////////////////////////// + // + // CS + // DS 0x820 BX + // _start1---------------pre_stage2_start + // CX+0x40---------------0x820 + // CX + // ES + // + ///////////////////////////////////////////////////////////// + + movw $0x200, %cx /* move 2 sectors */ + cld + repz movsw + + pushw %es /* ES:0000 = _start */ + pushw $(1f - _start) + lret /* CS=ES, CS:0000 = _start1 */ +1: + + /* move BX:0000 to 0820:0000 upward since BX >= 0x820 */ + + cld + + movw %bx, %ds + movw $0x820, %bx + movw %bx, %es + + xorw %si, %si + xorw %di, %di + + movw $6, %bx /* 64K pages: 0x20000 - 0x7ffff */ +1: + movw $0x8000, %cx + repz movsw + movw %ds, %ax + addw $0x1000, %ax + movw %ax, %ds + movw %es, %ax + addw $0x1000, %ax + movw %ax, %es + decw %bx + jnz 1b + + jmp 3f +2: + + /* move BX:0000 to 0820:0000 downward since BX < 0x820 */ + + std + + addw $0x7000, %bx + movw %bx, %ds + movw $0x7820, %bx + movw %bx, %es + + movw $0xfffe, %si + movw %si, %di + + movw $8, %bx /* 64K pages: 0x08200 - 0x881ff */ +1: + movw $0x8000, %cx + repz movsw + movw %ds, %ax + subw $0x1000, %ax + movw %ax, %ds + movw %es, %ax + subw $0x1000, %ax + movw %ax, %es + decw %bx + jnz 1b + + cld + +3: + + /* put the config file name */ + xorw %ax, %ax + movw %ax, %es + movw %ax, %ds + + xorl %ebp, %ebp + + movb %dh, 0x820A /* this is the boot partition number */ + + #; clear saved_entryno so that force_cdrom_as_boot_device be cleared + #; later in common.c + + movl %ebp, 0x820C /* EBP=0, clear saved_entryno */ + + movw $0x0010, %cx /* set max length of grub version string */ + movw $0x8212, %di /* version string */ + cld + /* AL is already 0. Locate the end of version string */ + repnz scasb /* find the location of the default config file name */ + + jcxz 1f /* failed, will not use the default config file name */ + + movw $0x4e, %cx /* max length of config file name */ + + movw %cs, %si /* CS:0000 = _start1 */ + shlw $4, %si /* 0000:SI = _start1 */ + + addw $(default_config_file - _start1), %si + + //movw $(default_config_file + 0x8200 - pre_stage2_start), %si + cld + repz movsb /* move file name to the config-file field of stage2 */ +1: + + movw $0x0003, %ax /* set display mode: 80*25 color text */ + int $0x10 + + xorw %bx, %bx + movw $(launch_pre_stage2 - _start1), %si + call print_message /* CS:SI points to message string */ + + xorw %ax, %ax + movw %ax, %ss + movw $0x2000, %sp + + sti + + ljmp $0, $0x8200 + +launch_pre_stage2: + .ascii "\r\n\r\nBooting GRLDR...\r\n" + + .byte 0 /* mark the end of ascii zero string */ + +default_config_file: +//#ifndef PRESET_MENU_STRING + .ascii "/menu.lst" +//#else +// .ascii "[default menu is disabled]" +//#endif + + .byte 0 /* mark the end of ascii zero string */ +#endif /* ! defined(GRLDR_MBR) && (! defined(GRLDR_INSTALL)) */ + + . = _start1 + 0x400 + +#define ALTERNATIVE_KERNEL + + +/* + * The following is based on FreeDOS, modified heavily by Tinybit in Feb, 2004 + * + * Merges LBA and CHS boot sectors to ONE FAT32 boot sector! + * + * Memory layout for GRLDR FAT32 single stage boot process: + * + * ... + * |-------| 1FE0:7E00 + * |BOOTSEC| (GRUB does not use this relocation area) + * |RELOC. | (overwritten by kernel loaded) + * |-------| 1FE0:7C00 + * ... + * |-------| + * |KERNEL | (overwrites bootsec reloc.) + * |LOADED | (holds 1 sector directory buffer before kernel load) + * |-------| 2000:0000 + * ... + * |-------| 0000:7E00 + * |BOOTSEC| GRUB always run inside this sector, + * |ORIGIN | no relocation. + * |-------| 0000:7C00 + * ... + * |-------| 0060:0200 + * | FAT | (only 1 sector buffered) + * |-------| 0060:0000 + * ... + * + */ + +/* +; This is an LBA-enabled FreeDOS FAT32 boot sector (single sector!). +; You can use and copy source code and binaries under the terms of the +; GNU Public License (GPL), version 2 or newer. See www.gnu.org for more. + +; Based on earlier work by FreeDOS kernel hackers, modified heavily by +; Eric Auer and Jon Gentle in 7 / 2003. +; +; Features: Uses LBA and calculates all variables from BPB/EBPB data, +; thus making partition move / resize / image-restore easier. FreeDOS +; can boot from FAT32 partitions which start > 8 GB boundary with this +; boot sector. Disk geometry knowledge is not needed for booting. +; +; Windows uses 2-3 sectors for booting (sector stage, statistics sector, +; filesystem stage). Only using 1 sector for FreeDOS makes multi-booting +; of FreeDOS and Windows on the same filesystem easier. +; +; Requirements: LBA BIOS and 386 or better CPU. Use the older CHS-only +; boot sector if you want FAT32 on really old PCs (problems: you cannot +; boot from > 8 GB boundary, cannot move / resize / ... without applying +; SYS again if you use the CHS-only FAT32 boot sector). +; +; FAT12 / FAT16 hints: Use the older CHS-only boot sector unless you +; have to boot from > 8 GB. The LBA-and-CHS FAT12 / FAT16 boot sector +; needs applying SYS again after move / resize / ... a variant of that +; boot sector without CHS support but with better move / resize / ... +; support would be good for use on LBA harddisks. + + +; Memory layout for the FreeDOS FAT32 single stage boot process: + +; ... +; |-------| 1FE0:7E00 +; |BOOTSEC| +; |RELOC. | +; |-------| 1FE0:7C00 +; ... +; |-------| 2000:0200 +; | FAT | (only 1 sector buffered) +; |-------| 2000:0000 +; ... +; |-------| 0000:7E00 +; |BOOTSEC| overwritten by the kernel, so the +; |ORIGIN | bootsector relocates itself up... +; |-------| 0000:7C00 +; ... +; |-------| +; |KERNEL | maximum size 134k (overwrites bootsec origin) +; |LOADED | (holds 1 sector directory buffer before kernel load) +; |-------| 0060:0000 +; ... +*/ + +#define BOOTGRUB /* undef this if compiled for loading FreeDOS */ +//#undef BOOTGRUB + +#ifdef BOOTGRUB +#define LOADSEG 0x2000 +#define FATSEG 0x0060 +#else +#define LOADSEG 0x0060 +#define FATSEG 0x2000 +#endif + +Entry_32: + jmp 1f + + . = Entry_32 + 0x02 + + /* The default mode is CHS. This is for maximum compatiblity with + * small-sized disks, e.g., floppies. + * + * Valid values are 0x90 for CHS mode, or 0x0e for LBA mode. + * + * If the BIOS int13 supports LBA, this byte can be safely set to 0x0e. + * + * Some USB BIOSes might have bugs when using CHS mode, so the format + * program should set this byte to 0x0e. It seems that (generally) all + * USB BIOSes have LBA support. + * + * If the format program does not know whether the BIOS has LBA + * support, it may operate this way: + * + * if (partition_start + total_sectors_in_partition) exceeds the CHS + * addressing ability(especially when it is greater than 1024*256*63), + * the caller should set this byte to 0x0e, otherwise, set to 0x90. + */ + + .byte 0x90 /* for CHS. Another possible value is 0x0e for LBA */ + + + . = Entry_32 + 0x03 + +#ifdef BOOTGRUB + .ascii "GRLDR " /* OEM name string (of OS which formatted the disk). */ +#endif + + . = Entry_32 + 0x0b + + .word 0x200 /* bytes per sector. Must be 512 */ + + . = Entry_32 + 0x0d + + /* Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64 and 128. + * But a cluster size larger than 32K should not occur. + */ + + .byte 1 /* sectors per cluster */ + + . = Entry_32 + 0x0e + + /* Reserved sectors(number of sectors before the first FAT, + * including the boot sector), usually 1. + */ + + .word 1 /* reserved sectors */ + + . = Entry_32 + 0x10 + + /* Number of FATs(nearly always 2). */ + + .byte 2 /* number of FATs */ + + . = Entry_32 + 0x11 + + /* (Maximum number of root directory entries)Must be 0. */ + + .word 0 /* Max dir entries for FAT12/FAT16 */ + + . = Entry_32 + 0x13 + + /* (Total number of sectors for small disks only)Must be 0. */ + + .word 0 /* total sectors for FAT12/FAT16 */ + + . = Entry_32 + 0x15 + + /* Media descriptor byte, pretty meaningless now. */ + + .byte 0xf8 /* media descriptor */ + + . = Entry_32 + 0x16 + + /* (Sectors per FAT)Must be 0. */ + + .word 0 /* sectors per FAT for FAT12/FAT16 */ + + . = Entry_32 + 0x18 + + .word 18 /* sectors per track */ + + . = Entry_32 + 0x1a + + .word 2 /* number of heads */ + + . = Entry_32 + 0x1c + + /* Number of hidden sectors (those preceding the boot sector). + * Also referred to as the starting sector of the partition. + * For floppies, it should be 0. + */ + + .long 0 /* hidden sectors */ + + . = Entry_32 + 0x20 + + /* Total number of sectors in the filesystem. */ + + .long 0 /* total sectors for FAT32 */ + + . = Entry_32 + 0x24 + + /* FAT32 sectors per FAT. */ + + .long 0 + + . = Entry_32 + 0x28 + + /* If bit 7 is clear then all FATs are updated, otherwise bits 0-3 + * give the current active FAT, all other bits are reserved. + * This word is not used by grldr boot code. + */ + + .word 0 + + . = Entry_32 + 0x2a + + /* High byte is major revision number, low byte is minor revision + * number, currently both are 0. + * This word is not used by grldr boot code. + */ + + .word 0 + + . = Entry_32 + 0x2c + + /* Root directory starting cluster. */ + + .long 0 + + . = Entry_32 + 0x30 + + /* File system information sector number. + * This word is not used by grldr boot code. + */ + + .word 0 + + . = Entry_32 + 0x32 + + /* If non-zero this gives the sector which holds a copy of the + * boot record, usually 6. + * This word is not used by grldr boot code. + */ + + .word 6 + + . = Entry_32 + 0x34 + + /* Reserved, 12 bytes, set to 0. */ + + .long 0 + .long 0 + .long 0 + + . = Entry_32 + 0x40 + + /* drive number of the boot device. + * This byte is ignored for read. The program will write DL onto + * this byte. The caller should set drive number in DL. + * We assume all BIOSes pass correct drive number in DL. + * That is to say, buggy BIOSes are not supported!! + */ + + .byte 0 + + . = Entry_32 + 0x41 + + /* partition number of this filesystem in the boot drive. + * This byte is ignored for read. The boot code will write partition + * number onto this byte. See Entry + 0x5d below. + */ + + .byte 0 + + . = Entry_32 + 0x42 + + /* Signature (must be 28h or 29h to be recognised by NT). */ + + .byte 0x29 /* extended boot signature for FAT12/FAT16 */ + + . = Entry_32 + 0x43 + + .long 0x0AC4AF63 /* volume serial number */ + + . = Entry_32 + 0x47 + + .ascii "NO NAME " /* volume label, 11 bytes. */ + + . = Entry_32 + 0x52 + + .ascii "FAT32 " /* filesystem ID, 8 bytes. */ + +/* +; bp is initialized to 7c00h +; %define bsOemName bp+0x03 ; OEM label (8) +%define bsBytesPerSec bp+0x0b ; bytes/sector (dw) +%define bsSecPerClust bp+0x0d ; sectors/allocation unit (db) +%define bsResSectors bp+0x0e ; # reserved sectors (dw) +%define bsFATs bp+0x10 ; # of fats (db) +; %define bsRootDirEnts bp+0x11 ; # of root dir entries (dw, 0 for FAT32) + ; (FAT32 has root dir in a cluster chain) +; %define bsSectors bp+0x13 ; # sectors total in image (dw, 0 for FAT32) + ; (if 0 use nSectorHuge even if FAT16) +; %define bsMedia bp+0x15 ; media descriptor: fd=2side9sec, etc... (db) +; %define sectPerFat bp+0x16 ; # sectors in a fat (dw, 0 for FAT32) + ; (FAT32 always uses xsectPerFat) +%define sectPerTrack bp+0x18 ; # sectors/track +; %define nHeads bp+0x1a ; # heads (dw) +%define nHidden bp+0x1c ; # hidden sectors (dd) +; %define nSectorHuge bp+0x20 ; # sectors if > 65536 (dd) +%define xsectPerFat bp+0x24 ; Sectors/Fat (dd) + ; +0x28 dw flags (for fat mirroring) + ; +0x2a dw filesystem version (usually 0) +%define xrootClst bp+0x2c ; Starting cluster of root directory (dd) + ; +0x30 dw -1 or sector number of fs.-info sector + ; +0x32 dw -1 or sector number of boot sector backup + ; (+0x34 .. +0x3f reserved) +%define drive bp+0x40 ; Drive number + bp+0x41 ; partition number for GRLDR + +%define fat_sector bp+0x44 ; last accessed FAT sector (dd) + ; (overwriting unused bytes) +%define fat_start bp+0x48 ; first FAT sector (dd) + ; (overwriting unused bytes) +%define data_start bp+0x4c ; first data sector (dd) + ; (overwriting unused bytes) + +*/ + /* not used: [0x42] = byte 0x29 (ext boot param flag) + * [0x43] = dword serial + * [0x47] = label (padded with 00, 11 bytes) + * [0x52] = "FAT32",32,32,32 (not used by Windows) + * ([0x5a] is where FreeDOS parts start) + */ + + . = Entry_32 + 0x5a +1: + cli + cld + +#ifdef BOOTGRUB + + . = Entry_32 + 0x5c + + /* the byte at offset 0x5d stores the real partition number for read. + * the format program or the caller should set it to a correct value. + * For floppies, it should be 0xff, which stands for whole drive. + */ + + movb $0xff, %dh /* boot partition number */ + + cmpb $0xff, %dh /* is floppy? */ + jne 1f + movb $0, %dl /* yes, let drive number = 0 */ +1: +#endif + + xorw %ax, %ax + movw %ax, %ds + movw $0x7c00, %bp + +#ifdef BOOTGRUB + movw %ax, %es +#else + movw $0x1fe0, %ax + movw %ax, %es + movw %bp, %si /* move from 0000:7c00 */ + movw %bp, %di /* move to 1fe0:7c00 */ + movw $0x0100, %cx /* one sector to move */ + repz movsw + ljmp $0x1fe0, $(1f - Entry_32 + 0x7c00) +1: + movw %ax, %ds +#endif + movw %ax, %ss /* stack and BP-relative moves up, too */ + leaw -0x20(%bp), %sp + sti + movw %dx, 0x40(%bp) /* BIOS passes drive number in DL */ + + movb $0x41, %ah + movw $0x55AA, %bx + int $0x13 + jc 1f /* No EBIOS */ + cmpw $0xAA55, %bx + jne 1f /* No EBIOS */ + testb $1, %cl + jz 1f /* No EBIOS */ + /* EBIOS supported */ + movb $0x42, (ebios_32 - 1 - Entry_32 + 0x7c00) +1: + +/* figure out where FAT and DATA area starts + * (modifies EAX EDX, sets fat_start and data_start variables) + */ + xorl %eax, %eax + movl %eax, 0x44(%bp) /* init buffer status */ + + /* first, find fat_start */ + movw 0x0e(%bp), %ax /* reserved sectors */ + addl 0x1c(%bp), %eax /* hidden sectors */ + movl %eax, 0x48(%bp) /* first FAT sector */ + movl %eax, 0x4c(%bp) /* first data sector, initial value */ + + /* next, find data_start */ + movl 0x10(%bp), %eax /* number of fats, no movzbl needed: the + 2 words after 0x10(%bp) are 0 for fat32 */ + mull 0x24(%bp) /* sectors per fat (EDX=0) */ + addl %eax, 0x4c(%bp) /* first DATA sector */ + +/* Searches for the file in the root directory. + * Returns: EAX = first cluster of file + */ + + movl 0x2c(%bp), %eax /* root dir cluster */ + +1: + pushl %eax /* save cluster */ + call cluster_to_lba_32 + /* EDX is sectors per cluster, EAX is sector number */ + movw $(msg_BootError_32 - Entry_32 + 0x7c00), %si + jc boot_error_32 /* EOC encountered */ + +2: + lesw (loadseg_off_32 - Entry_32)(%bp), %bx /* load to loadseg:0 */ + call readDisk_32 + + xorw %di, %di + + /* Search for kernel file name, and find start cluster */ +3: + movw $11, %cx + movw $(filename_32 - Entry_32 + 0x7c00), %si + repz cmpsb + jz 1f /* note that di now is at dirent+11 */ + + addw $0x20, %di + andw $-0x20, %di /* 0xffe0 */ + cmp 0x0b(%bp), %di /* bytes per sector */ + jnz 3b /* next directory entry */ + + decw %dx /* initially DX holds sectors per cluster */ + jnz 2b /* loop over sectors in cluster */ + + popl %eax /* restore current cluster */ + call next_cluster_32 + jmp 1b /* read next cluster */ + +#ifndef ALTERNATIVE_KERNEL +loadseg_off_32: + .word 0 + .word LOADSEG +#endif + +1: + /* kernel directory entry is found */ + pushw %es:(0x14-11)(%di) /* get cluster number HI */ + pushw %es:(0x1a-11)(%di) /* get cluster number LO */ + popl %eax /* convert to 32bit */ + + xorw %bx, %bx /* read kernel at ES:BX=LOADSEG:0 */ + +/* read kernel */ + +2: + pushl %eax + call cluster_to_lba_32 + /* EDX is sectors per cluster, EAX is sector number */ + jnc 1f + + /* EOC encountered - done */ +#ifdef BOOTGRUB + movw 0x40(%bp), %dx /* boot_drive and boot_partition */ +#else + movb 0x40(%bp), %bl /* FreeDOS kernel uses BL, not DL, for drive */ +#endif + ljmp *(loadseg_off_32 - Entry_32)(%bp) + +1: + call readDisk_32 + decw %dx /* initially DX holds sectors per cluster */ + jnz 1b /* loop over sectors in cluster */ + + popl %eax + call next_cluster_32 + jmp 2b + +/* given a cluster number, find the number of the next cluster in + * the FAT chain. Needs fat_start. + * input: EAX - cluster + * EDX = 0 + * output: EAX - next cluster + * EDX = undefined + */ + +next_cluster_32: + pushw %es + /* pushw %di */ + pushw %bx /* hi word of EBX never used */ + +#if 1 + /* xorl %edx, %edx */ + shll $2, %eax /* 32bit FAT */ + movzwl 0x0b(%bp), %ebx /* bytes per sector */ + divl %ebx /* residue is in EDX */ + /* movw %dx, %di */ +#else + shll $2, %eax /* 32bit FAT */ + ;xchgw %ax, %di /* movw %ax, %di */ + movw %ax, %di + ;shlw $2, %di /* 32bit FAT */ + + pushw %cx + movw 0x0b(%bp), %bx /* bytes per sector */ + bsfw %bx, %cx + ;decw %cx + ;decw %cx + decw %bx + andw %bx, %di /* mask to sector size */ + shrl %cl, %eax + popw %cx +#endif + addl 0x48(%bp), %eax /* add the first FAT sector number. + EAX is absolute sector number now */ + movw $FATSEG, %bx + movw %bx, %es + xorw %bx, %bx + + cmpl 0x44(%bp), %eax /* is it the last accessed and already buffered + FAT sector? */ + jz 1f + movl %eax, 0x44(%bp) /* mark sector EAX as buffered */ + call readDisk_32 /* read sector EAX to buffer */ +1: +#if 1 + //.byte 0x67, 0x26, 0x80, 0x62, 0x03, 0x0f + addr32 andb $0x0f, %es:3(%edx) /* mask out top 4 bits */ + + //.byte 0x67, 0x66, 0x26, 0x8b, 0x02 + addr32 movl %es:(%edx), %eax /* read next cluster number */ +#else + andb $0x0f, %es:3(%di) /* mask out top 4 bits */ + movl %es:(%di), %eax /* read next cluster number */ +#endif + popw %bx + /* popw %di */ + popw %es + ret + +/* Convert cluster number to the absolute sector number + * ... or return carry if EndOfChain! Needs data_start. + * input: EAX - target cluster + * output: EAX - absolute sector + * EDX - [bsSectPerClust] (byte) + * carry clear + * (if carry set, EAX/EDX unchanged, end of chain) + */ + +cluster_to_lba_32: + cmpl $0x0ffffff8, %eax /* check End Of Chain */ + cmc + jb 1f /* carry is stored if EOC */ + + /* sector = (cluster-2) * clustersize + data_start */ + decl %eax + decl %eax + + movzbl 0x0d(%bp), %edx /* sectors per cluster */ + pushw %dx /* only DX would change */ + mull %edx /* EDX = 0 */ + popw %dx + addl 0x4c(%bp), %eax /* data_start */ + /* here, carry is cleared (unless parameters are wrong) */ +1: + ret + +/* Read a sector from disk, using LBA or CHS + * input: EAX - 32-bit DOS sector number + * ES:BX - destination buffer + * (will be filled with 1 sector of data) + * output: ES:BX points one byte after the last byte read. + * EAX - next sector + */ + +readDisk_32: + pushal + xorl %edx, %edx /* EDX:EAX = LBA */ + pushl %edx /* hi 32bit of sector number */ + pushl %eax /* lo 32bit of sector number */ + pushw %es /* buffer segment */ + pushw %bx /* buffer offset */ + pushw $1 /* 1 sector to read */ + pushw $16 /* size of this parameter block */ + + xorl %ecx, %ecx + pushl 0x18(%bp) /* lo:sectors per track, hi:number of heads */ + popw %cx /* ECX = sectors per track */ + divl %ecx /* residue is in EDX */ + /* quotient is in EAX */ + incw %dx /* sector number in DL */ + popw %cx /* ECX = number of heads */ + pushw %dx /* push sector number into stack */ + xorw %dx, %dx /* EDX:EAX = cylinder * TotalHeads + head */ + divl %ecx /* residue is in EDX, head number */ + /* quotient is in EAX, cylinder number */ + xchgb %dl, %dh /* head number should be in DH */ + /* DL = 0 */ + popw %cx /* pop sector number from stack */ + xchgb %al, %ch /* lo 8bit cylinder should be in CH */ + /* AL = 0 */ + shlb $6, %ah /* hi 2bit cylinder ... */ + orb %ah, %cl /* ... should be in CL */ + + movw $0x201, %ax /* read 1 sector */ +ebios_32: /* ebios_32 - 1 points to 0x02 that can be changed to 0x42 */ + +// cmpb $0x0e, 2(%bp) /* force LBA? */ +// jnz 1f /* no, continue */ +// movb $0x42, %ah /* yes, use extended disk read */ +//1: + movw %sp, %si /* DS:SI points to disk address packet */ + movb 0x40(%bp), %dl /* hard disk drive number */ + int $0x13 + popaw /* remove parameter block from stack */ + popal + jc disk_error_32 /* disk read error, jc 1f if caller handles */ + incl %eax /* next sector */ + addw 0x0b(%bp), %bx /* bytes per sector */ + jnc 1f /* 64K bound check */ + pushw %dx + movw %es, %dx + addb $0x10, %dh /* add 1000h to ES */ + /* here, carry is cleared */ + movw %dx, %es + popw %dx +1: + /* carry stored on disk read error */ + ret + + . = . - (. - readDisk_32)/91 + +msg_DiskReadError_32: + + .ascii "disk error\0" + +msg_BootError_32: + + .ascii "No " + +filename_32: + +#ifdef BOOTGRUB + .ascii "GRLDR \0" +#else + .ascii "KERNEL SYS\0" +#endif + +#ifdef ALTERNATIVE_KERNEL +filename_end_32: + + . = Entry_32 + 0x1e8 + +loadseg_off_32: + .word 0 + .word LOADSEG + + . = Entry_32 + 0x1ec + +boot_image_ofs_32: + + .word (filename_32 - Entry_32)+(filename_end_32 - filename_32 - 1)*2048 +#endif + + . = Entry_32 + 0x1ee + +disk_error_32: + + movw $(msg_DiskReadError_32 - Entry_32 + 0x7c00), %si + +boot_error_32: + +/* prints string DS:SI (modifies AX BX SI) */ + +//print_32: +1: + lodsb (%si), %al /* get token */ + //xorw %bx, %bx /* video page 0 */ + movb $0x0e, %ah /* print it */ + int $0x10 /* via TTY mode */ + cmpb $0, %al /* end of string? */ + jne 1b /* until done */ + + /* The caller will change this to + * ljmp $0x9400, $(try_next_partition - _start1) + */ + +1: jmp 1b + + . = Entry_32 + 0x1fc + + .word 0, 0xAA55 /* Win9x uses all 4 bytes as magic value here */ + + . = Entry_32 + 0x200 + + . = _start1 + 0x600 + + //.arch i8086, nojumps + .arch i186, nojumps +/* + * The following is based on FreeDOS, modified heavily by Tinybit in Feb, 2004 + * + * Merges FAT12 and FAT16 boot sectors to ONE FAT boot sector! + * + * Memory layout for GRLDR FAT single stage boot process: + * + * +--------+ + * | | + * |GRLDR | also used as max 128k FAT buffer + * |LOADED | before GRLDR loading starts + * |--------| 2000:0000 + * | | + * |--------| 0000:7E00 + * |BOOTSECT| + * |ORIGIN | + * |--------| 0000:7C00 + * | | + * |--------| 0000:3000 + * |CLUSTER | + * |LIST | + * |--------| 0000:2000 + * | | + * +--------+ + */ + +/* +; +; File: +; boot.asm +; Description: +; DOS-C boot +; +; Copyright (c) 1997; +; Svante Frey +; All Rights Reserved +; +; This file is part of DOS-C. +; +; DOS-C is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License +; as published by the Free Software Foundation; either version +; 2, or (at your option) any later version. +; +; DOS-C is distributed in the hope that it will be useful, but +; WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +; the GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public +; License along with DOS-C; see the file COPYING. If not, +; write to the Free Software Foundation, 675 Mass Ave, +; Cambridge, MA 02139, USA. +; +; +; +--------+ 1FE0:7E00 +; |BOOT SEC| +; |RELOCATE| +; |--------| 1FE0:7C00 +; | | +; |--------| 1FE0:3000 +; | CLUSTER| +; | LIST | +; |--------| 1FE0:2000 +; | | +; |--------| 0000:7E00 +; |BOOT SEC| overwritten by max 128k FAT buffer +; |ORIGIN | and later by max 134k loaded kernel +; |--------| 0000:7C00 +; | | +; |--------| +; |KERNEL | also used as max 128k FAT buffer +; |LOADED | before kernel loading starts +; |--------| 0060:0000 +; | | +; +--------+ +*/ + +#ifdef BOOTGRUB +#define LOADSEG_12_16 0x2000 +#define FATBUF 0x2000 /* offset of temp buffer for FAT chain */ +#else +#define LOADSEG_12_16 0x0060 +#define FATBUF 0x2000 /* offset of temp buffer for FAT chain */ +#endif + +Entry_12_16: + jmp 1f + + . = Entry_12_16 + 0x02 + + /* The default mode is CHS. This is for maximum compatiblity with + * small-sized disks, e.g., floppies. + * + * Valid values are 0x90 for CHS mode, or 0x0e for LBA mode. + * + * If the BIOS int13 supports LBA, this byte can be safely set to 0x0e. + * + * Some USB BIOSes might have bugs when using CHS mode, so the format + * program should set this byte to 0x0e. It seems that (generally) all + * USB BIOSes have LBA support. + * + * If the format program does not know whether the BIOS has LBA + * support, it may operate this way: + * + * if (partition_start + total_sectors_in_partition) exceeds the CHS + * addressing ability(especially when it is greater than 1024*256*63), + * the caller should set this byte to 0x0e, otherwise, set to 0x90. + */ + + .byte 0x90 /* for CHS. Another possible value is 0x0e for LBA */ + + + . = Entry_12_16 + 0x03 + +#ifdef BOOTGRUB + .ascii "GRLDR " +#endif + + . = Entry_12_16 + 0x0b + + .word 0x200 /* bytes per sector */ + + . = Entry_12_16 + 0x0d + + .byte 1 /* sectors per cluster */ + + . = Entry_12_16 + 0x0e + + .word 1 /* reserved sectors */ + + . = Entry_12_16 + 0x10 + + .byte 2 /* number of FATs */ + + . = Entry_12_16 + 0x11 + + .word 224 /* Max dir entries */ + + . = Entry_12_16 + 0x13 + + .word 2880 /* total sectors in the filesystem */ + + . = Entry_12_16 + 0x15 + + .byte 0xf0 /* media descriptor */ + + . = Entry_12_16 + 0x16 + + .word 9 /* sectors per FAT */ + + . = Entry_12_16 + 0x18 + + .word 18 /* sectors per track */ + + . = Entry_12_16 + 0x1a + + .word 2 /* number of heads */ + + . = Entry_12_16 + 0x1c + + .long 0 /* hidden sectors */ + + . = Entry_12_16 + 0x20 + + .long 0 /* total sectors for large partitions */ + + . = Entry_12_16 + 0x24 + + /* drive number of the boot device. + * This byte is ignored for read. The program will write DL onto + * this byte. The caller should set drive number in DL. + * We assume all BIOSes pass correct drive number in DL. + * That is to say, buggy BIOSes are not supported!! + */ + + .byte 0 + + . = Entry_12_16 + 0x25 + + /* partition number of this filesystem in the boot drive. + * This byte is ignored for read. The boot code will write partition + * number onto this byte. See Entry_12_16 + 0x41 below. + */ + + .byte 0 + + . = Entry_12_16 + 0x26 + + .byte 0x29 /* extended boot signature */ + + . = Entry_12_16 + 0x27 + + .long 0x0AC4AF63 /* volume serial number */ + + . = Entry_12_16 + 0x2b + + .ascii "NO NAME " /* volume label */ + + . = Entry_12_16 + 0x36 + + .ascii "FAT12 " /* filesystem ID */ + +/* +; bp is initialized to 7c00h +%define bsOemName bp+0x03 ; OEM label +%define bsBytesPerSec bp+0x0b ; bytes/sector +%define bsSecPerClust bp+0x0d ; sectors/allocation unit +%define bsResSectors bp+0x0e ; # reserved sectors +%define bsFATs bp+0x10 ; # of fats +%define bsRootDirEnts bp+0x11 ; # of root dir entries +%define bsSectors bp+0x13 ; # sectors total in image +%define bsMedia bp+0x15 ; media descrip: fd=2side9sec, etc... +%define sectPerFat bp+0x16 ; # sectors in a fat +%define sectPerTrack bp+0x18 ; # sectors/track +%define nHeads bp+0x1a ; # heads +%define nHidden bp+0x1c ; # hidden sectors +%define nSectorHuge bp+0x20 ; # sectors if > 65536 +%define drive bp+0x24 ; drive number + bp+0x25 ; partition number for GRLDR +%define extBoot bp+0x26 ; extended boot signature +%define volid bp+0x27 +%define vollabel bp+0x2b +%define filesys bp+0x36 + +%define RootDirSecs bp+0x26 ; # of sectors root dir uses + ; (overwriting unused bytes) +%define fat_start bp+0x28 ; first FAT sector + ; (overwriting unused bytes) +%define root_dir_start bp+0x2c ; first root directory sector + ; (overwriting unused bytes) +%define data_start bp+0x30 ; first data sector + ; (overwriting unused bytes) +%define data_clusters bp+0x34 ; # of clusters in data area + ; (overwriting unused bytes) + bp+0x36 ; bytes per FAT( > 0x1800 means FAT16) + ; (overwriting unused bytes) +*/ + /* not used: [0x26] = byte 0x29 (ext boot param flag) + * [0x27] = dword serial + * [0x2b] = label (padded with 00, 11 bytes) + * [0x36] = "FAT12" or "FAT16",32,32,32 (not used by Windows) + * ([0x3e] is where FreeDOS parts start) + */ + + . = Entry_12_16 + 0x3e +1: + cli + cld + +#ifdef BOOTGRUB + + . = Entry_12_16 + 0x40 + + /* the byte at offset 0x41 stores the real partition number for read. + * the format program or the caller should set it to a correct value. + * For floppies, it should be 0xff, which stands for whole drive. + */ + + movb $0xff, %dh /* boot partition number */ + + cmpb $0xff, %dh /* is floppy? */ + jne 1f + movb $0, %dl /* yes, let drive number = 0 */ +1: +#endif + + xorw %ax, %ax + movw %ax, %ds + movw $0x7c00, %bp + +#ifdef BOOTGRUB + movw %ax, %es + movw %ax, %ss /* stack and BP-relative moves up, too */ + leaw -0x20(%bp), %sp + sti + movw %dx, 0x24(%bp) /* BIOS passes drive number in DL */ + /* AX=0 */ +// xchgw %ax, %dx /* let DX = 0 */ +// xorw %cx, %cx /* CX = 0 */ +#else + movw %bp, %si /* move from 0000:7c00 */ + movw %bp, %di /* move to 1fe0:7c00 */ + movb %dl, 0x24(%si) /* BIOS passes drive number in DL */ +// xchgw %ax, %dx /* let DX = 0 */ + movw $0x1fe0, %ax + movw %ax, %es + movw $0x0100, %cx /* one sector to move */ + repz movsw + /* CX = 0 */ + ljmp $0x1fe0, $(1f - Entry_12_16 + 0x7c00) +1: + movw %ax, %ds + movw %ax, %ss /* stack and BP-relative moves up, too */ + leaw -0x20(%bp), %sp + sti + /* AX=0x1fe0 */ +#endif + + movb $0x41, %ah + movw $0x55AA, %bx + int $0x13 + jc 1f /* No EBIOS */ + cmpw $0xAA55, %bx + jne 1f /* No EBIOS */ + testb $1, %cl + jz 1f /* No EBIOS */ + /* EBIOS supported */ + movb $0x42, (ebios_12_16 - 1 - Entry_12_16 + 0x7c00) +1: +// xorw %cx, %cx + xorw %ax, %ax + + /* GET DRIVE PARMS: Calculate start of some disk areas */ + + movw 0x1c(%bp), %si /* number of hidden sectors(lo) */ + movw 0x1e(%bp), %di /* number of hidden sectors(hi) */ + addw 0x0e(%bp), %si /* number of reserved sectors */ + adcw %ax, %di /* DI:SI = first FAT sector */ + /* AX = 0 */ + + movw %si, 0x28(%bp) /* FAT start sector(lo) */ + movw %di, 0x2a(%bp) /* FAT start sector(hi) */ + + //xchgw %ax, %dx /* let AX = 0 */ + movb 0x10(%bp), %al /* number of FATs */ + /* cbw */ + mulw 0x16(%bp) /* sectors per FAT */ + /* DX:AX = total number of FAT sectors */ + /* DX = 0 since no too many FAT sectors */ + addw %ax, %si + adcw %dx, %di /* DI:SI = root directory start sector */ + movw %si, 0x2c(%bp) /* root directory starting sector(lo) */ + movw %di, 0x2e(%bp) /* root directory starting sector(hi) */ + + /* Calculate how many sectors the root directory occupies */ + + movw 0x0b(%bp), %bx /* bytes per sector */ + movb $5, %cl /* divide BX by 32 */ + shrw %cl, %bx /* BX = directory entries per sector */ + + movw 0x11(%bp), %ax /* max number of root dir entries */ + /* xorw %dx, %dx */ /* assuming DX = 0 */ + divw %bx /* AX = sectors per root directory */ + /* DX = 0 since normally no residue */ + + movw %ax, 0x26(%bp) /* number of sectors the root dir occupies */ + + addw %ax, %si /* DI:SI = first data sector */ + adcw %dx, %di /* assuming DX = 0 */ + + movw %si, 0x30(%bp) /* data starting sector(lo) */ + movw %di, 0x32(%bp) /* data starting sector(hi) */ +#ifdef USE_TOTAL_CLUSTERS + movw 0x13(%bp), %cx /* total sectors(small) */ + jcxz 1f + movw %cx, 0x20(%bp) /* total sectors(large)(lo) */ + movw %dx, 0x22(%bp) /* total sectors(large)(hi), assuming DX = 0 */ +1: + movw 0x20(%bp), %ax /* total sectors(large) */ + movw 0x22(%bp), %bx + addw 0x1c(%bp), %ax /* number of hidden sectors */ + adcw 0x1e(%bp), %bx + subw %si, %ax /* data starting sector */ + sbbw %di, %bx /* BX:AX = total sectors in the data area */ + movb 0x0d(%bp), %dl /* sectors per cluster(DH=0) */ + xchgw %bx, %dx /* DX:AX = total sectors in the data area */ + /* BX = sectors per cluster */ + divw %bx /* AX = total clusters in the data area */ + movw %ax, 0x34(%bp) /* total clusters in the data area */ +#else + movw $0xffff, 0x36(%bp) + movw 0x16(%bp), %ax /* sectors per FAT */ + mulw 0x0b(%bp) /* bytes per sector */ + jc 1f + movw %ax, 0x36(%bp) +1: +#endif + /* Searches for the file in the root directory + * + * Returns: + * AX = first cluster of file + */ + + /* First, read the whole root directory into the temporary buffer */ + + movw 0x2c(%bp), %ax /* root directory starting sector(lo) */ + movw 0x2e(%bp), %dx /* root directory starting sector(hi) */ + movw 0x26(%bp), %di /* number of sectors the root dir occupies */ + lesw (loadseg_off_12_16 - Entry_12_16)(%bp), %bx + /* ES:BX = loadseg:0 */ + call readDisk_12_16 + + lesw (loadseg_off_12_16 - Entry_12_16)(%bp), %di + /* ES:DI = loadseg:0 */ + + + /* Search for kernel file name, and find start cluster */ + +1: + movw $11, %cx + movw $(filename_12_16 - Entry_12_16 + 0x7c00), %si + pushw %di + repz cmpsb + popw %di + movw %es:0x1a(%di), %ax /* get cluster number from dir entry */ + jz 1f + + addw $0x20, %di /* go to next directory entry */ + cmpb %ch, %es:(%di) /* if the first byte of the name is 0, */ + /* there is no more files in the directory */ + /* assuming CH = 0 */ + jnz 1b + movw $(msg_BootError_12_16 - Entry_12_16 + 0x7c00), %si + jmp boot_error_12_16 /* fail if not found */ + +#ifndef ALTERNATIVE_KERNEL +loadseg_off_12_16: .word 0 +loadseg_seg_12_16: .word LOADSEG_12_16 +#endif + +1: + pushw %ax /* store first cluster number */ + /* CX = 0 */ + + + /* Reads the FAT chain and stores it in a temporary buffer in the first + * 64KB. The FAT chain is stored an array of 16-bit cluster numbers, + * ending with 0. + * + * The file must fit in conventional memory, so it can't be larger than + * 640KB. The sector size must be at least 512 bytes, so the FAT chain + * can't be larger than around 3KB. + * + * Call with: AX = first cluster in chain + */ + + /* Load the complete FAT into memory. The FAT can't be larger + * than 128 kb, so it should fit in the temporary buffer. + */ + + lesw (loadseg_off_12_16 - Entry_12_16)(%bp), %bx + /* ES:BX = loadseg:0 */ + movw 0x16(%bp), %di /* sectors per FAT */ + movw 0x28(%bp), %ax /* FAT start sector(lo) */ + movw 0x2a(%bp), %dx /* FAT start sector(hi) */ + call readDisk_12_16 + popw %ax /* restore first cluster number */ + + /* Set ES:DI to the temporary storage for the FAT chain */ + pushw %ds + popw %es + movw (loadseg_seg_12_16 - Entry_12_16)(%bp), %ds + movw $FATBUF, %di + +2: + stosw /* store cluster number */ + movw %ax, %si /* SI = cluster number */ + addw %si, %si /* multiply cluster number by two */ + movw (loadseg_seg_12_16 - Entry_12_16)(%bp), %dx + /* segment for FAT16 */ + jnc 1f + addb $0x10, %dh /* overflow. Add 0x1000 to segment value */ +1: + +#ifdef USE_TOTAL_CLUSTERS + cmpw $0x0ff7, 0x34(%bp) /* total clusters in the data area */ +#else + cmpw $0x1801, 0x36(%bp) /* bytes per FAT */ +#endif + jnb 3f + + /* This is a FAT12 disk */ + + addw %ax, %si /* multiply cluster number by 3 ... */ + shrw $1, %si /* ... and divide by 2 */ + lodsw + + /* If the cluster number was even, the cluster value is now in + * bits 0-11 of AX. If the cluster number was odd, the cluster + * value is in bits 4-15, and must be shifted right 4 bits. If + * the number was odd, CF was set in the last shift instruction. + */ + + jnc 1f + movb $4, %cl + shrw %cl, %ax +1: + andb $0x0f, %ah /* mask off the highest 4 bits */ + cmpw $0x0ff7, %ax /* check for EOF */ + jmp 4f + +3: + /* This is a FAT16 disk. The maximal size of a 16bit FAT + * is 128KB, so it may not fit within a single 64KB segment + */ + + movw %dx, %ds /* DS:SI points to next cluster */ + lodsw /* AX = next cluster */ + + cmpw $0xfff7, %ax /* check for EOF */ +4: + jbe 2b /* continue if not EOF */ + + /* Mark end of FAT chain with 0, so we have a single + * EOF marker for both FAT12 and FAT16 systems. + */ + + xorw %ax, %ax + stosw + + pushw %cs + popw %ds + + /* Loads the file into memory, one cluster at a time */ + + lesw (loadseg_off_12_16 - Entry_12_16)(%bp), %bx + /* ES:BX = loadseg:0 */ + movw $FATBUF, %si /* set DS:SI to the FAT chain */ + +2: + lodsw /* AX = next cluster to read */ + orw %ax, %ax + jnz 1f + + /* EOC encountered - done */ +#ifdef BOOTGRUB + movw 0x24(%bp), %dx /* boot_drive and boot_partition */ +#else + movb 0x24(%bp), %bl /* FreeDOS kernel uses BL, not DL, for drive */ +#endif + ljmp *(loadseg_off_12_16 - Entry_12_16)(%bp) /* boot it! */ + +1: + decw %ax /* cluster numbers start with 2 */ + decw %ax + + movw 0x0d(%bp), %di /* sectors per cluster */ + andw $0xff, %di /* DI = sectors per cluster */ + mulw %di + addw 0x30(%bp), %ax /* data starting sector(lo) */ + adcw 0x32(%bp), %dx /* data starting sector(hi) */ + /* DX:AX = first sector to read */ + call readDisk_12_16 + jmp 2b /* read next cluster */ + +/* Reads a number of sectors into memory. + * + * Call with: DX:AX = 32-bit DOS sector number + * DI = number of sectors to read + * ES:BX = destination buffer + * + * Returns: CF set on error + * ES:BX points one byte after the last byte read. + * DX:AX = next sector number after read + */ + +readDisk_12_16: +2: + pushaw + xorw %cx, %cx + pushw %cx + pushw %cx + pushw %dx + pushw %ax + pushw %es /* buffer segment */ + pushw %bx /* buffer offset */ + incw %cx + pushw %cx /* 1 sector to read */ + movb $16, %cl + pushw %cx /* size of this parameter block */ + + xchgw %ax, %cx /* save AX to CX */ + + /* + * translate sector number to BIOS parameters + * + * LBA = sector-1 offset in track + * + head * sectPerTrack offset in cylinder + * + cyl * sectPerTrack * nHeads offset in platter + * + */ + pushw %bx + movw 0x18(%bp), %ax /* sectors per track */ + movw %ax, %bx + mulb 0x1a(%bp) /* nHeads, but maybe a word value 0x100 */ + jnz 1f + movb %bl, %ah /* nHeads=0x100, so AX=sectPerTrack*0x100 */ +1: + xchgw %ax, %cx /* restore AX from CX, and save AX to CX */ + /* DX:AX = LBA, CX = nHeads * sectPerTrack <= 256*63 */ + divw %cx /* AX = cyl, DX = sector-1 + head * sectPerTrack */ + xchgw %ax, %dx /* DX = cyl, AX = sector-1 + head * sectPerTrack */ + divb %bl /* sectors per track */ + /* DX = cyl, AL = head, AH = sector-1 */ +#if 1 + xchgb %al, %ah /* DX = cyl, AH = head, AL = sector-1 */ + incw %ax /* DX = cyl, AH = head, AL = sector */ + xchgw %ax, %dx /* AX = cyl, DH = head, DL = sector */ + xchgw %ax, %cx /* CX = cyl, DH = head, DL = sector */ + xchgb %cl, %ch /* set cyl number low 8 bits in CH */ + rorb $1, %cl /* move cyl high bits into bits 7-6 */ + rorb $1, %cl /* (assumes top = 0) */ + orb %dl, %cl /* merge sector into cylinder */ +#else + movw %dx, %cx /* CX = cyl, AL = head, AH = sector-1 */ + + /* + * the following manipulations are necessary in order to properly place + * parameters into registers. + * CH = cylinder number low 8 bits + * CL<7-6> = cylinder high two bits + * CL<5-0> = sector + */ + movb %al, %dh /* save head into DH for BIOS */ + xchgb %cl, %ch /* set cyl number low 8 bits in CH */ + rorb $1, %cl /* move cyl high bits into bits 7-6 */ + rorb $1, %cl /* (assumes top = 0) */ + incb %ah /* AH = sector number */ + orb %ah, %cl /* merge sector into cylinder */ +#endif + popw %bx + + movw $0x0201, %ax /* read 1 sector */ +ebios_12_16: /* ebios_12_16 - 1 points to 0x02 that can be changed to 0x42 */ + +// cmpb $0x0e, 2(%bp) /* force LBA? */ +// jnz 1f /* no, continue */ +// movb $0x42, %ah /* yes, use extended disk read */ +//1: + movw %sp, %si /* DS:SI points to disk address packet */ + movb 0x24(%bp), %dl /* drive number */ + int $0x13 +// stc #; only for testing the buggy Virtual PC + popaw /* remove parameter block from stack */ + popaw + jc disk_error_12_16 /* disk read error, jc 1f if caller handles */ + incw %ax /* next sector */ + jnz 1f + incw %dx +1: + addw 0x0b(%bp), %bx /* bytes per sector */ + jnc 1f /* 64K bound check */ + pushw %dx + movw %es, %dx + addb $0x10, %dh /* add 1000h to ES */ + /* here, carry is cleared */ + movw %dx, %es + popw %dx +1: + decw %di + jnz 2b + + /* carry stored on disk read error */ + ret + + . = . - (. - readDisk_12_16)/99 + +msg_DiskReadError_12_16: + + .ascii "disk error\0" + +msg_BootError_12_16: + + .ascii "No " + +filename_12_16: + +#ifdef BOOTGRUB + .ascii "GRLDR \0" +#else + .ascii "KERNEL SYS\0" +#endif + +#ifdef ALTERNATIVE_KERNEL +filename_end_12_16: + + . = Entry_12_16 + 0x1e8 + +loadseg_off_12_16: .word 0 +loadseg_seg_12_16: .word LOADSEG_12_16 + + . = Entry_12_16 + 0x1ec + +boot_image_ofs_12_16: + + .word (filename_12_16 - Entry_12_16)+(filename_end_12_16 - filename_12_16 - 1)*2048 +#endif + + . = Entry_12_16 + 0x1ee + +disk_error_12_16: + + movw $(msg_DiskReadError_12_16 - Entry_12_16 + 0x7c00), %si + +boot_error_12_16: + +/* prints string DS:SI (modifies AX BX SI) */ + +//print_12_16: +1: + lodsb (%si), %al /* get token */ + //xorw %bx, %bx /* video page 0 */ + movb $0x0e, %ah /* print it */ + int $0x10 /* via TTY mode */ + cmpb $0, %al /* end of string? */ + jne 1b /* until done */ + + /* The caller will change this to + * ljmp $0x9400, $(try_next_partition - _start1) + */ + +1: jmp 1b + + . = Entry_12_16 + 0x1fc + + .word 0, 0xAA55 /* Win9x uses all 4 bytes as magic value here */ + + . = Entry_12_16 + 0x200 + + . = _start1 + 0x800 + + + + + .arch i486, nojumps + +/* + #; Ext2 boot sector for GRLDR + */ + + +#define DEBUG call debug_print +#undef DEBUG + + //. = _start1 + 0x800 + +Entry_ext2: + + jmp 1f + + . = Entry_ext2 + 0x02 + + /* The default mode is CHS. This is for maximum compatiblity with + * small-sized disks, e.g., floppies. + * + * Valid values are 0x02 for CHS mode, or 0x42 for LBA mode. + * + * If the BIOS int13 supports LBA, this byte can be safely set to 0x42. + * + * Some USB BIOSes might have bugs when using CHS mode, so the format + * program should set this byte to 0x42. It seems that (generally) all + * USB BIOSes have LBA support. + * + * If the format program does not know whether the BIOS has LBA + * support, it may operate this way: + * + * if (partition_start + total_sectors_in_partition) exceeds the CHS + * addressing ability(especially when it is greater than 1024*256*63), + * the caller should set this byte to 0x42, otherwise, set to 0x02. + */ + + .byte 0x02 /* for CHS. Another possible value is 0x42 for LBA */ + + . = Entry_ext2 + 0x03 + +#if 0 + + .ascii "ext2 grldr" + +#else + +msg_DiskReadError_ext2: + + .ascii "I/O error\0" + +#endif + + . = Entry_ext2 + 0x0d + + /* sectors per block. Valid values are 2, 4, 8, 16, 32. */ + + .byte 2 + + . = Entry_ext2 + 0x0e + + /* bytes per block. + * Valid values are 0x400, 0x800, 0x1000, 0x2000, 0x4000. + */ + + .word 1024 /* bytes per block, at most 16K */ + + . = Entry_ext2 + 0x10 + + /* pointers in pointers-per-block blocks, that is, number of blocks + * covered by a double-indirect block. + * Valid values are 0x10000, 0x40000, 0x100000, 0x400000, 0x1000000. + */ + + .long 0x10000 /* number of blocks covered by double-indirect block */ + /* low word=0 */ + + . = Entry_ext2 + 0x14 + + /* pointers per block, that is, number of blocks covered by an indirect + * block. Valid values are 0x100, 0x200, 0x400, 0x800, 0x1000. + */ + + .long 0x100 /* high word=0, low byte=0 */ + + . = Entry_ext2 + 0x18 + + /* this is default for 1.44M floppy, the caller should set it to + * a correct value */ + + .word 18 /* sectors per track */ + + . = Entry_ext2 + 0x1a + + /* this is default for 1.44M floppy, the caller should set it to + * a correct value */ + + .word 2 /* number of heads */ + + . = Entry_ext2 + 0x1c + + /* this is default for 1.44M floppy, the caller should set it to + * a correct value */ + + .long 0 /* hidden sectors */ + + . = Entry_ext2 + 0x20 + + /* total sectors in the filesystem(or in the partition). + * This value is informative. The code does not use it. + */ + + /* this is default for 1.44M floppy, the caller should set it to + * a correct value */ + + .long 2880 + + . = Entry_ext2 + 0x24 + + /* This byte is ignored for read. The program will write DL onto + * this byte. The caller should set drive number in DL. + * We assume all BIOSes pass correct drive number in DL. + * That is to say, buggy BIOSes are not supported!! + */ + + .byte 0 /* drive number */ + + . = Entry_ext2 + 0x25 + + /* this is default for floppies, the caller should set it to + * a correct value for hard-drive partitions */ + + .byte 0xff /* partition number, 0xff for whole drive */ + + . = Entry_ext2 + 0x26 + + .word 0 /* reserved for future use */ + + . = Entry_ext2 + 0x28 + + /* this is default for 1.44M floppy, the caller should set it to + * a correct value */ + + .long 2048 /* s_inodes_per_group */ + + . = Entry_ext2 + 0x2c + + /* block number for group descriptors = s_first_data_block + 1. + * Valid values are 2 for 1024-byte blocks, and 1 for otherwise. + */ + + /* this is default for 1.44M floppy, the caller should set it to + * a correct value */ + + .long 2 /* block number for group descriptors */ + + . = Entry_ext2 + 0x30 +1: + cld /* 0xFC */ + + xorw %ax, %ax /* 0x31, 0xC0; CF=0, ZF=1 */ + + /* this byte `nop' will be changed to `cwd' by bootlace for floppy */ + nop /* 0x90=nop, 0x99=cwd */ + /* cwd will set DL=0 forcibly for floppy A: */ + + movw %ax, %ss /* constant SS=0 */ + movw $0x7c00, %sp + + movw %sp, %bp /* constant BP=0x7c00 */ + movw %ax, %ds /* constant DS=0 */ + + pushw %ax /* 0x0000 at 0000:7bfe */ + movw $0x1000, %bx + pushw %bx /* 0x1000 at 0000:7bfc */ + pushw %ax /* 0x0000 at 0000:7bfa */ + /* SP=0x7bfa */ + + /* the 6 bytes in the stack are used by read_block(): + * 0000 ---- -2(%bp) + * 1000 ---- -4(%bp) + * 0000 ---- -6(%bp) + * Don't touch them! + */ + + movb %dl, 0x24(%bp) /* BIOS passes drive number in DL */ + + movb $0x41, %ah + movw $0x55AA, %bx + int $0x13 +#if 0 + jnc 1f + /* No EBIOS */ + movb $0x02, (ebios_ext2 - 1 - Entry_ext2 + 0x7c00) +#else + jc 1f #; No EBIOS + + //testb $1, %cl + //jz 1f #; No EBIOS +#if 0 + /* gcc-4.0.1 does not generate 2-byte code. */ + rcrb $1, %cl #; also can be rorb $1, %cl +#else + .byte 0xD0, 0xD9 #; ror cl: D0 C9 +#endif + jnc 1f #; No EBIOS + + movb $0x42, (ebios_ext2 - 1 - Entry_ext2 + 0x7c00) +#endif +1: + xorl %eax, %eax /* CF=0, ZF=1 */ + +#if 0 + /* the INC touches ZF flag, so use MOV instead */ + + incw %ax + incw %ax /* EAX=2=inode number for root dir */ +#else + + /* MOV keeps all flags untouched, so it is better than INC */ + + movb $2, %al /* EAX=2=inode number for root dir */ +#endif + + /* CF=0, ZF=1 because MOV and PUSH do not touch Flags */ + + /* read root dir to 0000:1000, and grldr to 1000:0000 */ + +4: + /* EAX holds the inode number: for root dir or grldr */ + + /* These 3 PUSHes is intended to place 1000:0000 onto the stack for + * grldr. For root dir, the stack is not used since CF is cleared. + * Although there is no corresponding POPs, this is safe enough + * because the program comes here only twice: the first is for + * the root dir, and the second is for grldr. + * + * For root dir, CF=0 and ZF=1. For grldr, CF=1. + */ + + pushw %di /* 0x1000, see "jz 4b" below. */ + pushw %ss /* 0x0000 */ + pushfw + + /* SP=0x7bf4 for root dir, or 0x7bee for grldr */ + + decl %eax /* EAX=(inode - 1) */ + + /* inode numbers are far less than 0x7fffffff, so it is safe to + * initialise EDX with CDQ */ + + cdq /* let EDX=0 */ + + divl 0x28(%bp) /* s_inodes_per_group */ + /* EAX=group number */ + pushl %edx /* EDX=inode number in the group */ + + /* group numbers are far less than 0x7fffffff, so it is safe to + * initialise EDX with CDQ */ + + cdq /* let EDX=0 */ + shll $5, %eax /* EAX=relative displacement of the group descriptor */ + divl 0x0e(%bp) /* bytes per block */ + /* EAX=relative block number for the group descriptor */ + /* DX=displacement in the block */ + /* EDX high=0 */ + + pushw %dx /* we don't care about EDX high word, because it is 0 */ + + addl 0x2c(%bp), %eax /* EAX=absolute block number for the group descriptor */ + /* CF=0, ZF=0 */ + + call read_block /* 0000:1000 points to the block data containing the group descriptor */ + /* ES changed and > 0, BX=0x1000 */ + /* ECX=EDX=0 */ + /* CF=0, ZF=0 */ + + popw %si /* DS:[BX+SI] points to the group descriptor */ + /* DS:[BX+SI+8] points to the starting block number of the group inode table */ + + popl %eax /* inode number in the group */ + shll $7, %eax /* inode struct size = 0x80 */ + /* EAX=relative displacement of the inode struct */ + /* EDX=0 */ + + divl 0x0e(%bp) /* bytes per block */ + /* EAX=relative block number for the inode struct */ + pushw %dx /* DX=displacement of the inode struct in the block */ + /* EDX high=0 */ + + addl 8(%bx, %si), %eax /* EAX=absolute block number for the inode struct */ + /* CF=0, ZF=0 */ + + call read_block /* 0000:1000 points to the block data containing the inode struct */ + /* ES changed and > 0, BX=0x1000 */ + /* ECX=EDX=0 */ + /* CF=0, ZF=0 */ + + popw %si /* DS:[BX+SI] points to the inode struct */ + + addw %bx, %si /* DS:SI points to the inode struct */ + + /* Move the inode struct to a known safe area(0000:0fa8 - 0000:0fff), + * that is, 0x58 bytes immediately before 0000:1000. We care about only + * the beginning 0x58 bytes of the 0x80-byte inode struct, the last + * 0x28 bytes are ignored. The area from 0xfa8+0x28 to 0xfa8+0x57 + * stores 12 direct block pointers. + * + * + * At address Initial value Stores what? + * ========== ============= ====================================== + * 0xfa8+0x04 (const) the size of the file in bytes + * + * 0xfa8+0x08 total blocks blocks left to read + * + * 0xfa8+0x0c 0 serial number of the block to read + * + */ + + pushw %ss + popw %es /* ES=0 */ + + leaw -0x58(%bx), %di /* BX=0x1000, so DI=0x0fa8 */ + //movw $0x0fa8, %di + movb $0x2c, %cl /* 0x2c words = 0x58 bytes */ + + repz movsw /* now ECX=0, BX=0x1000=DI */ + + movl %ecx, (0x0c - 0x58)(%di) /* block serial number of the file */ + /* ECX=0 means first block */ + /* DI=0x1000 */ + + movl (0x04 - 0x58)(%di), %eax /* i_size, the file size */ + decl %eax + + divl 0x0e(%bp) /* bytes per block */ + /* EDX=various */ + incl %eax + movl %eax, (0x08 - 0x58)(%di) /* total blocks for file data */ + + /* + * 0000:1000 trebly indirect block + * 0000:8000 indirect block + * 0000:c000 double indirect block + * 1000:0000 the file data + */ + + /* now DS:SI points to indirect block number */ + + lodsl /* indirect block number */ + testl %eax, %eax + jz 1f + + //pushw %ss + //popw %es /* ES=0 */ + movb $0x80, %bh /* ES:BX=0000:8000 */ +#if 0 + stc + call read_block +#else + call read_block_c +#endif + /* ES changed and > 0, BX=0x8000 */ + /* ECX=EDX=0 */ + /* ZF=0, CF=0 */ + + /* now DS:SI points to double indirect block number */ + + lodsl /* double indirect block number */ + testl %eax, %eax + jz 1f + +#if 0 + pushw %ss + popw %es /* ES=0 */ + movb $0xc0, %bh /* ES:BX=0000:c000 */ + stc + call read_block +#else + movb $0xc0, %bh /* ES:BX=0000:c000 */ + call read_block_c +#endif + /* ES changed and > 0, BX=0xc000 */ + /* ECX=EDX=0 */ + /* ZF=0, CF=0 */ + + /* now DS:SI points to trebly indirect block number */ + + lodsl /* trebly indirect block number */ + testl %eax, %eax /* CF=0, TEST always clears CF */ + jz 1f + /* ZF=0 */ + //pushw %ss + //popw %es /* ES=0 */ + //movb $0x10, %bh /* ES:BX=0000:1000 */ + //stc + call read_block /* 0000:1000 points to the block data */ + /* ES changed and > 0, BX=0x1000 */ + /* ECX=EDX=0 */ + /* ZF=0, CF=0 */ + + /* the block at 0000:1000, which contains the indirect block numbers, + * is just overwritten by the trebly indirect block */ + +1: + /* get absolute block number by block serial number */ + + movl (0x0c - 0x58)(%di), %ebx /* block serial number of the file */ + subl $12, %ebx + jc 3f /* direct block: block serial number < 12 */ + + pushw %bx + subl 0x14(%bp), %ebx + popw %ax + jnc 2f + + /* indirect block: 12 <= block serial number < 12 + 0x14(%bp) */ + + //addw 0x14(%bp), %bx + addb $(0x70 / 4), %ah + //xchgw %ax, %bx + jmp 8f + +2: + pushl %ebx + subl 0x10(%bp), %ebx + jc 7f /* EBX on the stack is < 0x10(%bp). double indirect block: + * 12 + 0x14(%bp) <= block serial number < 12 + 0x14(%bp) + 0x10(%bp) + */ + + /* trebly indirect block: block serial number >= 12 + 0x14(%bp) + 0x10(%bp) */ + + popl %eax /* discard the stack */ + xchgl %eax, %ebx /* move EBX to EAX */ + /* EDX=0 */ + divl 0x10(%bp) + /* EAX=indirect block number, < 0x14(%bp) */ + /* EDX=block number, < 0x10(%bp) */ + + pushl %edx /* EDX < 0x10(%bp) */ + testl %edx, %edx + jnz 7f + + /* EDX=0, so we need to load the double indirect block */ + + shlw $2, %ax + xchgw %ax, %bx + + /* get the double indirect block number from the trebly indirect + * block data */ + + movl (%bx, %di), %eax + +//6: + movw $0xc000, %bx /* ES:BX=0000:c000 */ + + //pushw %ss + //popw %es /* ES=0 */ + //stc + call read_block_c /* 0000:c000 points to the block data */ + /* ES changed and > 0, BX=0xc000 */ + /* ECX=EDX=0 */ + /* CF=0, ZF=0 */ +7: + popl %eax /* EAX < 0x10(%bp) */ + cdq /* let EDX=0 (notice the above jc 7f and jnz 7f) */ + divl 0x14(%bp) + /* EAX=indirect block number, < 0x14(%bp) */ + /* EDX=block number, < 0x14(%bp) */ + + pushw %dx /* EDX < 0x14(%bp) */ + testw %dx, %dx + jnz 7f + + /* if DX=0, we need to load the indirect block */ + + //addb $(0xb0 / 4), %ah + shlw $2, %ax + xchgw %ax, %bx + + /* get the indirect block number from the double indirect block data */ + + movl 0xb000(%bx, %di), %eax + //movl (%bx, %di), %eax +//5: + movw $0x8000, %bx /* ES:BX=0000:8000 */ + + //pushw %ss + //popw %es /* ES=0 */ + //stc + call read_block_c /* 0000:8000 points to the block data */ + /* ES changed and > 0, BX=0x8000 */ + /* ECX=EDX=0 */ + /* CF=0, ZF=0 */ +7: + popw %ax /* AX < 0x14(%bp) */ +8: + xchgw %ax, %bx +3: + shlw $2, %bx + movl (%bx, %di), %eax + + /* got it! EAX=absolute block number */ + + /* read block data to 1000:0000. For root dir, read each block to + * 1000:0000(overwrite the previous read). For grldr, read blocks + * one by one to the area starting at 1000:0000. + */ + + popfw + popw %bx + popw %es + pushfw + + /* CF=0 and ZF=1 for reading root dir, CF=1 for reading grldr */ + + call read_block /* 1000:0000 points to the block data */ + /* ES changed and > 0x1000, BX=0 */ + /* ECX=EDX=0 */ + /* CF=0, ZF=0 */ + + popfw + pushw %es + pushw %bx + pushfw + + jc 3f /* CF=1, we are reading grldr */ + + /* We have just read a block of the root dir to 1000:0000. + * So we check all dir entries in the block to see if anyone + * matches grldr. + */ + + xorw %si, %si + pushw %ss + popw %es /* ES=0 */ + +2: + pushw %ds /* DS=0 */ + movw %di, %ds /* DS=0x1000 */ + movw $(filename_ext2 - Entry_ext2 + 0x7c00), %di + + pushw %si + lodsl /* This is possible inode number for grldr */ + pushl %eax /* This is possible inode number for grldr */ + lodsw + xchgw %ax, %dx /* rec_len */ + lodsw /* AL=name_len, should be 5 for grldr */ + /* AH=file_type(1 for regular file) */ +#if 0 + cmpw $0x0105, %ax + jnz 5f + movb %al, %cl /* CH is already 0 */ + repz cmpsb +#else + decb %ah + //jnz 5f + xchgw %ax, %cx /* CX=name_len */ + repz cmpsb + jnz 5f + xchgw %ax, %cx /* movb $0, %al */ + scasb +#endif +5: + popl %eax /* This is possible inode number for grldr */ + popw %si + + /* DS=0x1000, EAX=inode number */ + + movw %ds, %di /* DI=0x1000 */ + popw %ds /* DS=0 */ + + stc /* indicates the new inode is for grldr */ + + jz 4b /* grldr is found with EAX=inode number */ + + addw %dx, %si + cmpw 0x0e(%bp), %si /* bytes per block */ + jb 2b + + /* file not found in this block, continue */ + + /* We are lucky that CF=0, which indicates we are dealing with + * the root dir. + */ + +3: + + /* CF=1 for grldr, CF=0 for root dir. */ + + incl (0x0c - 0x58)(%di) + decl (0x08 - 0x58)(%di) + jnz 1b + +#if 0 + /* The above 2 instructions INC and DEC do not touch CF, so we + * can omit this POP-PUSH pair. + */ + + popfw + pushfw +#endif + + movw $(msg_No_grldr_ext2 - Entry_ext2 + 0x7c00), %si + + jnc boot_error_ext2 /* grldr not found in the root dir */ + + /* All grldr blocks have been loaded to memory starting at 1000:0000, + * Before the boot, we pass boot_drive and boot_partition to grldr. + */ + + /* ES>0x1000, BX=0, ECX=EDX=0, DI=0x1000, SS=0, SI>0x7c00, DS=0 + * BP=0x7c00, SP<=0x7c00 + */ + + movw 0x24(%bp), %dx + + /* boot it now! */ + + pushw %di /* 0x1000 */ + pushw %ss /* 0x0000 */ + lret + +read_block_c: + + pushw %ss + popw %es /* ES=0 */ + stc + +/* read_block - read a block + * input: CF - indicator for overlap or consecution + * EAX = block number + * ES:BX - buffer + * + * output: if CF is cleared on input, ES:BX is initialized to 0000:1000 + * ES:BX - buffer filled with data + * ES, EAX - Changed + * ECX = 0 + * EDX = 0 + * ZF = 0 + * CF = 0 + */ + +read_block: + + jc 1f + + .byte 0xC4, 0x5E, 0xFC /* lesw -4(%bp), %bx */ + /* ES:BX=0000:1000 */ + jnz 1f + + //at this time, the gcc cannot generate 3 byte code + .byte 0xC4, 0x5E, 0xFA /* lesw -6(%bp), %bx */ + /* ES:BX=1000:0000 */ + //. = . - (. - read_block) / 6 +1: + movzbl 0x0d(%bp), %ecx /* CX=sectors per block */ + /* ECX high=0 */ + . = . - (. - 1b) / 6 + mull %ecx /* EAX=relative sector number */ + /* EDX=0 */ + . = . - (. - 1b) / 9 + addl 0x1c(%bp), %eax /* EAX=absolute sector number */ + +#if 1 + /* pass through, saving 4 bytes(call and ret) */ +#else + call readDisk_ext2 + ret +#endif + +/* Read sectors from disk, using LBA or CHS + * input: EAX = 32-bit LBA sector number + * CX = number of sectors to read + * ECX high word = 0 + * ES:BX = destination buffer + * + * output: No return on error + * BX not changed + * ES = ES + 0x20 * CX + * EAX = EAX + CX + * ZF = 0 + * CF = 0 + */ + +readDisk_ext2: +2: + pushal + //xorl %edx, %edx /* EDX:EAX = LBA */ + pushl %edx /* hi 32bit of sector number */ + pushl %eax /* lo 32bit of sector number */ + pushw %es /* buffer segment */ + pushw %bx /* buffer offset */ + pushw $1 /* 1 sector to read */ + pushw $16 /* size of this parameter block */ + + //xorl %ecx, %ecx + pushl 0x18(%bp) /* lo:sectors per track, hi:number of heads */ + popw %cx /* ECX = sectors per track */ + divl %ecx /* residue is in EDX */ + /* quotient is in EAX */ + /* EDX high=0, DH=0 */ + incw %dx /* DL=sector number */ + popw %cx /* ECX = number of heads */ + pushw %dx /* push sector number into stack */ + xorw %dx, %dx /* EDX:EAX = cylinder * TotalHeads + head */ + divl %ecx /* residue is in EDX, head number */ + /* quotient is in EAX, cylinder number */ + /* EDX high=0, EAX high=0 */ + + + xchgb %dl, %dh /* head number should be in DH */ + /* DL = 0 */ + popw %cx /* pop sector number from stack */ + xchgb %al, %ch /* lo 8bit cylinder should be in CH */ + /* AL = 0 */ + shlb $6, %ah /* hi 2bit cylinder ... */ + orb %ah, %cl /* ... should be in CL */ + + incw %ax /* AL=1, read 1 sector */ + + /* Instead of 0x0e, the LBA indicator at 2(%bp) is + * + * 0x42 for LBA + * + * and + * + * 0x02 for CHS + */ +#if 0 + movb $0x42, %ah + /* ebios_ext2 - 1 points to 0x42 that can be changed to 0x02 */ +#else + movb $0x02, %ah + /* ebios_ext2 - 1 points to 0x02 that can be changed to 0x42 */ +#endif +ebios_ext2: + + //andb 2(%bp), %ah + + movw %sp, %si /* DS:SI points to disk address packet */ + movb 0x24(%bp), %dl /* drive number */ + int $0x13 + jc disk_error_ext2 + movw %es, %ax + addw $0x20, %ax /* here, carry is cleared */ + movw %ax, %es + popaw /* remove parameter block from stack */ + popal + incl %eax /* next sector, here ZF=0 */ + loop 2b + ret + + //. = . - (. - readDisk_ext2)/74 + +//msg_DiskReadError_ext2: +// +// .ascii "disk error\0" + +msg_No_grldr_ext2: + + .ascii "No " + +filename_ext2: + .ascii "grldr\0" + + . = Entry_ext2 + 0x1ee + +filename_end_ext2: + + .word (filename_ext2 - Entry_ext2)+(filename_end_ext2 - filename_ext2 - 1)*2048 + + . = Entry_ext2 + 0x1f0 + +disk_error_ext2: + + movw $(msg_DiskReadError_ext2 - Entry_ext2 + 0x7c00), %si + +boot_error_ext2: + +/* prints string DS:SI (modifies AX BX SI) */ + +//print_ext2: +1: + lodsb (%si), %al /* get token */ + //xorw %bx, %bx /* video page 0 */ + movb $0x0e, %ah /* print it */ + int $0x10 /* via TTY mode */ + cmpb $0, %al /* end of string? */ + jne 1b /* until done */ +#if 1 + + /* The caller will change this to + * ljmp $0x9400, $(try_next_partition - _start1) + */ + +1: jmp 1b + +#else + /* boot failed, try to hand over the control to supervisor */ + ldsw (1f + 3 - Entry_ext2)(%bp), %si + lodsl + cmpl $0x9400b8fa, %eax +1: jnz 1b /* no supervisor, hang up. */ + ljmp $0x9400, $(try_next_partition - _start1) + + //. = . - (. - disk_error_ext2) / 30 +#endif + + . = Entry_ext2 + 0x1fe + + .word 0xAA55 + + . = _start1 + 0xA00 + +#define INSIDE_GRLDR + +#include "ntfsbs.S" + + . = _start1 + 0x1200 + + .arch i586, jumps + +#ifdef DEBUG + + . = Entry_ext2 + 0x201 + +debug_print: + + pushfl + pushal + movl %eax, %ebp + call 2f +#if 0 + popal + pushal + movl %ebx, %ebp + call 2f + popal + pushal + movl %ecx, %ebp + call 2f + popal + pushal + movl %edx, %ebp + call 2f + popal + pushal + movl %esi, %ebp + call 2f + popal + pushal + movl %edi, %ebp + call 2f + popal + popfl + pushfl + pushal + pushfl + popl %ebp /* flags */ + call 2f + movw %ds, %bp + shll $16, %ebp + movw %es, %bp + call 2f + movw $0x0e0d, %ax /* print CR */ + int $0x10 /* via TTY mode */ + movw $0x0e0a, %ax /* print LF */ + int $0x10 /* via TTY mode */ +#endif + popal + popfl + ret +2: + movw $7, %cx +1: + xorw %bx, %bx /* video page 0 */ + movl %ebp, %eax + shrl %cl, %eax + shrl %cl, %eax + shrl %cl, %eax + shrl %cl, %eax + andb $0x0f, %al + addb $0x30, %al + movb $0x0e, %ah /* print char in AL */ + int $0x10 /* via TTY mode */ + + decw %cx + testw %cx, %cx + jns 1b + + movw $0x0e20, %ax /* print space */ + int $0x10 /* via TTY mode */ + ret +#endif + +#if 1 + /* restore GRLDR_CS */ + + /* this code is executed at 0000:MONITOR, which must be a 16-byte + * aligned address. The address 0000:MONITOR should be designed in + * a way that could avoid memory confliction with volume boot records + * (currently FAT12/16/32/NTFS/EXT2/3 are built in). + */ + + /* CS=code */ + + .align 16 + +restore_GRLDR_CS: +2: + call 1f +1: + popw %bx # instruction pointer of 1b + movw %cs, %ax + shrw $4, %bx + addw %ax, %bx # BX=segment value of this code + pushw %bx + pushw $(1f - 2b) + lret +1: + /* modify gdt base */ + xorl %eax, %eax + movw %bx, %ax + shll $4, %eax + addl $(gdt -2b), %eax + movl %eax, %cs:(gdt - 2b + 2) + + movw $GRLDR_CS, %bx + movw %bx, %es + movw %ds, %bx # save old DS to BX + + cli + lgdt %cs:(gdt - 2b) + movl %cr0, %eax + orb $1, %al + movl %eax, %cr0 + + movw $8, %si + movw %si, %ds + + xorl %esi, %esi + xorl %edi, %edi + movl $(0x9000 / 4), %ecx + + cld + repz movsl + + movw $16, %si + movw %si, %ds + + andb $0xfe, %al + movl %eax, %cr0 + + movw %bx, %ds # restore DS from BX + + ljmp $GRLDR_CS, $(try_next_partition - _start1) + +#endif + +# Descriptor tables +# +# NOTE: The intel manual says gdt should be sixteen bytes aligned for +# efficiency reasons. However, there are machines which are known not +# to boot with misaligned GDTs, so alter this at your peril! If you alter +# GDT_ENTRY_BOOT_CS (in asm/segment.h) remember to leave at least two +# empty GDT entries (one for NULL and one reserved). +# +# NOTE: On some CPUs, the GDT must be 8 byte aligned. This is +# true for the Voyager Quad CPU card which will not boot without +# This directive. 16 byte aligment is recommended by intel. +# + .align 16 +gdt: + /* this is the default null entry in GDT */ + .word gdt_end - gdt - 1 # gdt limit + .long (GRLDR_CS * 16 + gdt - _start1) # linear address of gdt + .word 0 # pad 2 bytes + + /* real mode data segment base=0x200000 */ + .word 0xFFFF, 0 + .byte 0x20, 0x92, 0, 0 + + /* real mode data segment base=0 */ + .word 0xFFFF, 0 + .byte 0, 0x92, 0, 0 + +gdt_end: + +helper_start: + + /* helper function begins here + * before the call: + * CF=1 : indicates an invalid or corrupt entry + * CF=0 : indicates a valid entry + * + * on return: + * CF=1 : means "below", try next entry + * CF=0,ZF=1 : means "equal", helper did nothing, so we need + * a further try to boot via NT bootsector + * CF=0,ZF=0 : means "above", helper succeeded, boot it now + */ + + sti + + /* DS=SS=0x9400 */ + pushw %cs + popw %ds + + pushw $FS_BOOT + popw %es + + /* ES=FS_BOOT */ + + /* Format of partition information blocks. + * + * Offset Length in bytes Field + * 00h 1 Set to 80h if this partition is active. + * 01h 1 Partition's starting head. + * 02h 2 Partition's starting sector and track. + * 04h(SI) 1 Partition's ID number. + * 05h 1 Partition's ending head. + * 06h 2 Partition's ending sector and track. + * 08h 4 Starting LBA. + * 0Ch 4 Partition's length in sectors. + */ + + pushw %ds /* DS=0x9400 */ + pushw %es /* ES=FS_BOOT */ + pushal + pushfw + + //pushw %si + //stc + //jc invalid_or_null /* invalid or null entry */ +#if 0 + /* backup 63 sectors at FS_BOOT:0 to 63 sectors at FS_BOOT:8000 + * this piece of code is no longer useful. + */ + pushw %es + popw %ds + xorw %si, %si + movw $0x8000, %di + movw $0x3f00, %cx + cld + repz movsw +#endif + +#if (defined(GRLDR_MBR)) || (defined(GRLDR_INSTALL)) + testb $0x80, %cs:0x02 /* boot previous MBR first? */ + jnz 2f /* no, continue to find GRLDR */ + + /* yes, call the routine for booting the previous MBR. + * it will not return on success. + * on failure, it will return here + */ + + /* before we call the routine, we will check if the user want to + * skip this step and continue to find the GRLDR + */ +#if 0 + movw $(press_space_bar_string - _start1), %si + cmpw $0x3920, %cs:0x04 + je 1f + movw $(press_hot_key_string - _start1), %si +1: + /* if timeout==0, don't display the message */ + + cmpb $0, %cs:0x03 + je 1f + call print_message /* CS:SI points to message string */ + movw $(press_any_key_string - _start1), %si + call print_message /* CS:SI points to message string */ +#else + cmpb $0, %cs:0x03 + je 1f + movw $(press_hot_key_pre - _start1), %si + call print_message + movw $(press_hot_key_name - _start1), %si + call print_message + movw $(press_hot_key_sub - _start1), %si + call print_message +#endif +1: + call sleep_5_seconds + jc 1f /* desired hot-key pressed */ + call boot_prev_mbr //Error_modify +1: + orb $0x80, %cs:0x02 +2: +#endif + popfw + popal + popw %es + popw %ds + + pushw %ds /* DS=0x9400 */ + pushw %es /* ES=FS_BOOT */ + pushal + pushfw + + //cmpb $0x0e, 0x00 /* EBIOS previously checked OK? */ + //jbe 1f /* yes, skip the check */ + movb $0x02, 0x00 /* initialise this byte to 0x02 */ + movb $0x41, %ah /* EBIOS check existence */ + movw $0x55aa, %bx + int $0x13 + jc 1f /* No EBIOS */ + cmpw $0xaa55, %bx + jnz 1f /* No EBIOS */ + testb $1, %cl + jz 1f /* No EBIOS */ + movb $0x42, 0x00 /* LBA supported, save 0x42 to 9400:0000 */ +1: + popfw + popal + popw %es + popw %ds + + pushw %ds /* DS=0x9400 */ + pushw %es /* ES=FS_BOOT */ + pushal + pushfw + + pushaw + cmpw $0x1c2, %si + jne 1f + /* initialize partition number and partition entries end */ + movw $0xffff, 0x1bc /* hd partition number */ + movw $0x01fe, 0x1ba /* partition entries end */ +1: + pushw %dx + testb %dl, %dl + jns 1f /* floppy, use normal CHS mode */ + cmpw $0x1f2, %si /* is it a primary partition? */ + ja 2f /* no, it is an extended partition */ + movl 4(%si), %eax + movl %eax, 8(%si) /* parent part_start saved here */ + xorl %eax, %eax + movl %eax, 4(%si) /* current part_start(0) saved here */ +2: + //movl -4(%si), %eax + //cmpl $0xfffffe00, %eax /* check the starting CHS */ + //jb 1f /* use normal CHS mode */ + + /* get CHS total number of sectors */ + pushw %es + pushw %ds + movb $8, %ah /* read drive parameters changes DX,ES,DI */ + //movb $0x80, %dl /* BIOS drive number is in DL */ + int $0x13 + popw %ds + popw %es + jc 3f + testb $63, %cl + jnz 2f +3: + /* failed to get drive parameters, use maximum value */ +#if 0 + popw %dx + pushw %dx + cmpb $0x80, %dl + jne 3f + pushw %ds + xorw %ax, %ax + movw %ax, %ds + cmpb $0, 0x475 + popw %ds + je 3f + +3: +#endif + movw $0xffff, %cx + movw %cx, %dx +2: + //xorl %eax, %eax + movzbl %dh, %eax + incw %ax + movzbl %cl, %edx + andb $63, %dl + mulw %dx /* DX=0, AX=product */ + shrb $6, %cl + xchgb %cl, %dh + xchgb %ch, %dl + incw %dx /* DX=total cylinders */ + mull %edx /* EDX=0, EAX=product */ + + /* check the partition's starting LBA */ + movl 4(%si), %ebx + addl 8(%si), %ebx /* EBX=start_LBA */ + + testl %ebx, %ebx + je 1f + + ///* we always use LBA mode */ + ////cmpl %eax, %ebx + ////jb 1f /* use normal CHS mode */ + cmpb $0x42, 0x00 /* EBIOS present? */ + jne 1f /* no, skip the LBA mode int13 call */ + + /* load partition boot track to FS_BOOT using LBA mode */ + popw %ax /* AX=orig DX which holds drive number DL */ + pushw %ax + pushl %edx /* EDX=0, higher 4 bytes of starting LBA */ + pushl %ebx /* lower 4 bytes of starting LBA */ + pushw %es /* ES=FS_BOOT */ + pushw %dx /* DX=0, ES:0 is the buffer */ + //pushl $0x003f0010 /* transfer 63 sectors */ + pushw $0x3f /* transfer 63 sectors */ + pushw $0x10 /* size of disk address packet */ + xchgw %ax, %dx /* restore drive number DL from AL */ + movb $0x42, %ah /* extended read */ + movw %sp, %si /* DS:SI points to disk address packet */ + int $0x13 /* ignore the read failure */ + popaw /* adjust the stack */ + jc 1f + popw %dx + popaw + + //popw %ax /* discard flags in the stack */ + popfw + clc + + pushfw /* push new flags with CF=0 */ + pushaw + pushw %dx +1: + popw %dx + popaw + + popfw + popal + popw %es + popw %ds + + pushw %ds /* DS=0x9400 */ + pushw %es /* ES=FS_BOOT */ + pushal + pushfw + + pushw %si + + pushfw + pushw %es +//--------------------------------------------------------- + /* print "Try (hd0,n): " or "Try (fd0): "*/ + pushw %ds + popw %es /* ES=DS=CS=0x9400 */ + + cld /* for stosb */ + xorw %ax, %ax + testb %dl, %dl + jns 1f /* floppy */ + /* hard drive */ +#if 0 + movw %si, %ax + subw $0x1c2, %ax + shrw $4, %ax + cmpw $0x1fe, %si /* is in MBR? */ + jb 1f /* yes */ + /* no, it is an entry in an extended partition */ + movb $0xFC, (add_sub_si + 2 - _start1) /* addw $-4, %si */ + incw 0x1bc /* logical partition number */ + movb 0x1bc, %al +#else + incw 0x1bc /* logical partition number */ + movw 0x1bc, %ax + cmpb $4, %al + jb 1f + movb $0xFC, (add_sub_si + 2 - _start1) /* addw $-4, %si */ +#endif +1: + /* AL=partition number, AH=0 */ + pushw %ax + + movw $(partition_message - _start1 + 7), %di /* drive type */ + movb %dl, %al + shrb $7, %al /* drive type: floppy=0, harddrive=1 */ + shlb $1, %al + addw $0x6466, %ax /* "fd" or "hd" */ + stosw + movb %dl, %al + andb $0x7f, %al /* drive number */ + aam /* convert binary to decimal, AH=high, AL=low */ + testb %ah, %ah + jz 1f + addb $0x30, %ah + movb %ah, (%di) + incw %di +1: + addb $0x30, %al + stosb + + popw %ax + + testb %dl, %dl + jns 2f /* floppy */ + /* this is a hard drive, the partition number is in AL */ + movb $0x2c, (%di) /* "," */ + incw %di + aam /* convert binary to decimal, AH=high, AL=low */ + testb %ah, %ah + jz 1f + addb $0x30, %ah + movb %ah, (%di) + incw %di +1: + addb $0x30, %al + stosb +2: + movl $0x00203a29, (%di) /* "): \0" */ + + movw $(partition_message - _start1), %si + call print_message /* CS:SI points to message string */ +//--------------------------------------------------------- + popw %es + popfw + //stc + jc invalid_or_null /* invalid or null entry */ + + xorw %si, %si + pushw %es + popw %ds + + /* DS=ES=FS_BOOT */ + + /* First, check for ext2 filesystem */ + + cmpw $0xEF53, 0x438 /* Magic signature */ + jnz 1f + xorl %eax, %eax + cmpl %eax, 0x400 /* s_inodes_count */ + jz 1f + cmpl %eax, 0x404 /* s_blocks_count */ + jz 1f +// cmpw %ax, 0x458 /* s_inode_size, usually 0x80 */ +// jz 1f + cmpl %eax, 0x420 /* s_blocks_per_group */ + jz 1f + cmpl %eax, 0x428 /* s_inodes_per_group */ + jz 1f + movl 0x414, %eax /* s_first_data_block */ + movw %ax, %bx /* BX=1 for 1K block, 0 otherwise */ + shrl $1, %eax /* must be 0 */ + jnz 1f + movl 0x418, %ecx /* s_log_block_size */ + cmpl $4, %ecx /* max size of block is 16K */ + ja 1f + negw %cx /* CF clear for 1K block, set otherwise */ + adcw %ax, %bx /* EAX=0 */ + decw %bx + jnz 1f + + /* BX = 0 */ + + /* super block is sane */ + + //pushw %cs + //popw %ds + ///* DS=SS=0x9400 */ + ///* ES=FS_BOOT */ + cld + movw $0x800, %si + xorw %di, %di + movw $0x0200, %cx /* yes, we need 2 sectors if enable debug */ + + repz cs movsw /* CS segment override prefix(=0x2E) */ + + /* modify the boot partition number */ + + /* the boot partition number is at offset 0x25 for ext2 */ + + testb %dl, %dl + jns 3f /* no modification for floppy */ + movw $0x25, %di + movw %cs:0x1bc, %ax /* partition number */ + stosb +3: + /* fix for ext2 partition: hidden_sectors, offset 0x1c */ + popw %si /* DI points to old entry in MBR */ + pushw %si + xorl %eax, %eax /* let hidden_sectors=0 for floppy */ + testb %dl, %dl + jns 3f /* floppy */ + movl %cs:4(%si), %eax + addl %cs:8(%si), %eax +3: + movl %eax, %es:0x1c(%bx) /* adjust hidden_sectors for EXT2 */ + + /* fix for ext2 partition: EBIOS indicator, offset 0x02 */ + + movb %cs:0x00(%bx), %al + movb %al, %es:0x02(%bx) + + /* fix for ext2 partition: sectors per block, offset 0x0d */ + /* fix for ext2 partition: bytes per block, offset 0x0e */ + /* fix for ext2 partition: dwords per block(dpb), offset 0x14 */ + /* fix for ext2 partition: square of dpb, offset 0x10 */ + + movb %es:0x418, %cl /* s_log_block_size */ + //incw %cx + movl $2, %eax + shlw %cl, %ax + movb %al, %es:0x0d(%bx) + shlw $9, %ax /* block size is word wide */ + movw %ax, %es:0x0e(%bx) + shrw $2, %ax + movl %eax, %es:0x14(%bx) + addb $8, %cl + shll %cl, %eax + movl %eax, %es:0x10(%bx) + + + /* fix for ext2 partition: sectors per track, offset 0x18 */ + /* fix for ext2 partition: number of heads, offset 0x1a */ +#if 1 + pushw %ds + pushw %es + pushw %bx + pushw %dx + movb $8, %ah /* read drive parameters changes DX,ES,DI,BX */ + movb $0x80, %dl /* BIOS drive number is in DL */ + int $0x13 + movw %dx, %ax + popw %dx + popw %bx + popw %es + popw %ds + jc 3f + andb $63, %cl + jz 3f + movb %cl, %es:0x18(%bx) + shrw $8, %ax + incw %ax + movw %ax, %es:0x1a(%bx) +3: +#else + testb %dl, %dl + jns 3f /* floppy */ + popw %di /* DI points to old entry in MBR */ + pushw %di + movw %cs:1(%di), %ax + andb $63, %ah + movb %ah, %es:0x18 + xorb %ah, %ah + incw %ax + movw %ax, %es:0x1a +3: +#endif + + /* fix for ext2 partition: s_inodes_per_group, offset 0x28 */ + movl %es:0x428, %eax /* s_inodes_per_group */ + movl %eax, %es:0x28(%bx) + + /* fix for ext2 partition: block number for group descriptors, offset 0x2c */ + /* At which block the group descriptors begin? */ + movl %es:0x414, %eax /* s_first_data_block */ + incw %ax + movl %eax, %es:0x2c(%bx) + + /* fix for ext2 partition: on error go back to supervisor, offset 0x01fc */ + movw $0x01fc, %si + movw %si, %di + lodsw + cmpw $0xFEEB, %ax /* EB FE is jmp back to itself(infinite loop) */ + jnz 3f + decw %ax /* AL=0xEA, ljmp */ + stosb + //movw $(try_next_partition - _start1), %ax + movw $MONITOR, %ax + stosw + //movw %cs, %ax /* AX=0x9400 */ + xorw %ax, %ax + stosw /* the last byte 0x00 is in the next sector! */ +// addw $0x0f, %di +// movw $(restore_GRLDR_CS - _start1), %si +// movw $((gdt_end - restore_GRLDR_CS) / 4), %cx +// .byte 0x2e /* %cs: prefix */ +// repz movsl +3: + + movw $(EXT2_message - _start1), %si + call print_message /* CS:SI points to message string */ + + clc + jmp move_entries_and_return + +1: + #; It is not EXT2. Check for FAT12/16/32/NTFS. + + /* DS=ES=FS_BOOT */ + + cmpw $0x200, 0x0b(%si) /* bytes per sector */ + jne 1f /* not a normal BPB */ + movb 0x0d(%si), %al /* sectors per cluster */ + testb %al, %al + jz 1f /* invalid if = 0 */ + movb %al, %cl + movw $128, %ax + divb %cl /* quo=AL, rem=AH */ + testb %ah, %ah + jnz 1f /* invalid if not 2^n */ + movw 0x18(%si), %ax /* sectors per track */ + testw %ax, %ax + jz 1f /* invalid if = 0 */ + cmpw $63, %ax + ja 1f /* invalid if > 63 */ + movw 0x1a(%si), %ax /* number of heads */ + decw %ax /* Max head number, should be a byte */ + testb %ah, %ah /* should be 0 */ + jnz 1f /* invalid if number of heads > 256 */ + cmpb $0xf0, 0x15(%si) /* media descriptor */ + jb 1f + + cmpb $0x42, %cs:0x00 /* EBIOS present? */ + jne 3f + //movb $0x41, %ah /* EBIOS check existence */ + //movw $0x55aa, %bx + //int $0x13 + //jc 3f /* No EBIOS */ + //cmpw $0xaa55, %bx + //jnz 3f /* No EBIOS */ + //testb $1, %cl + //jz 3f /* No EBIOS */ + movb $0x0e, 0x02(%si) /* force LBA */ +3: + cld + movw $0x0600, %bx /* FAT12/FAT16 */ + movw $0x003c, %cx /* FAT12/FAT16 */ + + movb 0x10(%si), %al /* number of FATs(NTFS:0, FAT:1,2) */ + cmpb $2, %al + ja 1f /* abnormal FAT */ + movw 0x11(%si), %ax /* max root entries */ + testw %ax, %ax + jnz 2f /* FAT12/FAT16 */ + + /* FAT32 or NTFS */ + movw 0x13(%si), %ax /* total sectors(small) */ + testw %ax, %ax + jnz 1f /* invalid FAT32 BPB */ + movw 0x16(%si), %ax /* sectors per FAT(small) */ + testw %ax, %ax + jnz 1f /* invalid FAT32 BPB */ + movb 0x10(%si), %al /* number of FATs(NTFS:0, FAT:1,2) */ + testb %al, %al + jz 8f + + /* FAT32 */ + movl 0x20(%si), %eax /* FAT32 total sectors */ + testl %eax, %eax + jz 1f + movl 0x24(%si), %eax /* FAT32 sectors per FAT */ + testl %eax, %eax + jz 1f + movw $0x0400, %bx /* FAT32 */ + movw $0x0058, %cx /* FAT32 */ + movw $(FAT32_message - _start1), %si + jmp 7f +8: + /* NTFS */ + movl 0x20(%si), %eax /* FAT32 total sectors */ + testl %eax, %eax + jnz 1f + //movw 0x11(%si), %ax /* max root entries */ + //testw %ax, %ax + //jnz 1f + movw 0x0e(%si), %ax /* reserved sectors */ + testw %ax, %ax + jnz 1f + + /* BUG fix for extended NTFS partition */ + popw %si /* SI points to old entry in MBR */ + pushw %si + xorl %eax, %eax /* let hidden_sectors=0 for floppy */ + testb %dl, %dl + jns 3f /* floppy */ + movl %cs:4(%si), %eax + addl %cs:8(%si), %eax +3: + movl %eax, 0x1c /* adjust hidden_sectors for NTFS */ + + movb %dl, 0x24 /* adjust drive number for NTFS */ + +#if 1 + // Load NTFS using internal boot sector at 0xA00 + + movw $(NTFS5_message - _start1), %si + call print_message /* CS:SI points to message string */ + + movw $0xA00, %bx + movw $0x52, %cx + + pushw %cs + popw %ds + + /* DS=SS=0x9400 */ + /* ES=FS_BOOT */ + + movw %bx, %si + xorw %di, %di + lodsw + stosw + addw %cx, %si + addw %cx, %di + movw $0x800, %cx + subw %di, %cx + + repz movsb + + /* modify the boot partition number */ + movb %es:1, %al + addb $5, %al /* AL is less than 0x80 */ + cbw /* AH=0 */ + xchgw %ax, %di /* move AX to DI */ + movb $0xff, %al /* partition=whole drive for floppy */ + testb %dl, %dl + jns 3f /* no modification for floppy */ + movb 0x1bc, %al /* partition number */ +3: + stosb + + /* fix for NTFS partition: on error go back to supervisor, offset 0x01fa */ + + movw $0x01fa, %di + movw %es:(%di), %ax + cmpw $0xFEEB, %ax /* EB FE is jmp back to itself(infinite loop) */ + jnz 3f + decw %ax /* AL=0xEA, ljmp */ + stosb + //movw $(try_next_partition - _start1), %ax + movw $MONITOR, %ax + stosw + + //movw %cs, %ax /* AX=0x9400 */ + xorw %ax, %ax + stosw /* DI=0x01ff */ +3: + clc + jmp move_entries_and_return + +#else + + /* modify the boot partition number */ + movb $0xB6, %al /* 0xB6="MOV DH,imm8" */ + movb %cs:0x1bc, %ah + testb %dl, %dl + js 3f + movb $0xff, %ah /* partition number for floppy is whole drive */ +3: + /* before the call: + * AH= partition number + * AL= 0xB6 ; 0xB6 is opcode of "MOV DH,imm8" + * DL= drive number + * + * on return: CF=0 if there is NTFS boot record; + * CF=1 otherwise. + * CF of flags_orig on the stack will set if CF=1 + */ + + call modify_NTFS_boot_record + //jnc move_entries_and_return + //movw $(NTFS5_message - _start1), %si + ////jmp 4f + //call print_message /* CS:SI points to message string */ + //stc + jmp move_entries_and_return + +#endif + +2: + /* FAT12/FAT16 */ + movb 0x10(%si), %al /* number of FATs(NTFS:0, FAT:1,2) */ + testb %al, %al + jz 1f + movw 0x16(%si), %ax /* sectors per FAT(small) */ + testw %ax, %ax + jz 1f + movw $(FAT16_message - _start1), %si + cmpw $12, %ax + ja 7f + movw $(FAT12_message - _start1), %si +7: + /* BUG fix for extended FAT12/16/32 partition */ + popw %di /* DI points to old entry in MBR */ + pushw %di + xorl %eax, %eax /* let hidden_sectors=0 for floppy */ + testb %dl, %dl + jns 3f /* floppy */ + movl %cs:4(%di), %eax + addl %cs:8(%di), %eax +3: + movl %eax, 0x1c /* adjust hidden_sectors for FAT */ + + call print_message /* CS:SI points to message string */ + pushw %cs + popw %ds + /* DS=SS=0x9400 */ + /* ES=FS_BOOT */ + movw %bx, %si + xorw %di, %di + lodsw + stosw + addw %cx, %si + addw %cx, %di + movw $0x0200, %cx + subw %di, %cx + repz movsb + /* modify the boot partition number */ + movb %es:1, %al + addb $5, %al /* AL is less than 0x80 */ + cbw /* AH=0 */ + xchgw %ax, %di /* move AX to DI */ + movb $0xff, %al /* partition=whole drive for floppy */ + testb %dl, %dl + jns 3f /* no modification for floppy */ + movb 0x1bc, %al /* partition number */ +3: + stosb + + /* fix for FAT12/16/32 partition: on error go back to supervisor, offset 0x01fa */ + //pushw %es + //popw %ds + movw $0x01fa, %di + //movw %di, %si + //lodsw + movw %es:(%di), %ax + cmpw $0xFEEB, %ax /* EB FE is jmp back to itself(infinite loop) */ + jnz 3f + decw %ax /* AL=0xEA, ljmp */ + stosb + //movw $(try_next_partition - _start1), %ax + movw $MONITOR, %ax + stosw + //movw %cs, %ax /* AX=0x9400 */ + xorw %ax, %ax + stosw /* DI=0x01ff */ +3: + + clc + jmp move_entries_and_return +1: + #; It is not FAT12/16/32/NTFS. Check for extended partition. + + /* DS=ES=FS_BOOT */ + + pushw %cs + popw %es + + /* ES=SS=0x9400 */ + /* DS=FS_BOOT */ + + popw %si + pushw %si + cmpb $0x05, %es:(%si) /* extended */ + je 1f + cmpb $0x0f, %es:(%si) /* Win95 extended (LBA) */ + je 1f + cmpb $0x15, %es:(%si) /* hidden extended */ + je 1f + cmpb $0x1f, %es:(%si) /* hidden win95 extended (LBA) */ + je 1f + cmpb $0x85, %es:(%si) /* Linux extended */ + je 1f + movw $(non_MS_message - _start1), %si +4: + call print_message /* CS:SI points to message string */ + stc + jmp move_entries_and_return +1: + /* extended partition entry */ + cmpw $0x1fe, %si + jb 1f + decw %es:0x1bc /* count the partitions in extended zone */ +1: + movw $(extended_message - _start1), %si + call print_message /* CS:SI points to message string */ + movw $0x1be, %si + movw $4, %cx +5: + //xorl %eax, %eax + //cmpl %eax, (%si) + //jnz 2f + movl (%si), %eax + cmpw 2(%si), %ax /* Is EAX high word equal to AX? */ + jnz 2f + cmpb %al, %ah /* Is AL=AH? */ + jnz 2f + + /* now all 4 bytes in EAX are equal to each other. */ + cmpl %eax, 4(%si) + jnz 2f + cmpl %eax, 8(%si) + jnz 2f + cmpl %eax, 12(%si) + jz 3f /* entry with 16 dups of a byte means empty entry */ +2: + movb (%si), %al + shlb $1, %al + jnz 1f + //jnz 3f /* invalid entry is treated as empty entry */ + movb 2(%si), %al + and $63, %al /* starting sector number */ + jz 1f + //jz 3f /* invalid entry is treated as empty entry */ + movb 6(%si), %al + and $63, %al /* ending sector number */ + jz 1f + //jz 3f /* invalid entry is treated as empty entry */ + movl 8(%si), %eax /* starting LBA */ + testl %eax, %eax + jz 1f + //jz 3f /* invalid entry is treated as empty entry */ + movl 12(%si), %eax /* total number of sectors in partition */ + testl %eax, %eax + jz 1f +3: + addw $16, %si + loop 5b + cmpw $0xaa55, (%si) + jnz 1f + + movw $0x1be, %si + movw $4, %cx + popw %bx /* the old SI points to extended partition ID in MBR */ + pushw %bx +5: +#if 1 + //xorl %eax, %eax + //cmpl %eax, (%si) + //jnz 2f + movl (%si), %eax + cmpw 2(%si), %ax /* Is EAX high word equal to AX? */ + jnz 2f + cmpb %al, %ah /* Is AL=AH? */ + jnz 2f + + /* now all 4 bytes in EAX are equal to each other. */ + cmpl %eax, 4(%si) + jnz 2f + cmpl %eax, 8(%si) + jnz 2f + cmpl %eax, 12(%si) + jz 3f /* entry with 16 dups of a byte means empty entry */ +2: + /* now it is an acceptable entry */ + movw %es:0x1ba, %di /* partition entries end */ + /* ensure our stack not to be overwritten by the partition entries */ + cmpw $0x83f0, %di + ja 3f /* try next */ + /* ensure our code not to be overwritten by the partition entries */ + cmpw $0x3fe, %di + jne 6f + /* more entries stores at 0x9be00-0x9c3ff */ + movw $0x7e00, %di + movw %di, %es:0x1ba +6: + addw $16, %es:0x1ba /* increment partition entries end */ + + lodsl + stosl + lodsl + stosl + + xchgw %ax, %dx /* save AL(the partition ID)to DL */ + + lodsl + xchgl %eax, %edx /* restore AL from DL(the partition ID) + * and save EAX to EDX */ + cmpb $0x05, %al + je 6f + cmpb $0x0f, %al + je 6f + cmpb $0x15, %al + je 6f + cmpb $0x1f, %al + je 6f + cmpb $0x85, %al + je 6f + /* normal partition, copied to 0x941fe-0x943fb */ + addl %es:4(%bx), %edx /* current partition start */ +6: + /* extended partition, copied to 0x941fe-0x943fb */ + xchgl %eax, %edx /* restore or update EAX from EDX */ + stosl + lodsl /* adjust SI only */ + movl %es:8(%bx), %eax /* parent partition start ... */ + stosl /* ... stored here */ + jmp 2f +3: + addw $16, %si +#endif + //. = 5b + 0x7c +2: + loop 5b + + /* extended partition is not a normal one, so set carry to try next */ + stc + jmp move_entries_and_return + +invalid_or_null: +1: + movw $(invalid_message - _start1), %si + call print_message /* CS:SI points to message string */ + stc + +move_entries_and_return: + popw %si + pushfw + pushw %cs + popw %ds + pushw %cs + popw %es + pushw %si + cmpw $0x202, %si + jne 1f + /* move entries backward 1 entry */ + movw $0x1fe, %di + movw $0x20e, %si + movw $0xf8, %cx /* 0x1f0 bytes = 0xf8 words */ + cld /* move upward */ + repz movsw + movw $0x3ee, %di + movw $0x7e00, %si + movw $0x8, %cx /* 0x10 bytes = 0x8 words */ + cld /* move upward */ + repz movsw + movw $0x7e00, %di + movw $0x7e10, %si + movw $0x2f8, %cx /* 0x5f0 bytes = 0x2f8 words */ + cld /* move upward */ + repz movsw + cmpw $0x7e10, 0x1ba + jne 2f + movw $0x40e, 0x1ba +2: + subw $0x10, 0x1ba + +1: + popw %si + movw $0x1ff, (add_sub_si + 5 - _start1) + cmpw $0x1fe, 0x1ba + jne 1f + decw (add_sub_si + 5 - _start1) + cmpw $0x31b2, %si /* floppy? */ + je 1f /* yes */ + cmpw $0x1f2, %si + ja 2f /* logical partition */ + jb 1f /* primary partition 0, 1, 2 */ + /* primary partition 3 */ + cmpw $0x0003, 0x1bc /* are there any logical partitions? */ + ja 1f /* yes */ +2: +inc_hard_drive: + + /* all partitions on the drive have been checked, try next drive. + * + * the current stack is: + * + * SP + 38 : DS + * SP + 36 : ES + * SP + 32 : EAX + * SP + 28 : ECX + * SP + 24 : EDX + * SP + 20 : EBX + * SP + 16 : ESP_temp + * SP + 12 : EBP + * SP + 8 : ESI + * SP + 4 : EDI + * SP + 2 : flags_orig + * SP : flags + * + */ + + /* get total hard drives */ + xorw %ax, %ax + movw %ax, %ds + movb 0x475, %dh + pushw %cs + popw %ds +// cmpb $16, %dh +// jnb 2f +// movb $16, %dh +//2: + orb $0x80, %dh /* CF=0, DH=Max harddrive number + 1 */ + //xchgw %ax, %cx /* CL=Max harddrive number + 1, CH=0 */ + movw %sp, %bp + movb 24(%bp), %dl /* BIOS drive number is in DL */ +2: + jnc 3f + call print_message /* CS:SI points to message string */ + movw $(drive_number_string - _start1), %si + movb %dl, %al + andb $0x7f, %al + aam /* AH=high decimal, AL=low decimal */ + addw $0x3030, %ax + xchgb %al, %ah + movw %ax, 9(%si) + call print_message /* CS:SI points to message string */ +3: + incw %dx + cmpb %dh, %dl + jnb 2f /* all drives checked, try floppy finally */ + + pushw %bx + pushw %dx + pushw %es + movb $8, %ah /* read drive parameters changes DX, ES, DI */ + int $0x13 + popw %es + jc 3f /* try next hard drive */ + //xchgw %ax, %cx /* this moves CL to AL */ + andb $63, %cl /* CL=sectors per track, CF cleared */ + stc + jz 3f /* try next hard drive */ + popw %dx /* get DL */ + popw %bx + movb %dl, %ch /* DL saved at BP high byte in the stack */ + pushw %cx /* push new BX onto stack */ + pushw %dx + //movb $0x02, %ah + //movw %ax, %si /* save AX to SI: read 1 track */ + movw $0x201, %ax /* read 1 sector */ + movw $0x7e00, %bx /* read MBR to 9400:7e00 */ + movw $1, %cx + //popw %dx + //pushw %dx + xorb %dh, %dh + stc + int $0x13 + sti +3: + popw %dx + popw %bx /* BL=sectors per track, BH=DL */ + + //movw %si, %bx /* BL=sectors per track */ + + movw $(Error_while_reading_string - _start1), %si + jc 2b /* read failure, try next hard drive */ + + /* on seccessful return, should be: ah=0 for OK, al=1 for 1 sector */ + //decw %ax /* some BIOSes return incorrect AL */ + testb %ah, %ah + stc + jnz 2b + + /* The new partition table might be empty or invalid. + * Move the new partition table onto the old one while checking + */ + + //movb %dl, %bh /* DL saved at BP high byte in the stack */ + + movw $0x7fbe, %si + movw $0x01be, %di + +3: + cmpw $0x1fe, %di + jnb 3f + + xorl %ecx, %ecx + + lodsl + stosl + orl %eax, %ecx + lodsl + stosl + orl %eax, %ecx + lodsl + stosl + orl %eax, %ecx + lodsl + stosl + orl %eax, %ecx + jecxz 3b /* null entry, check next */ + + //lodsw + //stosw + movb -16(%si), %al + shlb $1, %al + stc + xchgw %ax, %si /* save SI to AX */ + movw $(partition_boot_indicator_string - _start1), %si + jnz 2b + xchgw %ax, %si /* restore SI from AX */ + //lodsw + //stosw + movb -14(%si), %al + andb $63, %al + stc + xchgw %ax, %si /* save SI to AX */ + movw $(partition_sectors_per_track_string - _start1), %si + jz 2b + xchgw %ax, %si /* restore SI from AX */ + //lodsw + //stosw + //lodsw + //stosw + movb -10(%si), %al + andb $63, %al + stc + xchgw %ax, %si /* save SI to AX */ + movw $(partition_sectors_per_track_string - _start1), %si + jz 2b + xchgw %ax, %si /* restore SI from AX */ + //lodsl + //stosl + movl -8(%si), %eax + testl %eax, %eax + stc + xchgw %ax, %si /* save SI to AX */ + movw $(partition_start_sector_string - _start1), %si + jz 2b + xchgw %ax, %si /* restore SI from AX */ + + //lodsl + //stosl + movl -4(%si), %eax + testl %eax, %eax + stc + xchgw %ax, %si /* save SI to AX */ + movw $(partition_end_sector_string - _start1), %si + jz 2b + xchgw %ax, %si /* restore SI from AX */ + + jmp 3b +3: + cmpw $0xAA55, (%si) + stc + xchgw %ax, %si /* save SI to AX */ + movw $(no_boot_signature_string - _start1), %si + jnz 2b + xchgw %ax, %si /* restore SI from AX */ + //lodsw + //stosw /* store boot signature */ + + /* Now the partition table is OK */ + + movw %bx, 12(%bp) /* adjust BP in the stack */ + + movw $0x1b2, 8(%bp) /* adjust SI in the stack */ + + /* temp change the code: call self_modify_once + * + * "call self_modify_once" at add_sub_si is: + * + * .byte 0xE8 + * .word (self_modify_once - add_sub_si - 3) + * + */ + movb $0xE8, (add_sub_si - _start1) + movw $(self_modify_once - add_sub_si - 3), (add_sub_si + 1 - _start1) + + /* initialize partition number and partition entries end */ + movw $0xffff, 0x1bc /* hd partition number */ + movw $0x01fe, 0x1ba /* partition entries end */ + + jmp 1f +2: + /* get here if all drives have been checked */ +#if 0 + movw $0x202, 8(%bp) /* adjust SI in the stack */ + + /* restore the original code: addw $-4, %si */ + movw $0xC683, (add_sub_si - _start1) /* 0x83, 0xC6 */ + movb $0xFC, (add_sub_si + 2 - _start1) /* 0xFC */ +#endif + //-------------------------------------------------------------------- + /* change the code: jmp Error_modify + * + * "jmp Error_modify" at Error_or_prev_MBR: + * + * .byte 0xE9 + * .word (Error_modify - Error_or_prev_MBR - 3) + * + */ + movb $0xE9, (Error_or_prev_MBR - _start1) + movw $(Error_modify - Error_or_prev_MBR - 3), (Error_or_prev_MBR + 1 - _start1) + //-------------------------------------------------------------------- + + //-------------------------------------------------------------------- + /* floppy search disabled ? */ +#if 0 + testb $1, 0x02 /* test bit0 of the third byte */ + jz 1f /* zero means floppy search enabled */ + /* 0x1fd or below means disable floppy search */ + decw (add_sub_si + 5 - _start1) +#else + movb 0x02, %al + andb $0x01, %al + subb %al, (add_sub_si + 5 - _start1) +#endif + //-------------------------------------------------------------------- + +1: +#if 0 + popfw + lahf /* Load Flags into AH Register. */ + /* AH = SF:ZF:xx:AF:xx:PF:xx:CF */ + /* CF will be moved to ZF */ + movb %ah, %al + andb $1, %al /* CF=0 */ + shlb $6, %al /* move CF to ZF */ + popfw + lahf /* Load Flags into AH Register. */ + /* AH = SF:ZF:xx:AF:xx:PF:xx:CF */ + andb $0xbf, %ah /* 0xbf= binary 1011 1111. It clears ZF */ + orb %al, %ah +#else + popw %ax /* AX=Flags */ + popfw /* Flags_orig */ + lahf /* Load Flags_orig into AH Register. */ + /* AH = SF:ZF:xx:AF:xx:PF:xx:CF */ + shlb $2, %ah + rorw $2, %ax /* move CF of Flags to ZF of Flags_orig */ +#endif + + sahf /* update flags */ + /* current CF is the CF of Flags_orig */ + /* current ZF is the CF of Flags */ + jc 1f /* CF=1 means failed in loading bootsector */ + popal /* get drive number DL */ + pushal + pushfw + cmpb $0xff, %cs:0x06 + jz 2f + movb %cs:0x1bc, %dh + testb %dl, %dl + js 3f + movb $0xff, %dh /* partition # for floppy is "whole drive" */ +3: + cmpw %cs:0x06, %dx + jz 2f + popfw + stc + pushfw +2: + popfw +1: + popal + popw %es + popw %ds + ret + +self_modify_once: + /* when we get here, SI should be 0x1b2, and BP high holds DL */ + addw $12, %si /* 0x83, 0xC6, 0x0C */ + movw %bp, %ax + movb %ah, %dl + + /* note: DS=0x9400 */ + + /* restore the original code: addw $12, %si */ + movw $0xC683, (add_sub_si - _start1) /* 0x83, 0xC6 */ + movb $0x0C, (add_sub_si + 2 - _start1) /* 0x0C */ + ret + +Error_modify: + cmpb $0xff, %cs:0x06 /* preferred drive? */ + jz 1f /* not active. Turn to the final step. */ + + /* preferred drive is already handled, so de-activate it now. */ + movb $0xff, %cs:0x06 + + /* we will do the second pass, from drive 0x80. */ + movb $0x7f, %dl /* this will become 0x80 after inc. */ + + /* pass "error" to PUSHF, simulating a load failure, in order + * to try the first entry after return from the helper function. + */ + + stc + + pushw $(helper_call + 3 - _start1) /* return address */ + pushw %cs /* 0x9400, it is for DS. */ + pushw $FS_BOOT /* 0x0d00, it is for ES. */ + pushal + //pushl %eax + //pushl %ecx + //pushl %edx + //pushl %ebx + //pushl %esp + //pushl %ebp + //pushl %esi + //pushl %edi + pushfw /* CF=1 */ + pushfw + + pushw %cs + popw %es /* ES=0x9400 */ + + /* redo from start: DL will be 0x80 after inc. */ + jmp inc_hard_drive +1: +boot_prev_mbr: + + /* prepare to boot the previous MBR */ + + /* at this moment DS=0x9400, ES=$FS_BOOT or ES=0x9400 */ + xorw %ax, %ax + //pushw %ax /* AX=0, for the segment of 0000:7c00 */ + movw %ax, %es /* ES=0x0000 */ + movw %ax, %ds /* DS=0x0000 */ + pushw %ds + pushw %es + movw $0x0202, %ax /* read 2 sectors ... */ + movw $0x7A00, %bx /* ... to 0000:7A00 */ + //pushw %bx /* BX=0x7c00, for the offset of 0000:7c00 */ + movw $0x0001, %cx /* from the first sector ... */ + movw $0x0080, %dx /* ... of the first hard drive */ + stc + int $0x13 + sti + popw %es + popw %ds + jc 1f + testb %ah, %ah + jnz 1f + cmpw $0xAA55, 0x7dfe + jne 1f + cmpw $0xAA55, 0x7bfe + jne 1f + + /* has a valid partition table ? */ + movw $0x7dbe, %si +3: + cmpw $0x7dfe, %si + jnb 3f /* partition table is OK */ + movw $4, %cx + + movw %si, %di +2: + lodsl + negl %eax + jc 2f + loop 2b + /* empty entry, check next */ + jmp 3b +2: + /* non-empty entry */ + movw %di, %si + + lodsw + shlb $1, %al + jnz 2f + lodsw + andb $63, %al + jz 2f + lodsw + lodsw + andb $63, %al + jz 2f + lodsl + negl %eax + jnc 2f + lodsl + negl %eax + jc 3b +2: + stc /* invalid partition table */ +3: + pushfw + + /* disable the boot of non-MBR bootsector ? */ + testb $2, %cs:0x02 /* test bit1 of the third byte */ + jz 2f /* zero means non-MBR enabled */ + popfw + jc 1f /* invalid partition table, print "Error" */ + + /* the partition table is valid */ + pushfw + +2: + /* the check passed, and the boot is permitted */ + popfw + + jc 2f /* invalid partition table */ + + /* use partition table in MBR instead */ + + /* copy 72 bytes at 0000:7bb8 to 0000:7db8 */ + + movw $0x7bb8, %si + movw $0x7db8, %di + movw $36, %cx + cld + repz movsw + +2: + testb $0x80, %cs:0x02 /* test bit 7 of the third byte */ + jz 2f /* zero means boot prev-MBR first */ + + movw $(Cannot_find_GRLDR_string - _start1), %si + call print_message /* CS:SI points to message string */ +//#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + movw $(press_space_bar_string - _start1), %si + cmpw $0x3920, %cs:0x04 + je 3f + movw $0x3920, %cs:0x04 + #;movw $(press_hot_key_string - _start1), %si +3: + call print_message /* CS:SI points to message string */ + movw $(prev_MBR_string - _start1), %si + call print_message /* CS:SI points to message string */ +//#else +// movw $(press_hot_key_pre - _start1), %si +// call print_message +// movw $(press_hot_key_name - _start1), %si +// call print_message +// movw $(press_hot_key_sub - _start1), %si +// call print_message +//#endif +3: + call sleep_5_seconds + /* if hot-key is pressed, wait forever until another key is pressed. */ + movb $0xff, %cs:0x03 + jc 3b /* desired hot-key is pressed */ +2: + /* boot the previous MBR */ + + /* clear the DUCE indicator */ + movl $0, 0x5FC /* DS=ES=0 */ + + //movb $0x80, %dl + ljmp $0, $0x7c00 +1: + /* no previous MBR, print "Error" */ + ///* Note the 0000:7C00 is on the stack */ + //popw %ax /* AX=0x0000 */ + //popw %ax /* AX=0x7C00 */ + + testb $0x80, %cs:0x02 /* are we called prior to the GRLDR search? */ + jnz 1f /* no, it is a failure at last */ + /* yes, so return to the caller */ + movw $(continue_string - _start1), %si + call print_message /* CS:SI points to message string */ + call sleep_5_seconds + ret +1: + movw $(message_string_helper - _start1), %si + call print_message /* CS:SI points to message string */ +1: jmp 1b /* hang */ + +sleep_5_seconds: + /* sleep 5 seconds */ + + /* sleep forever if %cs:0x03 is 0xff */ + + /* calculate the timeout ticks */ + + pushw %ds + pushl %esi + pushl %edx + + movl $0xffffffff, %edx + movzbl %cs:0x03, %eax + cmpb $0xff, %al + je 1f + movl $18, %edx /* 18.2 ticks per second. We simply use 18. */ + mulw %dx /* EDX=0, EAX=ticks */ + xchgw %ax, %dx /* EAX=0, EDX=ticks */ +1: + xorw %ax, %ax + movw %ax, %ds + movl 0x46c, %eax /* initial tick */ + movl %eax, %ecx /* ECX=initial tick */ + testl %edx, %edx + js 1f + addl %edx, %eax /* EAX=timeout tick */ + pushl %eax + + movzbl %cs:0x03, %eax + orl %eax, %eax + jz 3f + + movw $(hot_key_timeout_pre - _start1), %si + pushl %eax + call print_message + popl %eax + + movw $(hot_key_timeout_num - _start1), %si + call print_decimal +3: + movl %ecx, %esi + addl $18, %esi + + popl %eax + jmp 3f +1: + movl %edx, %eax /* EAX=0xffffffff */ + movl %edx, %esi +3: + movl 0x46c, %ebx /* EBX=current tick */ + cmpl %ecx, %ebx + jnb 2f + + /* current tick is less than initial tick, this means the ticks have + * overflowed to the next day, and EBX is rather small. */ + xorl %ecx, %ecx + movl %edx, %eax + movl $18, %esi +2: + /* check if there is any key press. */ + pushl %eax + movb $1, %ah + int $0x16 + pushw %ax + pushfw + + movb $0x11, %ah + int $0x16 + jnz 1f + popfw + jnz 2f + + /* no, there is no key press. */ + + popw %ax + popl %eax + + cmpl %esi, %ebx + jb 4f + pushl %esi + pushl %eax + pushl %edx + + + subl %esi, %eax + xorl %edx, %edx + movl $18, %esi + divl %esi + + movw $(hot_key_timeout_num - _start1), %si + pushl %ebx + call print_decimal + popl %ebx + + popl %edx + popl %eax + popl %esi + addl $18, %esi +4: + cmpl %eax, %ebx /* timeout? */ + jbe 3b /* no, continue to wait */ + + /* timeout reached, CF=0, no key pressed. */ + popl %edx + popl %esi + popw %ds + ret +1: + popfw +2: + /* yes, there is a key press. */ +#if 0 + /* clear the keyboard buffer */ + movb $1, %ah + int $0x16 + jz 1f /* no keys, end */ + movb $0, %ah + int $0x16 /* discard the key */ + jmp 1b +1: +#endif + + /* check if it is the desired key. */ + + xorw %cs:0x04, %ax /* CF=0 */ + popw %ax + je 1f + xorw %cs:0x04, %ax /* CF=0 */ + jne 2f /* not desired, return CF=0 */ + + /* remove the desired key from the keyboard buffer. */ + + movb $0, %ah + int $0x16 /* discard the key */ + jmp 3f +1: + /* remove the desired key from the keyboard buffer. */ + + movb $0x10, %ah + int $0x16 /* discard the key */ +3: + stc /* CF=1, the desired key pressed */ +2: + popl %eax + popl %edx + popl %esi + popw %ds + ret + +out_decimal: + /* + * input: EAX = number, CS:SI = buffer + */ + + pushl %edx + pushl %ecx + pushw %bx + + movl $10, %ecx + movw %si, %bx + +1: + xorl %edx, %edx + divl %ecx + addb $'0', %dl + movb %dl, %cs:(%si) + incw %si + orl %eax, %eax + jnz 1b + + pushw %si + +1: + decw %si + cmpw %bx, %si + jbe 1f + movb %cs:(%si), %al + xchgb %al, %cs:(%bx) + movb %al, %cs:(%si) + incw %bx + jmp 1b +1: + + popw %si + + popw %bx + popl %ecx + popl %edx + ret + +print_decimal: + pushw %si + call out_decimal + +1: + cmpb $'\b', %cs:(%si) + jz 2f + movb $' ', %cs:(%si) + incw %si + jmp 1b +2: + popw %si + call print_message + ret + +#if 0 +modify_NTFS_boot_record: + + /* before the call: + * AH= partition number + * AL= 0xB6 ; 0xB6 is opcode of "MOV DH,imm8" + * DL= drive number + * + * on return: CF=0 if there is NTFS boot record; + * CF=1 otherwise. + * CF of flags_orig on the stack will set if CF=1 + */ + + /* + * + * the current stack is: + * + * SP + 40 : DS + * SP + 38 : ES + * SP + 34 : EAX + * SP + 30 : ECX + * SP + 26 : EDX + * SP + 22 : EBX + * SP + 18 : ESP_temp + * SP + 14 : EBP + * SP + 10 : ESI + * SP + 6 : EDI + * SP + 4 : flags_orig + * SP + 2 : SI ; SI points to old entry in MBR + * SP : return_IP + * + */ + + /* DS=ES=FS_BOOT */ + + /* change NTLDR to GRLDR */ + + /* check GR or NT or anything else */ + + pushw %ax + + movw $0x200, %si + lodsw + cmpw $5, %ax + jne 1f /* failure */ + lodsw + testb %ah, %ah /* high byte of unicode ASCII should be 0 */ + jne 1f /* failure */ + + /* 'N' should be a capital letter */ + + cmpb $0x41, %al /* Less than 'A' */ + jb 1f /* failure */ + cmpb $0x5A, %al /* Greater than 'Z'*/ + ja 1f /* failure */ + + xchgw %ax, %cx /* save AX to CX. CL='N' */ + + lodsw + testb %ah, %ah /* high byte of unicode ASCII should be 0 */ + jne 1f /* failure */ + + /* 'T' should be a capital letter */ + + cmpb $0x41, %al /* Less than 'A' */ + jb 1f /* failure */ + cmpb $0x5A, %al /* Greater than 'Z'*/ + ja 1f /* failure */ + + movb %al, %ch /* save AL to CH. CH='T' */ + + lodsw + cmpw $0x4C, %ax /* 'L' */ + jne 1f /* failure */ + lodsw + cmpw $0x44, %ax /* 'D' */ + jne 1f /* failure */ + lodsw + cmpw $0x52, %ax /* 'R' */ + jne 1f /* failure */ + lodsw + cmpw $0x04, %ax /* length of "$I30" */ + jne 1f /* failure */ + lodsw + cmpw $0x24, %ax /* '$' */ + jne 1f /* failure */ + lodsw + cmpw $0x49, %ax /* 'I' */ + jne 1f /* failure */ + lodsw + cmpw $0x33, %ax /* '3' */ + jne 1f /* failure */ + lodsw + cmpw $0x30, %ax /* '0' */ + jne 1f /* failure */ + + + /* assume it is NT bootsector. first, find "NTLDR". CX holds "NT" */ + movw $0x0100, %di + movb %cl, %al /* AL="N" */ + movb $1, %ah /* AH=Carry for SAHF below */ + movl $0x52444c00, %ebx /* "LDR" */ + movb %ch, %bl /* 'T' */ + movw $0x00fa, %cx + + /* now AL holds 'N' and BL holds 'T' */ + + //cld /* already upward */ +3: + repnz scasb /* find "N" */ + jcxz 4f /* gets the end, exit */ + cmpl %ebx, (%di) /* is it "NTLDR"? */ + jnz 3b /* no, continue to find */ + + /* "NTLDR" is found, so we believe it is NT boot sector. */ + + movw $0x5247, -1(%di) /* change "NT" to "GR" */ + + /* CF=0 for now */ + + lahf /* Load Flags into AH */ + /* AH = SF:ZF:xx:AF:xx:PF:xx:CF */ + /* AH = binary xxxxxxx0 */ + jmp 3b +4: + sahf /* Store AH into flags SF ZF xx AF xx PF xx CF */ + + /* CF=0 means "NTLDR" is found, CF=1 means "NTLDR" is not found. */ + + jc 1f /* failure */ + + movl $0x00520047, 0x202 /* change to "G R L D R" */ + + /* check NT 4.0 */ + + movw $0x406, %si + movl (%si), %ebx /* NT 4.0 */ + cmpl $0x03E8B800, %ebx /* MOV AX, 03E8 */ + jnz 3f + + movl 0x84, %ebx + cmpl $0x680007E8, %ebx /* call 008e; push (0D00) */ + jnz 3f + +// movw 0x154, %bx /* CR LF at end of "A disk read error occurred." */ +// cmpw $0x0A0D, %bx /* CR LF */ +// jnz 3f +// movw 0x180, %bx /* CR LF at end of "A kernel file is missing from the disk." */ +// cmpw $0x0A0D, %bx /* CR LF */ +// jnz 3f +// movw 0x1A8, %bx /* CR LF at end of "A kernel file is too discontiguous." */ +// cmpw $0x0A0D, %bx /* CR LF */ +// jnz 3f +// movw 0x1F8, %bx /* CR LF at end of "NTLDR is compressed." */ +// cmpw $0x0A0D, %bx /* CR LF */ +// jnz 3f + + movl 0xE8, %ebx + cmpl $0x13CD80B2, %ebx /* "B2 80"="mov DL, 80", "CD 13"="int 13" */ + jnz 3f + + popw %ax + movw %ax, 4(%si) + + movl $0x68909090, %ebx /* nop;nop;nop;push (0D00) */ + movl %ebx, 0x84 + +// /* change CRLF in NTFS error messages to spaces */ +// movw $0x2020, %bx /* change CRLF to 2 spaces */ +// movw %bx, 0x154 +// movw %bx, 0x180 +// movw %bx, 0x1A8 +// movw %bx, 0x1F8 + + movb %dl, 0xE9 /* modify drive number */ + + /* modify NTFS boot record */ + movb $0xea, %al /* ljmp, hand over the control to supervisor */ + movb %al, 0x122 + //movw $(try_next_partition - _start1), %ax /* offset for ljmp */ + movw $MONITOR, %ax /* offset for ljmp */ + movw %ax, 0x123 + //movw %cs, %ax /* AX=0x9400, segment for ljmp */ + xorw %ax, %ax + movw %ax, 0x125 + + movw $(NTFS4_message - _start1), %si + call print_message /* CS:SI points to message string */ + clc + ret +3: + /* check NT 5.0 */ + + movw $0x44b, %si + movl (%si), %ebx /* NT 5.0 */ + cmpl $0x03E8B800, %ebx /* MOV AX, 03E8 */ + jz 2f + + movw $0x479, %si + movl (%si), %ebx /* NT 5.1 SP2 */ + cmpl $0x03E8B800, %ebx /* MOV AX, 03E8 */ + jnz 1f +2: + movl 0x71, %ebx + cmpl $0x680053E8, %ebx /* call 00C7; push (0D00) */ + jnz 1f + + //movw 0x183, %bx /* CR LF at begin of "A disk read error occurred." */ + movb 0x1F8, %bl + movb $1, %bh + movw (%bx), %bx + cmpw $0x0A0D, %bx /* CR LF */ + jnz 1f + //movw 0x1A0, %bx /* CR LF at begin of "NTLDR is missing." */ + movb 0x1F9, %bl + movb $1, %bh + movw (%bx), %bx + cmpw $0x0A0D, %bx /* CR LF */ + jnz 1f + //movw 0x1B3, %bx /* CR LF at begin of "NTLDR is compressed." */ + movb 0x1FA, %bl + movb $1, %bh + movw (%bx), %bx + cmpw $0x0A0D, %bx /* CR LF */ + jnz 1f + + popw %ax + movw %ax, 4(%si) + + movl $0x68909090, %ebx /* nop;nop;nop;push (0D00) */ + movl %ebx, 0x71 + + /* change CRLF in NTFS error messages to spaces */ + movw $0x2020, %ax + movb 0x1F8, %bl + movb $1, %bh + movw %ax, (%bx) // 0x183 + movb 0x1F9, %bl + movb $1, %bh + movw %ax, (%bx) // 0x1A0 + movb 0x1FA, %bl + movb $1, %bh + movw %ax, (%bx) // 0x1B3 + + /* modify NTFS boot record */ + movb $0xEA, %al /* ljmp, hand over the control to supervisor */ + movb %al, 0x167 + //movw $(try_next_partition - _start1), %ax /* offset for ljmp */ + movw $MONITOR, %ax /* offset for ljmp */ + movw %ax, 0x168 + //movw %cs, %ax /* AX=0x9400, segment for ljmp */ + xorw %ax, %ax + movw %ax, 0x16A + + cmpw $0x44b, %si + jne 2f + movw $(NTFS5_message - _start1), %si + jmp 3f +2: + movw $(NTFS5p_message - _start1), %si +3: + call print_message /* CS:SI points to message string */ + clc + ret +1: + /* NTFS boot record not found. */ + + movw $(NTFS_no_boot_record_message - _start1), %si + call print_message /* CS:SI points to message string */ + + popw %ax + popl %eax /* return_IP and SI */ + popfw + stc + pushfw + pushl %eax /* return_IP and SI */ + ret +#endif + +//#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) +move_helper: + + /* called only once and only when the boot loader loaded this code */ + pushw %si + pushw %bx + pushl %eax + + movw $0x0003, %ax /* set display mode: 80*25 color text */ + int $0x10 + + movw $0x200, %si + movw %si, %di + movw $0xf00, %cx + cld + repz movsw + + popl %eax + popw %bx + popw %si + ret +//#endif + +#if (defined(GRLDR_MBR)) || (defined(GRLDR_INSTALL)) +filesystem_boot: + /* The partition boot record successfully modified, just boot it */ + + /* + * The boot might fail, but we want to take back the control. + * So we save the registers now. + */ + pushw %ds + pushw %es + pushal + + /* DS=CS=GRLDR_CS, ES=FS_BOOT */ + + /* save GRLDR_CS */ + + movw %es, %bx # save old ES to BX + + cli + lgdt gdt - _start1 + movl %cr0, %eax + orb $1, %al + movl %eax, %cr0 + + movw $8, %si + movw %si, %es + + xorl %esi, %esi + xorl %edi, %edi + movl $(0x9000 / 4), %ecx + + cld + repz movsl + + movw $16, %si + movw %si, %es + + andb $0xfe, %al + movl %eax, %cr0 + + movw %bx, %es # restore ES from BX + + /* move FS_BOOT:0000 to 0:7c00 */ +#if 0 + /* for single sector boot record */ + movw $0x0200, %cx /* move 2 sectors, the old FS_BOOT:0000 will + * keep untouched. */ +#else + /* for 4-sector NTFS boot record */ + movw $0x0400, %cx /* move 4 sectors, the old FS_BOOT:0000 will + * keep untouched. */ +#endif + xorw %si, %si + pushw %si /* SI=0, for the segment of 0000:7c00 */ + movw $0x7c00, %di + pushw %di /* DI=0x7c00, for the offset of 0000:7c00 */ + pushw %es /* ES=FS_BOOT */ + popw %ds /* DS=FS_BOOT */ + pushw %si /* SI=0 */ + popw %es /* ES=0 */ + cld + repz movsw + + movw $MONITOR, %di + movw $(restore_GRLDR_CS - _start1), %si + movw $((gdt_end - restore_GRLDR_CS) / 4), %cx + cld + repz cs movsl /* CS segment override prefix(=0x2E) */ + + pushw %es /* ES=0 */ + popw %ds /* DS=0 */ + sti + lret //ljmp $0, $0x7c00 +#endif + +press_space_bar_string: + .ascii "\r\nPress space bar\0" + +press_hot_key_pre: + .ascii "\r\nPress \0" + +press_hot_key_sub: + .ascii " to start GRUB, any other key to boot previous MBR ...\0" + +hot_key_timeout_pre: + .ascii "\r\nTimeout : \0" + +hot_key_timeout_num: + .ascii " \b\b\b\0" + +continue_string: + .ascii "\r\nInvalid previous MBR. Press any key to start GRUB ...\0" + +Cannot_find_GRLDR_string: + .ascii "\r\nCannot find GRLDR.\0" + +prev_MBR_string: + .ascii " to hold the screen, any other key to boot previous MBR ...\0" + +Error_while_reading_string: + .ascii "\r\nError while reading MBR of \0" + +drive_number_string: + .ascii "drive (hd0 ) \0" + +partition_boot_indicator_string: + .ascii "\r\nInvalid boot indicator in partition table of \0" + +partition_sectors_per_track_string: + .ascii "\r\nInvalid sectors_per_track in partition table of \0" + +partition_start_sector_string: + .ascii "\r\nInvalid start_sector in partition table of \0" + +partition_end_sector_string: + .ascii "\r\nInvalid end_sector in partition table of \0" + +no_boot_signature_string: + .ascii "\r\nNo boot signature in partition table of \0" + +message_string_helper: + .ascii "\r\nError: Cannot find GRLDR in all devices. Press Ctrl+Alt+Del to restart.\0" + +partition_message: + .ascii "\r\nTry (hd0,0 ) : \0" + +EXT2_message: + .ascii "EXT2: \0" +NTFS4_message: + .ascii "NTFS4: \0" +NTFS5_message: + .ascii "NTFS5: \0" +NTFS5p_message: + .ascii "NTFS5p: \0" +FAT32_message: + .ascii "FAT32: \0" +FAT16_message: + .ascii "FAT16: \0" +FAT12_message: + .ascii "FAT12: \0" +non_MS_message: + .ascii "non-MS: skip \0" +extended_message: + .ascii "Extended: \0" +invalid_message: + .ascii "invalid or null \0" +NTFS_no_boot_record_message: + .ascii "This partition is NTFS but with unknown boot record. Please\r\ninstall Microsoft NTFS boot sectors to this partition correctly, or create an\r\nFAT12/16/32 partition and place the same copy of GRLDR and MENU.LST there.\0" + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + . = _start1 + 0x1ffa +#else + . = . + (0x3ec - ((. - _start1) % 0x200)) % 0x200 + +press_hot_key_name: + + /* hot key name, the address is (grldr_signature - 16) */ + + .ascii "hot-key\0" + + . = press_hot_key_name + 14 + + //. = . + (0x3fa - ((. - _start1) % 0x200)) % 0x200 +#endif + + /* version word of grldr.mbr, the address is (grldr_signature - 2) */ + + .word 2 + +grldr_signature: + .byte 0x47, 0x52, 0x55, 0xaa /* signature for helper */ + + .align 0x200 + +#if (! defined(GRLDR_MBR)) && (! defined(GRLDR_INSTALL)) + + /* pre_stage2 start at 0x2000 for grldr */ + + . = _start1 + 0x2000 + +#endif + +#if defined(GRLDR_MBR) + /* if the size is less than 8192, let it be 8192 */ + . = . + (0x2000 - (. - _start1)) * (0x4000 / (. - _start1 + 0x2001)) +#endif + +pre_stage2_start: + + --- grub2-1.98.orig/debian/grub-extras/ntldr-img/ntfsbs.S +++ grub2-1.98/debian/grub-extras/ntldr-img/ntfsbs.S @@ -0,0 +1,1502 @@ +/* + * GRUB Utilities -- Utilities for GRUB Legacy, GRUB2 and GRUB for DOS + * Copyright (C) 2007 Bean (bean123@126.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* NTFS boot sector for loading GRLDR , written by bean + * + * This file can be compiled as standaolne boot sector, or it can be embeded in + * GRLDR.MBR at 0xA00 , right after the ext2 boot sector + * + * To compile the standalone ntfsbs.bin: + * gcc -c -o ntfsbs.o ntfsbs.S + * gcc -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00 -o ntfsbs_exec ntfsbs.o + * objcopy -O binary ntfsbs_exec ntfsbs.bin + * + * To install the standalone ntfsbs.bin: + * grubinst --restore=ntfsbs.bin DEVICE_OR_FILE + * + * Where DEVICE_OR_FILE specify a NTFS partition + * + * Limitations: + * 1. Don't support >1K MFT record size, >4K INDEX record size + * 2. Don't support encrypted file + * 3. Don't support >4K non-resident attribute list and $BITMAP + * + */ + +#ifndef INSIDE_GRLDR + + .text + + .code16 +#endif + +#define AT_STANDARD_INFORMATION 0x10 +#define AT_ATTRIBUTE_LIST 0x20 +#define AT_FILENAME 0x30 +#define AT_OBJECT_ID 0x40 +#define AT_SECURITY_DESCRIPTOR 0x50 +#define AT_VOLUME_NAME 0x60 +#define AT_VOLUME_INFORMATION 0x70 +#define AT_DATA 0x80 +#define AT_INDEX_ROOT 0x90 +#define AT_INDEX_ALLOCATION 0xA0 +#define AT_BITMAP 0xB0 +#define AT_SYMLINK 0xC0 +#define AT_EA_INFORMATION 0xD0 +#define AT_EA 0xE0 + +#define MAX_MFT_SIZE 1 // 1<<(1+9) = 1024 +#define MAX_IDX_SIZE 3 // 1<<(3+9) = 4096 + +#define LOADSEG_NT 0x2000 + +#define MMFT_BASE 0x2000 +#define MMFT_EMFT (MMFT_BASE +1024) +#define MMFT_EBUF (MMFT_BASE + 2048) + +#define CMFT_BASE (MMFT_BASE + 6144) +#define CMFT_EMFT (CMFT_BASE + 1024) +#define CMFT_EBUF (CMFT_BASE + 2048) + +#define INDX_BASE (CMFT_BASE + 6144) + +#define SBUF_BASE (INDX_BASE + 4096) + +#define NTFS_Large_Structure_Error_Code 1 +#define NTFS_Corrupt_Error_Code 2 +#define NTFS_Run_Overflow_Error_Code 3 +#define NTFS_No_Data_Error_Code 4 +#define NTFS_Decompress_Error_Code 5 + +#define NT_FG_COMP 1 +#define NT_FG_MMFT 2 +#define NT_FG_ALST 4 +#define NT_FG_GPOS 8 + +#define nt_boot_drive -2(%bp) +#define nt_blocksize -4(%bp) +#define nt_spc -5(%bp) +#define nt_mft_size -6(%bp) +#define nt_idx_size -7(%bp) +#define nt_mft_start -12(%bp) +#define nt_remain_len -16(%bp) +//#define nt_file_count -18(%bp) + +#define nt_flag (%di) +#define nt_attr_cur 2(%di) +#define nt_attr_nxt 4(%di) +#define nt_attr_end 6(%di) +#define nt_curr_vcn 8(%di) +#define nt_curr_lcn 0x10(%di) +#define nt_attr_ofs 0x14(%di) +#define nt_target_vcn 0x18(%di) +#define nt_read_count 0x1C(%di) +#define nt_vcn_offset 0x20(%di) + +#define nt_emft_buf 1024(%di) +#define nt_edat_buf 2048(%di) + + .arch i586 + +Entry_nt: + jmp 1f + + . = Entry_nt + 0x02 + + .byte 0x90 /* for CHS. Another possible value is 0x0e for LBA */ + + .ascii "NTFS " + + .word 0 /* 0B - Bytes per sector */ + .byte 0 /* 0D - Sectors per cluster */ + .word 0 /* 0E - reserved sectors, unused */ + .byte 0 /* 10 - number of FATs, unused */ + .word 0 /* 11 - Max dir entries for FAT12/FAT16, unused */ + .word 0 /* 13 - total sectors for FAT12/FAT16, unused */ + .byte 0xF8 /* 15 - Media descriptor */ + .word 0 /* 16 - sectors per FAT for FAT12/FAT16, unused */ + .word 255 /* 18 - Sectors per track */ + .word 63 /* 1A - Number of heads */ +nt_part_ofs: + .long 0 /* 1C - hidden sectors */ + .long 0 /* 20 - total sectors for FAT32, unused */ + .long 0x800080 + /* 24 - Usually 80 00 80 00, A value of 80 00 00 00 has + * been seen on a USB thumb drive which is formatted + * with NTFS under Windows XP. Note this is removable + * media and is not partitioned, the drive as a whole + * is NTFS formatted. + */ + .long 0,0 /* 28 - Number of sectors in the volume */ + .long 0,0 /* 30 - LCN of VCN 0 of the $MFT */ + .long 0,0 /* 38 - LCN of VCN 0 of the $MFTMirr */ + .long 0 /* 40 - Clusters per MFT Record */ + .long 4 /* 44 - Clusters per Index Record */ + .long 0,0 /* 48 - Volume serial number */ + .long 0 /* 50 - Checksum, usually 0 */ + +1: + + . = Entry_nt + 0x54 + + cli + cld + + . = Entry_nt + 0x56 + + /* the byte at offset 0x57 stores the real partition number for read. + * the format program or the caller should set it to a correct value. + * For floppies, it should be 0xff, which stands for whole drive. + */ + + movb $0xff, %dh /* boot partition number */ + + xorw %ax, %ax + movw %ax, %ds + movw $0x7c00, %bp + movw %ax, %es + + movw %ax, %ss /* stack and BP-relative moves up, too */ + leaw -0x20(%bp), %sp + sti + + movw %dx, nt_boot_drive + + /* Test if your BIOS support LBA mode */ + movb $0x41, %ah + movw $0x55AA, %bx + int $0x13 + jc 1f /* No EBIOS */ + cmpw $0xAA55, %bx + jne 1f /* No EBIOS */ + testb $1, %cl + jz 1f /* No EBIOS */ + /* EBIOS supported */ + movb $0x42, (ebios_nt - 1 - Entry_nt)(%bp) +1: + + cmpl $0x42555247, (nt_sector_mark - Entry_nt)(%bp) + jz 1f // Must be called from GRLDR.MBR + + movw $0x7E00, %bx + movl (nt_part_ofs - Entry_nt)(%bp), %eax + incl %eax + call readDisk_nt // Load the second sector from disk + call readDisk_nt // Load the third sector from disk + call readDisk_nt +1: + + xorl %eax, %eax + movw 0xb(%bp), %ax // Bytes per sector (blocksize) + movw %ax, nt_blocksize + + call convert_to_power_2 + movb %cl, %bl + movb 0xd(%bp), %al // Sectors per cluster + call convert_to_power_2 + movb %cl, %ch + addb %bl, %ch + subb $9, %ch // 1< + +#endif + +#include +#include + +#include "utils.h" + +static unsigned char ebuf[512]; + +#if defined(WIN32) + +#ifdef __GNUC__ // Mingw or Cygwin + +#define u_off_t off64_t +#define u_lseek lseek64 + +#else + +#define u_off_t __int64 +#define u_lseek _lseeki64 + +#endif + +#else + +#define u_off_t off_t // In FreeBSD, off_t is 64-bit ! +#define u_lseek lseek + +#endif + +int go_sect(int hd,unsigned long sec) +{ + // Test if 64-bit seek is supported + if (sizeof(u_off_t)>=8) + { + u_off_t bs,rs; + + bs=sec; + bs<<=9; + rs=u_lseek(hd,bs,SEEK_SET); + return (bs!=rs); + } + else + { + unsigned long bs[2]; + + bs[0]=sec<<9; + bs[1]=sec>>23; + if (bs[1]) + return 1; + return (lseek(hd,bs[0],SEEK_SET)!=bs[0]); + } +} + +// Partition enumerator +// xe->cur is the current partition number, before the first call to xd_enum, +// it should be set to 0xFF +// xe->nxt is the target partition number, if it equals 0xFF, it means enumerate +// all partitions, otherwise, it means jump to the specific partition. +int xd_enum(int hd,xde_t* xe) +{ + int nn=512,kk=1,cc; + + for (cc=xe->cur;;) + { + if (cc==0xFF) + { + unsigned long pt[4][2]; + int i,j,np; + + if (go_sect(hd,0)) + return 1; + if (read(hd,ebuf,nn)!=nn) + return 1; + if (valueat(ebuf,0x1FE,unsigned short)!=0xAA55) + return 1; + np=0; + for (i=0x1BE;i<0x1FE;i+=16) + if (ebuf[i+4]) + { + if ((pt[np][1]=valueat(ebuf,i+12,unsigned long))==0) + return 1; + pt[np++][0]=valueat(ebuf,i+8,unsigned long); + } + if (np==0) + return 1; + // Sort partition table base on start address + for (i=0;ipt[j][0]) k=j; + if (k!=i) + { + unsigned long tt; + + tt=pt[i][0]; + pt[i][0]=pt[k][0]; + pt[k][0]=tt; + tt=pt[i][1]; + pt[i][1]=pt[k][1]; + pt[k][1]=tt; + } + } + // Should have space for MBR + if (pt[0][0]==0) + return 1; + // Check for partition overlap + for (i=0;ipt[i+1][0]) + return 1; + cc=0; + } + else if (kk) + cc++; + if ((unsigned char)cc>xe->nxt) + return 1; + if (cc<4) + { + if (xe->nxt<4) + { + // Empty partition + if (! ebuf[xe->nxt*16+4+0x1BE]) + return 1; + xe->cur=xe->nxt; + xe->dfs=ebuf[xe->nxt*16+4+0x1BE]; + xe->bse=valueat(ebuf,xe->nxt*16+8+0x1BE,unsigned long); + xe->len=valueat(ebuf,xe->nxt*16+12+0x1BE,unsigned long); + return 0; + } + else if (xe->nxt!=0xFF) + cc=4; + else while (cc<4) + { + if (ebuf[cc*16+4+0x1BE]) + { + xe->cur=cc; + xe->dfs=ebuf[cc*16+4+0x1BE]; + xe->bse=valueat(ebuf,cc*16+8+0x1BE,unsigned long); + xe->len=valueat(ebuf,cc*16+12+0x1BE,unsigned long); + return 0; + } + cc++; + } + } + if ((cc==4) && (kk)) + { + int i; + + // Scan for extended partition + for (i=0;i<4;i++) + if ((ebuf[i*16+4+0x1BE]==5) || (ebuf[i*16+4+0x1BE]==0xF)) break; + if (i==4) + return 1; + xe->ebs=xe->bse=valueat(ebuf,i*16+8+0x1BE,unsigned long); + } + else + { + // Is end of extended partition chain ? + if ((ebuf[4+0x1CE]!=0x5) && (ebuf[4+0x1CE]!=0xF) || + (valueat(ebuf,8+0x1CE,unsigned long)==0)) + return 1; + xe->bse=xe->ebs+valueat(ebuf,8+0x1CE,unsigned long); + } + { + int r; + + while (1) + { + if (go_sect(hd,xe->bse)) + return 1; + + if (read(hd,ebuf,nn)!=nn) + return 1; + + if (valueat(ebuf,0x1FE,unsigned short)!=0xAA55) + return 1; + + if ((ebuf[4+0x1BE]==5) || (ebuf[4+0x1BE]==0xF)) + if (valueat(ebuf,8+0x1BE,unsigned long)==0) + return 1; + else + { + xe->bse=xe->ebs+valueat(ebuf,8+0x1BE,unsigned long); + continue; + } + break; + } + kk=(ebuf[4+0x1BE]!=0); + if ((kk) && ((xe->nxt==0xFF) || (cc==xe->nxt))) + { + xe->cur=cc; + xe->dfs=ebuf[4+0x1BE]; + xe->bse+=valueat(ebuf,8+0x1BE,unsigned long); + xe->len=valueat(ebuf,12+0x1BE,unsigned long); + return 0; + } + } + } +} + +#define EXT2_SUPER_MAGIC 0xEF53 + +int mbr_nhd, mbr_spt; + +void split_chs(unsigned char* chs,unsigned long* c,unsigned long* h,unsigned long* s) +{ + *h=chs[0]; + *s=(chs[1] & 0x3F)-1; + *c=((unsigned long)(chs[1]>>6))*256+chs[2]; +} + +int chk_chs(unsigned long nhd,unsigned long spt,unsigned long lba,unsigned char* chs) +{ + unsigned long c,h,s; + + split_chs(chs,&c,&h,&s); + if (c==0x3FF) + return ((nhd==h+1) && (spt==s+1)); + else + return (c*nhd*spt+h*spt+s==lba); +} + +int chk_mbr(unsigned char* buf) +{ + unsigned long nhd,spt,a1,a2,c2,h2,s2; + int i; + + i=0x1BE; + while ((i<0x1FE) && (buf[i+4]==0)) + i+=16; + if (i>=0x1FE) + return 0; + a1=valueat(buf[i],8,unsigned long); + a2=a1+valueat(buf[i],12,unsigned long)-1; + if (a1>=a2) + return 0; + split_chs(buf+i+5,&c2,&h2,&s2); + if (c2==0x3FF) + { + nhd=h2+1; + spt=s2+1; + if (! chk_chs(nhd,spt,a1,buf+i+1)) + return 0; + } + else + { + unsigned long c1,h1,s1; + long n1,n2; + + split_chs(buf+i+1,&c1,&h1,&s1); + if ((c1==0x3FF) || (c1>c2)) + return 0; + n1=(long)(c1*a2)-(long)(c2*a1)-(long)(c1*s2)+(long)(c2*s1); + n2=(long)(c1*h2)-(long)(c2*h1); + if (n2<0) + { + n2=-n2; + n1=-n1; + } + if ((n2==0) || (n1<=0) || (n1 % n2)) + return 0; + spt=(unsigned long)(n1/n2); + if (c2) + { + n1=(long)a2-(long)s2-(long)(h2*spt); + n2=(long)(c2*spt); + if ((n2==0) || (n1<=0) || (n1 % n2)) + return 0; + nhd=(unsigned long)(n1/n2); + } + else + nhd=h2+1; + } + if ((nhd==0) || (nhd>255) || (spt==0) || (spt>63)) + return 0; + i+=16; + while (i<0x1FE) + { + if (buf[i+4]) + { + if ((! chk_chs(nhd,spt,valueat(buf[i],8,unsigned long),buf+i+1)) || + (! chk_chs(nhd,spt,valueat(buf[i],8,unsigned long)+valueat(buf[i],12,unsigned long)-1,buf+i+5))) + return 0; + } + i+=16; + } + mbr_nhd=(int)nhd; + mbr_spt=(int)spt; + return 1; +} + +int get_fstype(unsigned char* buf) +{ + if (chk_mbr(buf)) + return FST_MBR; + + // The first sector of EXT2 might not contain the 0xAA55 signature + if (valueat(buf[1024],56,unsigned short)==EXT2_SUPER_MAGIC) + return FST_EXT2; + if (valueat(buf[0],0x1FE,unsigned short)!=0xAA55) + return FST_OTHER; + if (! strncmp(&buf[0x36],"FAT",3)) + return ((buf[0x26]==0x28) || (buf[0x26]==0x29))?FST_FAT16:FST_OTHER; + if (! strncmp(&buf[0x52],"FAT32",5)) + return ((buf[0x42]==0x28) || (buf[0x42]==0x29))?FST_FAT32:FST_OTHER; + if (! strncmp(&buf[0x3],"NTFS",4)) + return ((buf[0]==0xEB) && (buf[1]==0x52))?FST_NTFS:FST_OTHER; + return FST_OTHER; +} + +char* fst2str(int fs) +{ + switch (fs) { + case FST_OTHER: + return "Other"; + case FST_MBR: + return "MBR"; + case FST_FAT16: + return "FAT12/FAT16"; + case FST_FAT32: + return "FAT32"; + case FST_NTFS: + return "NTFS"; + case FST_EXT2: + return "EXT2/EXT3"; + default: + return "Unknown"; + } +} + +typedef struct { + int id; + char* str; +} fstab_t; + +static fstab_t fstab[]= { + {0x1,"FAT12"}, + {0x4,"FAT16"}, + {0x5,"Extended"}, + {0x6,"FAT16B"}, + {0x7,"NTFS"}, + {0xB,"FAT32"}, + {0xC,"FAT32X"}, + {0xE,"FAT16X"}, + {0xF,"ExtendedX"}, + {0x11,"(H)FAT12"}, + {0x14,"(H)FAT16"}, + {0x16,"(H)FAT16B"}, + {0x17,"(H)NTFS"}, + {0x1B,"(H)FAT32"}, + {0x1C,"(H)FAT32X"}, + {0x1E,"(H)FAT16X"}, + {0x82,"Swap"}, + {0x83,"Ext2"}, + {0xA5,"FBSD"}, + {0,"Other"}}; + +char* dfs2str(int fs) +{ + int i; + + for (i=0;fstab[i].id;i++) + if (fs==fstab[i].id) + return fstab[i].str; + return fstab[i].str; +} --- grub2-1.98.orig/debian/grub-extras/ntldr-img/bin2h.c +++ grub2-1.98/debian/grub-extras/ntldr-img/bin2h.c @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2008 Robert Millan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +int +main (int argc, char *argv[]) +{ + int b, i; + char *sym; + unsigned int len; + + if (argc != 3) + { + fprintf (stderr, "Usage: %s symbol_name length\n", argv[0]); + exit (1); + } + + sym = argv[1]; + len = atoi (argv[2]); + + b = getchar (); + if (b == EOF) + goto abort; + + printf ("/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\n" + "unsigned char %s[%u] =\n{\n", sym, len); + + while (1) + { + printf ("0x%02x", b); + + b = getchar (); + if (b == EOF) + goto end; + + for (i = 0; i < 16 - 1; i++) + { + printf (", 0x%02x", b); + + b = getchar (); + if (b == EOF) + goto end; + } + + printf (",\n"); + } + +end: + printf ("\n};\n"); + +abort: + exit (0); +} --- grub2-1.98.orig/debian/grub-extras/ntldr-img/README +++ grub2-1.98/debian/grub-extras/ntldr-img/README @@ -0,0 +1,11 @@ + +grub-extras is meant to be used as an overlay on grub2 source tree. + +Build instructions: + + - Copy grub-extras in a subdirectory of your grub2 checkout. + For example, "grub-extras". + + - Export GRUB_CONTRIB environment variable to point to this directory. + + - Build GRUB as usual. --- grub2-1.98.orig/debian/grub-extras/ntldr-img/g2hdr.S +++ grub2-1.98/debian/grub-extras/ntldr-img/g2hdr.S @@ -0,0 +1,99 @@ +/* + * GRUB Utilities -- Utilities for GRUB Legacy, GRUB2 and GRUB for DOS + * Copyright (C) 2007 Bean (bean123@126.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + + .file "g2hdr.S" + + .text + + .code16 + + .globl start, _start + +start: +_start: + + // We are at 0x2000:0 + // Move itself to 0x800:0 + // Don't modify dx + + cld + movw %cs, %ax + movw %ax, %ds + movw $0x800, %ax + movw %ax, %es + xorw %si, %si + movw %si, %di + movw $0x80, %cx + + rep + movsl + + ljmp $0, $(jump_start-start+0x8000) + +jump_start: + // Move data from 0x2040:0 to 0x820:0 + + movw $0x2040, %ax + movw %ax, %ds + movw $0x820, %ax + movw %ax, %es + xorl %eax, %eax + movb %dh, %al + movl %eax, GRUB_KERNEL_MACHINE_INSTALL_DOS_PART + movl GRUB_KERNEL_MACHINE_COMPRESSED_SIZE, %eax + addl $GRUB_KERNEL_MACHINE_RAW_SIZE, %eax + xorl %ecx, %ecx + +1: + xorw %si, %si + movw %si, %di + + movw $0x8000, %cx + cmpl %ecx, %eax + jae 2f + movw %ax, %cx +2: + + pushw %cx + addw $3, %cx + shrw $2, %cx + + rep + movsl + + popw %cx + + movw %ds, %si + addw $0x800, %si + movw %si, %ds + + movw %es, %si + addw $0x800, %si + movw %si, %es + + subl %ecx, %eax + jnz 1b + + ljmp $0, $(0x8000 + 0x200) + + . = _start + 0x200 - 2 + + .word 0xAA55 --- grub2-1.98.orig/debian/grub-extras/ntldr-img/grubinst.c +++ grub2-1.98/debian/grub-extras/ntldr-img/grubinst.c @@ -0,0 +1,1031 @@ +/* + * GRUB Utilities -- Utilities for GRUB Legacy, GRUB2 and GRUB for DOS + * Copyright (C) 2007 Bean (bean123@126.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include + +#ifndef WIN32 + +#define O_BINARY 0 + +#endif + +#include "grub_mbr.h" +#include "utils.h" +#include "version.h" + +// Application flags, used by this program + +#define AFG_VERBOSE 1 +#define AFG_PAUSE 2 +#define AFG_READ_ONLY 4 +#define AFG_NO_BACKUP_MBR 8 +#define AFG_FORCE_BACKUP_MBR 16 +#define AFG_RESTORE_PREVMBR 32 +#define AFG_LIST_PART 64 +#define AFG_IS_FLOPPY 128 +#define AFG_LBA_MODE 256 +#define AFG_CHS_MODE 512 +#define AFG_OUTPUT 1024 +#define AFG_EDIT 2048 + +// Grldr flags, this flag is used by grldr.mbr + +#define GFG_DISABLE_FLOPPY 1 +#define GFG_DISABLE_OSBR 2 +#define GFG_DUCE 4 +#define GFG_PREVMBR_LAST 128 + +#define APP_NAME "grubinst: " + +#define print_pause if (afg & AFG_PAUSE) {fputs("Press to continue ...\n",stderr); fflush(stderr); fgetc(stdin);} + +#define print_apperr(a) { fprintf(stderr,APP_NAME "%s\n",a); print_pause; } +#define print_syserr(a) { perror(APP_NAME a); print_pause; } + +void help(void) +{ + fputs("Usage:\n" + "\tgrubinst [OPTIONS] DEVICE_OR_FILE\n\n" + "OPTIONS:\n\n" + "\t--help,-h\t\tShow usage information\n\n" + "\t--pause\t\t\tPause before exiting\n\n" + "\t--version\t\tShow version information\n\n" + "\t--verbose,-v\t\tVerbose output\n\n" + "\t--list-part,-l\t\tList all logical partitions in DEVICE_OR_FILE\n\n" + "\t--save=FN,-s=FN\t\tSave the orginal MBR/BS to FN\n\n" + "\t--restore=FN,-r=FN\tRestore MBR/BS from previously saved FN\n\n" + "\t--restore-prevmbr,-r\tRestore previous MBR saved in the second sector\n" + "\t\t\t\tof DEVICE_OR_FILE\n\n" + "\t--read-only,-t\t\tdo everything except the actual write to the\n" + "\t\t\t\tspecified DEVICE_OR_FILE. (test mode)\n\n" + "\t--no-backup-mbr\t\tdo not copy the old MBR to the second sector of\n" + "\t\t\t\tDEVICE_OR_FILE.\n\n" + "\t--force-backup-mbr\tforce the copy of old MBR to the second sector\n" + "\t\t\t\tof DEVICE_OR_FILE.(default)\n\n" + "\t--mbr-enable-floppy\tenable the search for GRLDR on floppy.(default)\n\n" + "\t--mbr-disable-floppy\tdisable the search for GRLDR on floppy.\n\n" + "\t--mbr-enable-osbr\tenable the boot of PREVIOUS MBR with invalid\n" + "\t\t\t\tpartition table (usually an OS boot sector).\n" + "\t\t\t\t(default)\n\n" + "\t--mbr-disable-osbr\tdisable the boot of PREVIOUS MBR with invalid\n" + "\t\t\t\tpartition table (usually an OS boot sector).\n\n" + "\t--duce\t\t\tdisable the feature of unconditional entrance\n" + "\t\t\t\tto the command-line.\n\n" + "\t--boot-prevmbr-first\ttry to boot PREVIOUS MBR before the search for\n" + "\t\t\t\tGRLDR.\n\n" + "\t--boot-prevmbr-last\ttry to boot PREVIOUS MBR after the search for\n" + "\t\t\t\tGRLDR.(default)\n\n" + "\t--preferred-drive=D\tpreferred boot drive number, 0 <= D < 255.\n\n" + "\t--preferred-partition=P\tpreferred partition number, 0 <= P < 255.\n\n" + "\t--time-out=T,-t=T\twait T seconds before booting PREVIOUS MBR. if\n" + "\t\t\t\tT is 0xff, wait forever. The default is 5.\n\n" + "\t\t\t\tbefore booting PREVIOUS MBR. K is a word\n" + "\t\t\t\tvalue, just as the value in AX register\n" + "\t\t\t\treturned from int16/AH=1. The high byte is the\n" + "\t\t\t\tscan code and the low byte is ASCII code. The\n" + "\t\t\t\tdefault is 0x3920 for space bar.\n\n" + "\t--key-name=S\t\tSpecify the name of the hot key.\n\n" + "\t--floppy,-f\t\tif DEVICE_OR_FILE is floppy, use this option.\n\n" + "\t--floppy=N\t\tif DEVICE_OR_FILE is a partition on a hard\n" + "\t\t\t\tdrive, use this option. N is used to specify\n" + "\t\t\t\tthe partition number: 0,1,2 and 3 for the\n" + "\t\t\t\tprimary partitions, and 4,5,6,... for the\n" + "\t\t\t\tlogical partitions.\n\n" + "\t--sectors-per-track=S\tspecifies sectors per track for --floppy.\n" + "\t\t\t\t1 <= S <= 63, default is 63.\n\n" + "\t--heads=H\t\tspecifies number of heads for --floppy.\n" + "\t\t\t\t1 <= H <= 256, default is 255.\n\n" + "\t--start-sector=B\tspecifies hidden sectors for --floppy=N.\n\n" + "\t--total-sectors=C\tspecifies total sectors for --floppy.\n" + "\t\t\t\tdefault is 0.\n\n" + "\t--lba\t\t\tuse lba mode for --floppy. If the floppy BIOS\n" + "\t\t\t\thas LBA support, you can specify --lba here.\n" + "\t\t\t\tIt is assumed that all floppy BIOSes have CHS\n" + "\t\t\t\tsupport. So you would rather specify --chs.\n" + "\t\t\t\tIf neither --chs nor --lba is specified, then\n" + "\t\t\t\tthe LBA indicator(i.e., the third byte of the\n" + "\t\t\t\tboot sector) will not be touched.\n\n" + "\t--chs\t\t\tuse chs mode for --floppy. You should specify\n" + "\t\t\t\t--chs if the floppy BIOS does not support LBA.\n" + "\t\t\t\tWe assume all floppy BIOSes have CHS support.\n" + "\t\t\t\tSo it is likely you want to specify --chs.\n" + "\t\t\t\tIf neither --chs nor --lba is specified, then\n" + "\t\t\t\tthe LBA indicator(i.e., the third byte of the\n" + "\t\t\t\tboot sector) will not be touched.\n\n" + "\t--install-partition=I\tInstall the boot record onto the boot area of\n" + "\t-p=I\t\t\tpartition number I of the specified hard drive\n" + "\t\t\t\tor harddrive image DEVICE_OR_FILE.\n\n" + "\t--boot-file=F,-b=F\tChange the name of boot file.\n\n" + "\t--load-seg=S\t\tChange load segment for boot file.\n\n" + "\t--grub2,-2\t\tLoad grub2 kernel g2ldr instead of grldr.\n\n" + "\t--output,-o\t\tSave embeded grldr.mbr to DEVICE_OR_FILE.\n\n" + "\t--edit,-e\t\tEdit external grldr/grldr.mbr.\n", + stderr); +} + +int afg,gfg,def_drive,def_part,time_out,hot_key,part_num; +int def_spt,def_hds,def_ssc,def_tsc; +char *save_fn,*restore_fn,*boot_file,boot_file_83[12],*key_name; +unsigned short load_seg; + +static char fn_buf[24]; + +char* get_disk_name(int n) +{ +#if defined(WIN32) + sprintf(fn_buf,"\\\\.\\PhysicalDrive%d",n); +#elif defined(LINUX) + sprintf(fn_buf,"/dev/hd%c",'a'+n); +#elif defined(FREEBSD) + sprintf(fn_buf,"/dev/ad%d",n); +#else + print_apperr("Disk device is not supported in your system"); + return NULL; +#endif + return fn_buf; +} + +char* get_flop_name(int n) +{ +#if defined(WIN32) + if (n>1) + { + print_apperr("Only two floppy drives are supported"); + return NULL; + } + sprintf(fn_buf,"\\\\.\\%c:",'A'+n); +#elif defined(LINUX) || defined(FREEBSD) + sprintf(fn_buf,"/dev/fd%d",n); +#else + print_apperr("Floppy device is not supported in your system"); + return NULL; +#endif + return fn_buf; +} + +char* parse_fname(char* fn) +{ + if ((afg & AFG_OUTPUT) && (fn[0]=='(')) + { + print_apperr("Can\'t use device name while using --output option"); + return NULL; + } + if ((! strncmp(fn,"(hd",3)) || (! strncmp(fn,"(fd",3))) + { + int n; + char *p; + + n=strtol(&fn[3],&p,0); + if ((n<0) || (n>=MAX_DISKS)) + { + print_apperr("Invalid device number"); + return NULL; + } + if (*p==',') + { + part_num=strtol(p+1,&p,0); + if ((part_num<0) || (part_num>=MAX_PARTS)) + { + print_apperr("Invalid partition number"); + return NULL; + } + } + if ((*p!=')') || (*(p+1)!=0)) + { + print_apperr("Invalid device name"); + return NULL; + } + if (fn[1]=='h') + fn=get_disk_name(n); + else + { + fn=get_flop_name(n); + afg|=AFG_IS_FLOPPY; + } + } + return fn; +} + +char* str_upcase(char* str) +{ + int i; + + for (i=0;str[i];i++) + if ((str[i]>='a') && (str[i]<='z')) + str[i]-='a'-'A'; + + return str; +} + +char* str_lowcase(char* str) +{ + int i; + + for (i=0;str[i];i++) + if ((str[i]>='A') && (str[i]<='Z')) + str[i]+='a'-'A'; + + return str; +} + +int SetBootFile(char* fn) +{ + char* pc; + + if (*fn==0) + return 1; + if (strlen(fn)>7) + return 1; + pc=strchr(fn,'.'); + if (pc) + if ((pc==fn) || (pc-fn>8) || (strlen(pc+1)>3)) + return 1; + str_upcase(fn); + memset(boot_file_83,' ',sizeof(boot_file_83)-1); + if (pc) + { + memcpy(boot_file_83,fn,pc-fn); + memcpy(&boot_file_83[8],pc+1,strlen(pc+1)); + } + else + memcpy(boot_file_83,fn,strlen(fn)); + str_lowcase(fn); + boot_file=fn; + return 0; +} + +int chk_mbr(unsigned char* buf); + +void list(int hd) +{ + xde_t xe; + + xe.cur=xe.nxt=0xFF; + fprintf(stderr," # id base leng\n"); + while (! xd_enum(hd,&xe)) + fprintf(stderr,"%2d %02X %8X %8X\n",xe.cur,xe.dfs,xe.bse,xe.len); +} + +int is_grldr_mbr(char* buf) +{ + int i,n; + + i=0x1B7; + n=sizeof("Missing MBR-helper.")-1; + + while ((i>n) && (buf[i]==0)) + i--; + return (! strcmp(&buf[i-n+1],"Missing MBR-helper.")); +} + +int install(char* fn) +{ + int hd,nn,fs,slen; + char prev_mbr[sizeof(grub_mbr)]; + unsigned long ssec; + + if (fn==NULL) + return 1; + + if (afg & AFG_EDIT) + { + unsigned short r1,r2; + + if (afg & AFG_VERBOSE) + fprintf(stderr,"Edit mode\n"); + hd=open(fn,O_RDWR | O_BINARY,0644); + if (hd==-1) + { + print_syserr("open"); + return errno; + } + r1=valueat(grub_mbr[0x1FFA],0,unsigned short); + nn=read(hd,grub_mbr,sizeof(grub_mbr)); + if (nn==-1) + { + print_syserr("read"); + close(hd); + return errno; + } + if (nnvalueat(prev_mbr[n],8,unsigned long)) + ofs=valueat(prev_mbr[n],8,unsigned long); + } + if (ofs<(sizeof(prev_mbr)>>9)) + { + print_apperr("Not enough room to install mbr"); + close(hd); + return 1; + } + slen=sizeof(prev_mbr); + if (go_sect(hd,ofs)) + { + print_apperr("Can\'t seek to the first partition"); + close(hd); + return 1; + } + if (read(hd,bs,sizeof(bs))!=sizeof(bs)) + { + print_apperr("Fail to read boot sector"); + close(hd); + return 1; + } + nfs=get_fstype(bs); + if (nfs==FST_FAT32) + sln=0x5A - 0xB; + else if (nfs==FST_FAT16) + sln=0x3E - 0xB; + else + sln=0; + if (sln) + { + memcpy(&grub_mbr[0xB],&bs[0xB],sln); + valueat(grub_mbr[0],0x1C,unsigned long)=0; + valueat(grub_mbr[0],0xE,unsigned short)+=ofs; + } + } + else if (fs==FST_NTFS) + slen=2048; + else + slen=512; + + if (go_sect(hd,ssec)) + { + print_apperr("Can\'t seek to the start sector"); + close(hd); + return 1; + } + + if (save_fn) + { + int h2; + + h2=open(save_fn,O_CREAT | O_TRUNC | O_RDWR | O_BINARY,S_IREAD | S_IWRITE); + if (h2==-1) + { + print_syserr("open save file"); + close(hd); + return errno; + } + nn=write(h2,prev_mbr,slen); + if (nn==-1) + { + print_syserr("write save file"); + close(hd); + close(h2); + return errno; + } + if (nn=argc) + { + print_apperr("No filename specified"); + return 1; + } + if (idx $@ +DISTCLEANFILES += grldr.mbr + +bin2h: $(GRUB_CONTRIB)/ntldr-img/bin2h.c + $(CC) $^ -o $@ +DISTCLEANFILES += bin2h + +grub_mbr.h: grldr.mbr bin2h + ./bin2h grub_mbr 8192 < $< > $@ +DISTCLEANFILES += grub_mbr.h + +grubinst: $(GRUB_CONTRIB)/ntldr-img/grubinst.c $(GRUB_CONTRIB)/ntldr-img/utils.c grub_mbr.h + $(CC) -I. -I$(GRUB_CONTRIB)/ntldr-img -DLINUX -o $@ $(GRUB_CONTRIB)/ntldr-img/grubinst.c $(GRUB_CONTRIB)/ntldr-img/utils.c +DISTCLEANFILES += grubinst + +g2ldr.mbr: grubinst + ./grubinst --grub2 -o $@ +DISTCLEANFILES += g2ldr.mbr --- grub2-1.98.orig/debian/grub-extras/ntldr-img/conf/common.mk +++ grub2-1.98/debian/grub-extras/ntldr-img/conf/common.mk @@ -0,0 +1,3 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! +-include $(GRUB_CONTRIB)/ntldr-img/conf/$(target_cpu)-$(platform).mk --- grub2-1.98.orig/debian/grub-extras/ntldr-img/conf/common.rmk +++ grub2-1.98/debian/grub-extras/ntldr-img/conf/common.rmk @@ -0,0 +1,2 @@ +# -*- makefile -*- +-include $(GRUB_CONTRIB)/ntldr-img/conf/$(target_cpu)-$(platform).mk --- grub2-1.98.orig/debian/grub-extras/ntldr-img/conf/i386-pc.mk +++ grub2-1.98/debian/grub-extras/ntldr-img/conf/i386-pc.mk @@ -0,0 +1,104 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! + +pkglib_IMAGES += g2ldr.mbr g2hdr.bin grldr.img + +all: g2ldr.mbr g2hdr.bin + +DISTCLEANFILES += g2ldr.mbr g2hdr.bin + +g2hdr_bin_SOURCES = $(GRUB_CONTRIB)/ntldr-img/g2hdr.S + +clean-image-g2hdr.bin.1: + rm -f g2hdr.bin g2hdr.exec g2hdr_bin-__GRUB_CONTRIB__ntldr_img_g2hdr.o + +CLEAN_IMAGE_TARGETS += clean-image-g2hdr.bin.1 + +mostlyclean-image-g2hdr.bin.1: + rm -f g2hdr_bin-__GRUB_CONTRIB__ntldr_img_g2hdr.d + +MOSTLYCLEAN_IMAGE_TARGETS += mostlyclean-image-g2hdr.bin.1 + +ifneq ($(TARGET_APPLE_CC),1) +g2hdr.bin: g2hdr.exec + $(OBJCOPY) -O $(g2hdr_bin_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@ +else +ifneq (g2hdr.exec,kernel.exec) +g2hdr.bin: g2hdr.exec ./grub-macho2img + ./grub-macho2img $< $@ +else +g2hdr.bin: g2hdr.exec ./grub-macho2img + ./grub-macho2img --bss $< $@ +endif +endif + +g2hdr.exec: g2hdr_bin-__GRUB_CONTRIB__ntldr_img_g2hdr.o + $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(g2hdr_bin_LDFLAGS) + +g2hdr_bin-__GRUB_CONTRIB__ntldr_img_g2hdr.o: $(GRUB_CONTRIB)/ntldr-img/g2hdr.S $($(GRUB_CONTRIB)/ntldr-img/g2hdr.S_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/ntldr-img -I$(srcdir)/$(GRUB_CONTRIB)/ntldr-img $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(g2hdr_bin_ASFLAGS) -MD -c -o $@ $< +-include g2hdr_bin-__GRUB_CONTRIB__ntldr_img_g2hdr.d + +g2hdr_bin_ASFLAGS = $(COMMON_ASFLAGS) +g2hdr_bin_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x0 +g2hdr_bin_FORMAT = binary + +grldr_img_SOURCES = $(GRUB_CONTRIB)/ntldr-img/grldrstart.S $(GRUB_CONTRIB)/ntldr-img/ntfsbs.S + +clean-image-grldr.img.1: + rm -f grldr.img grldr.exec grldr_img-__GRUB_CONTRIB__ntldr_img_grldrstart.o grldr_img-__GRUB_CONTRIB__ntldr_img_ntfsbs.o + +CLEAN_IMAGE_TARGETS += clean-image-grldr.img.1 + +mostlyclean-image-grldr.img.1: + rm -f grldr_img-__GRUB_CONTRIB__ntldr_img_grldrstart.d grldr_img-__GRUB_CONTRIB__ntldr_img_ntfsbs.d + +MOSTLYCLEAN_IMAGE_TARGETS += mostlyclean-image-grldr.img.1 + +ifneq ($(TARGET_APPLE_CC),1) +grldr.img: grldr.exec + $(OBJCOPY) -O $(grldr_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@ +else +ifneq (grldr.exec,kernel.exec) +grldr.img: grldr.exec ./grub-macho2img + ./grub-macho2img $< $@ +else +grldr.img: grldr.exec ./grub-macho2img + ./grub-macho2img --bss $< $@ +endif +endif + +grldr.exec: grldr_img-__GRUB_CONTRIB__ntldr_img_grldrstart.o grldr_img-__GRUB_CONTRIB__ntldr_img_ntfsbs.o + $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(grldr_img_LDFLAGS) + +grldr_img-__GRUB_CONTRIB__ntldr_img_grldrstart.o: $(GRUB_CONTRIB)/ntldr-img/grldrstart.S $($(GRUB_CONTRIB)/ntldr-img/grldrstart.S_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/ntldr-img -I$(srcdir)/$(GRUB_CONTRIB)/ntldr-img $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(grldr_img_ASFLAGS) -MD -c -o $@ $< +-include grldr_img-__GRUB_CONTRIB__ntldr_img_grldrstart.d + +grldr_img-__GRUB_CONTRIB__ntldr_img_ntfsbs.o: $(GRUB_CONTRIB)/ntldr-img/ntfsbs.S $($(GRUB_CONTRIB)/ntldr-img/ntfsbs.S_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/ntldr-img -I$(srcdir)/$(GRUB_CONTRIB)/ntldr-img $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(grldr_img_ASFLAGS) -MD -c -o $@ $< +-include grldr_img-__GRUB_CONTRIB__ntldr_img_ntfsbs.d + +grldr_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRLDR_MBR +grldr_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x7c00 +grldr_img_FORMAT = binary + +grldr.mbr: grldr.img + head -c 8192 $< > $@ +DISTCLEANFILES += grldr.mbr + +bin2h: $(GRUB_CONTRIB)/ntldr-img/bin2h.c + $(CC) $^ -o $@ +DISTCLEANFILES += bin2h + +grub_mbr.h: grldr.mbr bin2h + ./bin2h grub_mbr 8192 < $< > $@ +DISTCLEANFILES += grub_mbr.h + +grubinst: $(GRUB_CONTRIB)/ntldr-img/grubinst.c $(GRUB_CONTRIB)/ntldr-img/utils.c grub_mbr.h + $(CC) -I. -I$(GRUB_CONTRIB)/ntldr-img -DLINUX -o $@ $(GRUB_CONTRIB)/ntldr-img/grubinst.c $(GRUB_CONTRIB)/ntldr-img/utils.c +DISTCLEANFILES += grubinst + +g2ldr.mbr: grubinst + ./grubinst --grub2 -o $@ +DISTCLEANFILES += g2ldr.mbr --- grub2-1.98.orig/debian/grub-extras/915resolution/COPYING +++ grub2-1.98/debian/grub-extras/915resolution/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. --- grub2-1.98.orig/debian/grub-extras/915resolution/915resolution.c +++ grub2-1.98/debian/grub-extras/915resolution/915resolution.c @@ -0,0 +1,970 @@ +/* 915resolution - Utility to change vbemodes on the intel + * integrated video chipset */ + +/* + * Based on Nathan Coulson's http://nathancoulson.com/proj/eee/grub-1.96-915resolution-0.5.2-3.patch + * Oct 10, 2008, Released as 915 + * Oct 10, 2008, Updated to include support for 945GM thanks to Scot Doyle + */ + +/* Copied from 915 resolution created by steve tomjenovic + * 915 resolution was in the public domain. + * + * All I have done, was make the above program run within + * the grub2 environment. + * + * Some of the checks are still commented, as I did not find + * easy replacement for memmem. + * + * Slightly edited by Nathan Coulson (conathan@gmail.com) + */ + +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2007 Free Software Foundation, Inc. + * Copyright (C) 2003 NIIBE Yutaka + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + + +/* 915 resolution by steve tomljenovic + * + * This was tested only on Sony VGN-FS550. Use at your own risk + * + * This code is based on the techniques used in : + * + * - 855patch. Many thanks to Christian Zietz (czietz gmx net) + * for demonstrating how to shadow the VBIOS into system RAM + * and then modify it. + * + * - 1280patch by Andrew Tipton (andrewtipton null li). + * + * - 855resolution by Alain Poirier + * + * This source code is into the public domain. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define printf grub_printf +#define malloc grub_malloc +#define free grub_free +#define strcmp grub_strcmp +#define fprintf(stream,template,args...) grub_printf(template, ## args) +#define strtol(x,y,z) grub_strtoul(x,y,z) +#define atoi(x) grub_strtoul(x,NULL,10) +#define assert(x) 0 /* FIXME */ +#define memset grub_memset +#define outl grub_outl +#define outb grub_outb +#define inl grub_inl +#define inb grub_inb + +#define NEW(a) ((a *)(malloc(sizeof(a)))) +#define FREE(a) (free(a)) + +#define VBIOS_START 0xc0000 +#define VBIOS_SIZE 0x10000 + +#define VBIOS_FILE "/dev/mem" + +#define FALSE 0 +#define TRUE 1 + +#define MODE_TABLE_OFFSET_845G 617 + +#define VERSION "0.5.3" + +#define ATI_SIGNATURE1 "ATI MOBILITY RADEON" +#define ATI_SIGNATURE2 "ATI Technologies Inc" +#define NVIDIA_SIGNATURE "NVIDIA Corp" +#define INTEL_SIGNATURE "Intel Corp" + +typedef unsigned char * address; +typedef unsigned char byte; +typedef unsigned short word; +typedef unsigned char boolean; +typedef unsigned int cardinal; + +typedef enum { + CT_UNKWN, CT_830, CT_845G, CT_855GM, CT_865G, CT_915G, CT_915GM, CT_945G, CT_945GM, CT_945GME, + CT_946GZ, CT_G965, CT_Q965, CT_965GM, CT_G33, CT_Q33, CT_Q35, CT_500GMA +} chipset_type; + +char * chipset_type_names[] = { + "UNKNOWN", "830", "845G", "855GM", "865G", "915G", "915GM", "945G", "945GM", "945GME", + "946GZ", "G965", "Q965", "965GM", "G33", "Q33", "Q35", "500GMA" +}; + +typedef enum { + BT_UNKWN, BT_1, BT_2, BT_3 +} bios_type; + +char * bios_type_names[] = {"UNKNOWN", "TYPE 1", "TYPE 2", "TYPE 3"}; + +int freqs[] = { 60, 75, 85 }; + +typedef struct { + byte mode; + byte bits_per_pixel; + word resolution; + byte unknown; +} __attribute__((packed)) vbios_mode; + +typedef struct { + byte unknow1[2]; + byte x1; + byte x_total; + byte x2; + byte y1; + byte y_total; + byte y2; +} __attribute__((packed)) vbios_resolution_type1; + +typedef struct { + unsigned long clock; + + word x1; + word htotal; + word x2; + word hblank; + word hsyncstart; + word hsyncend; + + word y1; + word vtotal; + word y2; + word vblank; + word vsyncstart; + word vsyncend; +} __attribute__((packed)) vbios_modeline_type2; + +typedef struct { + byte xchars; + byte ychars; + byte unknown[4]; + + vbios_modeline_type2 modelines[]; +} __attribute__((packed)) vbios_resolution_type2; + +typedef struct { + unsigned long clock; + + word x1; + word htotal; + word x2; + word hblank; + word hsyncstart; + word hsyncend; + + word y1; + word vtotal; + word y2; + word vblank; + word vsyncstart; + word vsyncend; + + word timing_h; + word timing_v; + + byte unknown[6]; +} __attribute__((packed)) vbios_modeline_type3; + +typedef struct { + unsigned char unknown[6]; + + vbios_modeline_type3 modelines[]; +} __attribute__((packed)) vbios_resolution_type3; + + +typedef struct { + cardinal chipset_id; + chipset_type chipset; + bios_type bios; + + int bios_fd; + address bios_ptr; + + vbios_mode * mode_table; + cardinal mode_table_size; + + byte b1, b2; + + boolean unlocked; +} vbios_map; + + +cardinal get_chipset_id(void) { + outl(0x80000000, 0xcf8); + return inl(0xcfc); +} + +chipset_type get_chipset(cardinal id) { + chipset_type type; + + switch (id) { + case 0x35758086: + type = CT_830; + break; + + case 0x25608086: + type = CT_845G; + break; + + case 0x35808086: + type = CT_855GM; + break; + + case 0x25708086: + type = CT_865G; + break; + + case 0x25808086: + type = CT_915G; + break; + + case 0x25908086: + type = CT_915GM; + break; + + case 0x27708086: + type = CT_945G; + break; + + case 0x27a08086: + type = CT_945GM; + break; + + case 0x27ac8086: + type = CT_945GME; + break; + + case 0x29708086: + type = CT_946GZ; + break; + + case 0x29a08086: + type = CT_G965; + break; + + case 0x29908086: + type = CT_Q965; + break; + + case 0x2a008086: + type = CT_965GM; + break; + + case 0x29c08086: + type = CT_G33; + break; + + case 0x29b08086: + type = CT_Q35; + break; + + case 0x29d08086: + type = CT_Q33; + break; + + case 0x81008086: + type = CT_500GMA; + break; + + default: + type = CT_UNKWN; + break; + } + + return type; +} + + +vbios_resolution_type1 * map_type1_resolution(vbios_map * map, word res) { + vbios_resolution_type1 * ptr = ((vbios_resolution_type1*)(map->bios_ptr + res)); + return ptr; +} + +vbios_resolution_type2 * map_type2_resolution(vbios_map * map, word res) { + vbios_resolution_type2 * ptr = ((vbios_resolution_type2*)(map->bios_ptr + res)); + return ptr; +} + +vbios_resolution_type3 * map_type3_resolution(vbios_map * map, word res) { + vbios_resolution_type3 * ptr = ((vbios_resolution_type3*)(map->bios_ptr + res)); + return ptr; +} + + +boolean detect_bios_type(vbios_map * map, boolean modeline, int entry_size) { + int i; + short int r1, r2; + + r1 = r2 = 32000; + + for (i=0; i < map->mode_table_size; i++) { + if (map->mode_table[i].resolution <= r1) { + r1 = map->mode_table[i].resolution; + } + else { + if (map->mode_table[i].resolution <= r2) { + r2 = map->mode_table[i].resolution; + } + } + + /*printf("r1 = %d r2 = %d\n", r1, r2);*/ + } + + return (r2-r1-6) % entry_size == 0; +} + + +void close_vbios(vbios_map * map); + + +vbios_map * open_vbios(chipset_type forced_chipset) { + vbios_map * map = NEW(vbios_map); + memset (map, 0, sizeof(vbios_map)); + + /* + * Determine chipset + */ + + if (forced_chipset == CT_UNKWN) { + map->chipset_id = get_chipset_id(); + + map->chipset = get_chipset(map->chipset_id); + } + else if (forced_chipset != CT_UNKWN) { + map->chipset = forced_chipset; + } + else { + map->chipset = CT_915GM; + } + + /* + * Map the video bios to memory + */ + + map->bios_ptr=(char*)VBIOS_START; + +#if 0 + /* + * check if we have ATI Radeon + */ + + if (memmem(map->bios_ptr, VBIOS_SIZE, ATI_SIGNATURE1, strlen(ATI_SIGNATURE1)) || + memmem(map->bios_ptr, VBIOS_SIZE, ATI_SIGNATURE2, strlen(ATI_SIGNATURE2)) ) { + fprintf(stderr, "ATI chipset detected. 915resolution only works with Intel 800/900 series graphic chipsets.\n"); + close(map->bios_fd); + exit(2); + } + + /* + * check if we have NVIDIA + */ + + if (memmem(map->bios_ptr, VBIOS_SIZE, NVIDIA_SIGNATURE, strlen(NVIDIA_SIGNATURE))) { + fprintf(stderr, "NVIDIA chipset detected. 915resolution only works with Intel 800/900 series graphic chipsets.\n"); + close(map->bios_fd); + exit(2); + } + + /* + * check if we have Intel + */ + + if (map->chipset == CT_UNKWN && memmem(map->bios_ptr, VBIOS_SIZE, INTEL_SIGNATURE, strlen(INTEL_SIGNATURE))) { + fprintf(stderr, "Intel chipset detected. However, 915resolution was unable to determine the chipset type.\n"); + + fprintf(stderr, "Chipset Id: %x\n", map->chipset_id); + + fprintf(stderr, "Please report this problem to stomljen@yahoo.com\n"); + + close_vbios(map); + exit(2); + } +#endif + + /* + * check for others + */ + + if (map->chipset == CT_UNKWN) { + fprintf(stderr, "Unknown chipset type and unrecognized bios.\n"); + fprintf(stderr, "915resolution only works with Intel 800/900 series graphic chipsets.\n"); + + fprintf(stderr, "Chipset Id: %x\n", map->chipset_id); + close_vbios(map); + return 0; + } + + /* + * Figure out where the mode table is + */ + + { + address p = map->bios_ptr + 16; + address limit = map->bios_ptr + VBIOS_SIZE - (3 * sizeof(vbios_mode)); + + while (p < limit && map->mode_table == 0) { + vbios_mode * mode_ptr = (vbios_mode *) p; + + if (((mode_ptr[0].mode & 0xf0) == 0x30) && ((mode_ptr[1].mode & 0xf0) == 0x30) && + ((mode_ptr[2].mode & 0xf0) == 0x30) && ((mode_ptr[3].mode & 0xf0) == 0x30)) { + + map->mode_table = mode_ptr; + } + + p++; + } + + if (map->mode_table == 0) { + fprintf(stderr, "Unable to locate the mode table.\n"); + fprintf(stderr, "Please run the program 'dump_bios' as root and\n"); + fprintf(stderr, "email the file 'vbios.dmp' to stomljen@yahoo.com.\n"); + + fprintf(stderr, "Chipset: %s\n", chipset_type_names[map->chipset]); + close_vbios(map); + return 0; + } + } + + /* + * Determine size of mode table + */ + + { + vbios_mode * mode_ptr = map->mode_table; + + while (mode_ptr->mode != 0xff) { + map->mode_table_size++; + mode_ptr++; + } + } + + /* + * Figure out what type of bios we have + * order of detection is important + */ + + if (detect_bios_type(map, TRUE, sizeof(vbios_modeline_type3))) { + map->bios = BT_3; + } + else if (detect_bios_type(map, TRUE, sizeof(vbios_modeline_type2))) { + map->bios = BT_2; + } + else if (detect_bios_type(map, FALSE, sizeof(vbios_resolution_type1))) { + map->bios = BT_1; + } + else { + fprintf(stderr, "Unable to determine bios type.\n"); + fprintf(stderr, "Please run the program 'dump_bios' as root and\n"); + fprintf(stderr, "email the file 'vbios.dmp' to stomljen@yahoo.com.\n"); + + fprintf(stderr, "Chipset: %s\n", chipset_type_names[map->chipset]); + fprintf(stderr, "Mode Table Offset: $C0000 + $%x\n", ((cardinal)map->mode_table) - ((cardinal)map->bios_ptr)); + fprintf(stderr, "Mode Table Entries: %u\n", map->mode_table_size); + return 0; + } + + return map; +} + +void close_vbios(vbios_map * map) { + assert(!map->unlocked); + + FREE(map); +} + +void unlock_vbios(vbios_map * map) { + + assert(!map->unlocked); + + map->unlocked = TRUE; + + switch (map->chipset) { + case CT_UNKWN: + break; + case CT_830: + case CT_855GM: + outl(0x8000005a, 0xcf8); + map->b1 = inb(0xcfe); + + outl(0x8000005a, 0xcf8); + outb(0x33, 0xcfe); + break; + case CT_845G: + case CT_865G: + case CT_915G: + case CT_915GM: + case CT_945G: + case CT_945GM: + case CT_946GZ: + case CT_G965: + case CT_Q965: + case CT_965GM: + case CT_G33: + case CT_Q35: + case CT_Q33: + case CT_500GMA: + outl(0x80000090, 0xcf8); + map->b1 = inb(0xcfd); + map->b2 = inb(0xcfe); + + outl(0x80000090, 0xcf8); + outb(0x33, 0xcfd); + outb(0x33, 0xcfe); + break; + } + +#if DEBUG + { + cardinal t = inl(0xcfc); + printf("unlock PAM: (0x%08x)\n", t); + } +#endif +} + +void relock_vbios(vbios_map * map) { + + assert(map->unlocked); + map->unlocked = FALSE; + + switch (map->chipset) { + case CT_UNKWN: + break; + case CT_830: + case CT_855GM: + outl(0x8000005a, 0xcf8); + outb(map->b1, 0xcfe); + break; + case CT_845G: + case CT_865G: + case CT_915G: + case CT_915GM: + case CT_945G: + case CT_945GM: + case CT_945GME: + case CT_946GZ: + case CT_G965: + case CT_Q965: + case CT_965GM: + case CT_G33: + case CT_Q35: + case CT_Q33: + case CT_500GMA: + outl(0x80000090, 0xcf8); + outb(map->b1, 0xcfd); + outb(map->b2, 0xcfe); + break; + } + +#if DEBUG + { + cardinal t = inl(0xcfc); + printf("relock PAM: (0x%08x)\n", t); + } +#endif +} + + +void list_modes(vbios_map *map, cardinal raw) { + cardinal i, x, y; + + for (i=0; i < map->mode_table_size; i++) { + switch(map->bios) { + case BT_1: + { + vbios_resolution_type1 * res = map_type1_resolution(map, map->mode_table[i].resolution); + + x = ((((cardinal) res->x2) & 0xf0) << 4) | res->x1; + y = ((((cardinal) res->y2) & 0xf0) << 4) | res->y1; + + if (x != 0 && y != 0) { + printf("Mode %02x : %dx%d, %d bits/pixel\n", map->mode_table[i].mode, x, y, map->mode_table[i].bits_per_pixel); + } + + if (raw) + { + printf("Mode %02x (raw) :\n\t%02x %02x\n\t%02x\n\t%02x\n\t%02x\n\t%02x\n\t%02x\n\t%02x\n", map->mode_table[i].mode, res->unknow1[0],res->unknow1[1], res->x1,res->x_total,res->x2,res->y1,res->y_total,res->y2); + } + + } + break; + case BT_2: + { + vbios_resolution_type2 * res = map_type2_resolution(map, map->mode_table[i].resolution); + + x = res->modelines[0].x1+1; + y = res->modelines[0].y1+1; + + if (x != 0 && y != 0) { + printf("Mode %02x : %dx%d, %d bits/pixel\n", map->mode_table[i].mode, x, y, map->mode_table[i].bits_per_pixel); + } + } + break; + case BT_3: + { + vbios_resolution_type3 * res = map_type3_resolution(map, map->mode_table[i].resolution); + + x = res->modelines[0].x1+1; + y = res->modelines[0].y1+1; + + if (x != 0 && y != 0) { + printf("Mode %02x : %dx%d, %d bits/pixel\n", map->mode_table[i].mode, x, y, map->mode_table[i].bits_per_pixel); + } + } + break; + case BT_UNKWN: + break; + } + } +} + +static void gtf_timings(int x, int y, int freq, + unsigned long *clock, + word *hsyncstart, word *hsyncend, word *hblank, + word *vsyncstart, word *vsyncend, word *vblank) +{ + int hbl, vbl, vfreq; + + vbl = y + (y+1)/(20000.0/(11*freq) - 1) + 1.5; + vfreq = vbl * freq; + hbl = 16 * (int)(x * (30.0 - 300000.0 / vfreq) / + (70.0 + 300000.0 / vfreq) / 16.0 + 0.5); + + *vsyncstart = y; + *vsyncend = y + 3; + *vblank = vbl - 1; + *hsyncstart = x + hbl / 2 - (x + hbl + 50) / 100 * 8 - 1; + *hsyncend = x + hbl / 2 - 1; + *hblank = x + hbl - 1; + *clock = (x + hbl) * vfreq / 1000; +} + +void set_mode(vbios_map * map, cardinal mode, cardinal x, cardinal y, cardinal bp, cardinal htotal, cardinal vtotal) { + int xprev, yprev; + cardinal i, j; + + for (i=0; i < map->mode_table_size; i++) { + if (map->mode_table[i].mode == mode) { + switch(map->bios) { + case BT_1: + { + vbios_resolution_type1 * res = map_type1_resolution(map, map->mode_table[i].resolution); + + if (bp) { + map->mode_table[i].bits_per_pixel = bp; + } + + res->x2 = (htotal?(((htotal-x) >> 8) & 0x0f) : (res->x2 & 0x0f)) | ((x >> 4) & 0xf0); + res->x1 = (x & 0xff); + + res->y2 = (vtotal?(((vtotal-y) >> 8) & 0x0f) : (res->y2 & 0x0f)) | ((y >> 4) & 0xf0); + res->y1 = (y & 0xff); + if (htotal) + res->x_total = ((htotal-x) & 0xff); + + if (vtotal) + res->y_total = ((vtotal-y) & 0xff); + } + break; + case BT_2: + { + vbios_resolution_type2 * res = map_type2_resolution(map, map->mode_table[i].resolution); + + res->xchars = x / 8; + res->ychars = y / 16 - 1; + xprev = res->modelines[0].x1; + yprev = res->modelines[0].y1; + + for(j=0; j < 3; j++) { + vbios_modeline_type2 * modeline = &res->modelines[j]; + + if (modeline->x1 == xprev && modeline->y1 == yprev) { + modeline->x1 = modeline->x2 = x-1; + modeline->y1 = modeline->y2 = y-1; + + gtf_timings(x, y, freqs[j], &modeline->clock, + &modeline->hsyncstart, &modeline->hsyncend, + &modeline->hblank, &modeline->vsyncstart, + &modeline->vsyncend, &modeline->vblank); + + if (htotal) + modeline->htotal = htotal; + else + modeline->htotal = modeline->hblank; + + if (vtotal) + modeline->vtotal = vtotal; + else + modeline->vtotal = modeline->vblank; + } + } + } + break; + case BT_3: + { + vbios_resolution_type3 * res = map_type3_resolution(map, map->mode_table[i].resolution); + + xprev = res->modelines[0].x1; + yprev = res->modelines[0].y1; + + for (j=0; j < 3; j++) { + vbios_modeline_type3 * modeline = &res->modelines[j]; + + if (modeline->x1 == xprev && modeline->y1 == yprev) { + modeline->x1 = modeline->x2 = x-1; + modeline->y1 = modeline->y2 = y-1; + + gtf_timings(x, y, freqs[j], &modeline->clock, + &modeline->hsyncstart, &modeline->hsyncend, + &modeline->hblank, &modeline->vsyncstart, + &modeline->vsyncend, &modeline->vblank); + if (htotal) + modeline->htotal = htotal; + else + modeline->htotal = modeline->hblank; + if (vtotal) + modeline->vtotal = vtotal; + else + modeline->vtotal = modeline->vblank; + + modeline->timing_h = y-1; + modeline->timing_v = x-1; + } + } + } + break; + case BT_UNKWN: + break; + } + } + } +} + +void display_map_info(vbios_map * map) { + printf("Chipset: %s\n", chipset_type_names[map->chipset]); + printf("BIOS: %s\n", bios_type_names[map->bios]); + + printf("Mode Table Offset: $C0000 + $%x\n", ((cardinal)map->mode_table) - ((cardinal)map->bios_ptr)); + printf("Mode Table Entries: %u\n", map->mode_table_size); +} + + +int parse_args(int argc, char *argv[], chipset_type *forced_chipset, cardinal *list, cardinal *mode, cardinal *x, cardinal *y, cardinal *bp, cardinal *raw, cardinal *htotal, cardinal *vtotal) { + cardinal index = 0; + + *list = *mode = *x = *y = *raw = *htotal = *vtotal = 0; + + *forced_chipset = CT_UNKWN; + + + if ((argc > index) && !strcmp(argv[index], "-c")) { + index++; + + if(argc<=index) { + return 0; + } + + if (!strcmp(argv[index], "845")) { + *forced_chipset = CT_845G; + } + else if (!strcmp(argv[index], "855")) { + *forced_chipset = CT_855GM; + } + else if (!strcmp(argv[index], "865")) { + *forced_chipset = CT_865G; + } + else if (!strcmp(argv[index], "915G")) { + *forced_chipset = CT_915G; + } + else if (!strcmp(argv[index], "915GM")) { + *forced_chipset = CT_915GM; + } + else if (!strcmp(argv[index], "945G")) { + *forced_chipset = CT_945G; + } + else if (!strcmp(argv[index], "945GM")) { + *forced_chipset = CT_945GM; + } + else if (!strcmp(argv[index], "945GME")) { + *forced_chipset = CT_945GME; + } + else if (!strcmp(argv[index], "946GZ")) { + *forced_chipset = CT_946GZ; + } + else if (!strcmp(argv[index], "G965")) { + *forced_chipset = CT_G965; + } + else if (!strcmp(argv[index], "Q965")) { + *forced_chipset = CT_Q965; + } + else if (!strcmp(argv[index], "965GM")) { + *forced_chipset = CT_965GM; + } + else if (!strcmp(argv[index], "G33")) { + *forced_chipset = CT_G33; + } + else if (!strcmp(argv[index], "Q35")) { + *forced_chipset = CT_Q35; + } + else if (!strcmp(argv[index], "Q33")) { + *forced_chipset = CT_Q33; + } + else if (!strcmp(argv[index], "500GMA")) { + *forced_chipset = CT_500GMA; + } + else { + *forced_chipset = CT_UNKWN; + } + + index++; + + if (argc<=index) { + return 0; + } + } + + if ((argc > index) && !strcmp(argv[index], "-l")) { + *list = 1; + index++; + + if(argc<=index) { + return 0; + } + } + + if ((argc > index) && !strcmp(argv[index], "-r")) { + *raw = 1; + index++; + + if(argc<=index) { + return 0; + } + } + + if (argc-index < 3 || argc-index > 6) { + return -1; + } + + *mode = (cardinal) strtol(argv[index], NULL, 16); + *x = (cardinal)atoi(argv[index+1]); + *y = (cardinal)atoi(argv[index+2]); + + + if (argc-index > 3) { + *bp = (cardinal)atoi(argv[index+3]); + } + else { + *bp = 0; + } + + if (argc-index > 4) { + *htotal = (cardinal)atoi(argv[index+4]); + } + else { + *htotal = 0; + } + + if (argc-index > 5) { + *vtotal = (cardinal)atoi(argv[index+5]); + } + else { + *vtotal = 0; + } + + return 0; +} + +static void usage() { + printf("Usage: 915resolution [-c chipset] [-l] [mode X Y] [bits/pixel] [htotal] [vtotal]\n"); + printf(" Set the resolution to XxY for a video mode\n"); + printf(" Bits per pixel are optional. htotal/vtotal settings are additionally optional.\n"); + printf(" Options:\n"); + printf(" -c force chipset type (THIS IS USED FOR DEBUG PURPOSES)\n"); + printf(" -l display the modes found in the video BIOS\n"); + printf(" -r display the modes found in the video BIOS in raw mode (THIS IS USED FOR DEBUG PURPOSES)\n"); +} + +int main (int argc, char *argv[]) +{ + vbios_map * map; + cardinal list, mode, x, y, bp, raw, htotal, vtotal; + chipset_type forced_chipset; + + printf("Intel 800/900 Series VBIOS Hack : version %s\n\n", VERSION); + + if (parse_args(argc, argv, &forced_chipset, &list, &mode, &x, &y, &bp, &raw, &htotal, &vtotal) == -1) { + usage(); + return 2; + } + + map = open_vbios(forced_chipset); + display_map_info(map); + + printf("\n"); + + if (list) { + list_modes(map, raw); + } + + if (mode!=0 && x!=0 && y!=0) { + unlock_vbios(map); + + set_mode(map, mode, x, y, bp, htotal, vtotal); + + relock_vbios(map); + + printf("Patch mode %02x to resolution %dx%d complete\n", mode, x, y); + + if (list) { + list_modes(map, raw); + } + } + + close_vbios(map); + + return 0; +} + + + + + +static grub_err_t +grub_cmd_915resolution (struct grub_arg_list *state __attribute__ ((unused)), int argc, char *argv[]) +{ + return main (argc, argv); +} + +GRUB_MOD_INIT(915resolution) +{ + (void)mod; /* To stop warning. */ + grub_register_extcmd ("915resolution", grub_cmd_915resolution, GRUB_COMMAND_FLAG_BOTH, + "915resolution", "Intel VBE editor", 0); +} + +GRUB_MOD_FINI(915resolution) +{ + grub_unregister_command ("915resolution"); +} --- grub2-1.98.orig/debian/grub-extras/915resolution/README +++ grub2-1.98/debian/grub-extras/915resolution/README @@ -0,0 +1,11 @@ + +grub-extras is meant to be used as an overlay on grub2 source tree. + +Build instructions: + + - Copy grub-extras in a subdirectory of your grub2 checkout. + For example, "grub-extras". + + - Export GRUB_CONTRIB environment variable to point to this directory. + + - Build GRUB as usual. --- grub2-1.98.orig/debian/grub-extras/915resolution/conf/i386-pc.rmk +++ grub2-1.98/debian/grub-extras/915resolution/conf/i386-pc.rmk @@ -0,0 +1,6 @@ +# -*- makefile -*- + +pkglib_MODULES += 915resolution.mod +915resolution_mod_SOURCES = $(GRUB_CONTRIB)/915resolution/915resolution.c +915resolution_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-error +915resolution_mod_LDFLAGS = $(COMMON_LDFLAGS) --- grub2-1.98.orig/debian/grub-extras/915resolution/conf/common.mk +++ grub2-1.98/debian/grub-extras/915resolution/conf/common.mk @@ -0,0 +1,3 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! +-include $(GRUB_CONTRIB)/915resolution/conf/$(target_cpu)-$(platform).mk --- grub2-1.98.orig/debian/grub-extras/915resolution/conf/common.rmk +++ grub2-1.98/debian/grub-extras/915resolution/conf/common.rmk @@ -0,0 +1,2 @@ +# -*- makefile -*- +-include $(GRUB_CONTRIB)/915resolution/conf/$(target_cpu)-$(platform).mk --- grub2-1.98.orig/debian/grub-extras/915resolution/conf/i386-pc.mk +++ grub2-1.98/debian/grub-extras/915resolution/conf/i386-pc.mk @@ -0,0 +1,99 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! + +pkglib_MODULES += 915resolution.mod +915resolution_mod_SOURCES = $(GRUB_CONTRIB)/915resolution/915resolution.c + +clean-module-915resolution.mod.1: + rm -f 915resolution.mod mod-915resolution.o mod-915resolution.c pre-915resolution.o 915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.o und-915resolution.lst + +CLEAN_MODULE_TARGETS += clean-module-915resolution.mod.1 + +clean-module-915resolution.mod-symbol.1: + rm -f def-915resolution.lst + +CLEAN_MODULE_TARGETS += clean-module-915resolution.mod-symbol.1 +DEFSYMFILES += def-915resolution.lst +mostlyclean-module-915resolution.mod.1: + rm -f 915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.d + +MOSTLYCLEAN_MODULE_TARGETS += mostlyclean-module-915resolution.mod.1 +UNDSYMFILES += und-915resolution.lst + +ifneq ($(TARGET_APPLE_CC),1) +915resolution.mod: pre-915resolution.o mod-915resolution.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(915resolution_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-915resolution.o mod-915resolution.o + if test ! -z "$(TARGET_OBJ2ELF)"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ +else +915resolution.mod: pre-915resolution.o mod-915resolution.o $(TARGET_OBJ2ELF) + -rm -f $@ + -rm -f $@.bin + $(TARGET_CC) $(915resolution_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@.bin pre-915resolution.o mod-915resolution.o + $(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@ + -rm -f $@.bin +endif + +pre-915resolution.o: $(915resolution_mod_DEPENDENCIES) 915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.o + -rm -f $@ + $(TARGET_CC) $(915resolution_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ 915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.o + +mod-915resolution.o: mod-915resolution.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -c -o $@ $< + +mod-915resolution.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh '915resolution' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(TARGET_APPLE_CC),1) +def-915resolution.lst: pre-915resolution.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 915resolution/' > $@ +else +def-915resolution.lst: pre-915resolution.o + $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed 's/^\([^ ]*\).*/\1 915resolution/' > $@ +endif + +und-915resolution.lst: pre-915resolution.o + echo '915resolution' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.o: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) + $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -MD -c -o $@ $< +-include 915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.d + +clean-module-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution-extra.1: + rm -f cmd-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst fs-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst partmap-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst handler-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst parttool-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst video-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst terminal-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst + +CLEAN_MODULE_TARGETS += clean-module-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution-extra.1 + +COMMANDFILES += cmd-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst +FSFILES += fs-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst +PARTTOOLFILES += parttool-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst +PARTMAPFILES += partmap-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst +HANDLERFILES += handler-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst +TERMINALFILES += terminal-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst +VIDEOFILES += video-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst + +cmd-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh 915resolution > $@ || (rm -f $@; exit 1) + +fs-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh 915resolution > $@ || (rm -f $@; exit 1) + +parttool-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) genparttoollist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/genparttoollist.sh 915resolution > $@ || (rm -f $@; exit 1) + +partmap-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh 915resolution > $@ || (rm -f $@; exit 1) + +handler-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) genhandlerlist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/genhandlerlist.sh 915resolution > $@ || (rm -f $@; exit 1) + +terminal-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) genterminallist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/genterminallist.sh 915resolution > $@ || (rm -f $@; exit 1) + +video-915resolution_mod-__GRUB_CONTRIB__915resolution_915resolution.lst: $(GRUB_CONTRIB)/915resolution/915resolution.c $($(GRUB_CONTRIB)/915resolution/915resolution.c_DEPENDENCIES) genvideolist.sh + set -e; $(TARGET_CC) -I$(GRUB_CONTRIB)/915resolution -I$(srcdir)/$(GRUB_CONTRIB)/915resolution $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(915resolution_mod_CFLAGS) -E $< | sh $(srcdir)/genvideolist.sh 915resolution > $@ || (rm -f $@; exit 1) + +915resolution_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-error +915resolution_mod_LDFLAGS = $(COMMON_LDFLAGS) --- grub2-1.98.orig/debian/legacy/update-grub +++ grub2-1.98/debian/legacy/update-grub @@ -0,0 +1,1094 @@ +#!/bin/bash +# +# Insert a list of installed kernels in a grub config file +# Copyright 2001 Wichert Akkerman +# Copyright (C) 2007,2008 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . +# +# Contributors: +# Jason Thomas +# David B.Harris +# Marc Haber +# Crispin Flowerday + +# Abort on errors +set -e + +host_os=`uname -s | tr '[A-Z]' '[a-z]'` + +abort() { + message=$@ + + echo >&2 + echo -e "$message" >&2 + echo >&2 + exit 1 +} + +find_grub_dir () +{ + echo -n "Searching for GRUB installation directory ... " >&2 + + for d in /boot/grub /boot/boot/grub ; do + if [ -d "$d" ] ; then + grub_dir="$d" + break + fi + done + + if [ -z "$grub_dir" ] ; then + abort "No GRUB directory found.\n To create a template run 'mkdir /boot/grub' first.\n To install grub, install it manually or try the 'grub-install' command.\n ### Warning, grub-install is used to change your MBR. ###" + else + echo "found: $grub_dir" >&2 + fi + + echo $grub_dir +} + +# This function was borrowed from grub2/util/update-grub_lib.in +make_system_path_relative_to_its_root () +{ + path=$1 + # abort if file doesn't exist + if test -e $path ; then : ;else + return 1 + fi + + # canonicalize + if path=`readlink -f $path` ; then : ; else + return 1 + fi + + # if not a directory, climb up to the directory containing it + if test -d $path ; then + dir=$path + else + dir=`echo $path | sed -e "s,/[^/]*$,,g"` + fi + + num=`stat -c %d $dir` + + # this loop sets $dir to the root directory of the filesystem we're inspecting + while : ; do + parent=`readlink -f $dir/..` + if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else + # $parent is another filesystem; we found it. + break + fi + if [ "x$dir" = "x/" ] ; then + # / is our root. + break + fi + dir=$parent + done + + # This function never prints trailing slashes (so that its output can be + # appended a slash unconditionally). Each slash in $dir is considered a + # preceding slash, and therefore the root directory is an empty string. + if [ "$dir" = "/" ] ; then + dir="" + fi + + echo $path | sed -e "s,^$dir,,g" +} + +# The grub installation directory +grub_dir=$(find_grub_dir) + +# Full path to the device.map +device_map=$grub_dir/device.map + +find_device () +{ + if ! test -e ${device_map} ; then + echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null + fi + grub-probe --device-map=${device_map} -t device $1 2> /dev/null +} + +# Usage: convert_raid1 os_device +# Checks if os_device is a software raid1. +# If so, converts to first physical device in array. +convert_raid1 () +{ + case $1 in + /dev/md[0-9] | /dev/md/[0-9]) + : ;; # Continue + *) + return 1 ;; + esac + + [ -x /sbin/mdadm ] || return 1 + + # Check that the raid device is raid1 + raidlevel=$(mdadm -D -b $1 | grep "^ARRAY" | \ + sed "s/^.*level=//" | cut -d" " -f1) + [ "$raidlevel" = "raid1" ] || return 1 + + # Take only the first device that makes up the raid + raiddev=$(mdadm -D $1 | grep -A1 "Number" | grep "dev" \ + | sed "s/^.*\(\/dev\/.*\)$/\1/") + [ -n "$raiddev" ] || return 1 + + echo $raiddev + return 0 +} + +# Usage: convert os_device +# Convert an OS device to the corresponding GRUB drive. +convert () { + if ! test -e ${device_map} ; then + echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null + fi + GRUB_LEGACY_0_BASED_PARTITIONS=1 grub-probe --device-map=${device_map} -t drive -d "$1" 2> /dev/null || { + echo "warning: grub-probe can't find drive for $1." >&2 + tmp_map=$(mktemp -t device.map.XXXXXXXX) + grub-mkdevicemap --device-map=${tmp_map} --no-floppy >/dev/null 2>&1 || true + GRUB_LEGACY_0_BASED_PARTITIONS=1 grub-probe --device-map=${tmp_map} -t drive -d "$1" || { + rm -f ${tmp_map} + return 1 + } + echo "Please check ${device_map}, you might have to regenerate it with grub-mkdevicemap." >&2 + rm -f ${tmp_map} + } +} + +# Usage: convert_default os_device +# Convert an OS device to the corresponding GRUB drive. +convert_default () { + # Check if device is software raid1 array + if tmp_dev=$(convert_raid1 $1 2>/dev/null) ; then + : # Use device returned by convert_raid1 + else + tmp_dev=$1 + fi + + convert $tmp_dev +} + +## Configuration Options + +# Full path to the menu.lst +menu_file_basename=menu.lst +menu_file=$grub_dir/$menu_file_basename + +# Full path to the default file +default_file_basename=default +default_file=$grub_dir/$default_file_basename + +# the device for the / filesystem +root_device=$(find_device "/") + +# loop-AES arranges things so that /dev/loop/X can be our root device, but +# the initrds that Linux uses don't like that. +case ${root_device} in + /dev/loop/*|/dev/loop[0-9]) + root_device=`losetup ${root_device} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; +esac + +# the device for the /boot filesystem +boot_device=$(find_device "/boot") + +# where grub looks for the kernels at boot time +kernel_dir=`make_system_path_relative_to_its_root /boot` + +# the "-t abstraction" check is a workaround untill #484297 is fixed +if abstraction=`grub-probe -t abstraction --device ${root_device} 2> /dev/null` && [ "$abstraction" = "" ] && \ + root_uuid=`grub-probe --device-map=${device_map} --device ${root_device} --target=fs_uuid 2> /dev/null` && \ + test -e "/dev/disk/by-uuid/${root_uuid}" ; then + linux_root_device=UUID=${root_uuid} +else + linux_root_device=${root_device} +fi + +# Default kernel options, overidden by the kopt statement in the menufile. +kopt="root=$linux_root_device ro" + +# Title +title=$(lsb_release --short --description 2>/dev/null) || title="Ubuntu" + +# should update-grub remember the default entry +updatedefaultentry="false" + +# Drive(in GRUB terms) where the kernel is located. Overridden by the +# groot statement in menufile. +grub_root_device=$(convert_default "$boot_device") + +# should grub create the alternative boot options in the menu + alternative="true" + +# should grub lock the alternative boot options in the menu + lockalternative="false" + +# additional options to use with the default boot option, but not with the +# alternatives + defoptions="quiet splash" + +# should grub lock the old kernels + 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" + +# options to use with the alternative boot options + altoptions="(recovery mode) single" + +# controls howmany kernels are listed in the config file, +# this does not include the alternative kernels + howmany="all" + +# should grub create a memtest86 entry + memtest86="true" + +# should grub add "savedefault" to default boot options + savedefault="false" + +# stores the command line arguments + command_line_arguments=$1 + +# does this version of grub support the quiet option? +if [ -f ${grub_dir}/installed-version ] && dpkg --compare-versions `cat ${grub_dir}/installed-version` ge 0.97-11ubuntu4; then + supports_quiet=true +else + supports_quiet=false +fi + +# read user configuration +if test -f "/etc/default/grub" ; then + . /etc/default/grub +fi + +# Default options to use in a new config file. This will only be used if $menu_file +# doesn't already exist. Only edit the lines between the two "EOF"s. The others are +# part of the script. +newtemplate=$(tempfile) +cat > "$newtemplate" <&2 +if [ -f "$default_file" ] ; then + echo "found: $default_file" >&2 +else + echo "Generating $default_file file and setting the default boot entry to 0" >&2 + if [ -f /usr/lib/grub-legacy/grub-set-default ] ; then + /usr/lib/grub-legacy/grub-set-default $1 + else + grub-set-default $1 + fi +fi + +# Make sure we use the standard sorting order +LC_COLLATE=C +# Magic markers we use +start="### BEGIN AUTOMAGIC KERNELS LIST" +end="### END DEBIAN AUTOMAGIC KERNELS LIST" + +startopt="## ## Start Default Options ##" +endopt="## ## End Default Options ##" + +# Extract options from config file +ExtractMenuOpt() +{ + opt=$1 + + sed -ne "/^$start\$/,/^$end\$/ { + /^$startopt\$/,/^$endopt\$/ { + /^# $opt=/ { + s/^# $opt=\(.*\)\$/\1/ + p + } + } + }" $menu +} + +GetMenuOpts() +{ + opt=$1 + + sed -ne "/^$start\$/,/^$end\$/ { + /^$startopt\$/,/^$endopt\$/ { + /^# $opt=/ { + p + } + } + }" $menu +} + +ExtractMenuOpts() +{ + opt=$1 + + GetMenuOpts $opt | sed "s/^# $opt=\(.*\)\$/\1=\"\2\"/" +} + +GetMenuOpt() +{ + opt=$1 + value=$2 + + [ -z "$(GetMenuOpts "$opt")" ] || value=$(ExtractMenuOpt "$opt") + + echo $value +} + +# Compares two version strings A and B +# Returns -1 if AB +# This compares version numbers of the form +# 2.4.14.2 > 2.4.14 +# 2.4.14random = 2.4.14-random > 2.4.14-ac10 > 2.4.14 > 2.4.14-pre2 > +# 2.4.14-pre1 > 2.4.13-ac99 +CompareVersions() +{ + local a=`echo $1 | sed -e "s,.*/vmlinu[zx]-,,g;s/[._-]\(pre\|rc\|test\|git\)/~\1/g"` + local b=`echo $2 | sed -e "s,.*/vmlinu[zx]-,,g;s/[._-]\(pre\|rc\|test\|git\)/~\1/g"` + if [ "$a" = "$b" ] ; then + echo 0 + elif dpkg --compare-versions "$a" gt "$b" ; then + echo 1 + else + echo -1 + fi +} + +# looks in the directory specified for an initrd image with the version specified +FindInitrdName() +{ + # strip trailing slashes + directory=$(echo $1 | sed -e 's#/*$##') + version=$2 + + # initrd + # initrd.img + # initrd-lvm + # .*.gz + + initrdName="" + names="initrd initrd.img initrd-lvm" + compressed="gz" + + for n in $names ; do + # make sure we haven't already found it + if [ -z "$initrdName" ] ; then + if [ -f "$directory/$n$version" ] ; then + initrdName="$n$version" + break + else + for c in $compressed ; do + if [ -f "$directory/$n$version.$c" ] ; then + initrdName="$n$version.$c" + break + fi + done + fi + else + break + fi + done + + # return the result + echo $initrdName +} + +FindXenHypervisorVersions () +{ + version=$1 + + if [ -f "/var/lib/linux-image-$version/xen-versions" ]; then + ret="$(cat /var/lib/linux-image-$version/xen-versions)" + fi + + echo $ret +} + +get_kernel_opt() +{ + kernel_version=$1 + + version=$(echo $kernel_version | sed 's/^[^0-9]*//') + version=$(echo $version | sed 's/[-\+\.]/_/g') + if [ -n "$version" ] ; then + while [ -n "$version" ] ; do + currentOpt="$(eval "echo \${kopt_$version}")" + if [ -n "$currentOpt" ] ; then + break + fi + version=$(echo $version | sed 's/_\?[^_]*$//') + done + fi + + if [ -z "$currentOpt" ] ; then + currentOpt=$kopt + fi + + echo $currentOpt +} + +write_kernel_entry() +{ + local kernel_version; kernel_version=$1; shift + local recovery_desc; recovery_desc=$1; shift + local lock_alternative; lock_alternative=$1; shift + local grub_root_device; grub_root_device=$1; shift + local kernel; kernel=$1; shift + local kernel_options; kernel_options=$1; shift + local recovery_suffix; recovery_suffix=$1; shift + local initrd; initrd=$1; shift + local savedefault; savedefault=$1; shift + local lockold; lockold=$1; shift + local hypervisor + if [ -n "$1" ]; then + # Hypervisor. + hypervisor=$1; shift + local hypervisor_image; hypervisor_image=$1; shift + local hypervisor_version; hypervisor_version=$1; shift + local hypervisor_options; hypervisor_options=$1; shift + fi + + local grub_root_type + case "$grub_root_device" in + [^A-Za-z0-9]*) grub_root_type='root' ;; + *) grub_root_type='uuid' ;; + esac + + echo -n "title " >> $buffer + + if [ -n "$hypervisor" ]; then + echo -n "$hypervisor $hypervisor_version / " >> $buffer + fi + + echo -n "$title" >> $buffer + if [ -n "$kernel_version" ]; then + echo -n ", " >> $buffer + # memtest86 is not strictly a kernel + if ! echo "$kernel_version" | grep -q ^memtest86; then + echo -n "kernel " >> $buffer + fi + echo -n "$kernel_version" >> $buffer + fi + if [ -n "$recovery_desc" ]; then + echo -n " $recovery_desc" >> $buffer + fi + echo >> $buffer + + # lock the alternative options + if test x"$lock_alternative" = x"true" ; then + echo "lock" >> $buffer + fi + # lock the old entries + if test x"$lockold" = x"true" ; then + echo "lock" >> $buffer + fi + + echo "$grub_root_type $grub_root_device" >> $buffer + + echo -n "kernel " >> $buffer + if [ -n "$hypervisor" ]; then + echo -n "$hypervisor_image" >> $buffer + if [ -n "$hypervisor_options" ]; then + echo -n " $hypervisor_options" >> $buffer + fi + echo >> $buffer + echo -n "module " >> $buffer + fi + echo -n "$kernel" >> $buffer + if [ -n "$kernel_options" ]; then + echo -n " $kernel_options" >> $buffer + fi + if [ -n "$recovery_desc" ]; then + echo -n " $recovery_suffix" >> $buffer + fi + echo >> $buffer + + if [ -n "$initrd" ]; then + if [ -n "$hypervisor" ]; then + echo -n "module " >> $buffer + else + echo -n "initrd " >> $buffer + fi + echo "$initrd" >> $buffer + fi + + if [ ! -n "$recovery_desc" -a x"$supports_quiet" = x"true" ]; then + echo "quiet" >> $buffer + fi + + if test x"$savedefault" = x"true" ; then + echo "savedefault" >> $buffer + fi + echo >> $buffer +} + + +echo -n "Testing for an existing GRUB $menu_file_basename file ... " >&2 + +# Test if our menu file exists +if [ -f "$menu_file" ] ; then + menu="$menu_file" + rm -f $newtemplate + unset newtemplate + echo "found: $menu_file" >&2 + cp -f "$menu_file" "$menu_file~" +else + # if not ask user if they want us to create one + menu="$menu_file" + echo >&2 + echo >&2 + if [ "-y" = "$command_line_arguments" ] ; then + echo "Warning: ignoring deprecated -y option." >&2 + fi + echo >&2 + echo "Generating $menu_file" >&2 + cat "$newtemplate" > $menu_file + rm -f $newtemplate + unset newtemplate +fi + +# Extract the kernel options to use +kopt=$(GetMenuOpt "kopt" "$kopt") + +# Set the kernel 2.6 option only for fresh install +test -z "$(GetMenuOpt "kopt" "")" && kopt_2_6="root=$linux_root_device ro" + +# Extract options for specific kernels +opts="$(ExtractMenuOpts "\(kopt_[[:alnum:]_]\+\)")" +test -z "$opts" || eval "$opts" +CustomKopts=$(GetMenuOpts "\(kopt_[[:alnum:]_]\+\)") + +# Extract the grub root +grub_root_device=$(GetMenuOpt "groot" "$grub_root_device") + +# Extract the old recovery value +alternative=$(GetMenuOpt "recovery" "$alternative") + +# Extract the alternative value +alternative=$(GetMenuOpt "alternative" "$alternative") + +# Extract the lockalternative value +lockalternative=$(GetMenuOpt "lockalternative" "$lockalternative") + +# Extract the additional default options +defoptions=$(GetMenuOpt "defoptions" "$defoptions") + +# Extract the lockold value +lockold=$(GetMenuOpt "lockold" "$lockold") + +# Extract Xen hypervisor options +xenhopt=$(GetMenuOpt "xenhopt" "$xenhopt") + +# Extract Xen Linux kernel options +xenkopt=$(GetMenuOpt "xenkopt" "$xenkopt") + +# Extract the howmany value +howmany=$(GetMenuOpt "howmany" "$howmany") + +# Extract the memtest86 value +memtest86=$(GetMenuOpt "memtest86" "$memtest86") + + +# Extract the updatedefaultentry option +updatedefaultentry=$(GetMenuOpt "updatedefaultentry" "$updatedefaultentry") + +# Extract the savedefault option +savedefault=$(GetMenuOpt "savedefault" "$savedefault") + +# Generate the menu options we want to insert +buffer=$(tempfile) +echo $start >> $buffer +echo "## lines between the AUTOMAGIC KERNELS LIST markers will be modified" >> $buffer +echo "## by the debian update-grub script except for the default options below" >> $buffer +echo >> $buffer +echo "## DO NOT UNCOMMENT THEM, Just edit them to your needs" >> $buffer +echo >> $buffer +echo "## ## Start Default Options ##" >> $buffer + +echo "## default kernel options" >> $buffer +echo "## default kernel options for automagic boot options" >> $buffer +echo "## If you want special options for specific kernels use kopt_x_y_z" >> $buffer +echo "## where x.y.z is kernel version. Minor versions can be omitted." >> $buffer +echo "## e.g. kopt=root=/dev/hda1 ro" >> $buffer +echo "## kopt_2_6_8=root=/dev/hdc1 ro" >> $buffer +echo "## kopt_2_6_8_2_686=root=/dev/hdc2 ro" >> $buffer +echo "# kopt=$kopt" >> $buffer +if [ -n "$CustomKopts" ] ; then + echo "$CustomKopts" >> $buffer +elif [ -n "$kopt_2_6" ] && [ "$kopt" != "$kopt_2_6" ]; then + echo "# kopt_2_6=$kopt_2_6" >> $buffer +fi +echo >> $buffer + +echo "## default grub root device" >> $buffer +echo "## e.g. groot=(hd0,0)" >> $buffer +echo "# groot=$grub_root_device" >> $buffer +echo >> $buffer + +echo "## should update-grub create alternative automagic boot options" >> $buffer +echo "## e.g. alternative=true" >> $buffer +echo "## alternative=false" >> $buffer +echo "# alternative=$alternative" >> $buffer +echo >> $buffer + +echo "## should update-grub lock alternative automagic boot options" >> $buffer +echo "## e.g. lockalternative=true" >> $buffer +echo "## lockalternative=false" >> $buffer +echo "# lockalternative=$lockalternative" >> $buffer +echo >> $buffer + +echo "## additional options to use with the default boot option, but not with the" >> $buffer +echo "## alternatives" >> $buffer +echo "## e.g. defoptions=vga=791 resume=/dev/hda5" >> $buffer +echo "# defoptions=$defoptions" >> $buffer +echo >> $buffer + +echo "## should update-grub lock old automagic boot options" >> $buffer +echo "## e.g. lockold=false" >> $buffer +echo "## lockold=true" >> $buffer +echo "# lockold=$lockold" >> $buffer +echo >> $buffer + +echo "## Xen hypervisor options to use with the default Xen boot option" >> $buffer +echo "# xenhopt=$xenhopt" >> $buffer +echo >> $buffer + +echo "## Xen Linux kernel options to use with the default Xen boot option" >> $buffer +echo "# xenkopt=$xenkopt" >> $buffer +echo >> $buffer + +echo "## altoption boot targets option" >> $buffer +echo "## multiple altoptions lines are allowed" >> $buffer +echo "## e.g. altoptions=(extra menu suffix) extra boot options" >> $buffer +echo "## altoptions=(recovery) single" >> $buffer + +if ! grep -q "^# altoptions" $menu ; then + echo "# altoptions=$altoptions" >> $buffer +else + grep "^# altoptions" $menu >> $buffer +fi +echo >> $buffer + +echo "## controls how many kernels should be put into the $menu_file_basename" >> $buffer +echo "## only counts the first occurence of a kernel, not the" >> $buffer +echo "## alternative kernel options" >> $buffer +echo "## e.g. howmany=all" >> $buffer +echo "## howmany=7" >> $buffer +echo "# howmany=$howmany" >> $buffer +echo >> $buffer + + +echo "## should update-grub create memtest86 boot option" >> $buffer +echo "## e.g. memtest86=true" >> $buffer +echo "## memtest86=false" >> $buffer +echo "# memtest86=$memtest86" >> $buffer +echo >> $buffer + +echo "## should update-grub adjust the value of the default booted system" >> $buffer +echo "## can be true or false" >> $buffer +echo "# updatedefaultentry=$updatedefaultentry" >> $buffer +echo >> $buffer + +echo "## should update-grub add savedefault to the default options" >> $buffer +echo "## can be true or false" >> $buffer +echo "# savedefault=$savedefault" >> $buffer +echo >> $buffer + +echo "## ## End Default Options ##" >> $buffer +echo >> $buffer + +echo -n "Searching for splash image ... " >&2 +current_splash=`grep '^splashimage=' ${menu_file} || true` +grub_dir_rel=`make_system_path_relative_to_its_root $grub_dir` +splashimage_path="splashimage=${grub_root_device}/${grub_dir_rel##${kernel_dir}}/splash.xpm.gz" +if [ `sed -e "/^$start/,/^$end/d" $menu_file | grep -c '^splashimage='` != "0" ] ; then + #checks for splashscreen defined outside the autoupdated part + splashimage=$(grep '^splashimage=' ${menu_file}) + echo "found: ${splashimage##*=}" >&2 + echo >&2 +elif [ -f "${grub_dir}/splash.xpm.gz" ] && [ "$current_splash" = "" ]; then + echo "found: /boot/grub/splash.xpm.gz" >&2 + echo "$splashimage_path" >> $buffer + echo >> $buffer +elif [ -f "${grub_dir}/splash.xpm.gz" ] && [ "$current_splash" = "$splashimage_path" ]; then + echo "found: /boot/grub/splash.xpm.gz" >&2 + echo "$splashimage_path" >> $buffer + echo >> $buffer +elif [ "$current_splash" != "" ] && [ "$current_splash" != "$splashimage_path" ]; then + echo "found but preserving previous setting: $(grep '^splashimage=' ${menu_file})" >&2 + echo "$current_splash" >> $buffer + echo >> $buffer +else + echo "none found, skipping ..." >&2 +fi + +xen0Kernels="" +# First kernels with xen0 support. +for ver in `grep -l CONFIG_XEN=y /boot/config* | sed -e s%/boot/config-%%`; do + if ! grep -q CONFIG_XEN_PRIVILEGED_GUEST=y /boot/config-$ver ; then + continue + fi + # ver is a kernel version + kern="/boot/vmlinuz-$ver" + if [ -r $kern ] ; then + newerKernels="" + for i in $xen0Kernels ; do + res=$(CompareVersions "$kern" "$i") + if [ "$kern" != "" ] && [ "$res" -gt 0 ] ; then + newerKernels="$newerKernels $kern $i" + kern="" + else + newerKernels="$newerKernels $i" + fi + done + if [ "$kern" != "" ] ; then + newerKernels="$newerKernels $kern" + fi + xen0Kernels="$newerKernels" + fi +done + +sortedKernels="" +for kern in $(/bin/ls -1vr /boot | grep -v "dpkg-*" | grep "^vmlinuz-") ; do + kern="/boot/$kern" + newerKernels="" + for i in $sortedKernels ; do + res=$(CompareVersions "$kern" "$i") + if [ "$kern" != "" ] && [ "$res" -gt 0 ] ; then + newerKernels="$newerKernels $kern $i" + kern="" + else + newerKernels="$newerKernels $i" + fi + done + if [ "$kern" != "" ] ; then + newerKernels="$newerKernels $kern" + fi + sortedKernels="$newerKernels" +done + +if test -f "/boot/vmlinuz.old" ; then + sortedKernels="/boot/vmlinuz.old $sortedKernels" +fi +if test -f "/boot/vmlinuz" ; then + sortedKernels="/boot/vmlinuz $sortedKernels" +fi + +hypervisors="" +for hyp in /boot/xen-*.gz; do + if [ ! -h "$hyp" ] && [ -f "$hyp" ]; then + hypervisors="$hypervisors `basename "$hyp"`" + fi +done + +#Finding the value the default line +use_grub_set_default="false" +if test "$updatedefaultentry" = "true" ; then + defaultEntryNumber=$(sed -ne 's/^[[:blank:]]*default[[:blank:]]*\(.*\).*/\1/p' $menu) + + if [ "$defaultEntryNumber" = "saved" ] ; then + defaultEntryNumber=$(sed 'q' "$grub_dir/default") + use_grub_set_default="true" + fi + + if test -n "$defaultEntryNumber"; then + defaultEntryNumberPlusOne=$(expr $defaultEntryNumber \+ 1); + defaultEntry=$(grep "^[[:blank:]]*title" $menu | sed -ne "${defaultEntryNumberPlusOne}p" | sed -ne ";s/^[[:blank:]]*title[[:blank:]]*//p") + defaultEntry=$(echo $defaultEntry | sed -e "s/[[:blank:]]*$//") # don't trust trailing blanks + else + notChangeDefault="yes" + fi +else + notChangeDefault="yes" +fi + +## heres where we start writing out the kernel entries +counter=0 + +case "$grub_root_device" in +[^A-Za-z0-9]*) grub_root_type='root' ;; +*) grub_root_type='uuid' ;; +esac + +grub2name="${kernel_dir}/grub/core.img" +if [ "$LET_US_TRY_GRUB_2" = "true" ] \ + && test -f /boot/grub/core.img ; then + echo "Found GRUB 2: $grub2name" >&2 + cat >> $buffer << EOF +title Chainload into GRUB 2 +$grub_root_type $grub_root_device +kernel $grub2name + +title `echo ───────────────────────────────────────────────────────────────────── | iconv -f utf-8 -t cp437` +root + +title When you have verified GRUB 2 works, you can use this command to +root + +title complete the upgrade: upgrade-from-grub-legacy +root + +title `echo ───────────────────────────────────────────────────────────────────── | iconv -f utf-8 -t cp437` +root + +EOF +fi + + +# Xen entries first. +for kern in $xen0Kernels ; do + if test ! x"$howmany" = x"all" ; then + if [ $counter -gt $howmany ] ; then + break + fi + fi + + kernelName=$(basename $kern) + kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//') + + initrdName=$(FindInitrdName "/boot" "$kernelVersion") + initrd="" + + kernel=$kernel_dir/$kernelName + if [ -n "$initrdName" ] ; then + initrd=$kernel_dir/$initrdName + fi + + kernelVersion=$(echo $kernelVersion | sed -e 's/^-//') + currentOpt=$(get_kernel_opt $kernelVersion) + + hypervisorVersions=$(FindXenHypervisorVersions "$kernelVersion") + + found= + for hypervisorVersion in $hypervisorVersions; do + hypervisor="$kernel_dir/xen-$hypervisorVersion.gz" + if [ -e "$hypervisor" ]; then + found=1 + + echo "Found Xen hypervisor $hypervisorVersion, kernel: $kernel" >&2 + + write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \ + "$kernel" "$currentOpt $xenkopt" '' "$initrd" "$savedefault" '' \ + Xen "$hypervisor" "$hypervisorVersion" "$xenhopt" + counter=$(($counter + 1)) + fi + done + + if [ -z $found ]; then + for hypervisor in $hypervisors; do + hypVersion=`basename "$hypervisor" .gz | sed s%xen-%%` + + echo "Found Xen hypervisor $hypVersion, kernel: $kernel" >&2 + + write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \ + "$kernel" "$currentOpt $xenkopt" '' "$initrd" "$savedefault" '' \ + Xen "$kernel_dir/$hypervisor" "$hypVersion" "$xenhopt" + counter=$(($counter + 1)) + done + fi +done + +for kern in $sortedKernels ; do + counter=$(($counter + 1)) + if test ! x"$howmany" = x"all" ; then + if [ $counter -gt $howmany ] ; then + break + fi + fi + kernelName=$(basename $kern) + kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//') + initrdName=$(FindInitrdName "/boot" "$kernelVersion") + initrd="" + + kernel=$kernel_dir/$kernelName + if [ -n "$initrdName" ] ; then + initrd=$kernel_dir/$initrdName + fi + + echo "Found kernel: $kernel" >&2 + + if [ "$kernelName" = "vmlinuz" ]; then + if [ -L "/boot/$kernelName" ]; then + kernelVersion=`readlink -f "/boot/$kernelName"` + kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//') + kernelVersion="$kernelVersion Default" + else + kernelVersion="Default" + fi + fi + if [ "$kernelName" = "vmlinuz.old" ]; then + if [ -L "/boot/$kernelName" ]; then + kernelVersion=`readlink -f "/boot/$kernelName"` + kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//') + kernelVersion="$kernelVersion Previous" + else + kernelVersion="Previous" + fi + fi + kernelVersion=$(echo $kernelVersion | sed -e 's/^-//') + + currentOpt=$(get_kernel_opt $kernelVersion) + + do_lockold=$lockold + # do not lockold for the first entry + [ $counter -eq 1 ] && do_lockold=false + + write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" "$kernel" \ + "$currentOpt $defoptions" "" "$initrd" "$savedefault" "$do_lockold" + + # insert the alternative boot options + if test ! x"$alternative" = x"false" ; then + # for each altoptions line do this stuff + sed -ne 's/# altoptions=\(.*\)/\1/p' $buffer | while read line; do + descr=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\1/p') + suffix=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\2/p') + + test x"$lockalternative" = x"true" && do_lockold=false + write_kernel_entry "$kernelVersion" "$descr" "$lockalternative" \ + "$grub_root_device" "$kernel" "$currentOpt" "$suffix" "$initrd" \ + "$savedefault" "$do_lockold" + + done + fi +done + +memtest86names="memtest86 memtest86+" + +if test ! x"$memtest86" = x"false" ; then + for name in $memtest86names ; do + if test -f "/boot/$name.bin" ; then + kernelVersion="$name" + kernel="$kernel_dir/$name.bin" + currentOpt= + initrd= + + echo "Found kernel: $kernel" >&2 + + write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" \ + "$kernel" "$currentOpt" "" "$initrd" "false" "" + fi + done +fi + +echo $end >> $buffer + +echo -n "Updating $menu ... " >&2 +# Insert the new options into the menu +if ! grep -q "^$start" $menu ; then + cat $buffer >> $menu + rm -f $buffer +else + umask 077 + sed -e "/^$start/,/^$end/{ + /^$start/r $buffer + d + } + " $menu > $menu.new + cat $menu.new > $menu + rm -f $buffer $menu.new +fi + +# Function to update the default value +set_default_value() { + if [ "$use_grub_set_default" = "true" ] ; then + if [ -f /usr/lib/grub-legacy/grub-set-default ] ; then + /usr/lib/grub-legacy/grub-set-default $1 + else + grub-set-default $1 + fi + else + value="$1" + newmenu=$(tempfile) + sed -e "s/^[[:blank:]]*default[[:blank:]]*[[:digit:]]*\(.*\)/default ${value}\1/;b" $menu > $newmenu + cat $newmenu > $menu + rm -f $newmenu + unset newmenu + fi +} + +#Updating the default number +if [ "$LET_US_TRY_GRUB_2" = "true" ] && test -f /boot/grub/core.img ; then + set_default_value "0" +elif test -z "$notChangeDefault"; then + newDefaultNumberPlusOne=$(grep "^[[:blank:]]*title[[:blank:]]*" $menu | grep -n "${defaultEntry}" | cut -f1 -d ":" | sed -ne "1p") + if test -z "$newDefaultNumberPlusOne"; then + echo "Previous default entry removed, resetting to 0">&2 + set_default_value "0" + elif test -z "$defaultEntry"; then + echo "Value of default value matches no entry, resetting to 0" >&2 + set_default_value "0" + else + if test "$newDefaultNumberPlusOne" = "1"; then + newDefaultNumber="0" + else + newDefaultNumber=$(expr $newDefaultNumberPlusOne - 1) + fi + echo "Updating the default booting kernel">&2 + set_default_value "$newDefaultNumber" + fi +fi + +echo "done" >&2 +echo >&2 --- grub2-1.98.orig/debian/legacy/upgrade-from-grub-legacy +++ grub2-1.98/debian/legacy/upgrade-from-grub-legacy @@ -0,0 +1,38 @@ +#!/bin/bash -e + +if test ! -f /boot/grub/core.img ; then + echo -e "\ncore.img doestn't exist, trying to create it.\n" >&2 + grub-install --no-floppy --grub-setup=/bin/true "(hd0)" > /dev/null +fi + +echo RESET grub-pc/install_devices | debconf-communicate + +# Pretend we're upgrading grub-pc. This will make our postinst DTRT. +/var/lib/dpkg/info/grub-pc.postinst configure dummy-version + +if test ! -f /boot/grub/grub.cfg ; then + echo -e "\nCalling update-grub to generate grub.cfg\n" >&2 + update-grub || cat << EOF +Failed to generate /boot/grub/grub.cfg but GRUB2 has been already installed to +your MBR. +THIS MEANS YOU HAVE CURRENTLY AN UNBOOTABLE SYSTEM. +Either fix the error from update-grub and run $0 again +or install old grub again and run grub-install from it to have again +grub-legacy in your MBR. +EOF +fi + +# These never contain any valuable information, and they aren't useful for +# boot anymore, since we just overwrote MBR/PBR. +rm -f /boot/grub/{{xfs,reiserfs,e2fs,fat,jfs,minix}_stage1_5,stage{1,2}} + +cat << EOF + +GRUB Legacy has been removed, but its configuration files have been preserved, +since this script cannot determine if they contain valuable information. If +you would like to remove the configuration files as well, use the following +command: + + rm -f /boot/grub/menu.lst* + +EOF --- grub2-1.98.orig/debian/default/grub +++ grub2-1.98/debian/default/grub @@ -0,0 +1,27 @@ +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_HIDDEN_TIMEOUT=0 +GRUB_HIDDEN_TIMEOUT_QUIET=true +GRUB_TIMEOUT=10 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal +# note that you can use only modes which your graphic card supports via VBE +# you can see them in real GRUB with the command `vbeinfo' +#GRUB_GFXMODE=640x480 + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_LINUX_RECOVERY="true" + +# Uncomment to get a beep at grub start +#GRUB_INIT_TUNE="480 440 1" --- grub2-1.98.orig/debian/default/grub.md5sum +++ grub2-1.98/debian/default/grub.md5sum @@ -0,0 +1,2 @@ +dfad90339e4227d432636ed7d4483744 experimental_1.96+20081129-1 +e916b60d7de71969dd7bad5a809fb9dc lenny_1.96+20080724-16