Ok, here's what I did:
1. Optimize scripts in '/etc/rc.d'
a) disable gpm, so just re-title
Code:
mv rc.gpm rc.gpm-sample
this way you can still execute it when you need it. You could also make it non-executable if you want.
b) disable hotplug, so
Code:
chmod a-x rc.hotplug
this should work just fine for most people running the 2.6.x kernels, but if you have trouble, just make it executable again.
c) modify 'rc.inet1' if you use dhcp as follows:
Code:
113,114c113,114
< echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1} &" | $LOGGER
< /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1} &
---
> echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1}" | $LOGGER
> /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60} ${DHCP_OPTIONS} ${1}
That's the output of 'diff' on the two files. Basically just add the '&' in those places, that way booting will continue without waiting for dhcpcd to finish getting an IP ... which can take a really long time.
d) modify 'rc.M' as follows:
Code:
128a129,140
> # Update all the shared library links:
> if [ -x /sbin/ldconfig ]; then
> echo "Updating shared library links: /sbin/ldconfig"
> /sbin/ldconfig
> fi
>
> # Update the X font indexes:
> if [ -x /usr/X11R6/bin/fc-cache ]; then
> echo "Updating X font indexes: /usr/X11R6/bin/fc-cache"
> /usr/X11R6/bin/fc-cache
> fi
>
189,193c201,205
< #if [ -x /sbin/accton -a -r /var/log/pacct ]; then
< # /sbin/accton /var/log/pacct
< # chmod 640 /var/log/pacct
< # echo "Process accounting turned on."
< #fi
---
> if [ -x /sbin/accton -a -r /var/log/pacct ]; then
> /sbin/accton /var/log/pacct
> chmod 640 /var/log/pacct
> echo "Process accounting turned on."
> fi
203,205c215,217
< #if [ -x /usr/sbin/atd ]; then
< # /usr/sbin/atd -b 15 -l 1
< #fi
---
> if [ -x /usr/sbin/atd ]; then
> /usr/sbin/atd -b 15 -l 1
> fi
So, basically, just comment out or delete those sections. I never use accton, and rc.M warns you that using it will result in a huge log file ... which I don't want. It is off by default, but I wanna make sure
I also never use atd, so kill it.
e) Now, that first part from part 'd)' about 'Update all the shared library links' and 'Update the X font indexes' I copied to 'rc.local'. So 'rc.local' now contains:
Code:
#!/bin/sh
# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
echo "Updating shared library links: /sbin/ldconfig"
/sbin/ldconfig
fi
# Update the X font indexes:
if [ -x /usr/X11R6/bin/fc-cache ]; then
echo "Updating X font indexes: /usr/X11R6/bin/fc-cache"
/usr/X11R6/bin/fc-cache
fi
# Add anything else to be run at startup below this line !
This should be added at the very beginning of 'rc.local',
put everything else you want to run at startup after these two commands. This is mostly in response to the concern that if "you want to start something in rc.local that uses libraries in a non-standard location"
as gnashley states in another thread, 'ldconfig' must be run before these other programs run.
Also, to 'rc.M', put an '&' after the call to 'rc.local' to background the script, like this (at the bottom of rc.M)
Code:
# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
. /etc/rc.d/rc.local &
fi
So, now it will not slow down the boot up process.
f) To 'rc.S' I added:
Code:
38,41d37
< # Boost HDD speed with hdparm
< echo "hdparm -c3 -m16 /dev/hda"
< /usr/sbin/hdparm -c3 -m16 /dev/hda
<
(that's from diff, so omit the '<'), also you need to know what is best for your HDD. I think -c3 should be ok for most HDDs. Read 'man hdparm'.
Also do:
you'll get something like:
Code:
/dev/hda:
Model=ST380023A, FwRev=3.33, SerialNo=3KB1BZNK
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=156301488
IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=no WriteCache=enabled
Drive conforms to: ATA/ATAPI-6 T13 1410D revision 2: ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6
* signifies the current active mode
Check the 'MaxMultSect=16, MultSect=16', MaxMultSect is the maximum setting for '-m' option. Thus I run 'hdparm -c3 -m16 /dev/hda'. Again, read 'man hdparm'.
If know that you have no 'non-root file systems in fstab' to mount, and every time you boot it says "Mounting non-root local filesystems:" and then nothing was mounted, then you can probably also comment the following section out of rc.S:
Code:
# Mount non-root file systems in fstab, but not NFS or SMB
# because TCP/IP is not yet configured, and not proc or sysfs
# because those have already been mounted. Also check that
# devpts is not already mounted before attempting to mount
# it. With 2.4.x kernels devpts is mounted from an fstab
# entry while with a 2.6.x or newer kernel udev mounts it.
# We also need to wait a little bit to let USB and other
# hotplugged devices settle (sorry to slow down the boot):
echo "Mounting non-root local filesystems:"
sleep 3
if /bin/grep -wq devpts /proc/mounts ; then
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs,nodevpts
else
/sbin/mount -a -v -t nonfs,nosmbfs,nocifs,noproc,nosysfs
fi
NOTE: the above may not be safe for all setups ... try at your own risk. It works fine for me.
g) Make un-executable anything else in '/etc/rc.d' that you do not need.
2. Compile a new kernel. Here is a good guide:
http://www.kroah.com/lkn/
Personally, I did the following, which is applicable to pretty much everyone, first start with the generic kernel and work from there:
a) Search for the words 'not', 'found', 'no', and 'error' in 'dmesg', and take appropriate action ... removing what fails anyway.
b) disable 'pcspkr', unless you like annoying beeps every time you make an error. (disable raid/md if you don't use it)
c) make floppy a module rather than built-in (on some machines, this is the only way it will work)
d) Under 'Block layer -> IO Schedulers' read the help on all of them and see which one you think is best. IMO, best are CFQ for desktop, and deadline for database/server.
e) Under 'Processor type and features' make sure to select your processor, to enable/disable SMP if you have or don't have it, disable 'Generic x86 support' unless you're making your own distro, put max # CPUs (for multi-core), enable/disable hyperthreading for P4, enable/disable multi-core scheduler suppport, (disable local apic), read and choose 'Preemption Model' (Voluntary is good for desktop), enable/disable high memory support (if you have near 1GB RAM), and set timer frequency acordingly (1000 Hz for desktop), also to make gcc generate a smaller, faster kernel you can select 'use register arguments', but use it at your own risk ... it hasn't caused me problems.
f) don't forget to fully enable your filesystem
I think those are most important performance-wise, the rest is also important, but harder to get right
The guide should help with that.
3. Install grub ... or maybe use lilo 'compact' option ? You choose. Grub is faster from what I can tell.
That's pretty much all I did. Tell me if there is something wrong or if I did something wrong