Make cpufreqd work as module in Gentoo

I’m using the default setting via genkernel to build my box. But the cpufreqd always shown it cannot be start-up without the kernel config CONFIG_CPU_FREQ.

But the weird thing is: I’ve selected the CPU_FREQ* settings in my kernel and there are corresponding modules in /lib/modules/<kernel version>:/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
...

Finally, I found the reason: the modules (also the government settings) not be auto-loaded when booting. So I append the configuration for module auto-load for gentoo and everything works fine.

1. The final kernel configuration, I’ve change the default government setting from performance to userspace which make me can choose the speed I want:

1
2
3
4
5
6
7
8
9
10
11
12
13
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

2. The auto-load module settings in gentoo (/etc/conf.d/module):

1
modules_3_0="acpi-cpufreq cpufreq_ondemand cpufreq_powersave cpufreq_conservative"

Which will load the INTEL’s CPUFREQ driver (acpi-cpufreq) and the governments.
Note: The governments which is loaded can be used in the programs (eg: Gnome’s CPU Frequency Scaling Monitor).
Note: the modules should be set AT LEAST major AND minor number of kernel (eg: 3.0 as 3_0) or it cannot be parsed.

Finally, everything works fine. Enjoy it. 🙂

GRUB settings of booting from usb disk with genkernel on Gentoo

I’ve tried to use genkernel to build my gentoo box recent days. But I cannot boot correctly via an installation with external USB disk (My gentoo box is on an external USB 2.5″ disk).

The default GRUB settings for genkernel user is:

1
2
3
4
title Gentoo Linux 2.6.34-r1
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.34-gentoo-r1 real_root=/dev/sda3
initrd /boot/initramfs-genkernel-x86-2.6.34-gentoo-r1

But with this configuration, the boot procedure will stop at there is not correct root sector can be loaded. That’s because the usb is slower o be configured than my laptop’s disks. And on the other hand, the waitroot, doslowusb, and so on additional configurations cannot be passed to a genkernal-ed source.

For some tries and referenced configurations on other linux distribution, the works setting is to use UUID (UUID=….) rather than aliased device name (dev/$ROOT). The correct settings:

1
2
3
4
title Gentoo Linux 2.6.34-r1
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.34-gentoo-r1 real_root=UUID=....
initrd /boot/initramfs-genkernel-x86-2.6.34-gentoo-r1

The UUID for devices can be found in your /etc/fstab if you also use genkernel. Finally, my USB gentoo works fine. Enjoy it. 🙂

SSH connection starts up slowly

The situation is: when connect to a server with SSH session, it starts up slowly (but the web connection is fast). For some tracing and debugging, it is due to the stupid DNS setting by someone.

The reference is – SSH session slow to start? It’s the DNS stupid!, and the solution listing:

1. Check for the DNS settings in /etc/resolv.conf or NetworkManger in Gnome or any management tools on desktop environment. Or
2. Set the ”UseDNS no” in sshd config: /etc/ssh/sshd_config, and then restart sshd.

Enjoy it. 🙂

Solution for android cannot search any wifi access point

The situations are:

1. There are access points but android phone has no result in the list.
2. The access point used in the past cannot be listing too.

The solution is, via the reference – HTC Tattoo WIFI 掃描找不到任何 AP 之解法:

IMPORTANT: ONLY FOR A ROOTED USER.

Using any file manager which can access the /data directory for your phone. Then remove a system generated file: /data/misc/wifi/wpa_supplicant.conf.

Because the file is generated by system which can be regenerated after reboot. So after reboot the wifi function works fine. But the secured network connections should be connected by hand again. Enjoy it. 🙂

How to extract specific file(s) using tar

If we want to extract specific file(s) from a VERY LARGE archive (eg. the file size is 6GB), we also can use tar to achieve this goal.

1. Find out the path name in archive file if you don’t know it via $ tar -tv -f {Archive file} | grep {File name}. And it will show the RELATED file path in the archive file after listing(-t) and filtering(grep).

2. Extract the file via $ tar -xv -f {Archive file} {File path}.

It is very easy, isn’t it?