HP 540
From OpenSource-WiKi
Some steps especially for HP 540
Kernel Configuration for HP 540
Get into menuconfig
cd /usr/src/linux && make menuconfig
and check the following kernel settings:
| Linux Kernel Configuration: for HP 540 |
General setup --->
[*]Enable loadable module support --->
[*]Module unloading
Processor type and features --->
[*]High Resolution Timer Support
[*]Symmetric multi-processing support
[*]HPET Timer Support
[*]Multi-core scheduler support (NEW)
[*]Reroute for broken boot IRQs
[*]machine Check Expection
<*>Check for non-fatal errors on AMD Athlon/Duron / Inter Pentium
[*]Check for P4 thermal throttling interrupt.
[*]Enable X86 board specific fixups for reboot
<M> /dev/cpu/microcode - microcode support
[*]Intel microcode patch loading support (NEW)
<M>/dev/cpu/*/msr - Model-specific register support
<M>/dev/cpu/*/cpuid - CPU information support
Processor family (Core 2/newer Xeon)
(*)Core 2/newer Xeon
[*]Preemption Model (No Forced Preemption (Desktop) --->
Voluntary Kernel Preemption (Desktop)
[*]MTRR (Memory Type Range Register) support
Power management and ACPI options --->
[*]Suspend to RAM and standby (NEW)
[*]Hibernation (aka 'suspend to disk') (NEW)
[*]ACPI (Advanced Configuration and Power Interface) Support --->
[*]Deprecated /proc/acpi files
...
[M]Smart Battery System #(modules called sbs and sbshc)
[*]CPU Frequency scaling --->
[*]CPU frequency translation statistics (NEW)
[*]CPU frequency translation statistics details
Default CPUFreq governer (ondemand) --->
<*>'powersave' governer for userspace frequency scaling (NEW)
<*>'userspace' governer for userspace frequency scaling (NEW)
<*>'conservative' cpufreq governor (NEW)
*** CPUFreq processor drivers ***
[*]ACPI Processor P-State driver (NEW)
<M>Intel Speedstep on ICH-M chipsets (ioport interface) #(speedstep-ich ?)
Bus options (PCI etc.) --->
[*]PCI Express support
[*]Networking support --->
<M>Bluetooth subsystem support --->
<M> L2CAP protocol support
<M> RFCOMM protocol support
<M> BNEP protocol support
<M> HIDP protocol support
Bluetooth device drivers --->
<M>HCI BCM203x USB driver
Device drivers --->
MAC ?
[*]USB support --->
<*>Support for Host-side USB
[*]USB verbose debug messages
[*]USB announce new devices
[*]USB device filesystem
[*]USB selective suspend/resume and wakeup
<*>EHCI HCD (USB 2.0) support
<*>OHCI HCD support
<*>UHCI HCD (most Intel and VIA) support
<M>USB Printer support #(usblp)
<M>USB Wireless Device Management support
<M>USB Mass Storage support ?
<M>USB Serial Converter support
<M>USB Generic Serial Driver
# which one is our USB to serial converter - yet to know !
<*>MMC/SD/SDIO card support --->
<*>Secure Digital Host Controller Interface support
<M>SDHCI support on PCI bus
<M>Ricoh MMC Controller Disabler (EXPERMENTAL) #(ricoh_mmc)
[*]LED Support --->
[*]LED Class Support
[*]LED Trigger support
<*> Real Time Clock
[*]Set system time from RTC on startup and resume
[*]X86 Platform Specific Device Drivers --->
<*>HP WMI extras #(I don't see them in 2.6.30-r6 ?)
<*>WMI
File systems
<*> Ext3 journalling file system support
CD-ROM/DVD Filesystems --->
<*> ISO 9660 CDROM file system support
[*] Microsoft Joliet CDROM extensions
[*] Transparent decompression extension
<M> UDF file system support #(udf)
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows 95) fs syooirt
<*> NTFS file system support
[*} NTFS write support
Psuedo filesystems --->
/proc file system support
[*] /proc/kcore support
[*] Virtual memory file system support (former shm fs)
Miscellaneous filesystems --->
<M> Apple Extended HFS file system support #(hfsplus)
[*]Network File Systems --->
NFS #(can't see why ?)
CIFS
|
Some configuration stuffs for HP 540
Set timezone to NST
| File: /etc/conf.d/clock |
CLOCK="local" TIMEZONE="Asia/Kathmandu" |
Set hostname
| File: /etc/conf.d/hostname |
HOSTNAME="my-laptop" |
Configure syslog-ng
| File: /etc/syslog-ng/syslog-ng.conf |
# add these lines
options { create_dirs(yes); perm(0660); dir_perm(0770); };
destination per_daemon { file("/var/log/syslog-ng/daemon/${PROGRAM}.log"); };
log { source(src); destination(per_daemon); };
# this creates log structures as follows
# /var/log/syslog-ng/daemon/acpid.log
# /var/log/syslog-ng/daemon/cron.log
# /var/log/syslog-ng/daemon/dhcpcd.log
# /var/log/syslog-ng/daemon/gdm.log
# /var/log/syslog-ng/daemon/gdmsetup.log
# /var/log/syslog-ng/daemon/gnome-power-manager.log
# /var/log/syslog-ng/daemon/groupadd.log
# /var/log/syslog-ng/daemon/init.log
# /var/log/syslog-ng/daemon/kernel.log
# /var/log/syslog-ng/daemon/logger.log
# /var/log/syslog-ng/daemon/login.log
# /var/log/syslog-ng/daemon/ntpdate.log
# /var/log/syslog-ng/daemon/rc-scripts.log
# /var/log/syslog-ng/daemon/sSMTP.log
# /var/log/syslog-ng/daemon/shutdown.log
# /var/log/syslog-ng/daemon/sshd.log
# /var/log/syslog-ng/daemon/su.log
# /var/log/syslog-ng/daemon/sudo.log
# /var/log/syslog-ng/daemon/syslog-ng.log
# /var/log/syslog-ng/daemon/useradd.log
# /var/log/syslog-ng/daemon/...
|
Configure logrotate.d to include above syslog files
| File: /etc/logrotate.d/syslog-ng |
# edit or add these lines to logrotate above mentioned syslog files
/var/log/messages <b>/var/log/syslog-ng/daemon/*.log</b> {
missingok
sharedscripts
postrotate
/etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
endscript
}
|
I see lots of unnecessary log files with my name in /var/log/syslog-ng/daemon, so I've made a bash script to clean them manually
| File: /var/log/syslog-ng/1_cleanup.sh |
#!/bin/sh # 07-sep-2009 - keshav.maharjan@worldlink.com.np find /var/log/syslog-ng/daemon/*keshav* | xargs rm rm /var/log/syslog-ng/daemon/.log |
Set displaymanager to gdm instead of default xdm
| File: /etc/conf.d/xdm |
##DISPLAYMANAGER="xdm" DISPLAYMANAGER="gdm" |
Configuration for wireless network connection
| File: /etc/conf.d/net |
# Wlink ?
key_Wlink="xxxxxxxx enc open"
...
mac_essid_000102030405="myssid"
key_myssid="enc off"
preferred_aps=( "Wlink" "myssid" )
config_eth0=( "dhcp" )
config_wlan0=( "dhcp" )
preup() {
# for eth0
#if mii-tool "${IFACE}" 2> /dev/null | grep -q "transceiver"; then
if ethtool "${IFACE}" | grep -q 'Link detected: no'; then
ewarn "No link on ${IFACE}, aborting configuration"
return 1
fi
# for wlan0
if ethtool "${IFACE}" | grep -q 'No data available'; then
return 0
fi
# for eth0
ewarn "Link ON on ${IFACE}"
return 0
}
postup () {
# for wlan0
if [[ ${IFACE} == "wlan0" ]]; then
iwconfig wlan0 txpower on
fi
}
|
Configure to name wireless interface wlan0 instead of generic eth1
| File: /etc/udev/rules.d/70-persistent-net.rules |
...was... KERNEL=="eth*", NAME="eth1"
...changed to ... KERNEL=="eth*", NAME="wlan0"
# PCI device 0x14e4:0x4315 (wl)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:01:02:03:04:05", ATTR{type}=="1", KERNEL=="eth*", NAME="wlan0"
|
How to automatically set brightness according to the time of day
Create file /etc/cron.hourly/set_brightness.sh
and chmod it 755.
| File: /etc/cron.hourly/set_brightness.sh |
#!/bin/sh
# 2009-09-09 - keshav.maharjan@worldlink.com.np
hour=`date +%H`
# cat /proc/acpi/video/C099/C1AE/brightness
# levels: 30 37 44 51 58 65 72 79 86 93 100
# current: 44
case "$hour" in
08 | 09 | 10 )
echo "44" > /proc/acpi/video/C099/C1AE/brightness
;;
11 | 12 | 13 )
echo "51" > /proc/acpi/video/C099/C1AE/brightness
;;
14 | 15 | 16 | 17 )
echo "44" > /proc/acpi/video/C099/C1AE/brightness
;;
18 | 19 )
echo "37" > /proc/acpi/video/C099/C1AE/brightness
;;
20 | 21 | 22 | 23 | 00 | 01 | 02 | 03 | 04 )
echo "30" > /proc/acpi/video/C099/C1AE/brightness
;;
05 | 06 | 07 )
echo "37" > /proc/acpi/video/C099/C1AE/brightness
;;
* )
echo "You got into a black hole"
;;
esac
|