Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 843169 Details for
Bug 912855
handle grub2 linux16/initrd16 commands (boot in 16 bits mode)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add support for grub2 linux16/initrd16 commands
1001-Add-support-for-grub2-linux16-initrd16-commands.patch (text/plain), 6.78 KB, created by
Fabrice Bellet
on 2013-12-29 20:26:37 UTC
(
hide
)
Description:
Add support for grub2 linux16/initrd16 commands
Filename:
MIME Type:
Creator:
Fabrice Bellet
Created:
2013-12-29 20:26:37 UTC
Size:
6.78 KB
patch
obsolete
>From 55892928a9a6b17d184a0d2d94ce568ac585b724 Mon Sep 17 00:00:00 2001 >From: Fabrice Bellet <fabrice@bellet.info> >Date: Wed, 20 Feb 2013 21:20:44 +0100 >Subject: [PATCH] Add support for grub2 linux16/initrd16 commands > >--- > grubby.c | 49 ++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 34 insertions(+), 15 deletions(-) > >diff --git a/grubby.c b/grubby.c >index 408e3ca..99eb266 100644 >--- a/grubby.c >+++ b/grubby.c >@@ -59,6 +59,7 @@ int debug = 0; /* Currently just for template debugging */ > #define JMP_SHORT_OPCODE 0xeb > > int isEfi = 0; >+int is16 = 0; > > char *saved_command_line = NULL; > >@@ -90,7 +91,9 @@ enum lineType_e { > LT_SET_VARIABLE = 1 << 19, > LT_KERNEL_EFI = 1 << 20, > LT_INITRD_EFI = 1 << 21, >- LT_UNKNOWN = 1 << 22, >+ LT_KERNEL_16 = 1 << 22, >+ LT_INITRD_16 = 1 << 23, >+ LT_UNKNOWN = 1 << 24, > }; > > struct singleLine { >@@ -214,8 +217,10 @@ struct keywordTypes grub2Keywords[] = { > { "fallback", LT_FALLBACK, ' ' }, > { "linux", LT_KERNEL, ' ' }, > { "linuxefi", LT_KERNEL_EFI, ' ' }, >+ { "linux16", LT_KERNEL_16, ' ' }, > { "initrd", LT_INITRD, ' ', ' ' }, > { "initrdefi", LT_INITRD_EFI, ' ', ' ' }, >+ { "initrd16", LT_INITRD_16, ' ', ' ' }, > { "module", LT_MBMODULE, ' ' }, > { "kernel", LT_HYPER, ' ' }, > { NULL, 0, 0 }, >@@ -282,11 +287,11 @@ static int isquote(char q) > } > > static int iskernel(enum lineType_e type) { >- return (type == LT_KERNEL || type == LT_KERNEL_EFI); >+ return (type == LT_KERNEL || type == LT_KERNEL_EFI || type == LT_KERNEL_16); > } > > static int isinitrd(enum lineType_e type) { >- return (type == LT_INITRD || type == LT_INITRD_EFI); >+ return (type == LT_INITRD || type == LT_INITRD_EFI || type == LT_INITRD_16); > } > > char *grub2ExtractTitle(struct singleLine * line) { >@@ -594,13 +599,25 @@ static enum lineType_e preferredLineType(enum lineType_e type, > if (isEfi && cfi == &grub2ConfigType) { > switch (type) { > case LT_KERNEL: >+ case LT_KERNEL_16: > return LT_KERNEL_EFI; > case LT_INITRD: >+ case LT_INITRD_16: > return LT_INITRD_EFI; > default: > return type; > } > } >+ if (is16 && cfi == &grub2ConfigType) { >+ switch (type) { >+ case LT_KERNEL: >+ return LT_KERNEL_16; >+ case LT_INITRD: >+ return LT_INITRD_16; >+ default: >+ return type; >+ } >+ } > return type; > } > >@@ -1628,7 +1645,7 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix, > return 0; > } > >- line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI, entry->lines); >+ line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); > if (!line) { > notSuitablePrintf(entry, 0, "no line found\n"); > return 0; >@@ -1762,7 +1779,7 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, > entry = findEntryByIndex(config, indexVars[i]); > if (!entry) return NULL; > >- line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI, entry->lines); >+ line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); > if (!line) return NULL; > > if (index) *index = indexVars[i]; >@@ -1813,9 +1830,9 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, > for (line = entry->lines; line; line = line->next) { > enum lineType_e ct = checkType; > if (entry->multiboot && checkType == LT_KERNEL) >- ct = LT_KERNEL|LT_KERNEL_EFI|LT_MBMODULE|LT_HYPER; >+ ct = LT_KERNEL|LT_KERNEL_EFI|LT_MBMODULE|LT_HYPER|LT_KERNEL_16; > else if (checkType & LT_KERNEL) >- ct = checkType | LT_KERNEL_EFI; >+ ct = checkType | LT_KERNEL_EFI | LT_KERNEL_16; > line = getLineByType(ct, line); > if (!line) > break; /* not found in this entry */ >@@ -1837,7 +1854,7 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, > * non-Linux boot entries (could find netbsd etc, though, which is > * unfortunate) > */ >- if (line && getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI, entry->lines)) >+ if (line && getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines)) > break; /* found 'im! */ > } > >@@ -2026,7 +2043,7 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) { > > printf("index=%d\n", index); > >- line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI, entry->lines); >+ line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); > if (!line) { > printf("non linux entry\n"); > return; >@@ -2091,7 +2108,7 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) { > printf("root=%s\n", s); > } > >- line = getLineByType(LT_INITRD|LT_INITRD_EFI, entry->lines); >+ line = getLineByType(LT_INITRD|LT_INITRD_EFI|LT_INITRD_16, entry->lines); > > if (line && line->numElements >= 2) { > if (!strncmp(prefix, line->elements[1].item, strlen(prefix))) >@@ -2508,7 +2525,7 @@ struct singleLine * addLineTmpl(struct singleEntry * entry, > insertElement(newLine, val, 1, cfi); > > /* but try to keep the rootspec from the template... sigh */ >- if (tmplLine->type & (LT_HYPER|LT_KERNEL|LT_MBMODULE|LT_INITRD|LT_KERNEL_EFI|LT_INITRD_EFI)) { >+ if (tmplLine->type & (LT_HYPER|LT_KERNEL|LT_MBMODULE|LT_INITRD|LT_KERNEL_EFI|LT_INITRD_EFI|LT_KERNEL_16|LT_INITRD_16)) { > char * rootspec = getRootSpecifier(tmplLine->elements[1].item); > if (rootspec != NULL) { > free(newLine->elements[1].item); >@@ -2878,7 +2895,7 @@ int updateActualImage(struct grubConfig * cfg, const char * image, > firstElement = 2; > > } else { >- line = getLineByType(LT_KERNEL|LT_MBMODULE|LT_KERNEL_EFI, entry->lines); >+ line = getLineByType(LT_KERNEL|LT_MBMODULE|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); > if (!line) { > /* no LT_KERNEL or LT_MBMODULE in this entry? */ > continue; >@@ -3043,10 +3060,12 @@ int updateInitrd(struct grubConfig * cfg, const char * image, > if (!image) return 0; > > for (; (entry = findEntryByPath(cfg, image, prefix, &index)); index++) { >- kernelLine = getLineByType(LT_KERNEL|LT_KERNEL_EFI, entry->lines); >+ kernelLine = getLineByType(LT_KERNEL|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); > if (!kernelLine) continue; >+ if (kernelLine->type == LT_KERNEL_16) >+ is16 = 1; > >- line = getLineByType(LT_INITRD|LT_INITRD_EFI, entry->lines); >+ line = getLineByType(LT_INITRD|LT_INITRD_EFI|LT_INITRD_16, entry->lines); > if (line) > removeLine(entry, line); > if (prefix) { >@@ -4200,7 +4219,7 @@ int main(int argc, const char ** argv) { > if (!entry) return 0; > if (!suitableImage(entry, bootPrefix, 0, flags)) return 0; > >- line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI, entry->lines); >+ line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); > if (!line) return 0; > > rootspec = getRootSpecifier(line->elements[1].item); >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 912855
: 843169