Dash:
[t2.git] / package / boot / grub / revert-diskio-verbosity.patch
blob5badbb150ff9d4d17ffc1232f534096f71480fcc
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../grub/revert-diskio-verbosity.patch
5 # Copyright (C) 2008 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Our imported patches introduce some multi config file auto-probe
18 code-path that results in multiple "Previous try failed, trying ..."
19 "debug" prints on the screen that distract humble watchers.
21 - Rene Rebe <rene@exactcode.de>
23 --- grub-0.97/stage2/disk_io.c 2008-11-24 15:32:56.000000000 +0000
24 +++ grub-0.97/stage2/disk_io.c 2004-05-23 16:35:24.000000000 +0000
25 @@ -1638,28 +1537,6 @@
26 int
27 grub_open (char *filename)
29 -#ifndef STAGE1_5
30 - const int buf_size = 1500;
31 - const char *try_filenames[] = { "menu.lst", "m" };
32 - char fn[buf_size]; /* arbitrary... */
33 - char *filename_orig = filename;
34 - int trycount = 0;
36 - if (grub_strlen(filename) > buf_size)
37 - {
38 - printf("Buffer overflow: %s(%d)\n", __FILE__, __LINE__);
39 - while (1) {}
40 - }
42 - /* initially, we need to copy filename to fn */
43 - grub_strcpy(fn, filename_orig);
44 - fn[grub_strlen(filename_orig)] = 0;
46 -restart:
47 - errnum = 0; /* hrm... */
48 - filename = fn;
49 -#endif
51 #ifndef NO_DECOMPRESSION
52 compressed_file = 0;
53 #endif /* NO_DECOMPRESSION */
54 @@ -1669,12 +1546,7 @@
55 filepos = 0;
57 if (!(filename = setup_part (filename)))
58 - {
59 - if (errnum == ERR_FILE_NOT_FOUND)
60 - goto retry;
61 - else
62 - return 0;
63 - }
64 + return 0;
66 #ifndef NO_BLOCK_FILES
67 block_file = 0;
68 @@ -1768,29 +1640,6 @@
69 #endif /* NO_DECOMPRESSION */
72 -retry:
73 -# ifndef STAGE1_5
74 - if (trycount < sizeof(try_filenames) / sizeof(*try_filenames))
75 - {
76 - unsigned int l = grub_strlen(filename_orig);
77 - unsigned int ll = grub_strlen(try_filenames[trycount]);
78 - int j;
80 - grub_memmove(fn, filename_orig, l);
82 - if (filename_orig[l - 1] != '/')
83 - fn[l++] = '/';
84 - for (j = 0; j < ll; j++)
85 - fn[l + j] = try_filenames[trycount][j];
86 - fn[l + ll] = 0;
88 - grub_printf("Previous try failed, trying \"%s\"\n", fn);
89 - trycount++;
90 - goto restart;
91 - }
92 -# endif
95 return 0;