Merge lp:~noskcaj/ubuntu/trusty/elilo/merge into lp:ubuntu/trusty/elilo

Proposed by Jackson Doak
Status: Merged
Merge reported by: Michael Terry
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/trusty/elilo/merge
Merge into: lp:ubuntu/trusty/elilo
Diff against target: 3477 lines (+1147/-1046)
53 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/apple.diff/Makefile (+1/-1)
.pc/apple.diff/elilo.c (+1/-1)
.pc/applied-patches (+0/-1)
.pc/debian-changes-3.12-3/Makefile (+0/-109)
.pc/debian-changes-3.12-3/choosers/Makefile (+0/-58)
.pc/debian-changes-3.12-3/devschemes/Makefile (+0/-46)
.pc/debian-changes-3.12-3/fs/Makefile (+0/-70)
.pc/debian-changes-3.12-3/ia32/Makefile (+0/-51)
.pc/debian-changes-3.12-3/ia64/Makefile (+0/-42)
.pc/debian-changes-3.12-3/tools/Makefile (+0/-47)
.pc/debian-changes-3.12-3/x86_64/Makefile (+0/-52)
.pc/fix-paths.diff/Make.defaults (+1/-1)
ChangeLog (+57/-0)
Makefile (+6/-11)
alloc.c (+15/-7)
bootparams.c (+2/-0)
choosers/Makefile (+10/-19)
choosers/simple.c (+7/-6)
choosers/textmenu.c (+3/-3)
config.c (+5/-5)
debian/changelog (+49/-3)
debian/control (+4/-2)
debian/elilo.sh (+1/-1)
debian/patches/cross-build.diff (+266/-0)
debian/patches/debian-changes-3.12-3 (+0/-284)
debian/patches/fix-paths.diff (+1/-1)
debian/patches/series (+1/-1)
debian/po/da.po (+86/-0)
debian/po/pl.po (+90/-0)
debian/rules (+5/-9)
devschemes/Makefile (+5/-10)
elilo.c (+1/-1)
elilo.h (+8/-2)
fileops.c (+1/-1)
fs/Makefile (+10/-19)
fs/localfs.c (+1/-1)
glue_netfs.c (+23/-0)
ia32/Makefile (+7/-12)
ia32/bzimage.c (+1/-1)
ia32/system.c (+19/-1)
ia64/Makefile (+4/-9)
ia64/system.c (+6/-0)
initrd.c (+10/-2)
strops.c (+6/-6)
tools/Makefile (+4/-9)
tools/eliloalt.c (+23/-12)
x86_64/Makefile (+7/-12)
x86_64/bzimage.c (+136/-32)
x86_64/config.c (+16/-3)
x86_64/sysdeps.h (+27/-36)
x86_64/system.c (+219/-46)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/trusty/elilo/merge
Reviewer Review Type Date Requested Status
Michael Terry Approve
Review via email: mp+198125@code.launchpad.net

Description of the change

Merge from debian

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Thanks so much! I uploaded this to trusty.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file '.ChangeLog.swp'
2Binary files .ChangeLog.swp 2009-11-01 22:37:21 +0000 and .ChangeLog.swp 1970-01-01 00:00:00 +0000 differ
3=== added file '.pc/.quilt_patches'
4--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
5+++ .pc/.quilt_patches 2013-12-06 20:30:39 +0000
6@@ -0,0 +1,1 @@
7+debian/patches
8
9=== added file '.pc/.quilt_series'
10--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
11+++ .pc/.quilt_series 2013-12-06 20:30:39 +0000
12@@ -0,0 +1,1 @@
13+series
14
15=== modified file '.pc/apple.diff/Makefile'
16--- .pc/apple.diff/Makefile 2011-08-22 21:17:34 +0000
17+++ .pc/apple.diff/Makefile 2013-12-06 20:30:39 +0000
18@@ -81,7 +81,7 @@
19
20 elilo.so: $(FILES)
21
22-elilo.o : elilo.c
23+elilo.o : elilo.c $(ARCH)/sysdeps.h
24
25 fileops.o : Make.defaults
26 chooser.o : Make.defaults
27
28=== modified file '.pc/apple.diff/elilo.c'
29--- .pc/apple.diff/elilo.c 2011-08-22 21:17:34 +0000
30+++ .pc/apple.diff/elilo.c 2013-12-06 20:30:39 +0000
31@@ -93,7 +93,7 @@
32 INTN
33 kernel_load(EFI_HANDLE image, CHAR16 *kname, kdesc_t *kd, memdesc_t *imem, memdesc_t *mmem)
34 {
35- CHAR16 kernel[CMDLINE_MAXLEN];
36+ CHAR16 kernel[FILENAME_MAXLEN];
37
38 /*
39 * Do the vm image switch here
40
41=== modified file '.pc/applied-patches'
42--- .pc/applied-patches 2011-08-22 21:17:34 +0000
43+++ .pc/applied-patches 2013-12-06 20:30:39 +0000
44@@ -1,3 +1,2 @@
45 fix-paths.diff
46 apple.diff
47-debian-changes-3.12-3
48
49=== removed directory '.pc/debian-changes-3.12-3'
50=== removed file '.pc/debian-changes-3.12-3/Makefile'
51--- .pc/debian-changes-3.12-3/Makefile 2011-08-22 21:17:34 +0000
52+++ .pc/debian-changes-3.12-3/Makefile 1970-01-01 00:00:00 +0000
53@@ -1,109 +0,0 @@
54-#
55-# Copyright (C) 2001-2003 Hewlett-Packard Co.
56-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
57-# Contributed by Fenghua Yu<fenghua.yu@intel.com>
58-# Contributed by Chandramouli Narayanan<mouli@linux.intel.com>
59-#
60-# This file is part of ELILO, the LINUX EFI boot loader.
61-#
62-# ELILO is free software; you can redistribute it and/or modify
63-# it under the terms of the GNU General Public License as published by
64-# the Free Software Foundation; either version 2, or (at your option)
65-# any later version.
66-#
67-# ELILO is distributed in the hope that it will be useful,
68-# but WITHOUT ANY WARRANTY; without even the implied warranty of
69-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
70-# GNU General Public License for more details.
71-#
72-# You should have received a copy of the GNU General Public License
73-# along with ELILO; see the file COPYING. If not, write to the Free
74-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
75-# 02111-1307, USA.
76-#
77-# Please check out the elilo.txt for complete documentation on how
78-# to use this program.
79-#
80-
81-include Make.defaults
82-TOPDIR=.
83-
84-
85-CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o
86-LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
87-
88-LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
89-LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
90-FORMAT = efi-app-$(ARCH)
91-
92-FILESYSTEM =
93-
94-ifeq ($(CONFIG_localfs),y)
95-FILESYSTEMS += glue_localfs.o
96-endif
97-
98-ifeq ($(CONFIG_ext2fs),y)
99-FILESYSTEMS += glue_ext2fs.o
100-endif
101-
102-ifeq ($(CONFIG_netfs),y)
103-FILESYSTEMS += glue_netfs.o
104-endif
105-
106-SUBDIRS = fs choosers devschemes tools
107-
108-ifeq ($(ARCH),ia64)
109-SUBDIRS += ia64
110-endif
111-
112-ifeq ($(ARCH),ia32)
113-SUBDIRS += ia32
114-endif
115-
116-ifeq ($(ARCH),x86_64)
117-SUBDIRS += x86_64
118-endif
119-
120-FILES = elilo.o getopt.o strops.o loader.o \
121- fileops.o util.o vars.o alloc.o chooser.o \
122- config.o initrd.o alternate.o bootparams.o \
123- gunzip.o console.o apple.o fs/fs.o \
124- choosers/choosers.o \
125- devschemes/devschemes.o \
126- $(ARCH)/sysdeps.o \
127- $(FILESYSTEMS)
128-
129-TARGETS = elilo.efi
130-
131-all: check_gcc $(SUBDIRS) $(TARGETS)
132-
133-elilo.efi: elilo.so
134-
135-elilo.so: $(FILES)
136-
137-elilo.o : elilo.c
138-
139-fileops.o : Make.defaults
140-chooser.o : Make.defaults
141-
142-$(SUBDIRS): dummy
143- $(MAKE) -C $@
144-
145-dummy:
146-
147-clean:
148- @set -e ; for d in $(SUBDIRS) ; do $(MAKE) -C $$d $@ ; done
149- rm -f $(TARGETS) *~ *.so $(FILES)
150-
151-.PRECIOUS: elilo.so
152-
153-#
154-# on both platforms you must use gcc 3.0 or higher
155-#
156-check_gcc:
157-ifeq ($(GCC_VERSION),2)
158- @echo "you need to use a version of gcc >= 3.0, you are using `$(CC) --version`"
159- @exit 1
160-endif
161-
162-include Make.rules
163
164=== removed directory '.pc/debian-changes-3.12-3/choosers'
165=== removed file '.pc/debian-changes-3.12-3/choosers/Makefile'
166--- .pc/debian-changes-3.12-3/choosers/Makefile 2010-06-08 13:42:05 +0000
167+++ .pc/debian-changes-3.12-3/choosers/Makefile 1970-01-01 00:00:00 +0000
168@@ -1,58 +0,0 @@
169-#
170-# Copyright (C) 2001-2003 Hewlett-Packard Co.
171-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
172-#
173-# This file is part of the ELILO, the EFI Linux boot loader.
174-#
175-# ELILO is free software; you can redistribute it and/or modify
176-# it under the terms of the GNU General Public License as published by
177-# the Free Software Foundation; either version 2, or (at your option)
178-# any later version.
179-#
180-# ELILO is distributed in the hope that it will be useful,
181-# but WITHOUT ANY WARRANTY; without even the implied warranty of
182-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
183-# GNU General Public License for more details.
184-#
185-# You should have received a copy of the GNU General Public License
186-# along with ELILO; see the file COPYING. If not, write to the Free
187-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
188-# 02111-1307, USA.
189-#
190-# Please check out the elilo.txt for complete documentation on how
191-# to use this program.
192-#
193-
194-include ../Make.defaults
195-include ../Make.rules
196-
197-TOPDIR=$(CDIR)/..
198-
199-FILES=
200-
201-ifeq ($(CONFIG_chooser_simple),y)
202-FILES +=simple.o
203-endif
204-
205-ifeq ($(CONFIG_chooser_textmenu),y)
206-FILES +=textmenu.o
207-endif
208-
209-TARGET=choosers.o
210-
211-all: $(TARGET)
212-
213-$(TARGET): check-choosers $(TOPDIR)/Make.defaults $(FILES)
214- $(LD) -o $@ -r $(FILES)
215-
216-clean:
217- $(RM) -f $(TARGET) $(FILES)
218-
219-check-choosers:
220- @if [ -n "$(FILES)" ]; then \
221- exit 0; \
222- else \
223- echo "You need to define at least one chooser in Make.defaults"; \
224- exit 1; \
225- fi
226-
227
228=== removed directory '.pc/debian-changes-3.12-3/devschemes'
229=== removed file '.pc/debian-changes-3.12-3/devschemes/Makefile'
230--- .pc/debian-changes-3.12-3/devschemes/Makefile 2010-06-08 13:42:05 +0000
231+++ .pc/debian-changes-3.12-3/devschemes/Makefile 1970-01-01 00:00:00 +0000
232@@ -1,46 +0,0 @@
233-#
234-# Copyright (C) 2001-2003 Hewlett-Packard Co.
235-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
236-#
237-# This file is part of the ELILO, the EFI Linux boot loader.
238-#
239-# ELILO is free software; you can redistribute it and/or modify
240-# it under the terms of the GNU General Public License as published by
241-# the Free Software Foundation; either version 2, or (at your option)
242-# any later version.
243-#
244-# ELILO is distributed in the hope that it will be useful,
245-# but WITHOUT ANY WARRANTY; without even the implied warranty of
246-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
247-# GNU General Public License for more details.
248-#
249-# You should have received a copy of the GNU General Public License
250-# along with ELILO; see the file COPYING. If not, write to the Free
251-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
252-# 02111-1307, USA.
253-#
254-# Please check out the elilo.txt for complete documentation on how
255-# to use this program.
256-#
257-
258-include ../Make.defaults
259-include ../Make.rules
260-
261-TOPDIR=$(CDIR)/..
262-
263-FILES=simple.o
264-
265-
266-TARGET=devschemes.o
267-
268-all: $(TARGET)
269-
270-#
271-# XXX: does not trigger recompile when changing filesystem selection
272-# without doing make clean.
273-#
274-$(TARGET): $(FILES)
275- $(LD) -r -o $@ $(FILES)
276-
277-clean:
278- $(RM) -f $(TARGET) $(FILES)
279
280=== removed directory '.pc/debian-changes-3.12-3/fs'
281=== removed file '.pc/debian-changes-3.12-3/fs/Makefile'
282--- .pc/debian-changes-3.12-3/fs/Makefile 2010-06-08 13:42:05 +0000
283+++ .pc/debian-changes-3.12-3/fs/Makefile 1970-01-01 00:00:00 +0000
284@@ -1,70 +0,0 @@
285-#
286-# Copyright (C) 2001-2003 Hewlett-Packard Co.
287-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
288-#
289-# This file is part of the ELILO, the EFI Linux boot loader.
290-#
291-# ELILO is free software; you can redistribute it and/or modify
292-# it under the terms of the GNU General Public License as published by
293-# the Free Software Foundation; either version 2, or (at your option)
294-# any later version.
295-#
296-# ELILO is distributed in the hope that it will be useful,
297-# but WITHOUT ANY WARRANTY; without even the implied warranty of
298-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
299-# GNU General Public License for more details.
300-#
301-# You should have received a copy of the GNU General Public License
302-# along with ELILO; see the file COPYING. If not, write to the Free
303-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
304-# 02111-1307, USA.
305-#
306-# Please check out the elilo.txt for complete documentation on how
307-# to use this program.
308-#
309-
310-include ../Make.defaults
311-include ../Make.rules
312-
313-TOPDIR=$(CDIR)/..
314-
315-FILES=
316-ifeq ($(CONFIG_localfs),y)
317-FILES += localfs.o
318-endif
319-
320-#
321-# Ext2 is now disabled by default. See top level Makefile
322-# for details
323-#
324-ifeq ($(CONFIG_ext2fs),y)
325-FILES += ext2fs.o
326-endif
327-
328-ifeq ($(CONFIG_netfs),y)
329-FILES += netfs.o
330-endif
331-
332-
333-TARGET=fs.o
334-
335-all: $(TARGET)
336-
337-#
338-# XXX: does not trigger recompile when changing filesystem selection
339-# without doing make clean.
340-#
341-$(TARGET): check-filesystems $(TOPDIR)/Make.defaults $(FILES)
342- $(LD) -r -o $@ $(FILES)
343-
344-clean:
345- $(RM) -f $(TARGET) $(FILES)
346-
347-check-filesystems:
348- @if [ -n "$(FILES)" ]; then \
349- exit 0; \
350- else \
351- echo "You need to define at least one filesystem in Make.defaults"; \
352- exit 1; \
353- fi
354-
355
356=== removed directory '.pc/debian-changes-3.12-3/ia32'
357=== removed file '.pc/debian-changes-3.12-3/ia32/Makefile'
358--- .pc/debian-changes-3.12-3/ia32/Makefile 2010-06-08 13:42:05 +0000
359+++ .pc/debian-changes-3.12-3/ia32/Makefile 1970-01-01 00:00:00 +0000
360@@ -1,51 +0,0 @@
361-#
362-# Copyright (C) 2001-2003 Hewlett-Packard Co.
363-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
364-#
365-# This file is part of the ELILO, the EFI Linux boot loader.
366-#
367-# ELILO is free software; you can redistribute it and/or modify
368-# it under the terms of the GNU General Public License as published by
369-# the Free Software Foundation; either version 2, or (at your option)
370-# any later version.
371-#
372-# ELILO is distributed in the hope that it will be useful,
373-# but WITHOUT ANY WARRANTY; without even the implied warranty of
374-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
375-# GNU General Public License for more details.
376-#
377-# You should have received a copy of the GNU General Public License
378-# along with ELILO; see the file COPYING. If not, write to the Free
379-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
380-# 02111-1307, USA.
381-#
382-# Please check out the elilo.txt for complete documentation on how
383-# to use this program.
384-#
385-
386-include ../Make.defaults
387-include ../Make.rules
388-
389-TOPDIR=$(CDIR)/..
390-
391-FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
392-
393-TARGET=sysdeps.o
394-
395-all: $(TARGET)
396-
397-system.o: rmswitch.h
398-
399-rmswitch.h: bin_to_h.c rmswitch.S
400- $(CC) -o bin_to_h bin_to_h.c
401- $(AS) -o rmswitch.o rmswitch.S
402- $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
403- ./bin_to_h <rmswitch >rmswitch.h
404-
405-$(TARGET): $(FILES)
406- $(LD) -r -o $@ $(FILES)
407-
408-clean:
409- $(RM) -f $(TARGET) $(FILES)
410- $(RM) -f bin_to_h.o bin_to_h
411- $(RM) -f rmswitch.h rmswitch.o rmswitch
412
413=== removed directory '.pc/debian-changes-3.12-3/ia64'
414=== removed file '.pc/debian-changes-3.12-3/ia64/Makefile'
415--- .pc/debian-changes-3.12-3/ia64/Makefile 2010-06-08 13:42:05 +0000
416+++ .pc/debian-changes-3.12-3/ia64/Makefile 1970-01-01 00:00:00 +0000
417@@ -1,42 +0,0 @@
418-#
419-# Copyright (C) 2001-2003 Hewlett-Packard Co.
420-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
421-#
422-# This file is part of the ELILO, the EFI Linux boot loader.
423-#
424-# ELILO is free software; you can redistribute it and/or modify
425-# it under the terms of the GNU General Public License as published by
426-# the Free Software Foundation; either version 2, or (at your option)
427-# any later version.
428-#
429-# ELILO is distributed in the hope that it will be useful,
430-# but WITHOUT ANY WARRANTY; without even the implied warranty of
431-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
432-# GNU General Public License for more details.
433-#
434-# You should have received a copy of the GNU General Public License
435-# along with ELILO; see the file COPYING. If not, write to the Free
436-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
437-# 02111-1307, USA.
438-#
439-# Please check out the elilo.txt for complete documentation on how
440-# to use this program.
441-#
442-
443-include ../Make.defaults
444-include ../Make.rules
445-
446-TOPDIR=$(CDIR)/..
447-
448-FILES=system.o config.o fpswa.o plain_loader.o gzip_loader.o \
449- gzip.o memset.o memcpy.o setjmp.o longjmp.o
450-
451-TARGET=sysdeps.o
452-
453-all: $(TARGET)
454-
455-$(TARGET): $(FILES)
456- $(LD) -o $@ -r $(FILES)
457-
458-clean:
459- $(RM) -f $(TARGET) $(FILES)
460
461=== removed directory '.pc/debian-changes-3.12-3/tools'
462=== removed file '.pc/debian-changes-3.12-3/tools/Makefile'
463--- .pc/debian-changes-3.12-3/tools/Makefile 2010-06-08 13:42:05 +0000
464+++ .pc/debian-changes-3.12-3/tools/Makefile 1970-01-01 00:00:00 +0000
465@@ -1,47 +0,0 @@
466-#
467-# Copyright (C) 2001-2003 Hewlett-Packard Co.
468-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
469-#
470-# This file is part of the ELILO, the EFI Linux boot loader.
471-#
472-# ELILO is free software; you can redistribute it and/or modify
473-# it under the terms of the GNU General Public License as published by
474-# the Free Software Foundation; either version 2, or (at your option)
475-# any later version.
476-#
477-# ELILO is distributed in the hope that it will be useful,
478-# but WITHOUT ANY WARRANTY; without even the implied warranty of
479-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
480-# GNU General Public License for more details.
481-#
482-# You should have received a copy of the GNU General Public License
483-# along with ELILO; see the file COPYING. If not, write to the Free
484-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
485-# 02111-1307, USA.
486-#
487-# Please check out the elilo.txt for complete documentation on how
488-# to use this program.
489-#
490-
491-include ../Make.defaults
492-include ../Make.rules
493-
494-TOPDIR=$(CDIR)/..
495-
496-FILES=eliloalt.o
497-TARGET=eliloalt
498-
499-all: $(TARGET)
500-
501-#
502-# redefine local rule (we build a Linux/ia64 binary here)
503-#
504-%.o: %.c
505- $(CC) $(OPTIMFLAGS) $(DEBUGFLAGS) -c $< -o $@
506-
507-$(TARGET): %:%.o
508- $(CC) -o $@ $(OPTIMFLAGS) $(DEBUGFLAGS) $^
509-
510-clean:
511- $(RM) -f $(TARGET) $(FILES)
512-
513
514=== removed directory '.pc/debian-changes-3.12-3/x86_64'
515=== removed file '.pc/debian-changes-3.12-3/x86_64/Makefile'
516--- .pc/debian-changes-3.12-3/x86_64/Makefile 2010-06-08 13:42:05 +0000
517+++ .pc/debian-changes-3.12-3/x86_64/Makefile 1970-01-01 00:00:00 +0000
518@@ -1,52 +0,0 @@
519-#
520-# Copyright (C) 2001-2003 Hewlett-Packard Co.
521-# Contributed by Stephane Eranian <eranian@hpl.hp.com>
522-#
523-# This file is part of the ELILO, the EFI Linux boot loader.
524-#
525-# ELILO is free software; you can redistribute it and/or modify
526-# it under the terms of the GNU General Public License as published by
527-# the Free Software Foundation; either version 2, or (at your option)
528-# any later version.
529-#
530-# ELILO is distributed in the hope that it will be useful,
531-# but WITHOUT ANY WARRANTY; without even the implied warranty of
532-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
533-# GNU General Public License for more details.
534-#
535-# You should have received a copy of the GNU General Public License
536-# along with ELILO; see the file COPYING. If not, write to the Free
537-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
538-# 02111-1307, USA.
539-#
540-# Please check out the elilo.txt for complete documentation on how
541-# to use this program.
542-#
543-
544-include ../Make.defaults
545-include ../Make.rules
546-
547-TOPDIR=$(CDIR)/..
548-
549-FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
550-#FILES=system.o config.o plain_loader.o
551-
552-TARGET=sysdeps.o
553-
554-all: $(TARGET)
555-
556-system.o: rmswitch.h
557-
558-rmswitch.h: bin_to_h.c rmswitch.S
559- $(CC) -o bin_to_h bin_to_h.c
560- $(AS) -o rmswitch.o rmswitch.S
561- $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
562- ./bin_to_h <rmswitch >rmswitch.h
563-
564-$(TARGET): $(FILES)
565- $(LD) -r -o $@ $(FILES)
566-
567-clean:
568- $(RM) -f $(TARGET) $(FILES)
569- $(RM) -f bin_to_h.o bin_to_h
570- $(RM) -f rmswitch.h rmswitch.o rmswitch
571
572=== modified file '.pc/fix-paths.diff/Make.defaults'
573--- .pc/fix-paths.diff/Make.defaults 2010-06-08 13:42:05 +0000
574+++ .pc/fix-paths.diff/Make.defaults 2013-12-06 20:30:39 +0000
575@@ -68,7 +68,7 @@
576
577 OPTIMFLAGS = -O2
578 DEBUGFLAGS = -Wall
579-CFLAGS = $(OPTIMFLAGS) -fno-strict-aliasing -fpic -fshort-wchar $(DEBUGFLAGS)
580+CFLAGS = $(OPTIMFLAGS) -fno-stack-protector -fno-strict-aliasing -fpic -fshort-wchar $(DEBUGFLAGS)
581 LDFLAGS = -nostdlib -znocombreloc
582 INSTALL = install
583
584
585=== modified file 'ChangeLog'
586--- ChangeLog 2011-08-22 21:17:34 +0000
587+++ ChangeLog 2013-12-06 20:30:39 +0000
588@@ -1,3 +1,17 @@
589+2011-1-10 signed off by Jason Fleischli <jason.fleischli@hp.com>
590+ * Uptake of SUSE patches
591+ - add sysfs support for efi vars (formerly /proc/efi/vars)
592+ - fix strncpy overflow
593+ - fix bzimage alloc
594+ - cleanups
595+ - support longer command line
596+ - yet some more mac fixes
597+ - align elilo with latest kernel boot protocol format.
598+ - new memory management strategy for initrd and kernel image loading.
599+ * add force text mode command line option.
600+ * replace error output on GOP handle failed, downgraded to normal
601+ print status with more informative output.
602+
603 2009-10-22 signed off by Jason Fleischli <jason.fleischli@hp.com>
604 * elilo 3.12 release commit
605 * Added additional #defines for debug levels to reduce the output
606@@ -39,8 +53,10 @@
607 subtree
608 * bugfix loader_probe now correctly errors out if no loaders
609 registered.
610+
611 2008-01-11 signed off by Jason Fleischli <jason.fleischli@hp.com>
612 * Various compile warning cleanups.
613+
614 2008-01-03 signed off by Jason Fleischli <jason.fleischli@hp.com>
615 * Patch contribution from Scott Davilla <davilla@4pi.com>
616 when x is zero for the first call to add_memory_region, e820_map[-1]
617@@ -49,6 +65,7 @@
618 above the e820_map[0] location that should have been zeroed by the
619 bootloader, the code should not access outside the bounds of
620 structures.
621+
622 2008-01-03 Jason Fleischli <jason.fleischli@hp.com>
623 * initrd.c -- Let the allocator decide where to grab the memory from
624 the efi memory map. Current start_addr=image->start_addr forces the
625@@ -57,8 +74,10 @@
626 the image->start_addr resulting in an elilo hang. Leaving start_addr
627 NULL at initialization forces alloc_pages to get a memory region
628 sufficient for the size of the initrd image.
629+
630 2007-12-19 Jason Fleischli <jason.fleischli@hp.com>
631 * bumping version string to 3.8
632+
633 2007-12-19 Jason Fleischli <jason.fleischli@hp.com>
634 * MORE PATCHES FROM INTEL FOR IA32 X86_64.
635 * Fix compile warning for cmdline_addr assignment.
636@@ -83,11 +102,13 @@
637 EFI framebuffer type ID setting code in ELILO is changed accordingly.
638 * E820 memory map is added to IA32 to make it possible for
639 Linux kernel not to depend on EFI memory map on EFI 32.
640+
641 2007-09-27 Jason Fleischli <jason.fleischli@hp.com>
642 * updating changelog for last commit that was omitted
643 * incorporating AGriffis patches to enhance parsing
644 passes root= option to kernel options and accounts for -- option
645 designation.
646+
647 2007-07-19 Jason Fleischli <jason.fleischli@hp.com>
648 * Integrated x86_64 support patches from Chandramouli Narayanan
649 <mouli@linux.intel.com> changes summarized in following bullets.
650@@ -159,13 +180,17 @@
651 * x86_64/sysdeps.c -- new file, system stuff for x86_64
652 * elilo.txt -- documentation update, add Intel to copyright
653 * README.gnu-efi -- documentation update for x86_64
654+
655 2006-01-27 Alex Williamson <alex.williamson@hp.com>
656 * Found a couple more places where vmcode isn't zeroed, causing the
657 option to get carried over to labels it shouldn't.
658+
659 2006-01-09 Brett Johnson <brett@hp.com>
660 * Released 3.6
661+
662 2005-12-22 Alex Williamson <alex.williamson@hp.com>
663 * Fixed vmcode_name initialization in textmenu chooser
664+
665 2005-12-01 Alex Williamson <alex.williamson@hp.com>
666 * Applied patch from Fred Yang <fred.yang@intel.com> to support the
667 vmm= boot option. This option specifies the kernel image for a
668@@ -179,29 +204,37 @@
669 image will be uncompressed into memory before it is provided to the
670 hypervisor. Any combination of compressed and uncompressed images
671 can be used for the image and vmm options.
672+
673 2005-09-15 Brett Johnson <brett@hp.com>
674 * Applied patch from Tristan Gingold to add dcache flush and sync with
675 icache to gzip and plain loaders. This ommision was just noticed now
676 due to the much larger caches in Montecito, and the smaller size of
677 Xen (as compared to the linux kernel).
678+
679 2004-09-27 Brett Johnson <brett@hp.com>
680 * Increase the hardcoded size of the texmenu chooser menu from 16 to 64
681+
682 2004-09-23 Brett Johnson <brett@hp.com>
683 * Fix for 924147. Thanks to Stephanie Schaaf <sas@sgi.com> for a patch
684 that the fix is based on.
685+
686 2004-02-19 Brett Johnson <brett@hp.com>
687 * Fixed bug where default image initrd would carry over to another
688 image that was selected interactively (iff the newly selected image
689 did not have an initrd).
690 * Added support for subnet-specific config files in netfs.
691+
692 2004-02-17 Brett Johnson <brett@hp.com>
693 * integrated ia32 compressed kernel support from Matt Tolentino
694 <matthew.e.tolentino@intel.com>
695+
696 2003-08-20 Stephane Eranian <eranian@hpl.hp.com>
697 * released 3.4
698+
699 2003-08-19 Stephane Eranian <eranian@hpl.hp.com>
700 * integrated ia32 updates from Matt
701 Tolentino <matthew.e.tolentino@intel.com>
702+
703 2003-08-13 Stephane Eranian <eranian@hpl.hp.com>
704 * updated elilo.txt and netbooting.txt
705 * fix a bug in choosers/simple.c:print_infos().
706@@ -214,37 +247,47 @@
707 * updated simple chooser set of builtin command keys
708 * command keys are only valid if first on the line
709 * increase default buffer size and increment when netbooting
710+
711 2003-06-04 Stephane Eranian <eranian@hpl.hp.com>
712 * fix fs/netfs.c to work with recent version
713 of EFI (14.61 or higher) which do not have the
714 TFTP problem anymore. fix submitted by Guy Laborde
715+
716 2003-04-21 Stephane Eranian <eranian@hpl.hp.com>
717 * ext2fs support is turned off by default to avoid
718 problems with ext3-formatted partitions.
719 * added gcc version check. MUST use 3.0 or higher
720+
721 2003-03-03 Stephane Eranian <eranian@hpl.hp.com>
722 * added check on dev_tab in fs/*fs.c:*_uninstall()
723+
724 2003-02-07 Stephane Eranian <eranian@hpl.hp.com>
725 * clean up in glue_localfs.c w.r.t. CHAR16 in set_default_path()
726 * added support for extracting basename of bootloader path
727 when using BOOTP (DHCP) only. The prefix is then used for all files
728 open via netfs. Suggestion and initial patch by Guy Laborde from HP.
729+
730 2003-01-28 Stephane Eranian <eranian@hpl.hp.com>
731 * fix the set_default_path() routine in glue_localfs.c. It would not
732 correctly get the basename of the devpath. This caused the
733 elilo.conf not to be found sometimes.
734+
735 2003-01-21 Stephane Eranian <eranian@hpl.hp.com>
736 * fix bug in glue_netfs.c convert_ip2decstr() which caused some IP
737 addresses to be incorrectly converted to strings.
738+
739 2002-11-01 Stephane Eranian <eranian@hpl.hp.com>
740 * fix bug in -r option for IA64. There is no argument to this option.
741+
742 2002-10-15 Stephane Eranian <eranian@hpl.hp.com>
743 * fixed a double free bug for the kernel memory in case of abort.
744 (bug spotted by Levent Akyl from Intel)
745 * released 3.3a
746+
747 2002-09-14 Stephane Eranian <eranian@hpl.hp.com>
748 * applied patch from Andreas Schwab <schwab@suse.de> to eliloalt.c.
749 eliloalt dynamically selects a variable in /proc/efi/vars.
750+
751 2002-09-12 Stephane Eranian <eranian@hpl.hp.com>
752 * removed extra free() from fs/ext2fs.c:ext2fs_init_state().
753 Bug report and fix by NOMURA Jun'ichi <j-nomura@ce.jp.nec.com>
754@@ -252,25 +295,31 @@
755 was bigger than the 128KB limit of EFI causing some weird fimrware
756 errors. bug reported by OMURA Jun'ichi <j-nomura@ce.jp.nec.com>
757 * on IA-64 forbid the use of f32-f127 by the compiler (EFI spec)
758+
759 2002-09-10 Stephane Eranian <eranian@hpl.hp.com>
760 * fix a bug in argify() that was causing an EFI assertion
761 when aborting at the elilo prompt when netbooted.
762+
763 2002-08-26 Stephane Eranian <eranian@hpl.hp.com>
764 * fixed devschemes/simple.c to use SPrint() instead of its own buggy
765 conversion code (spotted by Richard Hirst).
766 * fix bug in argify() when there was no NULL character in the string.
767 * released 3.3
768+
769 2002-08-19 Stephane Eranian <eranian@hpl.hp.com>
770 * added fpswa.txt in the docs directory
771 * updated elilo.txt
772+
773 2002-08-15 Stephane Eranian <eranian@hpl.hp.com>
774 * added -F file option for IA-64 to allow a specific fpswa driver to be loaded
775 * fixed fpswa.c to try and load the driver from all accessible partitions
776 * added support to load (plain or gzipped) big-endian ELF/ia64 binaries using p_paddr.
777 * fixed problem in fs/netfs.c causing large (>4MB) binaries to fail the Mftp() call
778+
779 2002-06-13 Stephane Eranian <eranian@hpl.hp.com>
780 * Changed the despecialization character for the variables from \\ to &
781 to avoid conflicts with \\ as a path separator
782+
783 2002-06-11 Stephane Eranian <eranian@hpl.hp.com>
784 * fixed the return value in efi_main(). elilo was always returning
785 success even in case of failure. Bug reported by Egan Ford <egan@sense.net>
786@@ -280,11 +329,13 @@
787 compliant with EFI spec with regards to where it looks for files.
788 With this patch, elilo will look in the directory it was loaded
789 from, not on the root of the partition anymore.
790+
791 2002-03-04 Stephane Eranian <eranian@hpl.hp.com>
792 * released version 3.2
793 * cleanup some GNU extension in fs/ext2fs.c (variable size array)
794 * updated all documentation. Added netbooting.txt, simple_chooser.txt,
795 eliloalt.txt, elilovar.txt
796+
797 2002-02-21 Stephane Eranian <eranian@hpl.hp.com>
798 * added a Linux utility program (elilovar in tools) to set/read/delete
799 the EliloAlt EFI variable used to specify an alternate kernel to boot.
800@@ -292,19 +343,24 @@
801 * added support for hostname,domain name extraction in fs/netfs.c
802 * fixed all known bugs in alternate.c
803 * integrated patch from SGI to fix load offset for relocatable kernels (Jack Steiner, Brent Casavant)
804+
805 2002-02-21 Michael Johnston <michael.johnston@intel.com> and Chris Ahna <christopher.j.ahna@intel.com>
806 * major update to ia32 support: can now boot 2.4.x, and 2.2.x kernels
807+
808 2002-02-20 Stephane Eranian <eranian@hpl.hp.com>
809 * fixed missing netfs_fd_free() in case of file not found in netfs.c
810+
811 2002-02-19 Stephane Eranian <eranian@hpl.hp.com>
812 * added support for substitution variables (vars.c)
813 * changed the bootparam structure size back to 4kB
814 * added support to simple to print final command line option with tab key
815 * got rid of all the \r characters in strings use only \n (adjust emulator)
816 * added EFICRT0 variable in Makefile to indicate location of loader script+crt0
817+
818 2002-02-14 Stephane Eranian <eranian@hpl.hp.com>
819 * added support for message= option to simple chooser
820 * added support for description= option to simple chooser
821+
822 2002-02-13 Stephane Eranian <eranian@hpl.hp.com>
823 * choosers/textmenu.c: new textmenu chooser (by rhirst@linuxcare.com) used by Debian
824 * config.c: added support for dynamic global/per-image option management
825@@ -333,6 +389,7 @@
826 mode was specified in config file. In this case, we now autoboot
827 and ignore the prompt directive.
828 * updated elilo.txt
829+
830 2001-08-15 Brent Casavant <bcasavan@sgi.com>
831 * fix a bug in config.c:find_option() where it would do
832 a strXcmp() on a NULL string.
833
834=== modified file 'Makefile'
835--- Makefile 2011-08-22 21:17:34 +0000
836+++ Makefile 2013-12-06 20:30:39 +0000
837@@ -25,19 +25,15 @@
838 # to use this program.
839 #
840
841-SRCDIR = .
842-
843-VPATH = $(SRCDIR)
844-
845-include $(SRCDIR)/Make.defaults
846-TOPDIR = $(SRCDIR)
847+include Make.defaults
848+TOPDIR=.
849
850
851 CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o
852 LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
853
854 LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
855-LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
856+LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
857 FORMAT = efi-app-$(ARCH)
858
859 FILESYSTEM =
860@@ -85,14 +81,13 @@
861
862 elilo.so: $(FILES)
863
864-elilo.o : elilo.c
865+elilo.o : elilo.c $(ARCH)/sysdeps.h
866
867 fileops.o : Make.defaults
868 chooser.o : Make.defaults
869
870 $(SUBDIRS): dummy
871- mkdir -p $@
872- $(MAKE) -C $@ -f $(SRCDIR)/../$@/Makefile SRCDIR=$(SRCDIR)/../$@ ARCH=$(ARCH)
873+ $(MAKE) -C $@
874
875 dummy:
876
877@@ -111,4 +106,4 @@
878 @exit 1
879 endif
880
881-include $(SRCDIR)/Make.rules
882+include Make.rules
883
884=== modified file 'alloc.c'
885--- alloc.c 2011-08-22 21:17:34 +0000
886+++ alloc.c 2013-12-06 20:30:39 +0000
887@@ -110,7 +110,7 @@
888 }
889 alloc_add(tmp, size, ALLOC_POOL);
890 #ifdef DEBUG_MEM
891- DBG_PRT((L"alloc: allocated %d bytes @[" PTR_FMT "-" PTR_FMT "]\n", size, tmp, tmp+size));
892+ DBG_PRT((L"alloc: allocated %d bytes @[" PTR_FMT "-" PTR_FMT "]", size, tmp, tmp+size));
893 #endif
894 return tmp;
895 }
896@@ -140,7 +140,7 @@
897
898 alloc_add(addr, pgcnt, ALLOC_PAGES);
899
900- DBG_PRT((L"allocator: allocated %d pages @0x%lx\n", pgcnt, tmp));
901+ DBG_PRT((L"allocator: allocated %d pages @" PTR_FMT, pgcnt, tmp));
902
903 return addr;
904 }
905@@ -162,7 +162,7 @@
906 return;
907 found:
908 #ifdef DEBUG_MEM
909- DBG_PRT((L"free: %s @" PTR_FMT " size=%d\n",
910+ DBG_PRT((L"free: %s @" PTR_FMT " size=%d",
911 p->type == ALLOC_POOL ? L"Pool": L"Page",
912 addr, p->size));
913 #endif
914@@ -196,7 +196,7 @@
915
916 while(used_allocs) {
917 #ifdef DEBUG_MEM
918- DBG_PRT((L"free_all %a @ " PTR_FMT "\n", used_allocs->type == ALLOC_POOL ? "pool" : "pages", used_allocs->addr));
919+ DBG_PRT((L"free_all %a @ " PTR_FMT, used_allocs->type == ALLOC_POOL ? "pool" : "pages", used_allocs->addr));
920 #endif
921 if (used_allocs->type == ALLOC_POOL)
922 uefi_call_wrapper(BS->FreePool, 1, used_allocs->addr);
923@@ -217,7 +217,15 @@
924 alloc_kmem_anywhere(VOID **start_addr, UINTN pgcnt)
925 {
926 void * tmp;
927- if ((tmp = alloc_pages(pgcnt, EfiLoaderData, AllocateAnyPages, *start_addr)) == 0) return -1;
928+ /*
929+ * During "AllocateAnyPages" *start_addr will be ignored.
930+ * Therefore we can safely subvert it to reuse this function with
931+ * an alloc_kmem_anyhwere_below() semantic...
932+ */
933+ tmp = alloc_pages(pgcnt, EfiLoaderData,
934+ (*start_addr) ? AllocateMaxAddress : AllocateAnyPages,
935+ *start_addr);
936+ if (tmp == NULL) return -1;
937
938 kmem_addr = tmp;
939 kmem_pgcnt = pgcnt;
940@@ -241,7 +249,7 @@
941 free_kmem(VOID)
942 {
943 #ifdef DEBUG_MEM
944- DBG_PRT((L"free_kmem before (" PTR_FMT ", %d)\n", kmem_addr, kmem_pgcnt));
945+ DBG_PRT((L"free_kmem before (" PTR_FMT ", %d)", kmem_addr, kmem_pgcnt));
946 #endif
947 if (kmem_addr && kmem_pgcnt != 0) {
948 free(kmem_addr);
949@@ -249,7 +257,7 @@
950 kmem_pgcnt = 0;
951 }
952 #ifdef DEBUG_MEM
953- DBG_PRT((L"free_kmem after (" PTR_FMT ", %d)\n", kmem_addr, kmem_pgcnt));
954+ DBG_PRT((L"free_kmem after (" PTR_FMT ", %d)", kmem_addr, kmem_pgcnt));
955 #endif
956 }
957
958
959=== modified file 'bootparams.c'
960--- bootparams.c 2009-12-08 23:48:32 +0000
961+++ bootparams.c 2013-12-06 20:30:39 +0000
962@@ -96,6 +96,8 @@
963 */
964 Memset(bp, 0, BOOT_PARAM_MEMSIZE);
965
966+ U2ascii(args, cp, cmdline_size);
967+
968 if (sysdeps_create_boot_params(bp, cp, initrd, vmcode, cookie) == -1) return 0;
969
970 /*
971
972=== modified file 'choosers/Makefile'
973--- choosers/Makefile 2009-11-01 22:37:21 +0000
974+++ choosers/Makefile 2013-12-06 20:30:39 +0000
975@@ -23,15 +23,10 @@
976 # to use this program.
977 #
978
979-SRCDIR = .
980-
981-VPATH = $(SRCDIR)
982-
983-include $(SRCDIR)/../Make.defaults
984-include $(SRCDIR)/../Make.rules
985-
986-TOPDIR=$(SRCDIR)/..
987-
988+include ../Make.defaults
989+include ../Make.rules
990+
991+TOPDIR=$(CDIR)/..
992
993 FILES=
994
995@@ -47,17 +42,13 @@
996
997 all: $(TARGET)
998
999-$(TARGET): check-choosers $(TOPDIR)/Make.defaults $(FILES)
1000- $(LD) $(LD3264) -o $@ -r $(FILES)
1001-
1002-clean:
1003- $(RM) -f $(TARGET) $(FILES)
1004-
1005-check-choosers:
1006- @if [ -n "$(FILES)" ]; then \
1007- exit 0; \
1008- else \
1009+$(TARGET): $(TOPDIR)/Make.defaults $(FILES)
1010+ @if [ -z "$(FILES)" ]; then \
1011 echo "You need to define at least one chooser in Make.defaults"; \
1012 exit 1; \
1013 fi
1014+ $(LD) -o $@ -r $(FILES)
1015+
1016+clean:
1017+ $(RM) -f $(TARGET) $(FILES)
1018
1019
1020=== modified file 'choosers/simple.c'
1021--- choosers/simple.c 2011-08-22 21:17:34 +0000
1022+++ choosers/simple.c 2013-12-06 20:30:39 +0000
1023@@ -41,8 +41,8 @@
1024 display_label_info(CHAR16 *name)
1025 {
1026 CHAR16 *desc;
1027- CHAR16 initrd_name[CMDLINE_MAXLEN];
1028- CHAR16 vmcode_name[CMDLINE_MAXLEN];
1029+ CHAR16 initrd_name[PATHNAME_MAXLEN];
1030+ CHAR16 vmcode_name[PATHNAME_MAXLEN];
1031 CHAR16 options_tmp[CMDLINE_MAXLEN];
1032 CHAR16 options[CMDLINE_MAXLEN];
1033 CHAR16 kname[FILENAME_MAXLEN];
1034@@ -254,10 +254,10 @@
1035 # define BOOT_IMG_STR L"BOOT_IMAGE="
1036 CHAR16 buffer[CMDLINE_MAXLEN];
1037 CHAR16 alt_buffer[CMDLINE_MAXLEN];
1038- CHAR16 initrd_name[CMDLINE_MAXLEN];
1039- CHAR16 vmcode_name[CMDLINE_MAXLEN];
1040+ CHAR16 initrd_name[PATHNAME_MAXLEN];
1041+ CHAR16 vmcode_name[PATHNAME_MAXLEN];
1042 CHAR16 args[CMDLINE_MAXLEN];
1043- CHAR16 devname[CMDLINE_MAXLEN];
1044+ CHAR16 devname[PATHNAME_MAXLEN];
1045 CHAR16 dpath[FILENAME_MAXLEN];
1046 CHAR16 *slash_pos, *colon_pos, *backslash_pos;
1047 UINTN len;
1048@@ -290,8 +290,9 @@
1049
1050 if (elilo_opt.prompt) {
1051 console_textmode();
1052- ret = select_kernel(buffer, sizeof(buffer));
1053+ ret = select_kernel(buffer, CMDLINE_MAXLEN);
1054 if (ret == -1) return -1;
1055+ /* this function takes really the number of bytes ... */
1056 argc = argify(buffer,sizeof(buffer), argv);
1057 index = 0;
1058 }
1059
1060=== modified file 'choosers/textmenu.c'
1061--- choosers/textmenu.c 2011-08-22 21:17:34 +0000
1062+++ choosers/textmenu.c 2013-12-06 20:30:39 +0000
1063@@ -363,10 +363,10 @@
1064 {
1065 # define BOOT_IMG_STR L"BOOT_IMAGE="
1066 CHAR16 label[CMDLINE_MAXLEN];
1067- CHAR16 initrd_name[CMDLINE_MAXLEN];
1068- CHAR16 vmcode_name[CMDLINE_MAXLEN];
1069+ CHAR16 initrd_name[PATHNAME_MAXLEN];
1070+ CHAR16 vmcode_name[PATHNAME_MAXLEN];
1071 CHAR16 args[CMDLINE_MAXLEN];
1072- CHAR16 devname[CMDLINE_MAXLEN];
1073+ CHAR16 devname[PATHNAME_MAXLEN];
1074 CHAR16 dpath[FILENAME_MAXLEN];
1075 CHAR16 *slash_pos, *colon_pos, *backslash_pos;
1076 UINTN len;
1077
1078=== modified file 'config.c'
1079--- config.c 2011-08-22 21:17:34 +0000
1080+++ config.c 2013-12-06 20:30:39 +0000
1081@@ -56,7 +56,7 @@
1082 */
1083 #define ELILO_DEFAULT_CONFIG L"elilo.conf"
1084
1085-#define MAX_STRING CMDLINE_MAXLEN
1086+#define MAX_STRING 512
1087 #define CONFIG_BUFSIZE 512 /* input buffer size */
1088
1089 /*
1090@@ -71,7 +71,7 @@
1091 struct boot_image *next;
1092 CHAR16 label[MAX_STRING];
1093 CHAR16 kname[FILENAME_MAXLEN];
1094- CHAR16 options[MAX_STRING];
1095+ CHAR16 options[CMDLINE_MAXLEN];
1096 CHAR16 initrd[FILENAME_MAXLEN];
1097 CHAR16 vmcode[FILENAME_MAXLEN];
1098 CHAR16 root[FILENAME_MAXLEN];
1099@@ -100,7 +100,7 @@
1100 CHAR16 root[FILENAME_MAXLEN]; /* globally defined root fs */
1101 CHAR16 initrd[FILENAME_MAXLEN];/* globally defined initrd */
1102 CHAR16 vmcode[FILENAME_MAXLEN];/* globally defined boot-time module */
1103- CHAR16 options[MAX_STRING];
1104+ CHAR16 options[CMDLINE_MAXLEN];
1105 CHAR16 default_image_name[MAX_STRING];
1106 CHAR16 message_file[MAX_MESSAGES][FILENAME_MAXLEN];
1107 CHAR16 chooser[FILENAME_MAXLEN];/* which image chooser to use */
1108@@ -909,10 +909,10 @@
1109 {
1110 boot_image_t *img, *dfl = global_config.default_image;
1111
1112- if (dfl) Print(L"\t%s\n", dfl->label);
1113+ if (dfl) Print(L" %s\n", dfl->label);
1114
1115 for (img = image_list; img; img = img->next) {
1116- if (img != dfl) Print(L"\t%s\n", img->label);
1117+ if (img != dfl) Print(L" %s\n", img->label);
1118 }
1119 }
1120
1121
1122=== modified file 'debian/changelog'
1123--- debian/changelog 2011-08-22 21:17:34 +0000
1124+++ debian/changelog 2013-12-06 20:30:39 +0000
1125@@ -1,3 +1,52 @@
1126+elilo (3.14-3ubuntu1) trusty; urgency=low
1127+
1128+ * Merge from Debian. LP: #1175026 Remaining changes:
1129+ - Add nasty hacks for Apple systems - switch to text mode on startup,
1130+ pass the framebuffer size to the system on boot, and automatically set
1131+ legacy-free option on ia32 Apple systems.
1132+ (needs-to-go-upstream)
1133+ - Perform some Ubuntu branding, put all files in /EFI/ubuntu.
1134+ (ubuntu-only)
1135+ - Add a modprobe call if efivars facility is not found.
1136+
1137+ -- Jackson Doak <noskcaj@ubuntu.com> Sat, 07 Dec 2013 07:11:04 +1100
1138+
1139+elilo (3.14-3) unstable; urgency=low
1140+
1141+ * orphan this package as I no longer use it myself
1142+
1143+ -- Bdale Garbee <bdale@gag.com> Tue, 07 May 2013 09:37:59 -0600
1144+
1145+elilo (3.14-2) unstable; urgency=low
1146+
1147+ * remove unnecessary explicit iocharset request in elilo.sh that prevents
1148+ ia64 installations from succeeding, closes: #685186
1149+
1150+ -- Bdale Garbee <bdale@gag.com> Tue, 16 Oct 2012 21:52:16 -0600
1151+
1152+elilo (3.14-1) unstable; urgency=low
1153+
1154+ * new upstream version
1155+
1156+ -- Bdale Garbee <bdale@gag.com> Fri, 29 Jun 2012 11:04:12 -0600
1157+
1158+elilo (3.12-5) unstable; urgency=low
1159+
1160+ * merge 3.12-4.1 diff from Christian Perrier
1161+ * add VCS entries to control file
1162+ * update standards version
1163+
1164+ -- Bdale Garbee <bdale@gag.com> Fri, 29 Jun 2012 09:25:49 -0600
1165+
1166+elilo (3.12-4.1) unstable; urgency=low
1167+
1168+ * Non-maintainer upload.
1169+ * Fix pending l10n issues. Debconf translations:
1170+ - Danish (Joe Hansen). Closes: #602446
1171+ - Polish (Michał Kułach). Closes: #657502
1172+
1173+ -- Christian Perrier <bubulle@debian.org> Wed, 01 Feb 2012 20:13:32 +0100
1174+
1175 elilo (3.12-4ubuntu1) oneiric; urgency=low
1176
1177 * Resynchronise with Debian. Remaining changes:
1178@@ -531,6 +580,3 @@
1179
1180 -- Bdale Garbee <bdale@gag.com> Tue, 10 Jul 2001 13:20:28 -0600
1181
1182-Local variables:
1183-mode: debian-changelog
1184-End:
1185
1186=== modified file 'debian/control'
1187--- debian/control 2011-08-22 21:17:34 +0000
1188+++ debian/control 2013-12-06 20:30:39 +0000
1189@@ -2,9 +2,11 @@
1190 Section: admin
1191 Priority: optional
1192 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
1193-XSBC-Original-Maintainer: Bdale Garbee <bdale@gag.com>
1194+XSBC-Original-Maintainer: Debian QA Group <packages@qa.debian.org>
1195 Build-Depends: debhelper (>> 5), binutils (>= 2.17.50.0.14), gcc-multilib [i386 amd64], gnu-efi (>=3.0d), po-debconf
1196-Standards-Version: 3.9.1
1197+Standards-Version: 3.9.3
1198+Vcs-Git: git://git.gag.com/debian/elilo
1199+Vcs-Browser: http://git.gag.com/?p=debian/elilo
1200
1201 Package: elilo
1202 Architecture: i386 ia64 amd64
1203
1204=== modified file 'debian/elilo.sh'
1205--- debian/elilo.sh 2011-08-22 21:17:34 +0000
1206+++ debian/elilo.sh 2013-12-06 20:30:39 +0000
1207@@ -345,7 +345,7 @@
1208 fi
1209
1210 [ "$VERBOSE" = 1 ] && echo "$PRG: Mounting $boot..."
1211- mount -t "$fstype" -o codepage=437,iocharset=iso8859-1,rw,noexec,umask=077$loop "$boot" "$TMP/bootstrap.$$"
1212+ mount -t "$fstype" -o codepage=437,rw,noexec,umask=077$loop "$boot" "$TMP/bootstrap.$$"
1213 if [ $? != 0 ] ; then
1214 echo 1>&2 "$PRG: An error occured mounting $boot"
1215 return 1
1216
1217=== added file 'debian/patches/cross-build.diff'
1218--- debian/patches/cross-build.diff 1970-01-01 00:00:00 +0000
1219+++ debian/patches/cross-build.diff 2013-12-06 20:30:39 +0000
1220@@ -0,0 +1,266 @@
1221+diff --git a/Makefile b/Makefile
1222+index f0efebd..9d82cbf 100644
1223+--- a/Makefile
1224++++ b/Makefile
1225+@@ -25,15 +25,19 @@
1226+ # to use this program.
1227+ #
1228+
1229+-include Make.defaults
1230+-TOPDIR=.
1231++SRCDIR = .
1232++
1233++VPATH = $(SRCDIR)
1234++
1235++include $(SRCDIR)/Make.defaults
1236++TOPDIR = $(SRCDIR)
1237+
1238+
1239+ CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o
1240+ LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
1241+
1242+ LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
1243+-LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
1244++LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
1245+ FORMAT = efi-app-$(ARCH)
1246+
1247+ FILESYSTEM =
1248+@@ -87,7 +91,8 @@ fileops.o : Make.defaults
1249+ chooser.o : Make.defaults
1250+
1251+ $(SUBDIRS): dummy
1252+- $(MAKE) -C $@
1253++ mkdir -p $@
1254++ $(MAKE) -C $@ -f $(SRCDIR)/../$@/Makefile SRCDIR=$(SRCDIR)/../$@ ARCH=$(ARCH)
1255+
1256+ dummy:
1257+
1258+@@ -106,4 +111,4 @@ ifeq ($(GCC_VERSION),2)
1259+ @exit 1
1260+ endif
1261+
1262+-include Make.rules
1263++include $(SRCDIR)/Make.rules
1264+diff --git a/choosers/Makefile b/choosers/Makefile
1265+index 9915f48..85d31c7 100644
1266+--- a/choosers/Makefile
1267++++ b/choosers/Makefile
1268+@@ -23,10 +23,15 @@
1269+ # to use this program.
1270+ #
1271+
1272+-include ../Make.defaults
1273+-include ../Make.rules
1274++SRCDIR = .
1275++
1276++VPATH = $(SRCDIR)
1277++
1278++include $(SRCDIR)/../Make.defaults
1279++include $(SRCDIR)/../Make.rules
1280++
1281++TOPDIR=$(SRCDIR)/..
1282+
1283+-TOPDIR=$(CDIR)/..
1284+
1285+ FILES=
1286+
1287+@@ -47,7 +52,8 @@ $(TARGET): $(TOPDIR)/Make.defaults $(FILES)
1288+ echo "You need to define at least one chooser in Make.defaults"; \
1289+ exit 1; \
1290+ fi
1291+- $(LD) -o $@ -r $(FILES)
1292++ $(LD) $(LD3264) -o $@ -r $(FILES)
1293++
1294+
1295+ clean:
1296+ $(RM) -f $(TARGET) $(FILES)
1297+diff --git a/devschemes/Makefile b/devschemes/Makefile
1298+index 6ac05af..5328cb1 100644
1299+--- a/devschemes/Makefile
1300++++ b/devschemes/Makefile
1301+@@ -23,10 +23,15 @@
1302+ # to use this program.
1303+ #
1304+
1305+-include ../Make.defaults
1306+-include ../Make.rules
1307++SRCDIR = .
1308++
1309++VPATH = $(SRCDIR)
1310++
1311++include $(SRCDIR)/../Make.defaults
1312++include $(SRCDIR)/../Make.rules
1313++
1314++TOPDIR=$(SRCDIR)/..
1315+
1316+-TOPDIR=$(CDIR)/..
1317+
1318+ FILES=simple.o
1319+
1320+@@ -40,7 +45,7 @@ all: $(TARGET)
1321+ # without doing make clean.
1322+ #
1323+ $(TARGET): $(FILES)
1324+- $(LD) -r -o $@ $(FILES)
1325++ $(LD) $(LD3264) -r -o $@ $(FILES)
1326+
1327+ clean:
1328+ $(RM) -f $(TARGET) $(FILES)
1329+diff --git a/fs/Makefile b/fs/Makefile
1330+index 8e422b2..0bb303f 100644
1331+--- a/fs/Makefile
1332++++ b/fs/Makefile
1333+@@ -23,10 +23,15 @@
1334+ # to use this program.
1335+ #
1336+
1337+-include ../Make.defaults
1338+-include ../Make.rules
1339++SRCDIR = .
1340++
1341++VPATH = $(SRCDIR)
1342++
1343++include $(SRCDIR)/../Make.defaults
1344++include $(SRCDIR)/../Make.rules
1345++
1346++TOPDIR=$(SRCDIR)/..
1347+
1348+-TOPDIR=$(CDIR)/..
1349+
1350+ FILES=
1351+ ifeq ($(CONFIG_localfs),y)
1352+@@ -59,7 +64,7 @@ $(TARGET): $(TOPDIR)/Make.defaults $(FILES)
1353+ echo "You need to define at least one filesystem in Make.defaults"; \
1354+ exit 1; \
1355+ fi
1356+- $(LD) -r -o $@ $(FILES)
1357++ $(LD) $(LD3264) -r -o $@ $(FILES)
1358+
1359+ clean:
1360+ $(RM) -f $(TARGET) $(FILES)
1361+diff --git a/ia32/Makefile b/ia32/Makefile
1362+index 353ae67..c5f421b 100644
1363+--- a/ia32/Makefile
1364++++ b/ia32/Makefile
1365+@@ -23,10 +23,15 @@
1366+ # to use this program.
1367+ #
1368+
1369+-include ../Make.defaults
1370+-include ../Make.rules
1371++SRCDIR = .
1372++
1373++VPATH = $(SRCDIR)
1374++
1375++include $(SRCDIR)/../Make.defaults
1376++include $(SRCDIR)/../Make.rules
1377++
1378++TOPDIR=$(SRCDIR)/..
1379+
1380+-TOPDIR=$(CDIR)/..
1381+
1382+ FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
1383+
1384+@@ -37,13 +42,13 @@ all: $(TARGET)
1385+ system.o: rmswitch.h
1386+
1387+ rmswitch.h: bin_to_h.c rmswitch.S
1388+- $(CC) -o bin_to_h bin_to_h.c
1389+- $(AS) -o rmswitch.o rmswitch.S
1390++ $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
1391++ $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
1392+ $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
1393+ ./bin_to_h <rmswitch >rmswitch.h
1394+
1395+ $(TARGET): $(FILES)
1396+- $(LD) -r -o $@ $(FILES)
1397++ $(LD) $(LD3264) -r -o $@ $(FILES)
1398+
1399+ clean:
1400+ $(RM) -f $(TARGET) $(FILES)
1401+diff --git a/ia64/Makefile b/ia64/Makefile
1402+index a243d0f..bee0a2b 100644
1403+--- a/ia64/Makefile
1404++++ b/ia64/Makefile
1405+@@ -23,10 +23,15 @@
1406+ # to use this program.
1407+ #
1408+
1409+-include ../Make.defaults
1410+-include ../Make.rules
1411++SRCDIR = .
1412++
1413++VPATH = $(SRCDIR)
1414++
1415++include $(SRCDIR)/../Make.defaults
1416++include $(SRCDIR)/../Make.rules
1417++
1418++TOPDIR=$(SRCDIR)/..
1419+
1420+-TOPDIR=$(CDIR)/..
1421+
1422+ FILES=system.o config.o fpswa.o plain_loader.o gzip_loader.o \
1423+ gzip.o memset.o memcpy.o setjmp.o longjmp.o
1424+diff --git a/tools/Makefile b/tools/Makefile
1425+index 8858224..97083d7 100644
1426+--- a/tools/Makefile
1427++++ b/tools/Makefile
1428+@@ -23,10 +23,15 @@
1429+ # to use this program.
1430+ #
1431+
1432+-include ../Make.defaults
1433+-include ../Make.rules
1434++SRCDIR = .
1435++
1436++VPATH = $(SRCDIR)
1437++
1438++include $(SRCDIR)/../Make.defaults
1439++include $(SRCDIR)/../Make.rules
1440++
1441++TOPDIR=$(SRCDIR)/..
1442+
1443+-TOPDIR=$(CDIR)/..
1444+
1445+ FILES=eliloalt.o
1446+ TARGET=eliloalt
1447+diff --git a/x86_64/Makefile b/x86_64/Makefile
1448+index 4af4b8d..7ade312 100644
1449+--- a/x86_64/Makefile
1450++++ b/x86_64/Makefile
1451+@@ -23,10 +23,15 @@
1452+ # to use this program.
1453+ #
1454+
1455+-include ../Make.defaults
1456+-include ../Make.rules
1457++SRCDIR = .
1458++
1459++VPATH = $(SRCDIR)
1460++
1461++include $(SRCDIR)/../Make.defaults
1462++include $(SRCDIR)/../Make.rules
1463++
1464++TOPDIR=$(SRCDIR)/..
1465+
1466+-TOPDIR=$(CDIR)/..
1467+
1468+ FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
1469+ #FILES=system.o config.o plain_loader.o
1470+@@ -38,13 +43,13 @@ all: $(TARGET)
1471+ system.o: rmswitch.h
1472+
1473+ rmswitch.h: bin_to_h.c rmswitch.S
1474+- $(CC) -o bin_to_h bin_to_h.c
1475+- $(AS) -o rmswitch.o rmswitch.S
1476++ $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
1477++ $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
1478+ $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
1479+ ./bin_to_h <rmswitch >rmswitch.h
1480+
1481+ $(TARGET): $(FILES)
1482+- $(LD) -r -o $@ $(FILES)
1483++ $(LD) $(LD3264) -r -o $@ $(FILES)
1484+
1485+ clean:
1486+ $(RM) -f $(TARGET) $(FILES)
1487
1488=== removed file 'debian/patches/debian-changes-3.12-3'
1489--- debian/patches/debian-changes-3.12-3 2010-06-08 13:42:05 +0000
1490+++ debian/patches/debian-changes-3.12-3 1970-01-01 00:00:00 +0000
1491@@ -1,284 +0,0 @@
1492-Description: Upstream changes introduced in version 3.12-3
1493- This patch has been created by dpkg-source during the package build.
1494- Here's the last changelog entry, hopefully it gives details on why
1495- those changes were made:
1496- .
1497- elilo (3.12-3) unstable; urgency=low
1498- .
1499- * fix paths and options to build both 32 and 64 bit versions on either
1500- flavor of build host, closes: #574713
1501- * don't generate noise when following symlink since that's now the normal
1502- situation, closes: #581068
1503- .
1504- The person named in the Author field signed this changelog entry.
1505-Author: Bdale Garbee <bdale@gag.com>
1506-Bug-Debian: http://bugs.debian.org/574713
1507-Bug-Debian: http://bugs.debian.org/581068
1508-
1509----
1510-The information above should follow the Patch Tagging Guidelines, please
1511-checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
1512-are templates for supplementary fields that you might want to add:
1513-
1514-Origin: <vendor|upstream|other>, <url of original patch>
1515-Bug: <url in upstream bugtracker>
1516-Bug-Debian: http://bugs.debian.org/<bugnumber>
1517-Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
1518-Forwarded: <no|not-needed|url proving that it has been forwarded>
1519-Reviewed-By: <name and email of someone who approved the patch>
1520-Last-Update: <YYYY-MM-DD>
1521-
1522---- elilo-3.12.orig/Makefile
1523-+++ elilo-3.12/Makefile
1524-@@ -25,15 +25,19 @@
1525- # to use this program.
1526- #
1527-
1528--include Make.defaults
1529--TOPDIR=.
1530-+SRCDIR = .
1531-+
1532-+VPATH = $(SRCDIR)
1533-+
1534-+include $(SRCDIR)/Make.defaults
1535-+TOPDIR = $(SRCDIR)
1536-
1537-
1538- CRTOBJS = $(EFICRT0)/crt0-efi-$(ARCH).o
1539- LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
1540-
1541- LDFLAGS += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
1542--LOADLIBES = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
1543-+LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
1544- FORMAT = efi-app-$(ARCH)
1545-
1546- FILESYSTEM =
1547-@@ -87,7 +91,8 @@ fileops.o : Make.defaults
1548- chooser.o : Make.defaults
1549-
1550- $(SUBDIRS): dummy
1551-- $(MAKE) -C $@
1552-+ mkdir -p $@
1553-+ $(MAKE) -C $@ -f $(SRCDIR)/../$@/Makefile SRCDIR=$(SRCDIR)/../$@ ARCH=$(ARCH)
1554-
1555- dummy:
1556-
1557-@@ -106,4 +111,4 @@ ifeq ($(GCC_VERSION),2)
1558- @exit 1
1559- endif
1560-
1561--include Make.rules
1562-+include $(SRCDIR)/Make.rules
1563---- elilo-3.12.orig/devschemes/Makefile
1564-+++ elilo-3.12/devschemes/Makefile
1565-@@ -23,10 +23,15 @@
1566- # to use this program.
1567- #
1568-
1569--include ../Make.defaults
1570--include ../Make.rules
1571-+SRCDIR = .
1572-+
1573-+VPATH = $(SRCDIR)
1574-+
1575-+include $(SRCDIR)/../Make.defaults
1576-+include $(SRCDIR)/../Make.rules
1577-+
1578-+TOPDIR=$(SRCDIR)/..
1579-
1580--TOPDIR=$(CDIR)/..
1581-
1582- FILES=simple.o
1583-
1584-@@ -40,7 +45,7 @@ all: $(TARGET)
1585- # without doing make clean.
1586- #
1587- $(TARGET): $(FILES)
1588-- $(LD) -r -o $@ $(FILES)
1589-+ $(LD) $(LD3264) -r -o $@ $(FILES)
1590-
1591- clean:
1592- $(RM) -f $(TARGET) $(FILES)
1593---- elilo-3.12.orig/ia64/Makefile
1594-+++ elilo-3.12/ia64/Makefile
1595-@@ -23,10 +23,15 @@
1596- # to use this program.
1597- #
1598-
1599--include ../Make.defaults
1600--include ../Make.rules
1601-+SRCDIR = .
1602-+
1603-+VPATH = $(SRCDIR)
1604-+
1605-+include $(SRCDIR)/../Make.defaults
1606-+include $(SRCDIR)/../Make.rules
1607-+
1608-+TOPDIR=$(SRCDIR)/..
1609-
1610--TOPDIR=$(CDIR)/..
1611-
1612- FILES=system.o config.o fpswa.o plain_loader.o gzip_loader.o \
1613- gzip.o memset.o memcpy.o setjmp.o longjmp.o
1614---- elilo-3.12.orig/choosers/Makefile
1615-+++ elilo-3.12/choosers/Makefile
1616-@@ -23,10 +23,15 @@
1617- # to use this program.
1618- #
1619-
1620--include ../Make.defaults
1621--include ../Make.rules
1622-+SRCDIR = .
1623-+
1624-+VPATH = $(SRCDIR)
1625-+
1626-+include $(SRCDIR)/../Make.defaults
1627-+include $(SRCDIR)/../Make.rules
1628-+
1629-+TOPDIR=$(SRCDIR)/..
1630-
1631--TOPDIR=$(CDIR)/..
1632-
1633- FILES=
1634-
1635-@@ -43,11 +48,11 @@ TARGET=choosers.o
1636- all: $(TARGET)
1637-
1638- $(TARGET): check-choosers $(TOPDIR)/Make.defaults $(FILES)
1639-- $(LD) -o $@ -r $(FILES)
1640-+ $(LD) $(LD3264) -o $@ -r $(FILES)
1641-
1642- clean:
1643- $(RM) -f $(TARGET) $(FILES)
1644--
1645-+
1646- check-choosers:
1647- @if [ -n "$(FILES)" ]; then \
1648- exit 0; \
1649---- elilo-3.12.orig/ia32/Makefile
1650-+++ elilo-3.12/ia32/Makefile
1651-@@ -23,10 +23,15 @@
1652- # to use this program.
1653- #
1654-
1655--include ../Make.defaults
1656--include ../Make.rules
1657-+SRCDIR = .
1658-+
1659-+VPATH = $(SRCDIR)
1660-+
1661-+include $(SRCDIR)/../Make.defaults
1662-+include $(SRCDIR)/../Make.rules
1663-+
1664-+TOPDIR=$(SRCDIR)/..
1665-
1666--TOPDIR=$(CDIR)/..
1667-
1668- FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
1669-
1670-@@ -37,13 +42,13 @@ all: $(TARGET)
1671- system.o: rmswitch.h
1672-
1673- rmswitch.h: bin_to_h.c rmswitch.S
1674-- $(CC) -o bin_to_h bin_to_h.c
1675-- $(AS) -o rmswitch.o rmswitch.S
1676-+ $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
1677-+ $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
1678- $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
1679- ./bin_to_h <rmswitch >rmswitch.h
1680-
1681- $(TARGET): $(FILES)
1682-- $(LD) -r -o $@ $(FILES)
1683-+ $(LD) $(LD3264) -r -o $@ $(FILES)
1684-
1685- clean:
1686- $(RM) -f $(TARGET) $(FILES)
1687---- elilo-3.12.orig/x86_64/Makefile
1688-+++ elilo-3.12/x86_64/Makefile
1689-@@ -23,10 +23,15 @@
1690- # to use this program.
1691- #
1692-
1693--include ../Make.defaults
1694--include ../Make.rules
1695-+SRCDIR = .
1696-+
1697-+VPATH = $(SRCDIR)
1698-+
1699-+include $(SRCDIR)/../Make.defaults
1700-+include $(SRCDIR)/../Make.rules
1701-+
1702-+TOPDIR=$(SRCDIR)/..
1703-
1704--TOPDIR=$(CDIR)/..
1705-
1706- FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
1707- #FILES=system.o config.o plain_loader.o
1708-@@ -38,13 +43,13 @@ all: $(TARGET)
1709- system.o: rmswitch.h
1710-
1711- rmswitch.h: bin_to_h.c rmswitch.S
1712-- $(CC) -o bin_to_h bin_to_h.c
1713-- $(AS) -o rmswitch.o rmswitch.S
1714-+ $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
1715-+ $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
1716- $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
1717- ./bin_to_h <rmswitch >rmswitch.h
1718-
1719- $(TARGET): $(FILES)
1720-- $(LD) -r -o $@ $(FILES)
1721-+ $(LD) $(LD3264) -r -o $@ $(FILES)
1722-
1723- clean:
1724- $(RM) -f $(TARGET) $(FILES)
1725---- elilo-3.12.orig/tools/Makefile
1726-+++ elilo-3.12/tools/Makefile
1727-@@ -23,10 +23,15 @@
1728- # to use this program.
1729- #
1730-
1731--include ../Make.defaults
1732--include ../Make.rules
1733-+SRCDIR = .
1734-+
1735-+VPATH = $(SRCDIR)
1736-+
1737-+include $(SRCDIR)/../Make.defaults
1738-+include $(SRCDIR)/../Make.rules
1739-+
1740-+TOPDIR=$(SRCDIR)/..
1741-
1742--TOPDIR=$(CDIR)/..
1743-
1744- FILES=eliloalt.o
1745- TARGET=eliloalt
1746---- elilo-3.12.orig/fs/Makefile
1747-+++ elilo-3.12/fs/Makefile
1748-@@ -23,10 +23,15 @@
1749- # to use this program.
1750- #
1751-
1752--include ../Make.defaults
1753--include ../Make.rules
1754-+SRCDIR = .
1755-+
1756-+VPATH = $(SRCDIR)
1757-+
1758-+include $(SRCDIR)/../Make.defaults
1759-+include $(SRCDIR)/../Make.rules
1760-+
1761-+TOPDIR=$(SRCDIR)/..
1762-
1763--TOPDIR=$(CDIR)/..
1764-
1765- FILES=
1766- ifeq ($(CONFIG_localfs),y)
1767-@@ -55,7 +60,7 @@ all: $(TARGET)
1768- # without doing make clean.
1769- #
1770- $(TARGET): check-filesystems $(TOPDIR)/Make.defaults $(FILES)
1771-- $(LD) -r -o $@ $(FILES)
1772-+ $(LD) $(LD3264) -r -o $@ $(FILES)
1773-
1774- clean:
1775- $(RM) -f $(TARGET) $(FILES)
1776
1777=== modified file 'debian/patches/fix-paths.diff'
1778--- debian/patches/fix-paths.diff 2010-06-08 13:42:05 +0000
1779+++ debian/patches/fix-paths.diff 2013-12-06 20:30:39 +0000
1780@@ -12,7 +12,7 @@
1781
1782 OPTIMFLAGS = -O2
1783 DEBUGFLAGS = -Wall
1784--CFLAGS = $(OPTIMFLAGS) -fno-strict-aliasing -fpic -fshort-wchar $(DEBUGFLAGS)
1785+-CFLAGS = $(OPTIMFLAGS) -fno-stack-protector -fno-strict-aliasing -fpic -fshort-wchar $(DEBUGFLAGS)
1786 +CFLAGS = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
1787 +ASFLAGS = $(ARCH3264)
1788 LDFLAGS = -nostdlib -znocombreloc
1789
1790=== modified file 'debian/patches/series'
1791--- debian/patches/series 2011-08-22 21:17:34 +0000
1792+++ debian/patches/series 2013-12-06 20:30:39 +0000
1793@@ -1,3 +1,3 @@
1794 fix-paths.diff
1795 apple.diff
1796-debian-changes-3.12-3
1797+cross-build.diff
1798
1799=== added file 'debian/po/da.po'
1800--- debian/po/da.po 1970-01-01 00:00:00 +0000
1801+++ debian/po/da.po 2013-12-06 20:30:39 +0000
1802@@ -0,0 +1,86 @@
1803+# Danish translation elilo.
1804+# Copyright (C) 2010 elilo & nedenstående oversættere.
1805+# This file is distributed under the same license as the elilo package.
1806+# Joe Hansen (joedalton2@yahoo.dk), 2010.
1807+#
1808+msgid ""
1809+msgstr ""
1810+"Project-Id-Version: elilo\n"
1811+"Report-Msgid-Bugs-To: bdale@gag.com\n"
1812+"POT-Creation-Date: 2007-03-13 08:22+0100\n"
1813+"PO-Revision-Date: 2010-11-04 12:42+0000\n"
1814+"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
1815+"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
1816+"Language: da\n"
1817+"MIME-Version: 1.0\n"
1818+"Content-Type: text/plain; charset=UTF-8\n"
1819+"Content-Transfer-Encoding: 8bit\n"
1820+
1821+#. Type: boolean
1822+#. Description
1823+#: ../elilo.templates:1001
1824+msgid "Automatically run elilo?"
1825+msgstr "Kør automatisk elilo?"
1826+
1827+#. Type: boolean
1828+#. Description
1829+#: ../elilo.templates:1001
1830+msgid ""
1831+"It is necessary to run /usr/sbin/elilo to install the new elilo binary into "
1832+"the EFI partition."
1833+msgstr ""
1834+"Det er nødvendigt at køre /usr/sbin/elilo for at installere den nye binære "
1835+"elilo til EFI-partitionen."
1836+
1837+#. Type: boolean
1838+#. Description
1839+#: ../elilo.templates:1001
1840+msgid ""
1841+"WARNING: This procedure will write data into the debian directory of the EFI "
1842+"disk partition, possibly overwriting files installed there by hand."
1843+msgstr ""
1844+"ADVARSEL: Denne procedure vil skrive data til debianmappen på EFI-"
1845+"diskpartitionen, og muligvis overskrive filer installeret der manuelt."
1846+
1847+#. Type: boolean
1848+#. Description
1849+#: ../elilo.templates:1001
1850+msgid ""
1851+"Not installing the new elilo binary on the EFI disk partition may leave the "
1852+"system in an unbootable state. Alternatives to automatic updating of the "
1853+"partition include running /usr/sbin/elilo by hand, or installing the new /"
1854+"usr/lib/elilo/elilo.efi executable into the EFI disk partition manually."
1855+msgstr ""
1856+"Undladelse af at installere den nye binære elilo på EFI-diskpartionen kan "
1857+"efterlade systemet i en tilstand, hvor det ikke kan startes op. Alternativer "
1858+"til automatisk opdatering af partitionen inkluderer at køre /usr/sbin/elilo "
1859+"manuelt, eller installere den nye kørbare /usr/lib/elilo/elilo.efi i EFI-"
1860+"diskpartitionen manuelt."
1861+
1862+#. Type: boolean
1863+#. Description
1864+#: ../elilo.templates:2001
1865+msgid "Reformat and reload EFI partition?"
1866+msgstr "Genformater og genindlæs EFI-partition?"
1867+
1868+#. Type: boolean
1869+#. Description
1870+#: ../elilo.templates:2001
1871+msgid ""
1872+"The structure of files in the EFI disk partition has changed since pre-3.2 "
1873+"versions of the elilo package. The EFI boot manager entry for Debian needs "
1874+"to be updated to reflect these changes."
1875+msgstr ""
1876+"Strukturen på filer i EFI-diskpartitionen har ændret sig siden pre-3.2-"
1877+"versionerne af elilopakken. Debians punkt i EFI-opstartshåndteringen skal "
1878+"opdateres for at afspejle disse ændringer."
1879+
1880+#. Type: boolean
1881+#. Description
1882+#: ../elilo.templates:2001
1883+msgid ""
1884+"In most cases, if no manual changes to the EFI partition content need to be "
1885+"preserved, this update can be handled automatically."
1886+msgstr ""
1887+"I de fleste tilfælde, hvor der ikke er behov for at bevare manuelle "
1888+"ændringer, kan denne opdatering håndteres automatisk."
1889
1890=== added file 'debian/po/pl.po'
1891--- debian/po/pl.po 1970-01-01 00:00:00 +0000
1892+++ debian/po/pl.po 2013-12-06 20:30:39 +0000
1893@@ -0,0 +1,90 @@
1894+# Copyright (C) 2007
1895+# This file is distributed under the same license as the elilo package.
1896+#
1897+# Michał Kułach <michal.kulach@gmail.com>, 2012.
1898+msgid ""
1899+msgstr ""
1900+"Project-Id-Version: \n"
1901+"Report-Msgid-Bugs-To: bdale@gag.com\n"
1902+"POT-Creation-Date: 2007-03-13 08:22+0100\n"
1903+"PO-Revision-Date: 2012-01-26 13:57+0100\n"
1904+"Last-Translator: Michał Kułach <michal.kulach@gmail.com>\n"
1905+"Language-Team: Polish <debian-l10n-polish@lists.debian.org>\n"
1906+"Language: pl\n"
1907+"MIME-Version: 1.0\n"
1908+"Content-Type: text/plain; charset=UTF-8\n"
1909+"Content-Transfer-Encoding: 8bit\n"
1910+"X-Generator: Lokalize 1.2\n"
1911+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
1912+"|| n%100>=20) ? 1 : 2);\n"
1913+
1914+#. Type: boolean
1915+#. Description
1916+#: ../elilo.templates:1001
1917+msgid "Automatically run elilo?"
1918+msgstr "Uruchomić elilo automatycznie?"
1919+
1920+#. Type: boolean
1921+#. Description
1922+#: ../elilo.templates:1001
1923+msgid ""
1924+"It is necessary to run /usr/sbin/elilo to install the new elilo binary into "
1925+"the EFI partition."
1926+msgstr ""
1927+"Konieczne jest uruchomienie /usr/sbin/elilo, aby zainstalować nowy plik "
1928+"binarny elilo na partycji EFI."
1929+
1930+#. Type: boolean
1931+#. Description
1932+#: ../elilo.templates:1001
1933+msgid ""
1934+"WARNING: This procedure will write data into the debian directory of the EFI "
1935+"disk partition, possibly overwriting files installed there by hand."
1936+msgstr ""
1937+"OSTRZEŻENIE: Ta procedura zapisze dane do katalogu debian na partycji "
1938+"dyskowej EFI, potencjalnie nadpisując pliki, które zostały tam zainstalowane "
1939+"ręcznie."
1940+
1941+#. Type: boolean
1942+#. Description
1943+#: ../elilo.templates:1001
1944+msgid ""
1945+"Not installing the new elilo binary on the EFI disk partition may leave the "
1946+"system in an unbootable state. Alternatives to automatic updating of the "
1947+"partition include running /usr/sbin/elilo by hand, or installing the new /"
1948+"usr/lib/elilo/elilo.efi executable into the EFI disk partition manually."
1949+msgstr ""
1950+"Niezainstalowanie nowego pliku binarnego elilo na partycji dyskowej EFI może "
1951+"uniemożliwić ponowny rozruch systemu. Alternatywami dla automatycznego "
1952+"uaktualnienia partycji są: ręczne uruchomienie /usr/sbin/elilo lub ręczne "
1953+"zainstalowanie nowego pliku wykonywalnego /usr/lib/elilo/elilo.efi na "
1954+"partycji dyskowej EFI."
1955+
1956+#. Type: boolean
1957+#. Description
1958+#: ../elilo.templates:2001
1959+msgid "Reformat and reload EFI partition?"
1960+msgstr "Sformatować i załadować partycję EFI ponownie?"
1961+
1962+#. Type: boolean
1963+#. Description
1964+#: ../elilo.templates:2001
1965+msgid ""
1966+"The structure of files in the EFI disk partition has changed since pre-3.2 "
1967+"versions of the elilo package. The EFI boot manager entry for Debian needs "
1968+"to be updated to reflect these changes."
1969+msgstr ""
1970+"Struktura plików na partycji dyskowej EFI zmieniła się od czasu wersji "
1971+"pre-3.2 pakietu elilo. Wpis dla Debiana w menedżerze rozruchu EFI musi "
1972+"zostać uaktualniony, aby uwzględnić te zmiany."
1973+
1974+#. Type: boolean
1975+#. Description
1976+#: ../elilo.templates:2001
1977+msgid ""
1978+"In most cases, if no manual changes to the EFI partition content need to be "
1979+"preserved, this update can be handled automatically."
1980+msgstr ""
1981+"W większości przypadków, jeśli nie ma potrzeby zachowania, dokonanych "
1982+"ręcznie, zmian w zawartości partycji EFI, uaktualnienie może zostać wykonane "
1983+"automatycznie."
1984
1985=== modified file 'debian/rules'
1986--- debian/rules 2011-08-22 21:17:34 +0000
1987+++ debian/rules 2013-12-06 20:30:39 +0000
1988@@ -7,13 +7,9 @@
1989
1990 buildarch := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
1991
1992-configure: configure-stamp
1993-configure-stamp:
1994- dh_testdir
1995-
1996- touch configure-stamp
1997-
1998-build: configure-stamp build-stamp
1999+build: build-arch build-indep
2000+build-arch: build-stamp
2001+build-indep: build-stamp
2002 build-stamp:
2003 dh_testdir
2004
2005@@ -34,7 +30,7 @@
2006 clean:
2007 dh_testdir
2008 dh_testroot
2009- rm -f build-stamp configure-stamp
2010+ rm -f build-stamp
2011
2012 [ ! -f Makefile ] || $(MAKE) clean
2013
2014@@ -107,4 +103,4 @@
2015 dh_builddeb
2016
2017 binary: binary-indep binary-arch
2018-.PHONY: build clean binary-indep binary-arch binary install configure
2019+.PHONY: build-indep build-arch build clean binary-indep binary-arch binary install
2020
2021=== modified file 'devschemes/Makefile'
2022--- devschemes/Makefile 2009-11-01 22:37:21 +0000
2023+++ devschemes/Makefile 2013-12-06 20:30:39 +0000
2024@@ -23,15 +23,10 @@
2025 # to use this program.
2026 #
2027
2028-SRCDIR = .
2029-
2030-VPATH = $(SRCDIR)
2031-
2032-include $(SRCDIR)/../Make.defaults
2033-include $(SRCDIR)/../Make.rules
2034-
2035-TOPDIR=$(SRCDIR)/..
2036-
2037+include ../Make.defaults
2038+include ../Make.rules
2039+
2040+TOPDIR=$(CDIR)/..
2041
2042 FILES=simple.o
2043
2044@@ -45,7 +40,7 @@
2045 # without doing make clean.
2046 #
2047 $(TARGET): $(FILES)
2048- $(LD) $(LD3264) -r -o $@ $(FILES)
2049+ $(LD) -r -o $@ $(FILES)
2050
2051 clean:
2052 $(RM) -f $(TARGET) $(FILES)
2053
2054=== modified file 'elilo.c'
2055--- elilo.c 2011-08-22 21:17:34 +0000
2056+++ elilo.c 2013-12-06 20:30:39 +0000
2057@@ -95,7 +95,7 @@
2058 INTN
2059 kernel_load(EFI_HANDLE image, CHAR16 *kname, kdesc_t *kd, memdesc_t *imem, memdesc_t *mmem)
2060 {
2061- CHAR16 kernel[CMDLINE_MAXLEN];
2062+ CHAR16 kernel[FILENAME_MAXLEN];
2063
2064 /*
2065 * Do the vm image switch here
2066
2067=== modified file 'elilo.h'
2068--- elilo.h 2011-08-22 21:17:34 +0000
2069+++ elilo.h 2013-12-06 20:30:39 +0000
2070@@ -29,7 +29,7 @@
2071 #ifndef __ELILO_H__
2072 #define __ELILO_H__
2073
2074-#define ELILO_VERSION L"3.12"
2075+#define ELILO_VERSION L"3.14"
2076
2077 #include <efi.h>
2078
2079@@ -54,6 +54,10 @@
2080 #define ROUNDUP(x,a) (((x) + (a) - 1) & ~((a) - 1))
2081 #define ROUNDDOWN(x,a) ((x) & ~((a) - 1))
2082
2083+#ifndef UINT32_MAX
2084+#define UINT32_MAX ((UINT32)-1)
2085+#endif
2086+
2087 /*
2088 * Elilo Boot modes
2089 */
2090@@ -65,7 +69,8 @@
2091 #define ELILO_DEFAULT_TIMEOUT ELILO_TIMEOUT_INFINITY
2092 #define ELILO_TIMEOUT_INFINITY (~0UL)
2093
2094-#define CMDLINE_MAXLEN 512 /* needed by ia32 */
2095+#define CMDLINE_MAXLEN 2048
2096+#define PATHNAME_MAXLEN 512
2097 #define FILENAME_MAXLEN 256
2098 #define MAX_ARGS 256
2099 /* Just pick an arbitrary number that's high enough for now :o) */
2100@@ -212,6 +217,7 @@
2101 extern INTN sysdeps_getopt(INTN, INTN, CHAR16 *);
2102 extern VOID sysdeps_print_cmdline_opts(VOID);
2103 extern INTN sysdeps_register_options(VOID);
2104+extern VOID *sysdeps_checkfix_initrd(VOID *, memdesc_t *);
2105
2106 #define CHAR_SLASH L'/'
2107 #define CHAR_BACKSLASH L'\\'
2108
2109=== modified file 'fileops.c'
2110--- fileops.c 2008-06-19 19:06:08 +0000
2111+++ fileops.c 2013-12-06 20:30:39 +0000
2112@@ -497,7 +497,7 @@
2113
2114 str2 = str == NULL ? L"Unknown" : str;
2115
2116- DBG_PRT((L"%s : %-8s : %s\n", dev_tab[idx].name,
2117+ DBG_PRT((L"%s : %-8s : %s", dev_tab[idx].name,
2118 (dev_tab[idx].fops ? dev_tab[idx].fops->name: L"N/A"), str2));
2119
2120 if (str) FreePool(str);
2121
2122=== modified file 'fs/Makefile'
2123--- fs/Makefile 2009-11-01 22:37:21 +0000
2124+++ fs/Makefile 2013-12-06 20:30:39 +0000
2125@@ -23,15 +23,10 @@
2126 # to use this program.
2127 #
2128
2129-SRCDIR = .
2130-
2131-VPATH = $(SRCDIR)
2132-
2133-include $(SRCDIR)/../Make.defaults
2134-include $(SRCDIR)/../Make.rules
2135-
2136-TOPDIR=$(SRCDIR)/..
2137-
2138+include ../Make.defaults
2139+include ../Make.rules
2140+
2141+TOPDIR=$(CDIR)/..
2142
2143 FILES=
2144 ifeq ($(CONFIG_localfs),y)
2145@@ -59,17 +54,13 @@
2146 # XXX: does not trigger recompile when changing filesystem selection
2147 # without doing make clean.
2148 #
2149-$(TARGET): check-filesystems $(TOPDIR)/Make.defaults $(FILES)
2150- $(LD) $(LD3264) -r -o $@ $(FILES)
2151-
2152-clean:
2153- $(RM) -f $(TARGET) $(FILES)
2154-
2155-check-filesystems:
2156- @if [ -n "$(FILES)" ]; then \
2157- exit 0; \
2158- else \
2159+$(TARGET): $(TOPDIR)/Make.defaults $(FILES)
2160+ @if [ -z "$(FILES)" ]; then \
2161 echo "You need to define at least one filesystem in Make.defaults"; \
2162 exit 1; \
2163 fi
2164+ $(LD) -r -o $@ $(FILES)
2165+
2166+clean:
2167+ $(RM) -f $(TARGET) $(FILES)
2168
2169
2170=== modified file 'fs/localfs.c'
2171--- fs/localfs.c 2008-06-19 19:06:08 +0000
2172+++ fs/localfs.c 2013-12-06 20:30:39 +0000
2173@@ -98,7 +98,7 @@
2174
2175 DBG_PRT((L"localfs_open on %s\n", name));
2176
2177- status = uefi_call_wrapper(lfs->volume->Open, 5, lfs->volume, &fh, name, EFI_FILE_MODE_READ, 0);
2178+ status = uefi_call_wrapper(lfs->volume->Open, 5, lfs->volume, &fh, name, EFI_FILE_MODE_READ, (UINT64)0);
2179 if (status == EFI_SUCCESS) {
2180 *fd = LOCALFS_F2FD(fh);
2181 }
2182
2183=== modified file 'glue_netfs.c'
2184--- glue_netfs.c 2011-08-22 21:17:34 +0000
2185+++ glue_netfs.c 2013-12-06 20:30:39 +0000
2186@@ -65,6 +65,19 @@
2187 static CHAR16 *hexa=L"0123456789ABCDEF";
2188
2189 static VOID
2190+convert_mac2hex(UINT8 *hw_addr,INTN l, CHAR16 *str)
2191+{
2192+ UINTN i;
2193+
2194+ for (i=0 ; i < l; i++) {
2195+ str[3*i] = hexa[(hw_addr[i] & 0xf0)>>4];
2196+ str[3*i+1] = hexa[hw_addr[i] & 0x0f];
2197+ str[3*i+2] = ':';
2198+ }
2199+ str[3*l-1]='\0';
2200+}
2201+
2202+static VOID
2203 convert_ip2hex(UINT8 *ip, INTN l, CHAR16 *str)
2204 {
2205 UINTN i;
2206@@ -153,6 +166,8 @@
2207 set_var(VAR_NETFS_DOMAINAME, info.domainame);
2208
2209 if (info.using_pxe) {
2210+ DBG_PRT((L"netfs_setdefaults: using_pxe"));
2211+
2212 status = netfs->netfs_query_layer(netfs, 0, NETFS_CONFIG_LAYER, maxlen, config[0].fname);
2213 if (EFI_ERROR(status)) {
2214 StrnCpy(config[0].fname, NETFS_DEFAULT_CONFIG, maxlen-1);
2215@@ -181,6 +196,8 @@
2216 # endif
2217
2218 # define CONFIG_EXTENSION L".conf\0"
2219+
2220+ DBG_PRT((L"netfs_setdefaults: machine specific (!using_pxe)"));
2221 /*
2222 * will try machine/subnet specific files first.
2223 * the filenames are constructed based on the IP(v4) address
2224@@ -206,6 +223,12 @@
2225
2226 StrnCpy(config[6].fname, str, maxlen-1);
2227 StrnCpy(config[6].fname+2, CONFIG_EXTENSION, 6);
2228+
2229+ /* use the MAC address as a possible file name as well */
2230+ convert_mac2hex(info.hw_addr,6,str);
2231+ StrnCpy(config[7].fname, str, maxlen-1);
2232+ StrnCpy(config[7].fname+17, CONFIG_EXTENSION, 6);
2233+
2234 #else
2235 StrnCpy(config[0].fname, NETFS_DEFAULT_CONFIG, maxlen-1);
2236 config[0].fname[maxlen-1] = CHAR_NULL;
2237
2238=== modified file 'ia32/Makefile'
2239--- ia32/Makefile 2010-03-15 16:24:32 +0000
2240+++ ia32/Makefile 2013-12-06 20:30:39 +0000
2241@@ -23,15 +23,10 @@
2242 # to use this program.
2243 #
2244
2245-SRCDIR = .
2246-
2247-VPATH = $(SRCDIR)
2248-
2249-include $(SRCDIR)/../Make.defaults
2250-include $(SRCDIR)/../Make.rules
2251-
2252-TOPDIR=$(SRCDIR)/..
2253-
2254+include ../Make.defaults
2255+include ../Make.rules
2256+
2257+TOPDIR=$(CDIR)/..
2258
2259 FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
2260
2261@@ -42,13 +37,13 @@
2262 system.o: rmswitch.h
2263
2264 rmswitch.h: bin_to_h.c rmswitch.S
2265- $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
2266- $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
2267+ $(CC) -o bin_to_h bin_to_h.c
2268+ $(AS) -o rmswitch.o rmswitch.S
2269 $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
2270 ./bin_to_h <rmswitch >rmswitch.h
2271
2272 $(TARGET): $(FILES)
2273- $(LD) $(LD3264) -r -o $@ $(FILES)
2274+ $(LD) -r -o $@ $(FILES)
2275
2276 clean:
2277 $(RM) -f $(TARGET) $(FILES)
2278
2279=== modified file 'ia32/bzimage.c'
2280--- ia32/bzimage.c 2011-08-22 21:17:34 +0000
2281+++ ia32/bzimage.c 2013-12-06 20:30:39 +0000
2282@@ -169,7 +169,7 @@
2283 kernel_start));
2284 }
2285
2286- kernel_load_address = kernel_start;
2287+ kernel_load_address = NULL; /* allocate anywhere! */
2288
2289 if (alloc_kmem(kernel_start, EFI_SIZE_TO_PAGES(kernel_size)) != 0) {
2290 /*
2291
2292=== modified file 'ia32/system.c'
2293--- ia32/system.c 2009-12-08 23:48:32 +0000
2294+++ ia32/system.c 2013-12-06 20:30:39 +0000
2295@@ -149,6 +149,12 @@
2296 return 0;
2297 }
2298
2299+VOID *
2300+sysdeps_checkfix_initrd(VOID *start_addr, memdesc_t *imem)
2301+{
2302+ return start_addr;
2303+}
2304+
2305 VOID
2306 sysdeps_free_boot_params(boot_params_t *bp)
2307 {
2308@@ -201,7 +207,19 @@
2309 (VOID **)Gop_handle);
2310
2311 if (EFI_ERROR(efi_status) && efi_status != EFI_BUFFER_TOO_SMALL) {
2312- ERR_PRT((L"LocateHandle GopProtocol failed."));
2313+ Print(L"LocateHandle GopProtocol failed.\n");
2314+ Print(L"--Either no graphics head is installed,\n" \
2315+ "--efi console is set to serial, or,\n" \
2316+ "--the EFI firmware version of this machine is\n" \
2317+ "--older than UEFI 2.0. and does not support GOP");
2318+ Print(L"you can SAFELY IGNORE this error. elilo will\n" \
2319+ "default to text-mode.\n Alternatively you can " \
2320+ "now force text mode by setting config variable\n" \
2321+ "text_mode=1 for x86 in elilo.conf or via cmdline.\n\n");
2322+ Print(L"However if this is the last text output you see\n" \
2323+ "ensure that your kernel console command line\n " \
2324+ "variable matches up with the actual efi boot menu\n" \
2325+ "console output settings. for example efi console\n\n");
2326 return -1;
2327 }
2328 Gop_handle = alloc(size, 0);
2329
2330=== modified file 'ia64/Makefile'
2331--- ia64/Makefile 2009-11-01 22:37:21 +0000
2332+++ ia64/Makefile 2013-12-06 20:30:39 +0000
2333@@ -23,15 +23,10 @@
2334 # to use this program.
2335 #
2336
2337-SRCDIR = .
2338-
2339-VPATH = $(SRCDIR)
2340-
2341-include $(SRCDIR)/../Make.defaults
2342-include $(SRCDIR)/../Make.rules
2343-
2344-TOPDIR=$(SRCDIR)/..
2345-
2346+include ../Make.defaults
2347+include ../Make.rules
2348+
2349+TOPDIR=$(CDIR)/..
2350
2351 FILES=system.o config.o fpswa.o plain_loader.o gzip_loader.o \
2352 gzip.o memset.o memcpy.o setjmp.o longjmp.o
2353
2354=== modified file 'ia64/system.c'
2355--- ia64/system.c 2009-11-01 22:37:21 +0000
2356+++ ia64/system.c 2013-12-06 20:30:39 +0000
2357@@ -140,6 +140,12 @@
2358 return 0;
2359 }
2360
2361+VOID *
2362+sysdeps_checkfix_initrd(VOID *start_addr, memdesc_t *imem)
2363+{
2364+ return start_addr;
2365+}
2366+
2367 /* Flush data cache [addr; addr + len], and sync with icache. */
2368 void
2369 flush_dcache (CHAR8 *addr, UINT64 len)
2370
2371=== modified file 'initrd.c'
2372--- initrd.c 2009-12-08 23:48:32 +0000
2373+++ initrd.c 2013-12-06 20:30:39 +0000
2374@@ -41,7 +41,11 @@
2375 load_file(CHAR16 *filename, memdesc_t *image)
2376 {
2377 EFI_STATUS status;
2378- VOID *start_addr = NULL;
2379+ /*
2380+ * Actually using the value from sysdeps_initrd_get_addr()
2381+ * instead of NULL is no change for ia64!
2382+ */
2383+ VOID *start_addr = image->start_addr;
2384 UINTN pgcnt;
2385 UINT64 size = 0;
2386 fops_fd_t fd;
2387@@ -71,7 +75,11 @@
2388 /* round up to get required number of pages (4KB) */
2389 image->pgcnt = pgcnt = EFI_SIZE_TO_PAGES(image->size);
2390
2391- start_addr = alloc_pages(pgcnt, EfiLoaderData, start_addr ? AllocateAddress : AllocateAnyPages, 0 );
2392+ start_addr = alloc_pages(pgcnt, EfiLoaderData,
2393+ start_addr ? AllocateAddress : AllocateAnyPages, start_addr);
2394+
2395+ start_addr = sysdeps_checkfix_initrd(start_addr, image);
2396+
2397 if (start_addr == NULL) {
2398 ERR_PRT((L"Failed to allocate %d pages for %s image", pgcnt,
2399 filename));
2400
2401=== modified file 'strops.c'
2402--- strops.c 2004-02-14 22:21:36 +0000
2403+++ strops.c 2013-12-06 20:30:39 +0000
2404@@ -41,11 +41,11 @@
2405 {
2406 CHAR16 *res = dst;
2407
2408- while (size-- && (*dst++ = *src++) != CHAR_NULL);
2409+ while (size && size-- && (*dst++ = *src++) != CHAR_NULL);
2410 /*
2411 * does the null padding
2412 */
2413- while (size-- > 0) *dst++ = CHAR_NULL;
2414+ while (size && size-- > 0) *dst++ = CHAR_NULL;
2415
2416 return res;
2417 }
2418@@ -55,11 +55,11 @@
2419 {
2420 CHAR8 *res = dst;
2421
2422- while (size-- && (*dst++ = (CHAR8)*src++) != '\0');
2423+ while (size && size-- && (*dst++ = (CHAR8)*src++) != '\0');
2424 /*
2425 * does the null padding
2426 */
2427- while (size-- > 0) *dst++ = '\0';
2428+ while (size && size-- > 0) *dst++ = '\0';
2429
2430 return res;
2431 }
2432@@ -76,11 +76,11 @@
2433 {
2434 CHAR8 *res = dst;
2435
2436- while (size-- && (*dst++ = *src++) != '\0');
2437+ while (size && size-- && (*dst++ = *src++) != '\0');
2438 /*
2439 * does the null padding
2440 */
2441- while (size-- > 0) *dst++ = '\0';
2442+ while (size && size-- > 0) *dst++ = '\0';
2443
2444 return res;
2445 }
2446
2447=== modified file 'tools/Makefile'
2448--- tools/Makefile 2009-11-01 22:37:21 +0000
2449+++ tools/Makefile 2013-12-06 20:30:39 +0000
2450@@ -23,15 +23,10 @@
2451 # to use this program.
2452 #
2453
2454-SRCDIR = .
2455-
2456-VPATH = $(SRCDIR)
2457-
2458-include $(SRCDIR)/../Make.defaults
2459-include $(SRCDIR)/../Make.rules
2460-
2461-TOPDIR=$(SRCDIR)/..
2462-
2463+include ../Make.defaults
2464+include ../Make.rules
2465+
2466+TOPDIR=$(CDIR)/..
2467
2468 FILES=eliloalt.o
2469 TARGET=eliloalt
2470
2471=== modified file 'tools/eliloalt.c'
2472--- tools/eliloalt.c 2004-02-14 22:21:36 +0000
2473+++ tools/eliloalt.c 2013-12-06 20:30:39 +0000
2474@@ -47,8 +47,10 @@
2475 #define ELILOALT_VERSION "0.02"
2476
2477 #define ELILO_ALT_NAME "EliloAlt"
2478-#define EFIVAR_DIR "/proc/efi/vars"
2479+#define EFIVAR_DIR "/sys/firmware/efi/vars"
2480+#define OFIVAR_DIR "/proc/efi/vars"
2481 #define ELILO_ALTVAR EFIVAR_DIR"/"ELILO_ALT_NAME"-00000000-0000-0000-0000-000000000000"
2482+#define OLILO_ALTVAR OFIVAR_DIR"/"ELILO_ALT_NAME"-00000000-0000-0000-0000-000000000000"
2483
2484 #define EFI_VARIABLE_NON_VOLATILE 0x0000000000000001
2485 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
2486@@ -80,7 +82,9 @@
2487 uint32_t attributes;
2488 } __attribute__((packed)) efi_variable_t;
2489
2490+static char *efivar_dir = EFIVAR_DIR;
2491 static char *elilo_alt_name = ELILO_ALT_NAME;
2492+static char *elilo_altvar = ELILO_ALTVAR;
2493
2494 static struct option cmd_options[]={
2495 { "version", 0, 0, 1},
2496@@ -129,9 +133,15 @@
2497 if (getuid() != 0) {
2498 fatal_error("This program must be run as root\n");
2499 }
2500- efi_vars = opendir(EFIVAR_DIR);
2501- if (efi_vars == NULL) {
2502- fatal_error("Cannot access %s\n", EFIVAR_DIR);
2503+ efi_vars = opendir(efivar_dir);
2504+ if (efi_vars == NULL) {
2505+ efivar_dir = OFIVAR_DIR;
2506+ elilo_altvar = OLILO_ALTVAR;
2507+ efi_vars = opendir(efivar_dir);
2508+ }
2509+ if (efi_vars == NULL) {
2510+ fatal_error("Can access neither %s nor %s\n",
2511+ EFIVAR_DIR, efivar_dir);
2512 }
2513 if (!find_entry) {
2514 closedir(efi_vars);
2515@@ -143,9 +153,10 @@
2516 break;
2517 }
2518 if (entry == NULL) {
2519- fatal_error("Cannot find entry in %s\n", EFIVAR_DIR);
2520+ fatal_error("Cannot find entry in %s\n", efivar_dir);
2521 }
2522- sprintf(name, "%s/%s", EFIVAR_DIR, entry->d_name);
2523+ snprintf(name, 1023, "%s/%s", efivar_dir, entry->d_name);
2524+ name[1023] = 0;
2525 closedir(efi_vars);
2526 return name;
2527 }
2528@@ -158,7 +169,7 @@
2529
2530 check_proc_efi(0);
2531
2532- fd = open(ELILO_ALTVAR, O_WRONLY);
2533+ fd = open(elilo_altvar, O_WRONLY);
2534 if (fd == -1) {
2535 fatal_error("variable not defined\n");
2536 }
2537@@ -176,7 +187,7 @@
2538
2539 r = write(fd, &var, sizeof(var));
2540 if (r != sizeof(var)) {
2541- fatal_error("Variable %s defined but invalid content\n", ELILO_ALTVAR);
2542+ fatal_error("Variable %s defined but invalid content\n", elilo_altvar);
2543 }
2544 close(fd);
2545 }
2546@@ -191,7 +202,7 @@
2547
2548 check_proc_efi(0);
2549
2550- fd = open(ELILO_ALTVAR, O_RDONLY);
2551+ fd = open(elilo_altvar, O_RDONLY);
2552 if (fd == -1) {
2553 fatal_error("variable not defined\n");
2554 }
2555@@ -200,7 +211,7 @@
2556
2557 r = read(fd, &var, sizeof(var));
2558 if (r != sizeof(var)) {
2559- fatal_error("Variable %s defined but invalid content\n", ELILO_ALTVAR);
2560+ fatal_error("Variable %s defined but invalid content\n", elilo_altvar);
2561 }
2562 printf("EliloAlt=\"");
2563 for(i=0; i < var.datasize; i+=1){
2564@@ -231,7 +242,7 @@
2565
2566 fd = open(name, O_WRONLY);
2567 if (fd == -1) {
2568- fatal_error("can't open %s: %s\n", ELILO_ALTVAR, strerror(errno));
2569+ fatal_error("can't open %s: %s\n", elilo_altvar, strerror(errno));
2570 }
2571
2572 memset(&var, 0, sizeof(var));
2573@@ -256,7 +267,7 @@
2574
2575 r = write(fd, &var, sizeof(var));
2576 if (r != sizeof(var)) {
2577- fatal_error("Variable %s defined but invalid content %d\n", ELILO_ALTVAR, r);
2578+ fatal_error("Variable %s defined but invalid content %d\n", elilo_altvar, r);
2579 }
2580 close(fd);
2581
2582
2583=== modified file 'x86_64/Makefile'
2584--- x86_64/Makefile 2011-08-22 21:17:34 +0000
2585+++ x86_64/Makefile 2013-12-06 20:30:39 +0000
2586@@ -23,15 +23,10 @@
2587 # to use this program.
2588 #
2589
2590-SRCDIR = .
2591-
2592-VPATH = $(SRCDIR)
2593-
2594-include $(SRCDIR)/../Make.defaults
2595-include $(SRCDIR)/../Make.rules
2596-
2597-TOPDIR=$(SRCDIR)/..
2598-
2599+include ../Make.defaults
2600+include ../Make.rules
2601+
2602+TOPDIR=$(CDIR)/..
2603
2604 FILES=system.o config.o bzimage.o plain_loader.o gzip_loader.o gzip.o
2605 #FILES=system.o config.o plain_loader.o
2606@@ -43,13 +38,13 @@
2607 system.o: rmswitch.h
2608
2609 rmswitch.h: bin_to_h.c rmswitch.S
2610- $(CC) -o bin_to_h $(SRCDIR)/bin_to_h.c
2611- $(AS) -o rmswitch.o $(SRCDIR)/rmswitch.S
2612+ $(CC) -o bin_to_h bin_to_h.c
2613+ $(AS) -o rmswitch.o rmswitch.S
2614 $(LD) -Ttext 0x0 -s --oformat binary -o rmswitch rmswitch.o
2615 ./bin_to_h <rmswitch >rmswitch.h
2616
2617 $(TARGET): $(FILES)
2618- $(LD) $(LD3264) -r -o $@ $(FILES)
2619+ $(LD) -r -o $@ $(FILES)
2620
2621 clean:
2622 $(RM) -f $(TARGET) $(FILES)
2623
2624=== modified file 'x86_64/bzimage.c'
2625--- x86_64/bzimage.c 2011-08-22 21:17:34 +0000
2626+++ x86_64/bzimage.c 2013-12-06 20:30:39 +0000
2627@@ -36,6 +36,129 @@
2628
2629 UINTN kernel_size = 0x800000; /* 8M (default x86_64 bzImage size limit) */
2630
2631+static VOID *
2632+bzImage_alloc()
2633+{
2634+ UINTN pages = EFI_SIZE_TO_PAGES(kernel_size);
2635+ int reloc_kernel = 0;
2636+ VOID *kla, *kend = kernel_start + kernel_size;
2637+ UINT32 kalign, kmask;
2638+ boot_params_t *ps = param_start;
2639+
2640+ /*
2641+ * Get address for kernel from header, if applicable & available.
2642+ */
2643+ if ((ps->s.hdr_major < 2) ||
2644+ (ps->s.hdr_major == 2 && ps->s.hdr_minor < 5)) {
2645+ reloc_kernel = 0;
2646+ } else {
2647+ if (ps->s.kernel_start >= DEFAULT_KERNEL_START)
2648+ kernel_start = (void *)(UINT64)ps->s.kernel_start;
2649+ reloc_kernel = ps->s.relocatable_kernel;
2650+ kalign = ps->s.kernel_alignment;
2651+ kmask = kalign - 1;
2652+ VERB_PRT(3, Print(L"kernel header (%d.%d) suggests kernel "
2653+ "start at address "PTR_FMT" (%srelocatable!)\n",
2654+ ps->s.hdr_major, ps->s.hdr_minor, ps->s.kernel_start,
2655+ (reloc_kernel ? L"": L"not ")));
2656+ }
2657+
2658+ /*
2659+ * Best effort for old (< 2.6.20) and non-relocatable kernels
2660+ */
2661+ if (alloc_kmem(kernel_start, pages) == 0) {
2662+ VERB_PRT(3, Print(L"kernel_start: "PTR_FMT" kernel_size: %d\n",
2663+ kernel_start, kernel_size));
2664+ return kernel_start;
2665+ } else if ( ! reloc_kernel ) {
2666+ /*
2667+ * Couldn't get desired address--just load it anywhere and
2668+ * (try to) move it later. It's the only chance for non-
2669+ * relocatable kernels, but it breaks occassionally...
2670+ */
2671+ ERR_PRT((L"Kernel header (%d.%d) suggests kernel "
2672+ "start at address "PTR_FMT" (non relocatable!)\n"
2673+ "This address is not available, so an attempt"
2674+ "is made to copy the kernel there later on\n"
2675+ "BEWARE: this is unsupported and may not work. "
2676+ "Please update your kernel.\n",
2677+ ps->s.hdr_major, ps->s.hdr_minor, ps->s.kernel_start));
2678+ kla = (VOID *)(UINT32_MAX - kernel_size);
2679+ /* NULL would preserve the "anywhere" semantic, */
2680+ /* but it would not prevent allocation above 4GB! */
2681+
2682+ if (alloc_kmem_anywhere(&kla, pages) != 0) {
2683+ /* out of luck */
2684+ return NULL;
2685+ }
2686+ VERB_PRT(3, Print(L"kernel_start: "PTR_FMT
2687+ " kernel_size: %d loading at: "PTR_FMT"\n",
2688+ kernel_start, kernel_size, kla));
2689+ return kla;
2690+ }
2691+
2692+
2693+ /* Is 'ps->s.kernel_alignment' guaranteed to be sane? */
2694+ if (kalign < EFI_PAGE_SIZE) {
2695+ kalign = EFI_PAGE_SIZE;
2696+ kmask = EFI_PAGE_MASK;
2697+ }
2698+ DBG_PRT((L"alignment: kernel=0x%x efi_page=0x%x : 0x%x\n",
2699+ ps->s.kernel_alignment, EFI_PAGE_SIZE, kalign));
2700+
2701+ /*
2702+ * Couldn't get the preferred address, but luckily it's
2703+ * a relocatable kernel, so ...
2704+ *
2705+ * 1. use 'find_kernel_memory()' (like Itanium)
2706+ * 2. try out the 16 lowest possible aligned addresses (> 0)
2707+ * 3. get enough memory to align "creatively"
2708+ * 4. forget alignment (and start praying)...
2709+ */
2710+
2711+ /* 1. */
2712+ if ((find_kernel_memory(kernel_start, kend, kalign, &kla) != 0) ||
2713+ (alloc_kmem(kla, pages) != 0)) {
2714+ kla = NULL;
2715+ }
2716+
2717+ /* 2. */
2718+ if ( ! kla && (UINT64)kernel_start < kalign ) {
2719+ int i;
2720+ for ( i = 1; i < 16 && !kla; i++ ) {
2721+ VOID *tmp = (VOID *)((UINT64)kalign * i);
2722+ if (alloc_kmem(tmp, pages) == 0) {
2723+ kla = tmp;
2724+ }
2725+ }
2726+ }
2727+
2728+ /* 3. */
2729+ if ( ! kla ) {
2730+ UINTN apages = EFI_SIZE_TO_PAGES(kernel_size + kmask);
2731+ kla = (VOID *)(UINT32_MAX - kernel_size - kmask);
2732+
2733+ if (alloc_kmem_anywhere(&kla, apages) == 0) {
2734+ kla = (VOID *)(((UINT64)kla + kmask) & ~kmask);
2735+ } else {
2736+ kla = NULL;
2737+ }
2738+ }
2739+
2740+ /* 4. last resort */
2741+ if ( ! kla ) {
2742+ kla = (VOID *)(UINT32_MAX - kernel_size);
2743+ if (alloc_kmem_anywhere(&kla, pages) != 0) {
2744+ return NULL;
2745+ }
2746+ }
2747+
2748+ kernel_start = kla;
2749+ VERB_PRT(1, Print(L"relocating kernel_start: "PTR_FMT
2750+ " kernel_size: %d\n", kernel_start, kernel_size));
2751+ return kla;
2752+}
2753+
2754 static INTN
2755 bzImage_probe(CHAR16 *kname)
2756 {
2757@@ -158,53 +281,34 @@
2758 * Allocate memory for kernel.
2759 */
2760
2761- /*
2762- * Get correct address for kernel from header, if applicable & available.
2763- */
2764- if ((param_start->s.hdr_major == 2) &&
2765- (param_start->s.hdr_minor >= 6) &&
2766- (param_start->s.kernel_start >= DEFAULT_KERNEL_START)) {
2767- kernel_start = (void *)param_start->s.kernel_start;
2768- VERB_PRT(3, Print(L"kernel header suggests kernel start at address "PTR_FMT"\n",
2769- kernel_start));
2770- }
2771-
2772- kernel_load_address = kernel_start;
2773-
2774- if (alloc_kmem(kernel_start, EFI_SIZE_TO_PAGES(kernel_size)) != 0) {
2775- /*
2776- * Couldn't get desired address--just load it anywhere and move it later.
2777- * (Easier than relocating kernel, and also works with non-relocatable kernels.)
2778- */
2779- if (alloc_kmem_anywhere(&kernel_load_address, EFI_SIZE_TO_PAGES(kernel_size)) != 0) {
2780- ERR_PRT((L"Could not allocate memory for kernel."));
2781- free(param_start);
2782- param_start = NULL;
2783- param_size = 0;
2784- fops_close(fd);
2785- return -1;
2786- }
2787- }
2788-
2789- VERB_PRT(3, Print(L"kernel_start: "PTR_FMT" kernel_size: %d loading at: "PTR_FMT"\n",
2790- kernel_start, kernel_size, kernel_load_address));
2791+ kernel_load_address = bzImage_alloc();
2792+ if ( ! kernel_load_address ) {
2793+ ERR_PRT((L"Could not allocate memory for kernel."));
2794+ free(param_start);
2795+ param_start = NULL;
2796+ param_size = 0;
2797+ fops_close(fd);
2798+ return -1;
2799+ }
2800
2801 /*
2802 * Now read the rest of the kernel image into memory.
2803 */
2804
2805- DBG_PRT((L"reading kernel image...\n"));
2806+ Print(L"Loading kernel %s... ", kname);
2807
2808 size = kernel_size;
2809 efi_status = fops_read(fd, kernel_load_address, &size);
2810 if (EFI_ERROR(efi_status) || size < 0x10000) {
2811- ERR_PRT((L"Error reading kernel image %s.", kname));
2812+ ERR_PRT((L"Error reading kernel image (0x%x).", efi_status));
2813 free(param_start);
2814 param_start = NULL;
2815 param_size = 0;
2816 fops_close(fd);
2817 free_kmem();
2818 return -1;
2819+ } else {
2820+ Print(L" done\n");
2821 }
2822
2823 DBG_PRT((L"kernel image read: %d bytes, %d Kbytes\n", size, size / 1024));
2824
2825=== modified file 'x86_64/config.c'
2826--- x86_64/config.c 2008-06-19 19:06:08 +0000
2827+++ x86_64/config.c 2013-12-06 20:30:39 +0000
2828@@ -33,15 +33,23 @@
2829
2830 typedef struct {
2831 UINTN legacy_free_boot;
2832+ UINTN text_mode;
2833 } x86_64_global_config_t;
2834
2835
2836+#define x86_64_opt_offsetof(option) (&((sys_img_options_t *)(0x0))->option)
2837+
2838 static x86_64_global_config_t x86_64_gconf;
2839
2840 static config_option_t sysdeps_global_options[]={
2841 {OPT_BOOL, OPT_GLOBAL, L"legacy-free", NULL, NULL, &x86_64_gconf.legacy_free_boot}
2842 };
2843
2844+static config_option_t sysdeps_image_options[]={
2845+ {OPT_BOOL, OPT_IMAGE_SYS, L"text-mode", NULL, NULL, x86_64_opt_offsetof(text_mode)}
2846+};
2847+
2848+
2849 /*
2850 * X86_64 operations that need to be done only once and just before
2851 * entering the main loop of the loader
2852@@ -81,6 +89,14 @@
2853 return x86_64_gconf.legacy_free_boot ? 1 : 0;
2854 }
2855
2856+
2857+INTN
2858+x86_64_text_mode(VOID)
2859+{
2860+ return (elilo_opt.sys_img_opts &&
2861+ elilo_opt.sys_img_opts->text_mode == TRUE) ? 1 : 0;
2862+}
2863+
2864 INTN
2865 sysdeps_register_options(VOID)
2866 {
2867@@ -89,14 +105,11 @@
2868 ret = register_config_options(sysdeps_global_options,
2869 sizeof(sysdeps_global_options)/sizeof(config_option_t),
2870 OPTIONS_GROUP_GLOBAL);
2871-#if 0
2872- /* no per image options yet */
2873 if (ret == -1 ) return ret;
2874
2875 ret = register_config_options(sysdeps_image_options,
2876 sizeof(sysdeps_image_options)/sizeof(config_option_t),
2877 OPTIONS_GROUP_IMAGE);
2878-#endif
2879
2880 return ret;
2881 }
2882
2883=== modified file 'x86_64/sysdeps.h'
2884--- x86_64/sysdeps.h 2009-12-08 23:48:32 +0000
2885+++ x86_64/sysdeps.h 2013-12-06 20:30:39 +0000
2886@@ -107,12 +107,12 @@
2887 /* 0x06 */ UINT8 orig_video_mode; /* LDR */
2888 /* 0x07 */ UINT8 orig_video_cols; /* LDR */
2889
2890-/* 0x08 */ UINT16 unused_1; /* unused */
2891+/* 0x08 */ UINT16 pad_1; /* unused */
2892
2893 /* %%TBD */
2894 /* 0x0A */ UINT16 orig_ega_bx; /* LDR */
2895
2896-/* 0x0C */ UINT16 unused_2; /* unused */
2897+/* 0x0C */ UINT16 pad_2; /* unused */
2898
2899 /* Screen height before passing control to kernel. */
2900 /* 0x0E */ UINT8 orig_video_rows; /* LDR */
2901@@ -174,7 +174,7 @@
2902 /* 0x4E */ UINT32 bios_code_len; /* LDR */
2903 /* 0x52 */ UINT16 bios_data_len; /* LDR */
2904
2905-/* 0x54 */ UINT8 unused_3[0x2C]; /* unused */
2906+/* 0x54 */ UINT8 pad_3[0x2C]; /* unused */
2907
2908 /* %%TBD */
2909 /* 0x80 */ UINT8 hd0_info[0x10]; /* LDR */
2910@@ -184,7 +184,7 @@
2911 /* 0xA0 */ UINT16 mca_info_len; /* LDR */
2912 /* 0xA2 */ UINT8 mca_info_buf[0x10]; /* LDR */
2913
2914-/* 0xB2 */ UINT8 unused_4[0x10E]; /* unused */
2915+/* 0xB2 */ UINT8 pad_4[0x10E]; /* unused */
2916
2917 /* EFI boot loader signature. */
2918 /* 0x1C0 */ UINT8 efi_loader_sig[4]; /* LDR */
2919@@ -209,9 +209,9 @@
2920 /* Available contiguous extended memory in KB. */
2921 /* 0x1E0 */ UINT32 alt_mem_k; /* LDR */
2922
2923-/* 0x1E4 */ UINT32 unused_51; /* unused */
2924+/* 0x1E4 */ UINT32 pad_51; /* unused */
2925 /* 0x1E8 */ UINT8 e820_nrmap;
2926-/* 0x1E9 */ UINT32 unused_52[2]; /* unused */
2927+/* 0x1E9 */ UINT32 pad_52[2]; /* unused */
2928
2929 /* Size of setup code in sectors (1 sector == 512 bytes). */
2930 /* 0x1F1 */ UINT8 setup_sectors; /* BLD */
2931@@ -220,15 +220,10 @@
2932 /* 0x1F2 */ UINT16 mount_root_rdonly; /* BLD */
2933
2934 /* %%TBD */
2935-/* 0x1F4 */ UINT16 sys_size; /* BLD */
2936-
2937-/* %%TBD */
2938-/* 0x1F6 */ UINT16 swap_dev; /* BLD */
2939-
2940-/* %%TBD */
2941-/* 0x1F8 */ UINT16 ramdisk_flags; /* BLD */
2942-#define RAMDISK_PROMPT 0x8000
2943-#define RAMDISK_LOAD 0x4000
2944+/* 0x1F4 */ UINT32 sys_size; /* BLD */
2945+
2946+/* %%TBD */
2947+/* 0x1F8 */ UINT16 ram_size_DNU; /* BLD */
2948
2949 /* %%TBD */
2950 /* 0x1FA */ UINT16 video_mode_flag; /* BLD */
2951@@ -236,12 +231,8 @@
2952 /* %%TBD */
2953 /* 0x1FC */ UINT16 orig_root_dev; /* BLD */
2954
2955-/* 0x1FE */ UINT8 unused_6; /* unused */
2956-
2957 /* %%TBD */
2958-/* 0x1FF */ UINT8 aux_dev_info; /* LDR */
2959-#define NO_MOUSE 0x00
2960-#define FOUND_MOUSE 0xAA
2961+/* 0x1FE */ UINT16 boot_flag; /* ? */
2962
2963 /* Jump past setup data (not used in EFI). */
2964 /* 0x200 */ UINT16 jump; /* BLD */
2965@@ -283,16 +274,21 @@
2966 /* 0x21C */ UINT32 initrd_size; /* LDR */
2967
2968 /* %%TBD */
2969-/* 0x220 */ UINT32 bootsect_helper; /* BLD */
2970+/* 0x220 */ UINT32 bootsect_helper_DNU; /* BLD */
2971
2972 /* %%TBD */
2973 /* 0x224 */ UINT16 heap_end_ptr; /* LDR */
2974
2975 /* %%TBD */
2976-/* 0x226 */ UINT16 unused_7; /* LDR */
2977+/* 0x226 */ UINT8 ext_loader_ver; /* LDR */
2978+/* 0x227 */ UINT8 ext_loader_type; /* LDR */
2979
2980 /* 0x228 */ UINT32 cmdline_addr; /* LDR */
2981-/* 0x22C */ UINT32 unused_8[41];
2982+/* 0x22C */ UINT32 initrd_addr_max; /* BLD */
2983+/* 0x230 */ UINT32 kernel_alignment; /* BLD */
2984+/* 0x234 */ UINT8 relocatable_kernel; /* BLD */
2985+/* 0x235 */ UINT8 pad_8[3];
2986+/* 0x238 */ UINT32 pad_9[38];
2987 /* 0x2D0 */ UINT8 e820_map[2560];
2988 } s;
2989 } boot_params_t;
2990@@ -368,6 +364,7 @@
2991 extern UINTN rmswitch_size;
2992
2993 extern INTN x86_64_use_legacy_free_boot();
2994+extern INTN x86_64_text_mode();
2995
2996 /*
2997 * How to jump to kernel code
2998@@ -382,7 +379,6 @@
2999 UINT16 kernel_cs;
3000 } jumpvector;
3001 VOID *jump_start;
3002- uint64_t temp;
3003
3004 /*
3005 * Disable interrupts.
3006@@ -390,22 +386,16 @@
3007 asm volatile ( "cli" : : );
3008
3009 /*
3010- * Relocate kernel (if needed), and initrd (if present).
3011- * Copy kernel first, in case kernel was loaded overlapping where we're
3012- * planning to copy the initrd. This assumes that the initrd didn't
3013- * get loaded overlapping where we're planning to copy the kernel, but
3014- * that's pretty unlikely since we couldn't alloc that space for the
3015- * kernel (or the kernel would already be there).
3016+ * Relocate kernel (if needed).
3017+ * This assumes that the initrd didn't get loaded overlapping where
3018+ * we're planning to copy the kernel, but that's pretty unlikely
3019+ * since we couldn't alloc that space for the kernel (or the kernel
3020+ * would already be there).
3021 */
3022 if (kernel_start != kernel_load_address) {
3023 MEMCPY(kernel_start, kernel_load_address, kernel_size);
3024 }
3025
3026- if (bp->s.initrd_start) {
3027- temp = bp->s.initrd_start;
3028- MEMCPY(INITRD_START, temp , bp->s.initrd_size);
3029- bp->s.initrd_start = INITRD_START;
3030- }
3031 /*
3032 * Copy boot sector, setup data and command line
3033 * to final resting place. We need to copy
3034@@ -468,7 +458,8 @@
3035 }
3036
3037 typedef struct sys_img_options {
3038- UINT8 nothing_yet;
3039+ UINT8 dummy; /* forces non-zero offset for first field */
3040+ UINT8 text_mode; /* do not try to initialize Graphics Output Protocol */
3041 } sys_img_options_t;
3042
3043 #endif /* __ELILO_SYSDEPS_X86_64_H__ */
3044
3045=== modified file 'x86_64/system.c'
3046--- x86_64/system.c 2009-12-08 23:48:32 +0000
3047+++ x86_64/system.c 2013-12-06 20:30:39 +0000
3048@@ -38,11 +38,19 @@
3049 */
3050 #include <efi.h>
3051 #include <efilib.h>
3052+#include <string.h>
3053
3054 #include "elilo.h"
3055 #include "loader.h"
3056 #include "rmswitch.h"
3057
3058+#define DEBUG_CREATE_BOOT_PARAMS 0
3059+#if DEBUG_CREATE_BOOT_PARAMS
3060+#define DPR(a) do { if (elilo_opt.debug) { Print a; } } while ( 0 )
3061+#else
3062+#define DPR(a)
3063+#endif
3064+
3065 extern loader_ops_t bzimage_loader, plain_loader, gzip_loader;
3066
3067 /*
3068@@ -105,14 +113,16 @@
3069 UINTN high_ext_mem = 32 * 1024 * 1024;
3070
3071 /* This starting address will hold true for all of the loader types for now */
3072-VOID *kernel_start = (void *)DEFAULT_KERNEL_START;
3073+VOID *kernel_start = (VOID *)DEFAULT_KERNEL_START;
3074
3075 /* The kernel may load elsewhere if EFI firmware reserves kernel_start */
3076-VOID *kernel_load_address = DEFAULT_KERNEL_START;
3077+VOID *kernel_load_address = (VOID *)DEFAULT_KERNEL_START;
3078
3079 VOID *initrd_start = NULL;
3080 UINTN initrd_size = 0;
3081
3082+INTN e820_map_overflow = 0;
3083+
3084 INTN
3085 sysdeps_init(EFI_HANDLE dev)
3086 {
3087@@ -131,10 +141,8 @@
3088 /*
3089 * initrd_get_addr()
3090 * Compute a starting address for the initial RAMdisk image.
3091- * For now, this image is placed immediately after the end of
3092- * the kernel memory. Inside the start_kernel() code, the
3093- * RAMdisk image will be relocated to the top of available
3094- * extended memory.
3095+ * For now we suggest 'initrd_addr_max' with room for 32MB,
3096+ * as image->pgcnt is not initialized yet.
3097 */
3098 INTN
3099 sysdeps_initrd_get_addr(kdesc_t *kd, memdesc_t *imem)
3100@@ -146,10 +154,12 @@
3101 return -1;
3102 }
3103
3104- VERB_PRT(3, Print(L"kstart="PTR_FMT" kentry="PTR_FMT" kend="PTR_FMT"\n",
3105- kd->kstart, kd->kentry, kd->kend));
3106+ VERB_PRT(3, Print(L"initrd_addr_max="PTR_FMT" reserve=%d\n",
3107+ param_start->s.initrd_addr_max, 32*MB));
3108
3109- imem->start_addr = kd->kend;
3110+ imem->start_addr = (VOID *)
3111+ (((UINT64)param_start->s.initrd_addr_max - 32*MB + 1)
3112+ & ~EFI_PAGE_MASK);
3113
3114 VERB_PRT(3, Print(L"initrd start_addr="PTR_FMT" pgcnt=%d\n",
3115 imem->start_addr, imem->pgcnt));
3116@@ -157,6 +167,48 @@
3117 return 0;
3118 }
3119
3120+
3121+/*
3122+ * checkfix_initrd()
3123+ * Check and possibly fix allocation of initrd memory.
3124+ */
3125+VOID *
3126+sysdeps_checkfix_initrd(VOID *start_addr, memdesc_t *imem)
3127+{
3128+ UINTN pgcnt = EFI_SIZE_TO_PAGES(imem->size);
3129+ UINT64 initrd_addr_max = (UINT64)param_start->s.initrd_addr_max;
3130+ UINT64 ki_max = initrd_addr_max - imem->size + 1;
3131+ VOID *ki_max_addr;
3132+
3133+ VERB_PRT( 3, Print(L"loadfile: start_addr="PTR_FMT
3134+ " ki_max_addr="PTR_FMT"\n", start_addr, (VOID *)ki_max));
3135+ if (ki_max > UINT32_MAX) {
3136+ ERR_PRT((L"Force kernel specified initrd_addr_max="PTR_FMT
3137+ " below 4GB\n", (VOID *)initrd_addr_max));
3138+ ki_max = UINT32_MAX - imem->size + 1;
3139+ }
3140+ ki_max_addr = (VOID *)ki_max;
3141+
3142+ if ((UINT64)start_addr > ki_max) {
3143+ VERB_PRT(1, Print(L"initrd start_addr="PTR_FMT" above "
3144+ "limit="PTR_FMT"\n", start_addr, ki_max_addr));
3145+ free(start_addr);
3146+ start_addr = NULL;
3147+ }
3148+ /* so either the initial allocation failed or it's been to high! */
3149+ if (start_addr == NULL) {
3150+ start_addr = alloc_pages(pgcnt, EfiLoaderData,
3151+ AllocateMaxAddress, ki_max_addr);
3152+ }
3153+ if ((UINT64)start_addr > ki_max) {
3154+ ERR_PRT((L"Failed to allocate %d pages below %dMB",
3155+ pgcnt, (param_start->s.initrd_addr_max+1)>>20));
3156+ free(start_addr);
3157+ start_addr = NULL;
3158+ }
3159+ return start_addr;
3160+}
3161+
3162 VOID
3163 sysdeps_free_boot_params(boot_params_t *bp)
3164 {
3165@@ -199,6 +251,10 @@
3166 UINTN size1;
3167 UINT8 i;
3168
3169+ if (x86_64_text_mode() == 1) {
3170+ Print((L"Skip GOP init, force text-mode.\n"));
3171+ return -1;
3172+ }
3173 efi_status = uefi_call_wrapper(
3174 BS->LocateHandle,
3175 5,
3176@@ -209,7 +265,19 @@
3177 (VOID **)Gop_handle);
3178
3179 if (EFI_ERROR(efi_status) && efi_status != EFI_BUFFER_TOO_SMALL) {
3180- ERR_PRT((L"LocateHandle GopProtocol failed."));
3181+ Print(L"LocateHandle GopProtocol failed.\n");
3182+ Print(L"--Either no graphics head is installed,\n" \
3183+ "--efi console is set to serial, or,\n" \
3184+ "--the EFI firmware version of this machine is\n" \
3185+ "--older than UEFI 2.0. and does not support GOP");
3186+ Print(L"you can SAFELY IGNORE this error. elilo will\n" \
3187+ "default to text-mode.\n Alternatively you can " \
3188+ "now force text mode by setting config variable\n" \
3189+ "text_mode=1 for x86 in elilo.conf or via cmdline.\n\n");
3190+ Print(L"However if this is the last text output you see\n" \
3191+ "ensure that your kernel console command line\n " \
3192+ "variable matches up with the actual efi boot menu\n" \
3193+ "console output settings.\n\n");
3194 return -1;
3195 }
3196 Gop_handle = alloc(size, 0);
3197@@ -326,10 +394,56 @@
3198 return 0;
3199 }
3200
3201+CHAR16 *
3202+StrStr(IN const CHAR16 *h, IN const CHAR16 *n)
3203+{
3204+ const CHAR16 *t = h;
3205+ CHAR16 *res;
3206+ int len = 0, i;
3207+
3208+ len = StrLen((CHAR16 *)n);
3209+ while(*t != CHAR_NULL) {
3210+ res = StrChr( t, n[0]);
3211+ if (!res) return res;
3212+ for( i = 1; i < len && res[i] != CHAR_NULL && res[i] == n[i]; i++);
3213+ if ( i == len ) return res;
3214+ t = res + 1;
3215+ if (t > h + CMDLINE_MAXLEN) return (CHAR16 *)0;
3216+ }
3217+
3218+ return (CHAR16 *)0;
3219+}
3220+
3221+CHAR8 *
3222+StrStr8(IN const CHAR8 *h, IN const CHAR8 *n)
3223+{
3224+ const CHAR8 *t = h;
3225+ CHAR8 *res;
3226+ int len = 0, i;
3227+
3228+ len = strlena((CHAR8 *)n);
3229+ while(*t != 0) {
3230+ res = strchra( t, n[0]);
3231+ if (!res) return res;
3232+ for( i = 1; i < len && res[i] != 0 && res[i] == n[i]; i++);
3233+ if ( i == len ) return res;
3234+ t = res + 1;
3235+ if (t > (h + CMDLINE_MAXLEN)) return (CHAR8 *)0;
3236+ }
3237+
3238+ return (CHAR8 *)0;
3239+}
3240+
3241 /* Convert EFI memory map to E820 map for the operating system
3242 * This code is based on a Linux kernel patch submitted by Edgar Hucek
3243 */
3244
3245+#if DEBUG_CREATE_BOOT_PARAMS
3246+static int e820_max = 6;
3247+#else
3248+static int e820_max = E820_MAX;
3249+#endif
3250+
3251 /* Add a memory region to the e820 map */
3252 static void add_memory_region (struct e820entry *e820_map,
3253 int *e820_nr_map,
3254@@ -338,21 +452,56 @@
3255 unsigned int type)
3256 {
3257 int x = *e820_nr_map;
3258-
3259- if (x == E820_MAX) {
3260- Print(L"Too many entries in the memory map!\n");
3261- return;
3262- }
3263-
3264+ static unsigned long long estart = 0ULL;
3265+ static unsigned long esize = 0L;
3266+ static unsigned int etype = -1;
3267+ static int merge = 0;
3268+
3269+ if (x == 0)
3270+ DPR((L"AMR: %3s %4s %16s/%12s/%s\n",
3271+ L"idx", L" ", L"start", L"size", L"type"));
3272+
3273+ /* merge adjacent regions of same type */
3274 if ((x > 0) && e820_map[x-1].addr + e820_map[x-1].size == start
3275- && e820_map[x-1].type == type)
3276+ && e820_map[x-1].type == type) {
3277 e820_map[x-1].size += size;
3278- else {
3279+ estart = e820_map[x-1].addr;
3280+ esize = e820_map[x-1].size;
3281+ etype = e820_map[x-1].type;
3282+ merge++;
3283+ return;
3284+ }
3285+ /* fill up to E820_MAX */
3286+ if ( x < e820_max ) {
3287 e820_map[x].addr = start;
3288 e820_map[x].size = size;
3289 e820_map[x].type = type;
3290 (*e820_nr_map)++;
3291- }
3292+ if (merge) DPR((L"AMR: %3d ==> %016llx/%012lx/%d (%d)\n",
3293+ x-1, estart, esize, etype, merge));
3294+ merge=0;
3295+ DPR((L"AMR: %3d add %016llx/%012lx/%d\n",
3296+ x, start, size, type));
3297+ return;
3298+ }
3299+ /* different type means another region didn't fit */
3300+ /* or same type, but there's a hole */
3301+ if (etype != type || (estart + esize) != start) {
3302+ if (merge) DPR((L"AMR: %3d ===> %016llx/%012lx/%d (%d)\n",
3303+ e820_map_overflow, estart, esize, etype, merge));
3304+ merge = 0;
3305+ estart = start;
3306+ esize = size;
3307+ etype = type;
3308+ e820_map_overflow++;
3309+ DPR((L"AMR: %3d OVER %016llx/%012lx/%d\n",
3310+ e820_map_overflow, start, size, type));
3311+ return;
3312+ }
3313+ /* same type and no hole, merge it */
3314+ estart += esize;
3315+ esize += size;
3316+ merge++;
3317 }
3318
3319 void fill_e820map(boot_params_t *bp, mmap_desc_t *mdesc)
3320@@ -431,6 +580,7 @@
3321 break;
3322 default:
3323 /* We should not hit this case */
3324+ DBG_PRT((L"hit default!?"));
3325 add_memory_region(e820_map, &e820_nr_map,
3326 md->PhysicalStart,
3327 md->NumberOfPages << EFI_PAGE_SHIFT,
3328@@ -444,6 +594,8 @@
3329
3330 /*
3331 * x86_64 specific boot parameters initialization routine
3332+ *
3333+ * Note: debug and verbose messages have already been turned off!
3334 */
3335 INTN
3336 sysdeps_create_boot_params(
3337@@ -459,6 +611,12 @@
3338 UINT8 row, col;
3339 UINT8 mode;
3340 UINT16 hdr_version;
3341+ UINT8 e820_map_overflow_warned = 0;
3342+
3343+#if DEBUG_CREATE_BOOT_PARAMS
3344+ elilo_opt.debug=1;
3345+ elilo_opt.verbose=5;
3346+#endif
3347
3348 DBG_PRT((L"fill_boot_params()\n"));
3349
3350@@ -493,17 +651,9 @@
3351 hdr_version = (bp->s.hdr_major << 8) | bp->s.hdr_minor;
3352
3353 /*
3354- * Clear out unused memory in boot sector image.
3355+ * Do NOT clear out unknown memory in boot sector image.
3356+ * This breaks boot protocol >= 2.10 (2.6.31).
3357 */
3358- bp->s.unused_1 = 0;
3359- bp->s.unused_2 = 0;
3360- ZeroMem(&bp->s.unused_3, sizeof bp->s.unused_3);
3361- ZeroMem(&bp->s.unused_4, sizeof bp->s.unused_4);
3362- ZeroMem(&bp->s.unused_51, sizeof bp->s.unused_51);
3363- ZeroMem(&bp->s.unused_52, sizeof bp->s.unused_52);
3364- bp->s.unused_6 = 0;
3365- bp->s.unused_7 = 0;
3366- ZeroMem(bp->s.unused_8, sizeof bp->s.unused_8);
3367
3368 /*
3369 * Tell kernel this was loaded by an advanced loader type.
3370@@ -553,19 +703,19 @@
3371 DBG_PRT((L"initrd->start_addr="PTR_FMT" initrd->pgcnt=%d\n",
3372 initrd->start_addr, initrd->pgcnt));
3373
3374- /* These RAMdisk flags are not needed, just zero them. */
3375- bp->s.ramdisk_flags = 0;
3376+ /* These RAMdisk flags are not needed, just zero them. NOT!*/
3377+ /* 'ramdisk_flags' (@0x1F8) is called 'ram_size' in the meantime, */
3378+ /* see Documentation/x86/boot.txt. */
3379
3380 if (initrd->start_addr && initrd->pgcnt) {
3381+ if ( (UINT64)initrd->start_addr > UINT32_MAX ) {
3382+ ERR_PRT((L"Start of initrd out of reach (>4GB)."));
3383+ free_kmem();
3384+ return -1;
3385+ }
3386 /* %%TBD - This will probably have to be changed. */
3387 bp->s.initrd_start = (UINT32)(UINT64)initrd->start_addr;
3388 bp->s.initrd_size = (UINT32)(initrd->size);
3389- /*
3390- * This is the RAMdisk root device for RedHat 2.2.x
3391- * kernels (major 0x01, minor 0x00).
3392- */
3393-
3394- bp->s.orig_root_dev = 0x0100;
3395 } else {
3396 bp->s.initrd_start = 0;
3397 bp->s.initrd_size = 0;
3398@@ -590,11 +740,6 @@
3399 ZeroMem(bp->s.mca_info_buf, sizeof bp->s.mca_info_buf);
3400
3401 /*
3402- * Pointing device presence. The kernel will detect this.
3403- */
3404- bp->s.aux_dev_info = NO_MOUSE;
3405-
3406- /*
3407 * EFI loader signature
3408 */
3409 CopyMem(bp->s.efi_loader_sig, EFI_LOADER_SIG_X64, 4);
3410@@ -602,6 +747,11 @@
3411 /*
3412 * Kernel entry point.
3413 */
3414+ if ( (UINT64)kernel_start != (UINT32)(UINT64)kernel_start ) {
3415+ ERR_PRT((L"Start of kernel (will be) out of reach (>4GB)."));
3416+ free_kmem();
3417+ return -1;
3418+ }
3419 bp->s.kernel_start = (UINT32)(UINT64)kernel_start;
3420
3421 /*
3422@@ -692,11 +842,9 @@
3423 CHECK_OFFSET(setup_sectors, 0x1F1, L"%xh");
3424 CHECK_OFFSET(mount_root_rdonly, 0x1F2, L"%xh");
3425 CHECK_OFFSET(sys_size, 0x1F4, L"%xh");
3426- CHECK_OFFSET(swap_dev, 0x1F6, L"%xh");
3427- CHECK_OFFSET(ramdisk_flags, 0x1F8, L"%xh");
3428 CHECK_OFFSET(video_mode_flag, 0x1FA, L"%xh");
3429 CHECK_OFFSET(orig_root_dev, 0x1FC, L"%xh");
3430- CHECK_OFFSET(aux_dev_info, 0x1FF, L"%xh");
3431+ CHECK_OFFSET(boot_flag, 0x1FE, L"%xh");
3432 CHECK_OFFSET(jump, 0x200, L"%xh");
3433 CHECK_OFFSET(setup_sig, 0x202, L"'%-4.4a'");
3434 CHECK_OFFSET(hdr_minor, 0x206, L"%xh");
3435@@ -710,9 +858,9 @@
3436 CHECK_OFFSET(kernel_start, 0x214, L"%xh");
3437 CHECK_OFFSET(initrd_start, 0x218, L"%xh");
3438 CHECK_OFFSET(initrd_size, 0x21C, L"%xh");
3439- CHECK_OFFSET(bootsect_helper, 0x220, L"%xh");
3440 CHECK_OFFSET(heap_end_ptr, 0x224, L"%xh");
3441 CHECK_OFFSET(cmdline_addr, 0x228, L"%xh");
3442+ CHECK_OFFSET(e820_map, 0x2D0, L"%xh");
3443
3444 if (test) {
3445 ERR_PRT((L"Boot sector and/or setup parameter alignment error."));
3446@@ -802,6 +950,31 @@
3447 * and update the bootparam accordingly
3448 */
3449 fill_e820map(bp, &mdesc);
3450+
3451+#if DEBUG_CREATE_BOOT_PARAMS
3452+ if ( e820_map_overflow == 0 )
3453+ e820_map_overflow = -1; /* force second get_memmap()! */
3454+#endif
3455+ if (e820_map_overflow && !e820_map_overflow_warned) {
3456+ CHAR8 *aem = (CHAR8 *)"add_efi_memmap";
3457+ e820_map_overflow_warned++;
3458+
3459+#if DEBUG_CREATE_BOOT_PARAMS
3460+ elilo_opt.debug=0;
3461+ elilo_opt.verbose=0;
3462+#endif
3463+ if (e820_map_overflow == -1 || StrStr8(cmdline, aem)) {
3464+ /* Print(L"...mapping again, silently!\n"); */
3465+ goto do_memmap;
3466+ }
3467+
3468+ Print(L"\nCAUTION: EFI memory map has %d more entr%a"
3469+ " than E820 map supports.\n"
3470+ "To access all memory, '%a' may be necessary.\n\n",
3471+ e820_map_overflow, (e820_map_overflow==1)?"y":"ies",
3472+ aem);
3473+ goto do_memmap;
3474+ }
3475
3476 return 0;
3477 }

Subscribers

People subscribed via source and target branches

to all changes: