ArchlinuxARM on Raspberry Pi


146 posts   Page 1 of 6   1, 2, 3, 4, 5, 6
by pepedog » Wed Nov 16, 2011 6:21 pm
You need packages dosfstools and parted
As root, and sd card inserted (1st bit of thinking, use dmesg to find the device node) (2nd bit of thinking, the 1700 is the size of card, I could have gone higher with the 2Gb used but being safe, an 8Gb card maybe 7700 would be the figure)
Note that the mac address is set in /boot/cmdline.txt and loglevel=2 (smsc95xx.macaddr=08:00:28:00:60:01), and openntpd sets the date for you.
If the card is /dev/mmcblk0
wget http://myplugbox.com/rprootfs.tar.gz
umount /dev/mmcblk0p1
umount /dev/mmcblk0p2
parted /dev/mmcblk0 mklabel msdos -s
parted --align=cyl /dev/mmcblk0 mkpart primary fat32 0 100
parted --align=cyl /dev/mmcblk0 mkpart primary ext3 101 1700
mkdosfs /dev/mmcblk0p1
mke2fs -j /dev/mmcblk0p2
partprobe
cd /media/sd-mmcblk0p2
tar xzfv /root/rprootfs.tar.gz
mv boot/* ../sd-mmcblk0p1/
sync
cd ~
umount /dev/mmcblk0p1
umount /dev/mmcblk0p2

Once installed, you can update with
pacman -Syu
To install say lxde
pacman -S xf86-video-fbdev lxde openbox xorg-xinit dbus

and to start
xinit /usr/bin/lxsession
optional
pacman -S udev-automount
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by SlayingDragons » Sat Nov 19, 2011 2:02 am
Awesome, thank you very much. :D
Posts: 67
Joined: Wed Sep 14, 2011 3:17 am
by vinceAPPLE » Sat Nov 19, 2011 3:15 am
wow...there is a full distro here for the Rasberry Pi...ready to go. Seems perfect for the Pi.

Is that correct?

could i install things like Audacity on this from a Repo?.....or does every tool need to be compiled first?

thanks

Vince.
Posts: 22
Joined: Sat Jul 30, 2011 1:31 pm
by pepedog » Sat Nov 19, 2011 1:13 pm
audacity 1.3.13-1 A program that lets you manipulate digital audio waveforms
is in our repo
To be honest, not every package is already compiled, (over on our forums http://archlinuxarm.org/forum/ ) if only one person wants a particular package not already there, people bend over backwards to help. I used to use Mandriva/Mandrake for years and it made me lazy.
Arch is a rolling release, ie no 2011 version, every update is an upgrade. Small risk something breaks (which is usually fixed quick)
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by pepedog » Sat Nov 19, 2011 1:25 pm
I have been making a script to format sd card, unfortunately using dmesg is not a reliable way to do it, so inserted card has to be mmcblk0. Has to be run as root, not sudo
Any suggestions or comments?
#!/bin/bash
#Drive=$(dmesg | grep mmcblk | tail -n 1 | awk '{print $2}' | cut -d ':' -f1)
mkdir /root/makecard
cd /root/makecard

Drive="mmcblk0"
Mb=$(parted -s /dev/$Drive unit mb print free | grep Disk | tail -n 1 | awk '{print $3}' | cut -d 'M' -f1)
#echo "using drive /dev/$Drive"
#echo "$Mb Mb"
Mnt=$Drive
Drive="/dev/$Drive"
p1="p1"
p2="p2"

while [ x$agreement = x ]; do
echo
echo -n "using drive $Drive $Mb Mb? [yes or no]: "
read yesnoanswer
case $yesnoanswer in
y* | Y*)
agreement=1
;;
n* | N*)
echo "OK, quitin";
echo
exit 1
;;
esac
done

#wget http://myplugbox.com/rprootfs.tar.gz
umount $Drive$p1
umount $Drive$p2
parted $Drive mklabel msdos -s
parted --align=cyl $Drive mkpart primary fat32 0 100
parted --align=cyl $Drive mkpart primary ext3 101 $Mb
mkdosfs $Drive$p1
mke2fs -j $Drive$p2
sleep 5
partprobe
sleep 15
cd /media/sd-$Mnt$p2
tar xzfv /root/makecard/rprootfs.tar.gz
mv boot/* ../sd-$Mnt$p1/
sync
cd ~
umount $Drive$p1
umount $Drive$p2
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by tufty » Sun Nov 20, 2011 8:48 am
For performance reasons, I'd try to be sure to align the primary / secondary partition split on an erase block boundary for the inserted card. Off the top of my head, I'm not quite sure how you'd go about doing that, though. You probably want --align=optimal rather than --align=cyl, too.
Posts: 1363
Joined: Sun Sep 11, 2011 2:32 pm
by sh4d0w0lf » Sun Dec 04, 2011 7:41 pm
Sorry if this is the wrong place to post this but will xbmc work outa the box? I know that its in the repo's.. If it does work how well do you think it will work with mythtv ect?
Posts: 20
Joined: Thu Jul 28, 2011 9:40 am
by Montekuri » Sun Dec 04, 2011 7:45 pm
There is a lot of xbmc topics out there.
The xbmc team is (still) working on a port to R-Pi device.
User avatar
Posts: 420
Joined: Thu Sep 22, 2011 6:26 pm
by obarthelemy » Sun Dec 04, 2011 9:11 pm
I've got a post about optimizing Linux for Flash in this forum/projects . there it is...
http://www.raspberrypi.org/for.....#038;t=607 .
2 things:
- align partitions on erase block indeed.
- use ext4 with *no journal*, instead of ext3
- I think the rest is mount-time options or other config, only these 2 are format/partion-time.
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm
by pepedog » Mon Dec 05, 2011 1:04 pm
The whole aligning subject is so complicated.
First, using fdisk to try and change number of heads and cylinders, I couldn't change this on an sd card (can you change your C & H on your cards).
I used fdisk again (hope my math for 128k blocks is ok)
Command (m for help): p

Disk /dev/mmcblk0: 1977 MB, 1977614336 bytes
4 heads, 16 sectors/track, 60352 cylinders, total 3862528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004b2e2

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 206847 102400 c W95 FAT32 (LBA)
/dev/mmcblk0p2 206848 3862527 1827840 83 Linux

Next, format ext4 with no journal wouldn't boot, altering cmdline.txt, or not.
Writing a dd of 512Mb was no faster, 3.6Mb/s on a class 2 card.
Finally, using optimal instead cylinder in parted threw up complaints, have to look into that.
No doubt there is a benifit in aligning, but advice is spread far and wide, it is beyond a chore with no guarantee I got it right.
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by asb » Mon Dec 05, 2011 4:34 pm
pepedog: The best resource for information about flash media is the work by Arnd Bergman, both this LWN article https://lwn.net/Articles/428584/ and this Linaro page https://wiki.linaro.org/WorkingGroups/Kernel/Projects/FlashCardSurvey

He also had a talk at the Embedded Linux Conference Europe that's worth watching http://free-electrons.com/blog.....11-videos/
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 788
Joined: Fri Sep 16, 2011 7:16 pm
by liamfraser280 » Mon Jan 16, 2012 9:51 pm
Hi Pepedog!

Thanks so much for all of the work you are putting into this.

I'm currently a Debian user but plan to try Arch Linux out when I get my Pi. Looking in the fstab and cmdline.txt files, I couldn't find anything about a swap file. I assume it's up to the user to sort that out themselves? Just curious in case it is stored somewhere else.

Is it essential to specify a mac address? I thought the hardware has it's own. Again, I'm just curious.

Cheers,

Liam.
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
by pepedog » Tue Jan 17, 2012 1:26 am
Well, it has been said final product will have a unique serial in gpu from which mac is derived, but I have an alpha board.
As to swap, I prefer using a swap file, not swap partition, but not on flash (except for short periods. Search archlinuxarm.org for swapon
You might wonder why I never did an hd install, some fixes required on USB first.
Be assured it only takes a few hours to work out an arch install once we get our hands on final kernel.
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by liamfraser280 » Tue Jan 17, 2012 7:35 am
Thanks for the response :) .

I'm just curious because I plan to include Arch Linux in my GUI SD Card Preperation tool that I'm working on. I know it's for the more advanced users but would still be nice to have as a choice I think.

Do you plan to distribute the final release as a rootfs like this or a DD image? Do you plan to leave swap down to the user (perfectly fine of course)?

Cheers,

Liam.
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
by tawalker » Tue Jan 17, 2012 10:06 am
I am eyeing up an R-Pi once I get some spare "pocket-money" together (!), and would be very interested in installing Arch/ARM. I have been running Arch (the x86 version) on my Eee 701SD netbook, and have found it to be an ideal Linux distro for computers with constrained resources - my Eee runs Fluxbox instead of a full desktop environment, and it's surprisingly fast for such a low-powered machine.

If Arch can be added to Picard "out of the box", I'll be one happy user, so I'll be following this with interest...
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by pepedog » Tue Jan 17, 2012 11:20 am
Liam, no doubt there will be a download for rootfs, swapfile won't be included because of likelyhood of installing on a flash drive. It's also easy to add later.

I have destroyed 3 sticks lately because of this.
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by liamfraser280 » Tue Jan 17, 2012 5:12 pm
Thanks pepedog!

It wont be ready for a few more weeks I'm guessing... needs to be tested a lot (with an actual R-Pi) and a large chunk of the coding still needs to be done (weighed down with college exams and stuff).

I'll probably get Fedora going on it first simply because it's the default but it will be easy to add distros as it gets a list from a repository somewhere.
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
by sylvan » Tue Jan 17, 2012 8:50 pm
pepedog said:


device node) (2nd bit of thinking, the 1700 is the size of card, I could have gone higher with the 2Gb used but being safe, an 8Gb card


Instead of specifying the size of the card, let parted figure it out.  Just put "100%".  (You could also be explicit on the other units, e.g. 100MB)
Posts: 115
Joined: Sun Nov 27, 2011 8:39 pm
by tawalker » Tue Jan 17, 2012 10:30 pm
Liam Fraser said:

I'm currently a Debian user but plan to try Arch Linux out when I get my Pi. Looking in the fstab and cmdline.txt files, I couldn't find anything about a swap file. I assume it's up to the user to sort that out themselves? Just curious in case it is stored somewhere else.

Quick note on this from my perspective: I run Arch on my Eee 701SD netbook, which has an 8GB SSD. I'd heard that it's inadvisable to have a swap file on a flash drive, so I installed Arch without one, and set up logging to a ramdisk.

This is made easier because I upgraded my Eee from 512MB RAM to 2GB; I gather this won't be an option with the R.Pi... ;-)
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am
by liamfraser280 » Tue Jan 17, 2012 10:32 pm
I plan to setup logging to a ram disk also. Or can you just set log level to 0?
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
by Chromatix » Sun Jan 22, 2012 6:06 am
Regarding swap, the aggressiveness with which Linux uses swap can be tuned using sysctl vm.swappiness.  This can be set permanently in /etc/sysctl.conf.

The default value is 60.  This is arguably far too high even for a normal desktop system, and could easily explain why it tends to eat cheap Flash drives.

Reasonable values IMO are 0 or 1.  Zero means that swap will not be used unless the only alternative is to kill processes through lack of memory - so use this if you are really paranoid about Flash wear.  One means that swap will be used if there is a really good performance tradeoff, due to freeing up rarely-used chunks of memory for frequently-used disk cache.

I use vm.swappiness=1 on an old EeePC, with the swap partition on an SD card rather than the internal SSD.  It works surprisingly well.
The key to knowledge is not to rely on people to teach you it.
User avatar
Posts: 430
Joined: Mon Jan 02, 2012 7:00 pm
Location: Helsinki
by liamfraser280 » Sun Jan 22, 2012 9:42 am
That sounds ideal mate.

Cheers for the response :)
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
by pepedog » Mon Jan 23, 2012 11:50 pm
I am booting new 3.1.9 kernel now, so a new kernel package soon, and new rootfs as a new GPU boot blob required.
Posts: 957
Joined: Fri Oct 07, 2011 9:55 am
by banshee » Tue Jan 24, 2012 8:09 pm
I would suggest to disable swap at all, unless you have a very specific need for it. Not only it will wear your sd or whatever you will use as a block device, it will give you IO headaches if your free memory runs off. And you will get them on 256M, believe me :)

Using compcache instead of swap is probably a valid idea if you need more RAM available. I think it is used on some android custom ROMs, and probably in ubuntu iso.
Posts: 3
Joined: Tue Jan 24, 2012 7:58 pm
by HansH » Wed Jan 25, 2012 2:15 pm
I have been running a system on flash for years, most important is:

- don"t use  swap

- use  ext2 with atime disabled (ext3 is worse for flash, ext4 is better)

My ext2 fs is mounted usually in readonly mode, I remount it in rw if I need to install a package or change a config

You can mount tmpfs on /var/tmp, /var/lock, var/run. var/log
Posts: 212
Joined: Mon Sep 05, 2011 7:49 am