Sunday, August 4, 2013

Installing Arch GNU/Linux on Macbok air Version 4.2(Late 2011) part 3

Disclaimer: I dont take any responsibility for the damage of your equipment. If you point your ire at me, I will have the last laugh. USE THE INFO AT YOUR OWN RISK.

So, You are not used to being a master. You are used to situations where you adapt yourself to the Operating system(Master) and tells what you should be doing. So, be careful, what happens from now on is different. You tell the Operating system what is to be done and how it is to be done.

Let us begin.

After successful boot u will be logged in as root with the root prompt. Type the commands below as described. Majority of this info has been culled from the Arch wiki.


# nano /etc/hostname
enter your hostname press ^o and ^x to exit


# nano /etc/locale.gen

en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8

# locale-gen
# export LANG=de_DE.UTF-8

#wifi-menu
select your wifi connection from the list given. It will prompt for the password. Give the password and you are connected to the public network.

#cgdisk /dev/sda

Be careful here. remember the partition scheme you had decided in the beginning. delete the partition you had created in osx for linux. Now create a partition and select the type as "linux". cgdisk is an ncurses interface for the gdisk tool. I created only one partition. cgdisk manages a GPT parititon table, rather than the traditional MBR-style partitions. If swap is required we can always create swap on a file in the regular file system. Remember the partition number you created. You can always find out the partition number by

#lsblk /dev/sda

format it to your favorite file system

#mkefs.ext4 /dev/sda5

mount the partition

#mount /dev/sda5 /mnt

Since we are on an efi system, we have to mount the first partition

# mkdir /mnt/boot/efi
# mount /dev/sdax /mnt/boot/efi

 Select a mirror

Before installing, you may want to edit the mirrorlist file and place your preferred mirror first. A copy of this file will be installed on your new system by pacstrap as well, so it's worth getting it right.

# nano /etc/pacman.d/mirrorlist

    Alt+6 to copy a Server line.
    PageUp key to scroll up.
    Ctrl+U to paste it at the top of the list.
    Ctrl+X to exit, and when prompted to save changes, press Y and Enter to use the same filename.

If you want, you can make it the only mirror available by getting rid of everything else (using Ctrl+K), but it's usually a good idea to have a few more, in case the first one goes offline.
Tip: Use the Mirrorlist Generator to get an updated list for your country. HTTP mirrors are faster than FTP, because of something called keepalive. With FTP, pacman has to send out a signal each time it downloads a package, resulting in a brief pause.

 Install the base system

The base system is installed using the pacstrap script.

# pacstrap /mnt base base-devel


 Generate an fstab

Generate an fstab file with the following command. If you prefer to use UUIDs or labels, add the -U or -L option, respectively. It's also a good idea to check it before continuing:

# genfstab -p /mnt > /mnt/etc/fstab
# nano /mnt/etc/fstab


 Chroot and configure the base system

Next, we chroot into our newly installed system:

# arch-chroot /mnt

At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system. These can either be created if they do not exist, or edited if you wish to change the defaults.

 Locale

Locales are used by glibc and other locale-aware programs or libraries for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards.

There are two files that need editing: locale.gen and locale.conf.

    The locale.gen file is empty by default (everything is commented out) and you need to remove the # in front of the line(s) you want. You may uncomment more lines than just English (US), as long as you choose their UTF-8 encoding:

# nano /etc/locale.gen

en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8

# locale-gen

This will run on every glibc upgrade, generating all the locales specified in /etc/locale.gen.

    The locale.conf file doesn't exist by default. Setting only LANG should be enough. It will act as the default value for all other variables.

# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8

Note: If you set some other language than English at the beginning of the install, the above commands would be something like:

# echo LANG=de_DE.UTF-8 > /etc/locale.conf
# export LANG=de_DE.UTF-8

To use other LC_* variables, first run locale to see the available options. An advanced example can be found here.
Warning: Using the LC_ALL variable is strongly discouraged because it overrides everything.


Timezone Available time zones and subzones can be found in the /usr/share/zoneinfo// directories.

To view the available , check the directory /usr/share/zoneinfo/:

# ls /usr/share/zoneinfo/


Create a symbolic link /etc/localtime to your zone file /usr/share/zoneinfo// using this command:

ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime

Daemons

A list of available services (and their running status) can be found using the command:

# rc.d list


 Hostname

Add your hostname in /etc/hostname:

# echo myhostname > /etc/hostname


Wireless

     Install the required packages:

# pacman -S wireless_tools netctl

If you use WPA/WPA2 encryption, install:

# pacman -S wpa_supplicant wpa_actiond
#pacman -S dialog(for using wifi-menu it is a dependency)

initrd will be generated automatically during the install

#modprobe dm-mod



     Connect to the network with wifi-menu (optionally checking the interface name with ip link, but usually it's wlan0), which will generate a profile file in /etc/network.d named after the SSID. There are also templates available in /etc/network.d/examples/ for manual configuration.

# wifi-menu



GRUB



For 64-bit aka x86_64 UEFI firmware:

# pacman -S grub-efi-x86_64


The UEFI system partition will need to be mounted at /boot/efi/ for the GRUB(2) install script to detect it:

# mkdir -p /boot/efi
# mount -t vfat /dev/sdXY /boot/efi

Install GRUB UEFI application to /boot/efi/EFI/arch_grub and its modules to /boot/grub/x86_64-efi (recommended) using:

# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo


While using a manually created grub.cfg is absolutely fine, automatically generating one is recommended:
Tip: To automatically search for other operating systems on your computer, install os-prober before generating it:

# pacman -S os-prober

# grub-mkconfig -o /boot/grub/grub.cfg

After all this a .efi is installed in /dev/sda1/EFI/arch_boot/
This will read the grub.cfg in /boot/grub/grub.cfg

#passwd    change the root password


pacman -S xorg xorg-apps xorg-drivers xorg-fonts



#mkdir /home/vanisri
#useradd vanisri
#passwd vanisri
#chown  -R  $USER:$USER  $HOME

reboot

Hold the option button. This will choose the previous working refit screen. Here select osX. Once in osX re-install refit.
reboot
Hold the option button and see everything is fine.
reboot
Now you will get back the old refit which you have been using previous to installing arch. This is required since the step to install grub discussed above installed grub to the efi partition thereby overwriting the previous refit and you boot directly into grub instead of refit.


pacman -S xfce4 xfce4-goodies
pacman -S gstream.....
pacman -S firefox
pacman -S flashplugin
pacman -S alsa_utils alsa_oss ffmpeg alsa_plugins libva-driver-intel ttf-dejavu
#cat /etc/group
#gpasswd -a vanisri audio (Like this add yourself to the other groups)

pacman -S lightdm

pacman -Syu


#emacs /etc/rc.conf
HARDWARECLOCK="localtime"
TIMEZONE="Asia/Kolkata"

To display the correct time.

To check whether time is set properly

run the commands below
# hwclock --show
$ date

Both the commands should show the same time. Else run the following

# hwclock --hctosys

Now check the two commands above. They should be the same.


That completes a near 90 percent of Arch GNU/Linux installation on the Macbook air. Little more tips/adjustments/betterments in the next post.


No comments:

Post a Comment

Nobody can deter me away from "free as in freedom" concept seeded by Sri RMS. See to it that u dont make fun of my belief. If u think otherwise, no need to comment.