--- nvram_linux.c.orig 2005-07-18 11:28:05.272965392 +0200 +++ nvram_linux.c 2005-07-18 11:57:15.383908088 +0200 @@ -41,6 +41,21 @@ int nvram_init(void *unused) { + /* on the wgt634u the device major and minor don't + * match those of the driver */ + char *hostname = getenv("HOSTNAME"); + if (hostname && !strcmp(hostname, "WGT634U")) { + struct stat s; + if (stat(PATH_DEV_NVRAM, &s) < 0) + goto err; + if (!S_ISCHR(s.st_mode) || (major(s.st_rdev) != 252) || (minor(s.st_rdev) != 0)) { + if (unlink(PATH_DEV_NVRAM) < 0) + goto err; + if (mknod(PATH_DEV_NVRAM, S_IFCHR | S_IRUSR | S_IWUSR, makedev(252, 0)) == -1) + goto err; + } + } + if ((nvram_fd = open(PATH_DEV_NVRAM, O_RDWR)) < 0) goto err;