SurJector
05-06-2006, 23:08
Here are some suggestions based on 1.9.2.7-7c firmware.
1) You install the kernel modules after the various packages. You eliminate the parport.o, parport_splink.o and lp.o (might be on purpose, but I don't know). If you move the big "for" line after the module installation, you keep those modules.
2) You could make a link from /opt to /tmp/opt (and maybe something similar also for /mnt and /usr/X11R6).
3) If you make an empty (executable) file in /usr/X11R6/bin/xauth, dropbear stops complaining about non-existing xauth.
4) Specifically for the WL-HDD, you could add a function that puts the drive to sleep after a period of inactivity). I've written the following function, added it to rc/init.c (I've not really tried it so it might be buggy):
diff -r gateway/rc/init.c gateway-orig/rc/init.c
33d32
< #include <bcmnvram.h>
282,298d280
<
< #ifdef CONFIG_WLHDD
< void
< hdd_timeout(void)
< {
< int time = atoi(nvram_safe_get("hdd_timeout"));
< int fd;
<
< if (time > 0 &&
< (fd=open("/dev/ide/host0/bus0/target0/lun0/disc", O_RDWR)) >= 0) {
< unsigned char args[4] = {0xE3 /*WIN_SETIDLE1*/,time-1,0,0};
<
< ioctl(fd, 0x31f /*HDIO_DRIVE_CMD*/, &args) &&
< close(fd);
< }
< }
< #endif
Alternatively, it is possible to enable hdparm in busybox (and use hdparm -S).
5) I suggest two changes to rc/rc.c, the first one is to correct the modes of the directories created in /tmp, the second is just to call the above function:
diff -r gateway/rc/rc.c gateway-orig/rc/rc.c
455d454
< mode_t oumask;
462,464d460
< chmod("/tmp", 01777);
<
< oumask = umask(0000);
467,471c463,467
< mkdir("/tmp/var", 01777);
< mkdir("/var/lock", 01777);
< mkdir("/var/log", 01777);
< mkdir("/var/run", 01777);
< mkdir("/var/tmp", 01777);
---
> mkdir("/tmp/var", 0777);
> mkdir("/var/lock", 0777);
> mkdir("/var/log", 0777);
> mkdir("/var/run", 0777);
> mkdir("/var/tmp", 0777);
476,481d471
<
< /* /opt */
< mkdir("/tmp/opt", 0755);
<
< /* /home */
< mkdir("/tmp/home", 0755);
486d475
< umask(oumask);
684,688d672
< #ifdef CONFIG_WLHDD
< /* Set IDE timeout for hard drive */
< hdd_timeout();
< #endif
<
6) (minor) in rc/watchdog.c, there is a comment containing NORMAL_PERIOD*10 while the check is done each NORMAL_PERIOD*5
7) (minor) I don't like <CR><LF> in text files, you could change the www files to only <LF> (this can easily be automated with a sed script).
8) Some modules can be included in kernel to save some memory (if they have to be there all the time: usb for instance, ide for the WL-HDD), other could be loaded "on demand" (videodev, usb-storage, scsi, sd)
Obviously, you are free to follow my suggestions or not. Fact is that your firmware is fantastic...
Obviously2: I've done the diff in reverse, if you want to use them you'll have to use patch -R -p1 (against standard 1.9.2.7-7c source tree).
1) You install the kernel modules after the various packages. You eliminate the parport.o, parport_splink.o and lp.o (might be on purpose, but I don't know). If you move the big "for" line after the module installation, you keep those modules.
2) You could make a link from /opt to /tmp/opt (and maybe something similar also for /mnt and /usr/X11R6).
3) If you make an empty (executable) file in /usr/X11R6/bin/xauth, dropbear stops complaining about non-existing xauth.
4) Specifically for the WL-HDD, you could add a function that puts the drive to sleep after a period of inactivity). I've written the following function, added it to rc/init.c (I've not really tried it so it might be buggy):
diff -r gateway/rc/init.c gateway-orig/rc/init.c
33d32
< #include <bcmnvram.h>
282,298d280
<
< #ifdef CONFIG_WLHDD
< void
< hdd_timeout(void)
< {
< int time = atoi(nvram_safe_get("hdd_timeout"));
< int fd;
<
< if (time > 0 &&
< (fd=open("/dev/ide/host0/bus0/target0/lun0/disc", O_RDWR)) >= 0) {
< unsigned char args[4] = {0xE3 /*WIN_SETIDLE1*/,time-1,0,0};
<
< ioctl(fd, 0x31f /*HDIO_DRIVE_CMD*/, &args) &&
< close(fd);
< }
< }
< #endif
Alternatively, it is possible to enable hdparm in busybox (and use hdparm -S).
5) I suggest two changes to rc/rc.c, the first one is to correct the modes of the directories created in /tmp, the second is just to call the above function:
diff -r gateway/rc/rc.c gateway-orig/rc/rc.c
455d454
< mode_t oumask;
462,464d460
< chmod("/tmp", 01777);
<
< oumask = umask(0000);
467,471c463,467
< mkdir("/tmp/var", 01777);
< mkdir("/var/lock", 01777);
< mkdir("/var/log", 01777);
< mkdir("/var/run", 01777);
< mkdir("/var/tmp", 01777);
---
> mkdir("/tmp/var", 0777);
> mkdir("/var/lock", 0777);
> mkdir("/var/log", 0777);
> mkdir("/var/run", 0777);
> mkdir("/var/tmp", 0777);
476,481d471
<
< /* /opt */
< mkdir("/tmp/opt", 0755);
<
< /* /home */
< mkdir("/tmp/home", 0755);
486d475
< umask(oumask);
684,688d672
< #ifdef CONFIG_WLHDD
< /* Set IDE timeout for hard drive */
< hdd_timeout();
< #endif
<
6) (minor) in rc/watchdog.c, there is a comment containing NORMAL_PERIOD*10 while the check is done each NORMAL_PERIOD*5
7) (minor) I don't like <CR><LF> in text files, you could change the www files to only <LF> (this can easily be automated with a sed script).
8) Some modules can be included in kernel to save some memory (if they have to be there all the time: usb for instance, ide for the WL-HDD), other could be loaded "on demand" (videodev, usb-storage, scsi, sd)
Obviously, you are free to follow my suggestions or not. Fact is that your firmware is fantastic...
Obviously2: I've done the diff in reverse, if you want to use them you'll have to use patch -R -p1 (against standard 1.9.2.7-7c source tree).