Package: powerpc-utils
Version: 1.1.3-12
Severity: normal
Tags: patch
nvsetenv hardcodes /dev/nvram as the nvram device. devfs (and udev,
using devfs.rules) uses /dev/misc/nvram instead.
The attached patch checks for both devices so that it will work on
both systems. The wording of two error messages has been changed
to allow for this.
Regards,
Roger
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (990, 'unstable')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.8-powerpc
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages powerpc-utils depends on:
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
-- no debconf information
--- orig/powerpc-utils-1.1.3/nvsetenv.c 2005-03-22 20:37:11.765358544 +0000
+++ powerpc-utils-1.1.3/nvsetenv.c 2005-03-22 20:33:33.634519472 +0000
@@ -113,7 +113,7 @@
if (lseek(nvfd, NVSTART, 0) < 0
|| read(nvfd, &nvbuf, NVSIZE) != NVSIZE) {
- perror("Error reading /dev/nvram");
+ perror("Error reading nvram");
exit(EXIT_FAILURE);
}
if (nvbuf.nv.magic != NVMAGIC)
@@ -129,7 +129,7 @@
{
if (lseek(nvfd, NVSTART, 0) < 0
|| write(nvfd, &nvbuf, NVSIZE) != NVSIZE) {
- perror("Error writing /dev/nvram");
+ perror("Error writing nvram");
exit(EXIT_FAILURE);
}
}
@@ -311,10 +311,13 @@
}
}
- nvfd = open("/dev/nvram", ac <= 2 ? O_RDONLY: O_RDWR);
+ nvfd = open("/dev/misc/nvram", ac <= 2 ? O_RDONLY: O_RDWR);
if (nvfd < 0) {
- perror("Couldn't open /dev/nvram");
+ nvfd = open("/dev/nvram", ac <= 2 ? O_RDONLY: O_RDWR);
+ if (nvfd < 0) {
+ perror("Couldn't open nvram");
exit(EXIT_FAILURE);
+ }
}
if (newWorld)