Mailinglist Archive: opensuse-commit (817 mails)

< Previous Next >
commit elilo for openSUSE:Factory
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Mon, 15 Dec 2008 12:28:47 +0100
  • Message-id: <20081215112848.1F27667815D@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package elilo for openSUSE:Factory
checked in at Mon Dec 15 12:28:47 CET 2008.


--------
--- arch/i386/elilo/elilo.changes 2008-11-21 16:41:51.000000000 +0100
+++ /mounts/work_src_done/STABLE/elilo/elilo.changes 2008-12-09
16:37:18.000000000 +0100
@@ -1,0 +2,8 @@
+Tue Dec 9 16:34:53 CET 2008 - rw@xxxxxxx
+
+- elilo.efi
+ * Second attempt to work around firmware problem. (bnc#437486)
+- elilo.conf
+ * Provide stub man page. (bnc#435648)
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
eliloalt.debian.man8
elilo-uEFI-no-alloc_kmem.diff

New:
----
debian.eliloalt.man8
elilo-bzimage-alloc.diff
elilo.conf.man5

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ elilo.spec ++++++
--- /var/tmp/diff_new_pack.L13053/_old 2008-12-15 12:27:28.000000000 +0100
+++ /var/tmp/diff_new_pack.L13053/_new 2008-12-15 12:27:28.000000000 +0100
@@ -21,7 +21,7 @@
Name: elilo
Summary: EFI Linux Loader
Version: 3.8
-Release: 24
+Release: 25
ExclusiveArch: ia64 %ix86 x86_64
Group: System/Boot
AutoReqProv: on
@@ -30,16 +30,17 @@
Url: http://elilo.sourceforge.net/
Source: http://dl.sourceforge.net/elilo/elilo-3.8.tar.gz
Source1: elilo.pl
-Source2: eliloalt.debian.man8
-Source3: rpmlintrc
+Source2: debian.eliloalt.man8
+Source3: elilo.conf.man5
+Source9: rpmlintrc
Patch0: elilo-3.8-cvs20080127.diff
Patch1: elilo-MAC.diff
Patch2: elilo-spelling.diff
Patch3: elilo-longer-commandline.diff
Patch4: elilo-fix-possible-overflow.diff
Patch5: elilo-avoid-tab.diff
-Patch6: eliloalt-sysfs.diff
-Patch7: elilo-uEFI-no-alloc_kmem.diff
+Patch6: elilo-bzimage-alloc.diff
+Patch9: eliloalt-sysfs.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gnu-efi >= 3.0e

@@ -64,7 +65,7 @@
%patch4 -p1
%patch5 -p1
%patch6 -p1
-%patch7 -p1
+%patch9 -p1
perl -pe 's{\@EDITION\@}{%{version}-%{release}};
s{\@LIBEXECDIR\@}{%{_libexecdir}};
s{\@ARCH\@}{%{_target_cpu}};
@@ -72,7 +73,6 @@
perl -pi -e 's{/usr/lib}{%{_libexecdir}}' Make.defaults
chmod 555 elilo.pl && touch -r %{SOURCE1} elilo.pl
! fgrep '%%{version}-%%{release}' elilo.pl
-cp --preserve=time %{SOURCE2} eliloalt.8

%build
make OPTIMFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-stack-protector"
@@ -85,11 +85,9 @@
install -m 444 elilo.efi $RPM_BUILD_ROOT%{_libexecdir}/efi
install tools/eliloalt $RPM_BUILD_ROOT/sbin
install -p -m 555 elilo.pl $RPM_BUILD_ROOT/sbin/elilo
-%if 0
-install -D -p -m 644 elilo.5 $RPM_BUILD_ROOT/usr/share/man/man5/elilo.conf.5
-%endif
install -D -p -m 644 elilo.8 $RPM_BUILD_ROOT/usr/share/man/man8/elilo.8
-install -D -p -m 644 eliloalt.8 $RPM_BUILD_ROOT/usr/share/man/man8/eliloalt.8
+install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/man/man8/eliloalt.8
+install -D -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/usr/share/man/man5/elilo.conf.5

%clean
rm -fr $RPM_BUILD_ROOT
@@ -104,12 +102,15 @@
%{_libexecdir}/efi
/sbin/elilo
/sbin/eliloalt
-%if 0
/usr/share/man/man5/*
-%endif
/usr/share/man/man8/*

%changelog
+* Tue Dec 09 2008 rw@xxxxxxx
+- elilo.efi
+ * Second attempt to work around firmware problem. (bnc#437486)
+- elilo.conf
+ * Provide stub man page. (bnc#435648)
* Fri Nov 21 2008 rw@xxxxxxx
- elilo.efi
* Significant code cleanup from CVS. (bnc#443565)

++++++ debian.eliloalt.man8 ++++++
.TH ELILOALT 8 "18 Mar 2002"
.SH NAME
eliloalt \- manipulate elilo alternate
.SH SYNOPSIS
.B eliloalt
.RI [ options ]
.SH DESCRIPTION
The
.B eliloalt
command makes it possible to coerce elilo to boot an alternate
kernel configuration one time only, as when engaging in kernel development or
debugging.
.sp
.SH SEE ALSO
Additional information about
.B eliloalt
is available in the /usr/share/doc/packages/elilo directory.
.SH AUTHOR
This manual page was written by Bdale Garbee <bdale@xxxxxxx>
for the Debian GNU/Linux system (but may be used by others).
++++++ elilo-bzimage-alloc.diff ++++++
From: Stuart_Hayes@xxxxxxxx
Subject: Re: [elilo-discuss] Follow-Up to 1MB Allocation Problem
Message-ID:
<DFEF91B22ED07447AB6AA4B237F913F90218586E@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>

Here's one solution to the problem, for bzImages in x86_64 (which could
easily be ported to the other image types and architecture). I tried to
make this minimally invasive. If bzImage_probe() can't load the kernel
where it should be, it will just load the kernel anywhere, and it will
be moved to the right address after elilo exits EFI boot services. (I
also made it read where the kernel should be from the kernel header.)
It looks like it was already loading the initrd just anywhere and then
moving it after exiting boot services.

(I also enhanced the "MEMCPY" macro in x86_64/sysdeps.h so it will copy
to an overlapping area correctly regardless of whether the "from"
address is higher or lower than the "to" address.)

I originally wrote code that would actually check if the kernel was
relocatable and then relocate it, like the ia64 code does. That worked
fine, except that the address that was found overlapped the area where
elilo copies the initrd in start_kernel() after EFI boot services are
exited! Instead of modifying the initrd addresses, too, I decided it
would be easier and less likely to break anyting else (and would work
with non-relocatable kernels, too) to just do it the other way.

Any chance we could get this patch into elilo? I can modify and
resubmit if there are any issues with this approach.

Thanks!

diff -purN '--exclude=*o' '--exclude=tags' elilo-3.8-3.35-orig1/alloc.c
elilo-3.8-3.35-orig_c/alloc.c
--- elilo-3.8-3.35-orig1/alloc.c 2008-12-08 06:03:05.000000000 -0600
+++ elilo-3.8-3.35-orig_c/alloc.c 2008-12-08 04:51:28.000000000 -0600
@@ -213,6 +213,19 @@ free_all(VOID)
}

INTN
+alloc_kmem_anywhere(VOID **start_addr, UINTN pgcnt)
+{
+ void * tmp;
+ if ((tmp = alloc_pages(pgcnt, EfiLoaderData, AllocateAnyPages,
*start_addr)) == 0) return -1;
+
+ kmem_addr = tmp;
+ kmem_pgcnt = pgcnt;
+ *start_addr = tmp;
+
+ return 0;
+}
+
+INTN
alloc_kmem(VOID *start_addr, UINTN pgcnt)
{
if (alloc_pages(pgcnt, EfiLoaderData, AllocateAddress, start_addr) ==
0) return -1;
diff -purN '--exclude=*o' '--exclude=tags' elilo-3.8-3.35-orig1/elilo.c
elilo-3.8-3.35-orig_c/elilo.c
--- elilo-3.8-3.35-orig1/elilo.c 2008-12-08 06:03:05.000000000 -0600
+++ elilo-3.8-3.35-orig_c/elilo.c 2008-12-08 05:01:33.000000000 -0600
@@ -132,6 +132,9 @@ kernel_load(EFI_HANDLE image, CHAR16 *kn

if (elilo_opt.initrd[0]) {

+ /*
+ * fix me? -- load_file() ignores address from
sysdeps_initrd_get_addr()
+ */
if (sysdeps_initrd_get_addr(kd, imem) == -1) goto exit_error;

switch(load_file(elilo_opt.initrd, imem)) {
Files elilo-3.8-3.35-orig1/elilo.efi and elilo-3.8-3.35-orig_c/elilo.efi differ
Files elilo-3.8-3.35-orig1/tools/eliloalt and
elilo-3.8-3.35-orig_c/tools/eliloalt differ
diff -purN '--exclude=*o' '--exclude=tags'
elilo-3.8-3.35-orig1/x86_64/bzimage.c elilo-3.8-3.35-orig_c/x86_64/bzimage.c
--- elilo-3.8-3.35-orig1/x86_64/bzimage.c 2008-12-08 06:03:05.000000000
-0600
+++ elilo-3.8-3.35-orig_c/x86_64/bzimage.c 2008-12-08 05:04:52.000000000
-0600
@@ -158,13 +158,37 @@ bzImage_probe(CHAR16 *kname)
* Allocate memory for kernel.
*/

+ /*
+ * Get correct address for kernel from header, if applicable &
available.
+ */
+ if ((param_start->s.hdr_major == 2) &&
+ (param_start->s.hdr_minor >= 0) &&
+ (param_start->s.kernel_start >= DEFAULT_KERNEL_START)) {
+ kernel_start = kernel_load_address = (VOID
*)((UINTN)param_start->s.kernel_start);
+ VERB_PRT(3, Print(L"kernel header suggests kernel start at
address 0x%x\n",
+ kernel_start));
+ }
+
+ kernel_load_address = kernel_start;
+
if (alloc_kmem(kernel_start, EFI_SIZE_TO_PAGES(kernel_size))) {
- ERR_PRT((L"Could not allocate kernel memory."));
- return -1;
- } else {
- VERB_PRT(3, Print(L"kernel_start: 0x%x kernel_size: %d\n",
- kernel_start, kernel_size));
+ /*
+ * Couldn't get desired address--just load it anywhere and move
it later.
+ * (Easier than relocating kernel, and also works with
non-relocatable kernels.)
+ */
+ if (alloc_kmem_anywhere(&kernel_load_address,
EFI_SIZE_TO_PAGES(kernel_size))) {
+ ERR_PRT((L"Could not allocate memory for kernel."));
+ free(param_start);
+ param_start = NULL;
+ param_size = 0;
+ fops_close(fd);
+ return -1;
+ }
}
+
+ VERB_PRT(3, Print(L"kernel_start: 0x%x kernel_size: %d loading at:
0x%x\n",
+ kernel_start, kernel_size, kernel_load_address));
+
/*
* Now read the rest of the kernel image into memory.
*/
@@ -172,7 +196,7 @@ bzImage_probe(CHAR16 *kname)
DBG_PRT((L"reading kernel image...\n"));

size = kernel_size;
- efi_status = fops_read(fd, kernel_start, &size);
+ efi_status = fops_read(fd, kernel_load_address, &size);
if (EFI_ERROR(efi_status) || size < 0x10000) {
ERR_PRT((L"Error reading kernel image %s.", kname));
free(param_start);
diff -purN '--exclude=*o' '--exclude=tags'
elilo-3.8-3.35-orig1/x86_64/sysdeps.h elilo-3.8-3.35-orig_c/x86_64/sysdeps.h
--- elilo-3.8-3.35-orig1/x86_64/sysdeps.h 2008-12-08 06:03:05.000000000
-0600
+++ elilo-3.8-3.35-orig_c/x86_64/sysdeps.h 2008-12-08 06:01:52.000000000
-0600
@@ -48,6 +48,11 @@
#define INITRD_START (50*1024*1024)

/*
+ * Default start address for kernel.
+ */
+#define DEFAULT_KERNEL_START 0x100000
+
+/*
* This version must match the one in the kernel.
*
* This table was put together using information from the
@@ -307,10 +312,16 @@ typedef union x86_64_boot_params {
UINT8 *t = (UINT8 *)(to); \
UINT8 *f = (UINT8 *)(from); \
UINTN n = cnt; \
- if (t && f && n) { \
+ if (t && f && n && (t<f)) { \
while (n--) { \
*t++ = *f++; \
} \
+ } else if (t && f && n && (t>f)) { \
+ t += n; \
+ f += n; \
+ while (n--) { \
+ *t-- = *f--; \
+ } \
} \
}

@@ -343,6 +354,7 @@ extern UINTN param_size;

extern VOID *kernel_start;
extern UINTN kernel_size;
+extern VOID *kernel_load_address;

extern VOID *initrd_start;
extern UINTN initrd_size;
@@ -379,14 +391,24 @@ start_kernel(VOID *kentry, boot_params_t
asm volatile ( "cli" : : );

/*
- * Relocate initrd, if present.
+ * Relocate kernel (if needed) and initrd (if present).
+ * Copy kernel first, in case kernel was loaded overlapping where we're
+ * planning to copy the initrd. This assumes that the initrd didn't
+ * get loaded overlapping where we're planning to copy the kernel, but
+ * that's pretty unlikely since we couldn't alloc that space for the
+ * kernel (or the kernel would already be there).
*/

+ if (kernel_start != kernel_load_address) {
+ MEMCPY(kernel_start, kernel_load_address, kernel_size);
+ }
+
if (bp->s.initrd_start) {
temp = bp->s.initrd_start;
MEMCPY(INITRD_START, temp , bp->s.initrd_size);
bp->s.initrd_start = INITRD_START;
}
+
/*
* Copy boot sector, setup data and command line
* to final resting place. We need to copy
diff -purN '--exclude=*o' '--exclude=tags' elilo-3.8-3.35-orig1/x86_64/system.c
elilo-3.8-3.35-orig_c/x86_64/system.c
--- elilo-3.8-3.35-orig1/x86_64/system.c 2008-12-08 06:03:25.000000000
-0600
+++ elilo-3.8-3.35-orig_c/x86_64/system.c 2008-12-08 04:51:28.000000000
-0600
@@ -105,7 +105,9 @@ UINTN high_base_mem = 0x90000;
UINTN high_ext_mem = 32 * 1024 * 1024;

/* This starting address will hold true for all of the loader types for now */
-VOID *kernel_start = (VOID *)0x100000; /* 1M */
+VOID *kernel_start = (VOID *)DEFAULT_KERNEL_START;
+/* The kernel may load elsewhere if EFI firmware reserves kernel_start */
+VOID *kernel_load_address = (VOID *)DEFAULT_KERNEL_START;

VOID *initrd_start = NULL;
UINTN initrd_size = 0;
--- elilo/fs/localfs.c
+++ elilo/fs/localfs.c
@@ -98,7 +98,7 @@

DBG_PRT((L"localfs_open on %s\n", name));

- status = uefi_call_wrapper(lfs->volume->Open, 5, lfs->volume, &fh,
name, EFI_FILE_MODE_READ, 0);
+ status = uefi_call_wrapper(lfs->volume->Open, 5, lfs->volume, &fh,
name, EFI_FILE_MODE_READ, (UINT64)0);
if (status == EFI_SUCCESS) {
*fd = LOCALFS_F2FD(fh);
}
--- elilo/elilo.h
+++ elilo/elilo.h
@@ -151,6 +151,7 @@
extern VOID free_pages(VOID *);
extern VOID free_all(VOID);
extern INTN alloc_kmem(VOID *, UINTN);
+extern INTN alloc_kmem_anywhere(VOID **, UINTN);
extern VOID free_kmem(VOID);
extern VOID free_all_memory(VOID);

++++++ elilo.conf.man5 ++++++
.TH ELILO.CONF 5 "2008-12-06"
.SH NAME
elilo.conf \- elilo configuration file
.SH SYNOPSIS
/etc/elilo.conf
.SH FILES
.IR /etc/elilo.conf ,
.I /boot/efi/efi/SuSE/elilo.conf
.SH SEE ALSO
.IR /usr/share/doc/packages/elilo/elilo.txt
(Section III)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages