ALT Linux Bugzilla
– Attachment 6881 Details for
Bug 32810
Не может загрузить Xen: "вылетает" сразу же после выбора соответствующего пункта меню
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Исправление проблемы
grub-2.00-handle-space-in-command-line.patch (text/plain), 5.62 KB, created by
Dmitriy Shadrinov
on 2016-11-26 21:29:05 MSK
(
hide
)
Description:
Исправление проблемы
Filename:
MIME Type:
Creator:
Dmitriy Shadrinov
Created:
2016-11-26 21:29:05 MSK
Size:
5.62 KB
patch
obsolete
>commit 1a46a3a4b38c36f0c2f23d860b341fbba476b35a >Author: Vladimir Serbinenko <phcoder@gmail.com> >Date: Sat Nov 9 17:32:37 2013 +0100 > > * grub-core/loader/i386/multiboot_mbi.c: Handle space in command line. > * grub-core/loader/multiboot_mbi2.c: Likewise. > >diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def >index 8dd9926..a053f20 100644 >--- a/grub-core/Makefile.core.def >+++ b/grub-core/Makefile.core.def >@@ -1576,6 +1576,7 @@ module = { > cppflags = "-DGRUB_USE_MULTIBOOT2"; > > common = loader/multiboot.c; >+ common = lib/cmdline.c; > common = loader/multiboot_mbi2.c; > enable = x86; > enable = mips; >@@ -1584,6 +1585,7 @@ module = { > module = { > name = multiboot; > common = loader/multiboot.c; >+ common = lib/cmdline.c; > x86 = loader/i386/multiboot_mbi.c; > extra_dist = loader/multiboot_elfxx.c; > enable = x86; >diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c >index bff0389..7431aa4 100644 >--- a/grub-core/loader/i386/multiboot_mbi.c >+++ b/grub-core/loader/i386/multiboot_mbi.c >@@ -35,6 +35,7 @@ > #include <grub/file.h> > #include <grub/net.h> > #include <grub/i18n.h> >+#include <grub/lib/cmdline.h> > > #ifdef GRUB_MACHINE_EFI > #include <grub/efi/efi.h> >@@ -641,31 +642,18 @@ grub_err_t > grub_multiboot_init_mbi (int argc, char *argv[]) > { > grub_ssize_t len = 0; >- char *p; >- int i; > > grub_multiboot_free_mbi (); > >- for (i = 0; i < argc; i++) >- len += grub_strlen (argv[i]) + 1; >- if (len == 0) >- len = 1; >+ len = grub_loader_cmdline_size (argc, argv); > >- cmdline = p = grub_malloc (len); >+ cmdline = grub_malloc (len); > if (! cmdline) > return grub_errno; > cmdline_size = len; > >- for (i = 0; i < argc; i++) >- { >- p = grub_stpcpy (p, argv[i]); >- *(p++) = ' '; >- } >- >- /* Remove the space after the last word. */ >- if (p != cmdline) >- p--; >- *p = '\0'; >+ grub_create_loader_cmdline (argc, argv, cmdline, >+ cmdline_size); > > return GRUB_ERR_NONE; > } >@@ -675,9 +663,7 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, > int argc, char *argv[]) > { > struct module *newmod; >- char *p; >- grub_ssize_t len = 0; >- int i; >+ grub_size_t len = 0; > > newmod = grub_malloc (sizeof (*newmod)); > if (!newmod) >@@ -686,13 +672,9 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, > newmod->size = size; > newmod->next = 0; > >- for (i = 0; i < argc; i++) >- len += grub_strlen (argv[i]) + 1; >- >- if (len == 0) >- len = 1; >+ len = grub_loader_cmdline_size (argc, argv); > >- newmod->cmdline = p = grub_malloc (len); >+ newmod->cmdline = grub_malloc (len); > if (! newmod->cmdline) > { > grub_free (newmod); >@@ -701,24 +683,13 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, > newmod->cmdline_size = len; > total_modcmd += ALIGN_UP (len, 4); > >- for (i = 0; i < argc; i++) >- { >- p = grub_stpcpy (p, argv[i]); >- *(p++) = ' '; >- } >- >- /* Remove the space after the last word. */ >- if (p != newmod->cmdline) >- p--; >- *p = '\0'; >+ grub_create_loader_cmdline (argc, argv, newmod->cmdline, >+ newmod->cmdline_size); > > if (modules_last) > modules_last->next = newmod; > else >- { >- modules = newmod; >- modules_last->next = NULL; >- } >+ modules = newmod; > modules_last = newmod; > > modcnt++; >diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c >index cdbeef9..951988f 100644 >--- a/grub-core/loader/multiboot_mbi2.c >+++ b/grub-core/loader/multiboot_mbi2.c >@@ -35,6 +35,8 @@ > #include <grub/video.h> > #include <grub/acpi.h> > #include <grub/i18n.h> >+#include <grub/net.h> >+#include <grub/lib/cmdline.h> > > #if defined (GRUB_MACHINE_EFI) > #include <grub/efi/efi.h> >@@ -905,31 +906,18 @@ grub_err_t > grub_multiboot_init_mbi (int argc, char *argv[]) > { > grub_ssize_t len = 0; >- char *p; >- int i; > > grub_multiboot_free_mbi (); > >- for (i = 0; i < argc; i++) >- len += grub_strlen (argv[i]) + 1; >- if (len == 0) >- len = 1; >+ len = grub_loader_cmdline_size (argc, argv); > >- cmdline = p = grub_malloc (len); >+ cmdline = grub_malloc (len); > if (! cmdline) > return grub_errno; > cmdline_size = len; > >- for (i = 0; i < argc; i++) >- { >- p = grub_stpcpy (p, argv[i]); >- *(p++) = ' '; >- } >- >- /* Remove the space after the last word. */ >- if (p != cmdline) >- p--; >- *p = '\0'; >+ grub_create_loader_cmdline (argc, argv, cmdline, >+ cmdline_size); > > return GRUB_ERR_NONE; > } >@@ -939,9 +927,7 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, > int argc, char *argv[]) > { > struct module *newmod; >- char *p; >- grub_ssize_t len = 0; >- int i; >+ grub_size_t len = 0; > > newmod = grub_malloc (sizeof (*newmod)); > if (!newmod) >@@ -949,13 +935,9 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, > newmod->start = start; > newmod->size = size; > >- for (i = 0; i < argc; i++) >- len += grub_strlen (argv[i]) + 1; >+ len = grub_loader_cmdline_size (argc, argv); > >- if (len == 0) >- len = 1; >- >- newmod->cmdline = p = grub_malloc (len); >+ newmod->cmdline = grub_malloc (len); > if (! newmod->cmdline) > { > grub_free (newmod); >@@ -964,16 +946,8 @@ grub_multiboot_add_module (grub_addr_t start, grub_size_t size, > newmod->cmdline_size = len; > total_modcmd += ALIGN_UP (len, MULTIBOOT_TAG_ALIGN); > >- for (i = 0; i < argc; i++) >- { >- p = grub_stpcpy (p, argv[i]); >- *(p++) = ' '; >- } >- >- /* Remove the space after the last word. */ >- if (p != newmod->cmdline) >- p--; >- *p = '\0'; >+ grub_create_loader_cmdline (argc, argv, newmod->cmdline, >+ newmod->cmdline_size); > > if (modules_last) > modules_last->next = newmod;
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 32810
: 6881