Tuesday 3 September 2013

notes on installing gentoo with linux kernel 3.10 on toshiba laptop

When you learn Red Hat, you learn Red Hat, when you learn debian, you learn debian, when you learn Slackware/gentoo, you learn Linux

This is one of the reasons I decided to swap into slackware and gentoo.

different from mainstream linux which provides intall guides and be able to boot, gentoo has to be installed by chrooting from a working distro. now there are three stages to start from. however, it is suggested to be started from the stage three, as one didn't miss too much for the first two stages, together with the fact that it is very time consuming for the first two stages. I decided to start from the stage 3.

I used 


as installation guidance. it is very straightforward

here I just made some notes on the things that are be aware of during the installation:

1. it is suggested from the manual that one use minimal cd to install which provides all the required tools for compiling. However, I realized that using this approach can not connect to wifi still. therefore, I decided to use systemrescue cd and ubuntu. it turns out that both are almost the same, if one follows the instruction neatly.

2. it is also suggested from the manual that one separate /boot with /. i did that for my install. however, from the web, i do found that it is not necessary to do so if one don't want to. I will not install that in the next run.

3. commands

mount /dev/sda2 /mnt/gentoo
cd /mnt/gentoo/
mount -t proc proc /mnt/gentoo/proc   # required

it is still not clear why this is needed.


mount -o rbind /dev /mnt/gentoo/dev
mount -o rbind /sys /mnt/gentoo/sys   # needed

this two are very important --rbind sets /mnt/gentoo/dev to /dev recursively, so that the /dev at guest gentoo is equivalent to the host /dev. this is very important at the very beginning, because thereare not too much device working in the gentoo installation. also it is important because the linking file can point to the target properly

cp -L /etc/resolv.conf /mnt/gentoo/etc/
copy dns info

chroot /mnt/gentoo /bin/bash

remember once we rescue a crashed system (like scientificlinx) we use another medium to boot the pc and gain the root priviliage of the broken system and to work further.

source /etc/profile
export PS1="(gentoo) $PS1"

then we just follow the instruction to finish the installation. 

but the trouble part is how to install wifi driver in gentoo linux? mine is rtl8188. I tried to make driver downloaded from both rtl website and backports. but they all failed to install. (something like autoconf.h file do not exist any more. for backports, it is installed properly, but still may not be able to work) 
  later on I understood that after kernel 3. 8192 driver has been integrated into the kenel as modual. therefore, one has enable

CONFIG_RTLWIFI=m
CONFIG_RTL8192CE=m

at /usr/src/linux/.config file.

and recompile and install.

after that one still need

emerge linux-firmware 

to automatically find the driver

also one needs

ln /etc/init.d/net.lo /etc/init.d/net.wlp2s0
(wlp2s0 is the wifi name, which is not wlan0 as usual)

then one can use command 
/etc/init.d/net.wlp2s0 start
/etc/init.d/net.wlp2s0 restart

some useful commands for wifi
ifconfig wlp2s0 up
ethtool -i wlp2s0
iw wlp2s0 scan 
iwlist scan

other commands used during install
emerge htop
emerge net-wireless/wireless-tools
emerge app-editors/vim
emerge sys-apps/pciutils   # get ispci
emerge linux-firmware

emerge sync  #  apt-get update
emerge -DNu  world 
update-env
update-etc

so far the network is working, the next stage is just try to enrich the system and make it like a normal system.

another thing that needs to be aware is that once using wext driver in wpa_supplicant there are some problem, the wifi will not be connected. therefore, one has to use -Dnl8011 instead.

loss during install 1. two day working time 2. my windows 7 is mistakenly deleted during a install

#----------------------------------
make wicd work

# /etc/rc.d/dbus restart
# /etc/rc.d/wicd restart
# wicd-gtk


#--------------------------
wpa_supplicant -c /home/chenmingl/Desktop/wpa_supplicant.conf -i wlp2s0 -Dnl80211


make ati drivers work
in /usr/src/linux/.conf

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_TTM=m         # this is newly added

#
# I2C encoder or helper chips
#
# CONFIG_DRM_I2C_CH7006 is not set
# CONFIG_DRM_I2C_SIL164 is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
CONFIG_DRM_RADEON=m         # this is newly added
# CONFIG_DRM_RADEON_UMS is not set
# CONFIG_DRM_NOUVEAU is not set


this is equivalent to
Processor type and features --->
<*> MTRR (Memory Type Range Register) support
Device drivers --->
   Graphics support --->
   <M> /dev/agpgart (AGP Support) --->
      (The agpgart option is not present on 64-bit kernels; just choose your chipset support.)
      <M> Intel 440LX/BX/GX, I8xx and E7x05 support
      (Enable your chipset instead of the above.)
   <M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
      <M> (Select your graphics card from the list)

at manual setup
#---------------------------------

if one wants to use wpa_managager, one has to stop dbus which supports networkmanager and wicd

/etc/init.d/dbus stop

#---make network manager work--------------------------------
# NetworkManager
# startx
#but the priviliage problem still exists, that is why i decided to go to gnome to try my luck

# the problem for wicd is if I run
# wicd
# wicd-gtk or wicd-client
the system didn't actually find network for it

there is a trick to work around this problem, which is to startx by root, set the wireless settings, then go back logon as normal user.


The problem for wpa_supplient is that it always connects and disconnects. which is very annoying

#------------------can not emerge  gnome-extra/gnome-user-docs----
this happens when I tries to emerge gnome
# MAKEOPTS=-j1 emerge -1 gnome-user-docs
#


#--------------------no GUI on VLC and virtualbox---------------
one has to ad qt4 in /etc/portage/make.conf file sothat it will be enabled.
#--------------------install chinese input in gentoo------------
now ibus does not have ebuild on ibus-table-wubi so we have to use another input method
Fcitx is a very good alternative for chinese input purpose.
but one has to be careful before installing that, one has to uninstall ibus completelly.
otherwise there will be problem in using ctrl+space to change input method.
#-------------------no sound problem after installing gentoo-----------------
once i came across a problem on sound card in gentoo.
I have installed the sound card properly in linux kernel,
and from lsmod, we can find the sound card module are properly loaded on boot
however, from pulsemixer I can not find any sound device.
it turns out to be a problem of the group. I need to add my user name to audio by
# usermod -a -G audio chenming

1 comment:

  1. Thanks for the reply, the later post will be better formatted and described.

    ReplyDelete