Difference between revisions of "Lenovo Thinkpad T420"

From Funtoo Linux
Jump to: navigation, search
Line 272: Line 272:
 
Welcome to funtoo! You should be greeted by a bunch of spammy text that scrolls by reasonably fast and then a couple penguins and openrc. Login to your root user and lets start playing.
 
Welcome to funtoo! You should be greeted by a bunch of spammy text that scrolls by reasonably fast and then a couple penguins and openrc. Login to your root user and lets start playing.
  
== Getting up the (wired) network ==
+
==== Getting up the (wired) network ====
 
If you're gifted with a wired network connect, use it! The initial setup is much more convenient and quick.
 
If you're gifted with a wired network connect, use it! The initial setup is much more convenient and quick.
  

Revision as of 03:51, 21 April 2012

Contents

Introduction

Throughout, this article will assume the following:

  • You have installed Gentoo or Funtoo in the past.
    • If you haven't, this article will still serve you well, but please have either the official funtoo, or gentoo install guides open. We move through non-machine-specific bits with little elaboration.
  • Have a T420 or similar machine.

Even if you do not have a T420, you may find this guide useful for:

  • Nvidia Optimus Cards.
  • Power management.
  • General setup.

This installation assumes (For now) that the install is starting from an MS-Windows installation. If you are not on Windows, please add your favourite choice of steps, keep the emphasis on ease of understanding.

Getting Started

You'll want to get yourself running off a LiveCD or LiveUSB to start. This guide will assume liveUSB, since some users find them more difficult to prepare, this is usually due to boot flag issues. (Note: Live USB restore drives are nice to have in general! The author keeps one in his college binder.)

Windows

We can use LiLi for this, it provides a nice, simple interface and is fairly reliable: LiLi Download

SysrescueCD

Grab the version that Suites your needs here: Sysrescue Download Next use LiLi (Or whatever you happen to be using) to flash the image or burn your CD. Reboot, change your boot device, and you'll find yourself at a grub menu.

Since the T series are all 64-bit laptops, make sure to boot the 64-bit kernel, as the default is 32-bit.

But Why?: If we pick 32-bit, later on we won't be able to chroot into our Funtoo's 64-bit stage 3.

You should see a fairly verbose boot as sysrescueCD scans for modules it requires and starts up. It is safe to simply accept prompt defaults here, unless they are errors.

When you are greeted by the interactive command prompt, enter 'wizard' as prompted, and accept the default entry in the dialogue. This will give us a functioning XFCE desktop environment.

Partitioning

Partitioning is the only step of this install which provides real risk to data on other operating systems. Be extremely careful if there is something you do not wish to loose. These steps are not foolproof and may result in lost data.

Please be aware that MBR disks only support 4 primary partitions. You can solve this by creating an 'extended' partition and adding logical partitions to it. If you are feeling particularly brave try GPT on your disk.

So lets start: First open up gparted. You should see it on the taskbar if you're using systemrescueCD. It will scan available drives and show you the partition table. Most users will likely find one of the following to their liking:

Pure Funtoo

You'll likely want:

/boot       :: EXT2       :: 100mb-500mb
    ''Note: We choose EXT2 because there is really no good use for a journalled boot partition, but feel free to use EXT4 instead!''
/           :: EXT4       :: 60gb (suggested floor value) - 500+
swap        :: linux-swap :: Your RAM Value (Optional, allows for hibernation)

You may wish for a separate /home, which is perfectly legitimate, or any number of other partitions.

Dual Boot with Windows

If dual booting with Windows, it is advisable to have Windows installed first since it will muck with the MBR and possibly want to create it's own boot partition. You'll likely want:

System Reserved    :: NTFS      :: Whatever windows chooses.
Windows            :: NTFS      :: >100gb (If you plan on doing any serious work on windows)
/boot              :: EXT2      :: 100mb-500mb
Extended Partition -
  /                :: EXT4      :: Whatever is left.
  swap             :: linux-swap:: Your RAM value. (Optional, allows for hibernation)

You may also want a separate /home, etc. These will fit into your extended partition without contributing to MBR's 4 partition limit.

Starting the (actual) Install

Up until now everything we've done has just been foreplay. Finally we can mount our partitions and get started on the installation!

Mounting

First, lets mount all of our partitions.

  • Make a directory for root. Lets assume /mnt/funtoo
mkdir /mnt/funtoo
  • Mount your '/' partition to /mnt/funtoo
mount /dev/sd## /mnt/funtoo
  • Make a directory for your boot partition.
mkdir /mnt/funtoo/boot
  • Mount your boot partition.
mount /dev/sd## /mnt/funtoo/boot
  • Mount anything else you may have made and need. (Not swap)

Checking the Date

Although this may seem super un-important, if you want to avoid lots of spammy warning messages later, checking your date is beneficial.

date

If it needs to be set, you'll want something like:

date 071620002011
#Fri Jul 16 20:00:00 UTC 2011

Fetch a Stage 3

Next we need to fetch a tarball containing a barebones stage. We will download the core-i7 architecture version, if you have a core i5 or i3, don't worry, it's all the same.

cd /mnt/funtoo
wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/corei7/stage3-current.tar.xz

Next lets unpack with

tar xJpf stage3-current.tar.xz

Seriously, don't forget the 'p' option.

If you run 'ls' now, you should see the /mnt/funtoo is fully populated with folders such as lib, home, and proc.

Chroot'ing

Now we need to change the apparent root of our system to our fledgling Funtoo system.

cd /mnt/funtoo
mount --bind /proc ./proc
mount --bind /dev ./dev
cp /etc/resolv.conf ./etc
env -i HOME=/root TERM=$TERM chroot /mnt/funtoo /bin/bash --login

Getting the Portage Tree

Funtoo (Unlike Gentoo) uses a git based portage tree, however if you're coming from Gentoo, you'll be glad to know we sync with the Gentoo tree once every 12 hours.

emerge --sync

You can ignore most of the errors that might be spat out at this stage, however if they do not disappear on subsequent merges, talk to us in #funtoo. Your first sync will take significantly longer then subsequent syncs, as the whole tree must be synced.

A Configuration Celebration

Now that we have our portage tree cloned, we need to do some initial setup on some files before doing anything else with portage.

Fstab

nano /etc/fstab

You'll want something like this: (Replace the dev values with what you are using)

# <fs>			<mountpoint>	<type>		<opts>		         <dump/pass>

/dev/sda1		/boot		ext2		noauto,noatime  	 1 2
/dev/sda3		none		swap		sw		         0 0
/dev/sda4		/		ext4		noatime		         0 1
/dev/cdrom		/mnt/cdrom	auto		noauto,ro	         0 0

Localtime

Lets remove the default localtime, and create a symbolic link to the proper time zone. (You probably will want something other then Vancouver)

rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Vancouver /etc/localtime

Hostname Set your host name:

nano /etc/conf.d/hostname

hwclock

If you're using a dual boot system, you'll want to change this. Otherwise it's entirely optional.

nano /etc/conf.d/hwclock

If you're on windows you'll want:

clock="local"

Make.conf Important enough that it deserves it's own article. A template make.conf for the T420 will be forthcoming.

For now: If you have an i5 or i3 you will want

MAKEOPTS="-j3"

If you have an i7 you'll probably want

MAKEOPTS="-j5"

But I have Hyperthreading! Why only -j3? Hyperthreading and compiling don't play well together. You'll have the same (or better) performance with -j3 as -j5 with a dual core hyper threaded processor.

Stop, Kernel time!

For this guide we'll be using some pre-found config options that I will be adding later.

  • Networking:
    • iwlwifi and auxilary
    • Unknown intel ethernet adapter. Selected several.
  • GPU
    • Intel available default.
    • nvidia will be dealt with later

Install:

  • wpa_supplicant
  • iwl6000-ucode
  • wireless-tools


Bootloader Setup

In funtoo the setup of grub is extremely simplified.

emerge -vqat boot-update

Q: What are those options? A: We'll get to them later, lets get the system booted first, okay? Boot-update is a tool that will allow for very simple configuration of grub similar to older versions (But nicer still).

You will now find a file:

$ cat /etc/boot.conf
boot {
        generate grub
        default "Funtoo Linux genkernel"
        timeout 3 
}

"Funtoo Linux" {
        kernel bzImage[-v]
        # params += nomodeset
}

"Funtoo Linux genkernel" {
        kernel kernel[-v]
        initrd initramfs[-v]
        params += real_root=auto 
        # params += nomodeset
} 
This can be configured (We'll touch on this later. We need to make sure the kernel is booting and working before we start tweaking) with options for the kernel.

==== Dual-Booters Only ====
If you want to dual boot with windows you'll need to add an entry here:
<pre>
"Windows 7" {
    type win7
    params root=/dev/sda1
}

Installing Grub onto the Drive(Everyone)

Next we can install grub onto the drive.

grub-install --no-floppy /dev/sda
boot-update

No errors means we should be good to go!

Tidy up and go.

Just a few more things!

Lets set a root password.

passwd

It is advisable to exit the chroot and umount all the relevant install drives. Or at least just exit the chroot, but you can just simply reboot from here.

exit
cd /
umount /mnt/funtoo/boot /mnt/funtoo/dev /mnt/funtoo/proc /mnt/funtoo
reboot

Configuring the New System

Welcome to funtoo! You should be greeted by a bunch of spammy text that scrolls by reasonably fast and then a couple penguins and openrc. Login to your root user and lets start playing.

Getting up the (wired) network

If you're gifted with a wired network connect, use it! The initial setup is much more convenient and quick.

Quickly set up the network with

/etc/init.d/dhcpcd start

Now check to see if our wired adapter is listed with ifconfig.

ifconfig
#  (or)
ping google.com

If you see it listed with a description, we're good to go!

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff