Uderc programming article aggregator sites

[HOWTO] Installing Arch Linux stable release on Acer Aspire One 522

Tags:
Answers: Have 6 answers
Advertisement
[This is a work on progress and my first howto ever]
These steps will teach you how to install ArchLinux x64 stable release (currently 2010.05) on Acer Aspire One 522 from an existing ArchLinux (your desktop computer)
As you need a 2.6.37+ kernel to make networking work on the AO522, installing stable release as is won't work.
This Howto borns with the intention to address this problem.
You need to be familiarized with Linux internals to follow this howto.
(Expect this howto to become useless with new stable releases of ArchLinux.)
Remember to make a backup of your Windows 7 Starter system before installing ArchLinux.
I did a full raw copy of the harddisk by using systemrescuecd, an external harddisk and dd utility:
Just boot with systemrescuecd
Mount your external harddisk on /mnt/floppy for example
Clone harddisk with: dd if=/dev/sda |gzip -c > /mnt/floppy/ao522.img
This process took me a lot of time since my external harddisk is USB-1 (almost an entire evening)
Result image was about 22GB size
This image will restore partition table, boot sector and all data if things go wrong.
I followed some of the steps from this guide: https://wiki.archlinux.org/index.php/In … ting_Linux
If you have some Gentoo Linux experience you will find those steps really familiar.
You will need 2 USB pendrives or similar storage options.
One is needed to boot into your netbook, and the other to store our custom archlinux build.
Making an updated ArchLinux system
1) Make a local dir on your existing linux system
# mkdir ./newarch
2) Install pacman database on it
# pacman -Sy -r ./newarch
3) Install base system
# pacman -S base -r ./newarch
4) Let's chroot inside
# cp /etc/resolv.conf ./newarch/etc/
# cp /etc/pacman.d/mirrorlist ./newarch/etc/pacman.d
# mount -t proc proc ./newarch/proc
# mount -t sysfs sys ./newarch/sys
# mount -o bind /dev ./newarch/dev
# chroot ./newarch /bin/bash
5) Edit configuration files
# nano -w /etc/rc.conf
# nano -w /etc/hosts
# nano -w /etc/mkinitcpio.conf
Forget /etc/fstab for now since you don't know what partitions to use yet
6) Generate kernel image
# mkinitcpio -p kernel26
7) Generate locales
# nano -w /etc/locale.gen
# locale-gen
8) Make a tarball with our custom ArchLinux
# exit
# umount ./newarch/proc
# umount ./newarch/dev
# umount ./newarch/sys
# tar -cvpf newarch.tar ./newarch
9) Copy this tarball to an USB pendrive or external harddisk
10) Boot your netbook with a Linux bootable USB stick (I used systemrescuecd, and remember to pick the x64 bit kernel at grub screen)
You can use any linux distribution with usb bootable options. I suppose ArchLinux works too
To install SystemRescueCD on an USB stick follow this tutorial -> SystemRescueCD on usb stick
Insert the usb stick on your netbook, switch on, hit F2 to enter BIOS menu, and choose to boot from USB as first option. Save and Exit.
You should be booting into SystemRescueCD without any problem.
After initialization you will end in a root prompt.
11) Let's partition the disk
You will find 3 partitions if this is your first time:
/dev/sda1 2048 29362175 14680064 27 Hidden NTFS WinRE
/dev/sda2 * 29362176 29566975 102400 7 HPFS/NTFS/exFAT
/dev/sda3 29566976 488397167 229312696 7 HPFS/NTFS/exFAT
My recomendation is to leave sda1 and sda2 intact, as they have the recovery information to restore Windows 7 Starter
You have plenty of space with sda3, about 230G.
So run fdisk/cfdisk and delete /dev/sda3
Now create a 100M partition for boot
Now create a Extended partition with all the space left
Now create a 1GB logical partition for swap
Now create a 10-15 GB  logical partition for root system
And finally a logical partition for our home partition with all space left
Your partition table should look like this:
/dev/sda1 2048 29362175 14680064 27 Hidden NTFS WinRE
/dev/sda2 * 29362176 29566975 102400 7 HPFS/NTFS/exFAT
/dev/sda3 29566976 29771775 102400 83 Linux
/dev/sda4 29771776 488397167 229312696 5 Extended
/dev/sda5 29773824 31821823 1024000 83 Linux
/dev/sda6 31823872 63281151 15728640 83 Linux
/dev/sda7 63283200 488397167 212556984 83 Linux
12) Create filesystems
I choosed ext2 for boot, and reiserfs for root and home partitions.
# mke2fs /dev/sda3
# mkreiserfs /dev/sda6
# mkreiserfs /dev/sda7
# mkswap /dev/sda5
13) Mount partitions
# mkdir arch
# mount /dev/sda6 arch
# mkdir arch/boot
# mount /dev/sda3 arch/boot
# mkdir arch/home
# mount /dev/sda7 arch/home
14) Copy our custom ArchLinux build on it
# mount /dev/sdb1 /mnt/floppy (for example)
# cd arch
# tar -xvpf /mnt/flopy/newarch.tar
15) Configure /etc/fstab
Mine is as follows:
devpts /dev/pts devpts defaults 0 0
shm /dev/shm tmpfs nodev,nosuid 0 0
/dev/sda3 /boot ext2 defaults 0 1
/dev/sda6 / reiserfs defaults 0 1
/dev/sda7 /home reiserfs defaults 0 1
/dev/sda5 swap swap defaults 0 0
16) Chroot in your new system
# mount -t proc proc ./proc
# mount -t sysfs sys ./sys
# mount -o bind /dev ./dev
# chroot ./ /bin/bash
17) Install grub
# grub-install
Edit /boot/grub/menu.lst to suit your needs
Mine looks like this:
timeout 5
default 0
color light-blue/black light-cyan/blue
title Arch Linux
root (hd0,2)
kernel /vmlinuz26 root=/dev/sda6 ro
initrd /kernel26.img
title Arch Linux Fallback
root (hd0,2)
kernel /vmlinuz26 root=/dev/sda6 ro
initrd /kernel26-fallback.img
title Windows 7 Recovery
rootnoverify (hd0,0)
makeactive
chainloader +1
As you see, you can restore Windows 7 Starter from Grub.
18) Change root password
# passwd
19) Add a regular  user account
# useradd -G video,audio,users -m username
# passwd username
20) You're done!
# exit
# cd ..
# umount ./arch/proc
# umount ./arch/dev
# umount ./arch/sys
# umount ./arch/boot
# umount ./arch/
# reboot
Remove the usb stick from your netbook.
If all went ok, you will be inside your new stable and updated ArchLinux system
Next post is reserved for software configurations specific to the Acer Aspire One 522
Last edited by tigrezno (2011-04-20 12:22:38)
Advertisement
The best answer: Using acpid to achieve the following:
- Change screen brightness when operating in battery mode
- Power off when the power button is pressed
- Suspend when the lid is down
- Reduce CPU frequency speed to maximize battery usage
Remember that system suspend is only supported by ati free driver xf86-video-ati
1) Install acpid daemon and cpufrequtils
# pacman -S apcid cpufrequtils
2) edit acpid handler script
# nano -w /etc/acpi/handler.sh
Change the following section:
ac_adapter)
case "$2" in
AC)
case "$4" in
00000000)
echo -n $minspeed >$setspeed
#/etc/laptop-mode/laptop-mode start
00000001)
echo -n $maxspeed >$setspeed
#/etc/laptop-mode/laptop-mode stop
esac
*) logger "ACPI action undefined: $2" ;;
esac
for:
ac_adapter)
case "$2" in
ACAD)
case "$4" in
00000000)
echo 3 > /sys/devices/virtual/backlight/acpi_video0/brightness
cpufreq-set -c 0 -f 800Mhz
cpufreq-set -c 1 -f 800Mhz
00000001)
echo 9 > /sys/devices/virtual/backlight/acpi_video0/brightness
cpufreq-set -c 0 -f 1000Mhz
cpufreq-set -c 1 -f 1000Mhz
esac
*) logger "ACPI action undefined: $2" ;;
esac
Make sure you changed AC) for ACAD)
Now change this other section:
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
with:
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF) poweroff ;;
*) logger "ACPI action undefined: $2" ;;
esac
Change:
button/lid)
#echo "LID switched!">/dev/tty5
logger "ACPI group/action undefined: $1 / $2"
for:
button/lid)
pm-suspend && /etc/rc.d/network restart
logger "ACPI group/action undefined: $1 / $2"
Network restart is used because wlan0 will disconnect from AP after some time. You can try using iwconfig wlan0 essid <ap> key <key> instead of the network script, but haven't tested it myself.
3) Start acpid and load modules
# modprobe powernow-k8
# /etc/rc.d/acpid start
Add "acpid" to DAEMONS in /etc/rc.conf to start on boot
Add "powernow-k8" to the modules sections on /etc/rc.conf to load at boot
Stopping system freezes due to ethernet driver
The only way people have found to avoid freezes is by blacklisting atheros kernel drivers.
To do it at boot just edit /etc/rc.conf and change the MODULES line as this:
MODULES=(!ath9k !atl1c)
Reboot and you're done, but remember to not press the Wifi key, because it can freeze your system.
Correctly starting wireless at boot
I've found that standard scripts wont load properly my wireless lan. It gave an error telling you to use the WIRELESS_TIMEOUT variable and such.
To solve this, edit /etc/rc.d/network script and change the wi_up function by adding a second iwconfig command like this:
wi_up()
eval iwcfg="\$wlan_${1}"
[[ ! $iwcfg ]] && return 0
/usr/sbin/iwconfig $iwcfg
[[ $WIRELESS_TIMEOUT ]] || WIRELESS_TIMEOUT=2
sleep $WIRELESS_TIMEOUT
/usr/sbin/iwconfig $iwcfg
bssid=$(iwgetid $1 -ra)
It will do the trick and will start at boot correctly. This is not a solution but a fix.
Adjust Touchpad to disable false taps
What I did here is defining an area to be ignored. This area are 3 rectangles on top, left and right of the touchpad.
This means you can write and press space without having the cursor click out of the window and such.
# synclient AreaLeftEdge=150
# synclient AreaRightEdge=1300
# synclient AreaTopEdge=300
Also, add it to your /etc/X11/xorg.conf.d/10-evdev.conf:
Section "InputClass"
Identifier "evdev touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "AreaTopEdge" "300"
Option "AreaLeftEdge" "150"
Option "AreaRightEdge" "1300"
EndSection
You can play with those values. They just work for me.
Last edited by tigrezno (2011-04-23 13:49:48)