Your message dated Wed, 05 Sep 2007 14:32:03 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#427512: fixed in elilo 3.7-1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: elilo
Version: 3.6-3.1
Severity: normal
Tags: patch

eliloalt doesn't work anymore with the new efivars module. For one thing, the old module exposed itself through /proc/efi/vars; now it's
/sys/firmware/efi/vars.  Also, the semantics for creating and deleting
variables have changed.  This patch detects which path is available, and
changes eliloalt's semantics based on that.

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: ia64
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-mckinley
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages elilo depends on:
ii debconf 1.5.11 Debian configuration management sy ii dosfstools 2.11-2.1 Utilities to create and check MS-D ii efibootmgr 0.5.3-2 Interact with the EFI Boot Manager

elilo recommends no packages.

-- debconf information:
  elilo/format: true
* elilo/runme: false
--- eliloalt.c.old	2007-05-31 15:16:16.000000000 -0600
+++ eliloalt.c	2007-06-01 15:20:34.000000000 -0600
@@ -32,6 +32,7 @@
  * be run by root.
  */
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -47,8 +48,9 @@
 #define ELILOALT_VERSION	"0.02"
 
 #define ELILO_ALT_NAME	"EliloAlt"
-#define EFIVAR_DIR	"/proc/efi/vars"
-#define ELILO_ALTVAR	EFIVAR_DIR"/"ELILO_ALT_NAME"-00000000-0000-0000-0000-000000000000"
+#define OLDEFIVAR_DIR	"/proc/efi/vars"
+#define NEWEFIVAR_DIR	"/sys/firmware/efi/vars"
+#define ELILO_ALTVAR	ELILO_ALT_NAME"-00000000-0000-0000-0000-000000000000"
 
 #define EFI_VARIABLE_NON_VOLATILE 0x0000000000000001
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
@@ -81,6 +83,11 @@
 } __attribute__((packed)) efi_variable_t;
 
 static char *elilo_alt_name = ELILO_ALT_NAME;
+static char *efi_vars_dir = NULL;
+static char *elilo_altvar = NULL;
+static char *elilo_newvar = NULL;
+static char *elilo_delvar = NULL;
+unsigned char efivars_version = -1; 
 
 static struct option cmd_options[]={
 	{ "version", 0, 0, 1},
@@ -129,9 +136,9 @@
 	if (getuid() != 0) {
 		fatal_error("This program must be run as root\n");
 	}
-	efi_vars = opendir(EFIVAR_DIR);
+	efi_vars = opendir(efi_vars_dir);
 	if (efi_vars == NULL) {
-		fatal_error("Cannot access %s\n", EFIVAR_DIR);
+		fatal_error("Cannot access %s\n", efi_vars_dir);
 	}
 	if (!find_entry) {
 		closedir(efi_vars);
@@ -143,9 +150,9 @@
 			break;
 	}
 	if (entry == NULL) {
-		fatal_error("Cannot find entry in %s\n", EFIVAR_DIR);
+		fatal_error("Cannot find entry in %s\n", efi_vars_dir);
 	}
-	sprintf(name, "%s/%s", EFIVAR_DIR, entry->d_name);
+	sprintf(name, "%s/%s", efi_vars_dir, entry->d_name);
 	closedir(efi_vars);
 	return name;
 }
@@ -157,10 +164,17 @@
 	int fd, r, i;
 
 	check_proc_efi(0);
-
-	fd = open(ELILO_ALTVAR, O_WRONLY);
-	if (fd == -1) {
-		fatal_error("variable not defined\n");
+	
+	if (efivars_version == 1) {
+		fd = open(elilo_altvar, O_WRONLY);
+		if (fd == -1) {
+			fatal_error("variable not defined\n");
+		}
+        } else {
+		fd = open(elilo_delvar, O_WRONLY);
+		if (fd == -1) {
+			fatal_error("can't open %s\n", elilo_delvar);
+		}
 	}
 
 	memset(&var, 0, sizeof(var));
@@ -176,7 +190,7 @@
 	
 	r = write(fd, &var, sizeof(var));
 	if (r != sizeof(var)) {
-		fatal_error("Variable %s defined but invalid content\n", ELILO_ALTVAR);
+		fatal_error("Variable %s defined but invalid content\n", elilo_altvar);
 	}
 	close(fd);
 }
@@ -191,7 +205,7 @@
 
 	check_proc_efi(0);
 
-	fd = open(ELILO_ALTVAR, O_RDONLY);
+	fd = open(elilo_altvar, O_RDONLY);
 	if (fd == -1) {
 		fatal_error("variable not defined\n");
 	}
@@ -200,7 +214,7 @@
 
 	r = read(fd, &var, sizeof(var));
 	if (r != sizeof(var)) {
-		fatal_error("Variable %s defined but invalid content\n", ELILO_ALTVAR);
+		fatal_error("Variable %s defined but invalid content\n", elilo_altvar);
 	}
 	printf("EliloAlt=\"");
 	for(i=0; i < var.datasize; i+=1){
@@ -229,11 +243,19 @@
 		fatal_error("Variable content is too long, must be <= 512 characters\n");
 	}
 
-	fd = open(name, O_WRONLY);
-	if (fd == -1) {
-		fatal_error("can't open %s: %s\n", ELILO_ALTVAR, strerror(errno));
+	if (efivars_version == 1) {
+		fd = open(name, O_WRONLY);
+		if (fd == -1) {
+			fatal_error("can't open %s: %s\n", name,
+			            strerror(errno));
+                }
+        } else {
+		fd = open(elilo_newvar, O_WRONLY);
+		if (fd == -1) {
+			fatal_error("can't open %s: %s\n", elilo_newvar,
+			            strerror(errno));
+                }
 	}
-
 	memset(&var, 0, sizeof(var));
 
 	for (i=0; i < sizeof(elilo_alt_name); i++) {
@@ -256,7 +278,7 @@
 	
 	r = write(fd, &var, sizeof(var));
 	if (r != sizeof(var)) {
-		fatal_error("Variable %s defined but invalid content %d\n", ELILO_ALTVAR, r);
+		fatal_error("Variable %s defined but invalid content %d\n", elilo_altvar, r);
 	}
 	close(fd);
 
@@ -266,6 +288,26 @@
 main(int argc, char **argv)
 {
 	int c;
+	struct stat statbuf;
+
+	if (stat(OLDEFIVAR_DIR, &statbuf) == 0) {
+		efi_vars_dir = strdup(OLDEFIVAR_DIR);
+		efivars_version = 1;
+        } else if (stat(NEWEFIVAR_DIR, &statbuf) == 0) {
+		efi_vars_dir = strdup(NEWEFIVAR_DIR);
+		elilo_newvar = malloc(strlen(efi_vars_dir) +
+				      strlen("new_var") + 2);
+		sprintf(elilo_newvar, "%s/%s", efi_vars_dir, "new_var");
+		elilo_delvar = malloc(strlen(efi_vars_dir) +
+				      strlen("del_var") + 2);
+		sprintf(elilo_delvar, "%s/%s", efi_vars_dir, "del_var");
+		efivars_version = 2;
+	} else {
+		fatal_error("No EFI vars dir found\n\ttried:\n\t%s\n\t%s",
+			    OLDEFIVAR_DIR, NEWEFIVAR_DIR);
+	}
+	elilo_altvar = malloc(strlen(efi_vars_dir)+strlen(ELILO_ALTVAR)+2);
+	sprintf(elilo_altvar, "%s/%s", efi_vars_dir, ELILO_ALTVAR);
 
 	while ((c=getopt_long(argc, argv,"hdps:", cmd_options, 0)) != -1) {
 		switch(c) {

--- End Message ---
--- Begin Message ---
Source: elilo
Source-Version: 3.7-1

We believe that the bug you reported is fixed in the latest version of
elilo, which is due to be installed in the Debian FTP archive:

elilo_3.7-1.diff.gz
  to pool/main/e/elilo/elilo_3.7-1.diff.gz
elilo_3.7-1.dsc
  to pool/main/e/elilo/elilo_3.7-1.dsc
elilo_3.7-1_i386.deb
  to pool/main/e/elilo/elilo_3.7-1_i386.deb
elilo_3.7.orig.tar.gz
  to pool/main/e/elilo/elilo_3.7.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bdale Garbee <[EMAIL PROTECTED]> (supplier of updated elilo package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 05 Sep 2007 15:12:13 +0100
Source: elilo
Binary: elilo
Architecture: source i386
Version: 3.7-1
Distribution: unstable
Urgency: low
Maintainer: Bdale Garbee <[EMAIL PROTECTED]>
Changed-By: Bdale Garbee <[EMAIL PROTECTED]>
Description: 
 elilo      - Bootloader for systems using EFI-based firmware
Closes: 413897 413899 414116 414211 414662 414663 414947 415369 418396 427512 
433498
Changes: 
 elilo (3.7-1) unstable; urgency=low
 .
   * new upstream version
   * patch from upstream CVS via Alex Williamson to clear vmm= options,
     closes: #433498
   * patch from Eric Schwartz to fix eliloalt, closes: #427512
   * fix typo in elilo.templates, closes: #414663
   * documentation / translation fixes coalesced by Christian Perrier
     - Remove extra spaces in debconf templates. Closes: #413899
     - Galician. Closes: #414116
     - Swedish
     - Tamil
     - German. Closes: #413897
     - French
     - Czech.
     - Portuguese. Closes: #414211
     - Brazilian Portuguese.
     - Japanese. Closes: #414662
     - Italian.
     - Romanian. Closes: #414947, #415369
   * merge Dutch translation, closes: #418396
Files: 
 9778cf5c39aad9c5b2fe8f65efade89c 578 admin optional elilo_3.7-1.dsc
 980311f59f7c7ab1aa2a77f74db825d0 398151 admin optional elilo_3.7.orig.tar.gz
 27ddcb7aa5307e72b661612fe1c06645 32206 admin optional elilo_3.7-1.diff.gz
 7242df96bdad480063ca57753f5e5223 130486 admin optional elilo_3.7-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG3rpwZKfAp/LPAagRAvzwAJ9bjdBiFFo0on/d16ZM9cQyPflqYACZAbF/
+CyMlriw99//ECZljAdkeGo=
=u5uM
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to