Thursday 25 September 2014

FreeBSD Woes: No power management under LXDE/XFCE

FreeBSD version: 10.0
Device: ASUS Aspire One
Symptom: No Suspend/Restart/Shutdown in the logoff menu, and no suspend in the lid close of xfce4-power-manager.

LINUX oriented forums on the Web suggest installing the package pm-utils [1], however, as of today this package is too Linux centric and is not available on FreeBSD.

A SECOND solution offered is the PolicyKit configuration to allow shutdown/restart/standby for all users [2].

AUTHOR SUGGESTS the use of GDM as the X login manager, even for XFCE4 and LXDE, instead of XDM or SLIME.

[1]: http://askubuntu.com/questions/460101/xfce4-power-manager-suspend-not-available-for-lid-close
[2]: https://bbs.archlinux.org/viewtopic.php?id=139197

FreeBSD Woes: Console with KMS XOrg

FreeBSD version: 9.3
Device: HP EliteBook 6930p
Symptom: No console, cannot switch to console after X desktop manager bootup.

FreeBSD 9.3-RELEASE kernel does not have VT (newcons) device driver enabled by default and a new kernel has to be compiled with the VT options enabled [1].

The process for compiling the kernel may be found in the handbook [2].

In order to have the bootup kernel messages in text mode instead of the graphics (VGA) mode, the following line is required in /boot/loader.conf[1].

/boot/loader.conf:
hw.vga.textmode=1

[1]: https://wiki.freebsd.org/Newcons
[2]: https://www.freebsd.org/doc/handbook/kernelconfig-config.html, section 9.4 and 9.5.

FreeBSD on Older Laptops: Sound

FreeBSD version: 9.3
Device: HP EliteBook 6930p
Symptom: No sound although no error messages, and truss shows /dev/dsp being written to normally

The usual cause of this issue is that wrong pins are allocated to the sound output. Pin dumping using the following commands can help find the root cause [1].

# sysctl dev.hdac.0.pindump=1
# dmesg

For HP EliteBook 6930p, the following lines have to be added to /boot/device.hints file:

/boot/device.hints:
# From the web for sound
hint.hdac.0.cad0.nid22.config="as=1"
hint.hdac.0.cad0.nid18.config="as=2"

[1]: http://forums.pcbsd.org/showthread.php?t=15377

FreeBSD on Older Laptops: Boot issues

FreeBSD version: 9.3
Device: HP EliteBook 6930p
Symptom: FreeBSD does not boot after successful installation

These two causes are covered in this post:
1. GPT based slices when old laptop BIOS do not support them.
2. No boot code written by sysinstall.

THE GUID based partition tables (GPT) allow for larger disks, higher protection by redundancy, and higher level of configurability. However, this new feature is not supported on older laptops such as HP EliteBook 6930p, which support the MBR based partition scheme.

GPT could be wrongly setup on older laptops due to two reasons: 1) wrong selection by the user, or 2) automated partition programs for e.g. PC-BSD graphical installer.

The solution is to destroy all the partitions, make new MBR slices (partitions) and re-install the OS.

A SECOND rare cause is that FreeBSD bootcode essential for bootup, is not written by sysinstall. Author usually escapes to the chroot'ed shell at the end of the installation to execute the following commands which manually install the bootcode.

Assuming that your disk is 'ada0' and you've installed FreeBSD on the first slice (partition):

# gpart bootcode -b /boot/boot0 ada0
# gpart bootcode -b /boot/boot ada0s1

Your disk and partition may be found out in the chroot'ed shell by checking the device that is mounted. Multiple resources on the Web detail these steps well, for e.g. [1].


[1]: http://daemon-notes.com/articles/system/install-ufs/gpart-mbr