Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, June 15, 2010

Setup Gentoo on Asus U30JC-QX010X : Part 3 - X

This post is greatly inspired from Gentoo Xorg How-To. Edit 2010-07-27 :
  • Replaced vesa by intel in VIDEO_CARDS. Using vesa cannot scale X to 1366x768 and it is not compatible with vesa framebuffer.
  • nvidia is not working. It is better to remove it to avoid problems when enabling xorg-x11 opengl (conflict between lib32 and lib64 folders).
Edit /etc/make.conf and define both INPUT_DEVICES and VIDEO_CARDS :
INPUT_DEVICES="evdev synaptics keyboard mouse"
VIDEO_CARDS="nvidia intel"
Edit use flags for a couple of packages needed for X. You can group these settings in /etc/portage/package.use/X :
media-fonts/corefonts X
media-fonts/dejavu X
sys-apps/dbus X
sys-apps/hal laptop X
x11-base/xorg-server hal
x11-drivers/xf86-input-synaptics hal
Emerge Xorg :
emerge xorg-server
env-update && source /etc/profile
Select xorg-x11 (this might be not necessary) ;
eselect opengl set xorg-x11
Emerge hal :
emerge hal
rc-update add hald default
Update keymap if needed :
mkdir -p /etc/hal/fdi/policy
cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy

<merge key="input.xkb.layout" type="string">fr</merge>

/etc/init.d/hald restart
Add yourself to the video group (maybe not needed). Nvidia (I fail to use Nvidia and the Geforce 310m for now. No better result with 256.35) : /etc/portage/package.keywords/X :
~sys-kernel/gentoo-sources-2.6.33-r2 ~amd64
~sys-kernel/gentoo-sources-2.6.34-r1 ~amd64
~x11-drivers/nvidia-drivers-195.36.24 ~amd64
~x11-libs/libvdpau-0.3-r2 ~amd64
Emerge kernel, nvidia-drivers, glx tools (like glxgears) :
emerge gentoo-sources-2.6.33-r2
emerge nvidia-drivers-195.36.24
emerge mesa-progs
module-rebuild will rebuild the necessary packages when upgrading your kernel :
emerge module-rebuild
module-rebuild populate
module-rebuild rebuild
Configure Xorg :
Xorg -configure
Copy /root/xorg.conf.new to /etc/X11/xorg.conf. You need to comment the Nvidia section to keep only vesa (Nvidia fails).
#Section "Device"
# Identifier  "Card0"
# Driver      "nvidia"
# VendorName  "nVidia Corporation"
# BoardName   "Unknown Board"
# BusID       "PCI:1:0:0"
#EndSection
Emerge enlightenment. It is also a good idea to add xterm and some font packages. Set enlightenment default :
emerge enlightenment corefonts dejavu xterm
~/.xinitrc :
exec /usr/bin/e16
At this point, once the new kernel has been installed, you should be able to start enlightenment safely (with intel driver only for now). For info, small kernel updates :
diff config-2.6.33-r2.0 config-2.6.33-r2.7

< CONFIG_ACPI_VIDEO=y
> CONFIG_ACPI_VIDEO=m
< CONFIG_I2C_ALGOBIT=y
> CONFIG_I2C_ALGOBIT=m
< CONFIG_AGP=y
< CONFIG_AGP_AMD64=y
< CONFIG_AGP_INTEL=y
> CONFIG_AGP=m
> CONFIG_AGP_INTEL=m
< CONFIG_DRM=y
< CONFIG_DRM_KMS_HELPER=y
> CONFIG_DRM=m
> CONFIG_DRM_KMS_HELPER=m
< CONFIG_DRM_I915=y
> CONFIG_DRM_I830=m
> CONFIG_DRM_I915=m
< CONFIG_VIDEO_OUTPUT_CONTROL=y
< CONFIG_FB=y
> CONFIG_VIDEO_OUTPUT_CONTROL=m
> CONFIG_FB=m
> CONFIG_FIRMWARE_EDID=y
< CONFIG_FB_CFB_FILLRECT=y
< CONFIG_FB_CFB_COPYAREA=y
< CONFIG_FB_CFB_IMAGEBLIT=y
> CONFIG_FB_CFB_FILLRECT=m
> CONFIG_FB_CFB_COPYAREA=m
> CONFIG_FB_CFB_IMAGEBLIT=m
< CONFIG_FB_TILEBLITTING=y
< CONFIG_FB_EFI=y
> CONFIG_FB_UVESA=m
< CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
> CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256
< CONFIG_FRAMEBUFFER_CONSOLE=y
> CONFIG_FRAMEBUFFER_CONSOLE=m
> CONFIG_LOGO_LINUX_MONO=y
> CONFIG_LOGO_LINUX_VGA16=y
Nvidia errors :
NVRM: failed to copy vbios to system memory.
NVRM: RmInitAdapter failed! (0x30:0xffffffff:868)
NVRM: rm_init_adapter(0) failed

Friday, May 14, 2010

Setup Gentoo on Asus U30JC-QX010X : Part 2

Here is common hardware info about Asus U30JC-QX010X : lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12)
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 12)
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 12)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)
00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 06)
00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 06)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)
01:00.0 VGA compatible controller: nVidia Corporation GT218 [GeForce 310M] (rev a2)
03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
04:00.0 Ethernet controller: Atheros Communications AR8131 Gigabit Ethernet (rev c0)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model  : 37
model name : Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz
stepping : 2
cpu MHz  : 2267.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id  : 0
cpu cores : 2
apicid  : 0
initial apicid : 0
fpu  : yes
fpu_exception : yes
cpuid level : 11
wp  : yes
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips : 4521.00
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model  : 37
model name : Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz
stepping : 2
cpu MHz  : 2267.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id  : 2
cpu cores : 2
apicid  : 4
initial apicid : 4
fpu  : yes
fpu_exception : yes
cpuid level : 11
wp  : yes
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips : 4521.75
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 2
vendor_id : GenuineIntel
cpu family : 6
model  : 37
model name : Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz
stepping : 2
cpu MHz  : 2267.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id  : 0
cpu cores : 2
apicid  : 1
initial apicid : 1
fpu  : yes
fpu_exception : yes
cpuid level : 11
wp  : yes
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips : 4521.75
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 3
vendor_id : GenuineIntel
cpu family : 6
model  : 37
model name : Intel(R) Core(TM) i5 CPU       M 430  @ 2.27GHz
stepping : 2
cpu MHz  : 2267.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id  : 2
cpu cores : 2
apicid  : 5
initial apicid : 5
fpu  : yes
fpu_exception : yes
cpuid level : 11
wp  : yes
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips : 4521.75
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         84000 mWh
last full capacity:      80700 mWh
battery technology:      rechargeable
design voltage:          15000 mV
design capacity warning: 8400 mWh
design capacity low:     840 mWh
capacity granularity 1:  840 mWh
capacity granularity 2:  840 mWh
model number:            UL50-56
serial number:            
battery type:            LIon
OEM info:                ASUSTek

Setup Gentoo on Asus U30JC-QX010X : Part 1

Here is how to setup Gentoo on my brand new asus. Summary :
  • Resize partitions with gparted.
  • Setup minimal gentoo
  • Update Windows 7 boot loader
Partitioning :
  • Burn last GParted live iso (current is 0.5.2-9).
  • Enter BIOS (sup key)
  • Switch boot devices
  • Launch GParted
  • Remove 30 GB from D: (/dev/sda5)
  • Add / partition : 25 GB (/dev/sda6)
  • Add /home partition : 5 GB (/dev/sda7)
I don't think I need a swap partition. To install Gentoo, I followed both x64 (last updated in 2008) and x86 (updated in 2010) guides.
  • Boot : gentoo with fr keymap.
  • Set root pasword : passwd ...
  • Load wifi : modprobe ath9k
  • ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
  • Edit /etc/conf.d/net and /etc/wpa_supplicant/wpa_supplicant.conf
Copy them from another box through a usb key or edit them from scratch with nano. /etc/conf.d/net :
modules=( "wpa_supplicant" "!iwconfig" )
wpa_supplicant_wlan0="-Dwext"
/etc/wpa_supplicant/wpa_supplicant.conf :
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
network={
 ssid="freebox_essid"
 key_mgmt=WPA-PSK
 psk="secret"
 priority=20
}
  • Start network : /etc/init.d/net.wlan0 start
  • Mount partitions :
mount /dev/sda6 /mnt/gentoo
mkdir /mnt/gentoo/home
mount /dev/sda7 /mnt/gentoo/home
  • Set date
Stage3 :
cd /mnt/gentoo
links http://www.gentoo.org/main/en/mirrors.xml
  • Links keys : Download / Quit.
  • releases/amd64/current-iso/stage3-amd64-20100408.tar.bz2
tar xvjpf stage3-*.tar.bz2
  • snapshots/current/portage-latest.tar.bz2
tar -xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
make.conf :
nano -w /mnt/gentoo/etc/make.conf
  • Got CFLAGS and CXXFLAGS from Gentoo wiki.
  • MAKEOPTS is cpu count plus one.
CFLAGS="-march=core2 -msse4 -mcx16 -mpopcnt -msahf -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
mirrorselect (free.fr) :
emerge mirrorselect
mirrorselect -i -o >> /etc/make.conf
mirrorselect -i -r -o >> /etc/make.conf
Chroot :
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile
export PS1="(chroot) $PS1"
Portage :
emerge --sync
USE="-fortran -ipv6 mmx nptl nptlonly sse sse2 unicode"
locale & time :
nano -w /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
fr_FR ISO-8859-1
fr_FR@euro ISO-8859-15
fr_FR.UTF-8 UTF-8
cp /usr/share/zoneinfo/Europe/Paris /etc/localtime
Kernel (2.6.32-r7) :
emerge gentoo-sources
make menuconfig
    Device Drivers  --->
[*]   Network device support  --->
[*]     Wireless LAN  --->
[*]       Wireless LAN (IEEE 802.11)  --->
<M>         Atheros Wireless Cards  --->
<M>           Atheros 802.11n wireless cards support
    File systems  --->
<*>   The Extended 4 (ext4) filesystem
[*]     Ext4 extended attributes
[*]       Ext4 POSIX Access Control Lists
[*]       Ext4 Security Labels
CONFIG_ATH_COMMON=m
CONFIG_ATH9K=m
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
make -j5 && make modules_install
cp arch/x86_64/boot/bzImage /boot/kernel-2.6.32-gentoo-r7
nano -w /etc/modules.autoload.d/kernel-2.6
ath9k
  • fstab :
nano -w /etc/fstab
/dev/sda6 / ext4 defaults,noatime 1 1
/dev/sda7 /home ext4 noatime   0 2
  • network : copy net and wpa_supplicant.conf (you can use alternate console with Alt-F2)
cd /etc/init.d
ln -s net.lo net.wlan0
rc-update add net.wlan0 default
emerge dhcpcd wpa_supplicant
System configuration :
emerge syslog-ng vixie-cron
rc-update add syslog-ng default
rc-update add vixie-cron default
rc-update add sshd default
  • Set root password (do not skip this step!) :
passwd
  • Config files :
nano -w /etc/conf.d/clock

TIMEZONE="Europe/Paris"

nano -w /etc/rc.conf

EDITOR="/usr/bin/vim"
XSESSION="e16"

nano -w /etc/conf.d/rc

RC_PARALLEL_STARTUP="yes"

nano -w /etc/conf.d/keymaps

KEYMAP="fr-latin9"
grub :
emerge grub

nano -w /boot/grub/grub.conf

default 0
timeout 50
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo
root (hd0,5)
kernel /boot/kernel-2.6.32-r7 root=/dev/sda6

grub

grub> root (hd0,5)
grub> setup (hd0,5)
grub> quit
  • Save boot sector (to some usb key):
dd if=/dev/sda6 of=boot.grub bs=512 count=1
Reboot :
exit
umount /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo/home /mnt/gentoo
reboot
Update boot loader :
  • Steps based on this post
  • Copy boot.grub to C:\
  • Open a cmd as administrator :
C:\>bcdedit /export bcdedit-export-100513
L'opération a réussi.

C:\>bcdedit /create /d Gentoo /application BOOTSECTOR
L'entrée {4bd6ad4c-7c0c-11de-baef-deb9d273c9fa} a été correctement créée.
L'entrée {4bd6ad4d-7c0c-11de-baef-deb9d273c9fa} a été correctement créée.

C:\>bcdedit /set {4bd6ad4d-7c0c-11de-baef-deb9d273c9fa} device boot
L'opération a réussi.

C:\>bcdedit /set {4bd6ad4d-7c0c-11de-baef-deb9d273c9fa} path \boot.grub
L'opération a réussi.

C:\>bcdedit /set {4bd6ad4d-7c0c-11de-baef-deb9d273c9fa} locale fr-FR
L'opération a réussi.

C:\>bcdedit /displayorder {4bd6ad4d-7c0c-11de-baef-deb9d273c9fa} /addlast
L'opération a réussi.

C:\>bcdedit -v
...

Secteur de démarrage en mode réel
---------------------------------
identificateur          {4bd6ad4d-7c0c-11de-baef-deb9d273c9fa}
device                  boot
path                    \boot.grub
description             Gentoo
locale                  fr-FR
Now you should be able to select Gentoo on next reboot. Not seen in amd64 guide :
ccache
emerge -vuD --newuse world
emerge --oneshot libtool
dispatch-conf
perl-cleaner all
python-updater
Notes :
  • grub menu is not visible ?!
  • A lot of packages need to be emerged, still.
Some hardware info is available in next post.