Installation d’Archlinux sur Carte SD 16 Go pour un Raspberry Pi Modèle B.
Télechargement de la derniere version de archlinux ARM, sur le site de Raspberry Pi : http://www.raspberrypi.org/downloads
Actuellement la dernière version est celle datant du 18 Septembre 2012 :
$ wget http://files.velocix.com/c1410/images/archlinuxarm/archlinux-hf-2012-09-18/archlinux-hf-2012-09-18.zip |
$ wget http://files.velocix.com/c1410/images/archlinuxarm/archlinux-hf-2012-09-18/archlinux-hf-2012-09-18.zip
On vérifie l’intégrité (toujours utile) :
$ sha1sum archlinux-hf-2012-09-18.zip
56e043f3c629f6c408759bcc157d2d635ce0b6af archlinux-hf-2012-09-18.zip |
$ sha1sum archlinux-hf-2012-09-18.zip
56e043f3c629f6c408759bcc157d2d635ce0b6af archlinux-hf-2012-09-18.zip
On extrait notre archive zip :
unzip archlinux-hf-2012-09-18.zip |
unzip archlinux-hf-2012-09-18.zip
On met en place notre Carte SD, pour connaitre quel périphérique est utilisé on fait un petit « dmesg »
$ dmesg
...(extrait)...
[ 6685.088186] scsi 7:0:0:0: Direct-Access Multiple Card Reader 1.00 PQ: 0 ANSI: 0
[ 6685.826912] sd 7:0:0:0: [sdb] 31504384 512-byte logical blocks: (16.1 GB/15.0 GiB)
[ 6685.828905] sd 7:0:0:0: [sdb] Write Protect is off
[ 6685.828911] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 6685.830904] sd 7:0:0:0: [sdb] No Caching mode page present
[ 6685.830910] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 6685.836904] sd 7:0:0:0: [sdb] No Caching mode page present
[ 6685.836910] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 6685.838290] sdb: sdb1 sdb2
[ 6685.843910] sd 7:0:0:0: [sdb] No Caching mode page present
[ 6685.843917] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 6685.843921] sd 7:0:0:0: [sdb] Attached SCSI removable disk |
$ dmesg
...(extrait)...
[ 6685.088186] scsi 7:0:0:0: Direct-Access Multiple Card Reader 1.00 PQ: 0 ANSI: 0
[ 6685.826912] sd 7:0:0:0: [sdb] 31504384 512-byte logical blocks: (16.1 GB/15.0 GiB)
[ 6685.828905] sd 7:0:0:0: [sdb] Write Protect is off
[ 6685.828911] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 6685.830904] sd 7:0:0:0: [sdb] No Caching mode page present
[ 6685.830910] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 6685.836904] sd 7:0:0:0: [sdb] No Caching mode page present
[ 6685.836910] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 6685.838290] sdb: sdb1 sdb2
[ 6685.843910] sd 7:0:0:0: [sdb] No Caching mode page present
[ 6685.843917] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[ 6685.843921] sd 7:0:0:0: [sdb] Attached SCSI removable disk
on voit que notre carte SD correspond, au device /dev/sdb
On pose notre systeme :
$ sudo dd if=archlinux-hf-2012-09-18.img of=/dev/sdb bs=1M
1886+0 records in
1886+0 records out
1977614336 bytes (2.0 GB) copied, 168.367 s, 11.7 MB/s |
$ sudo dd if=archlinux-hf-2012-09-18.img of=/dev/sdb bs=1M
1886+0 records in
1886+0 records out
1977614336 bytes (2.0 GB) copied, 168.367 s, 11.7 MB/s
On place notre carte dans le raspberry, on branche écran hdmi/clavier usb OU le cable ethernet, on boot et on peut se connecter en ssh sur notre raspberry 😉 (root/root)
Pour connaître notre ip, si on a pas d’écran HDMI (ou d’apdateur HDMI, VGA/DVI) : nmap -sn 192.168.1.0/24
$ nmap 192.168.1.0/24
Nmap scan report for 192.168.1.16
Host is up (0.040s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
22/tcp open ssh |
$ nmap 192.168.1.0/24
Nmap scan report for 192.168.1.16
Host is up (0.040s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
22/tcp open ssh
On se connecte :
Maintenant, on partitionne les 16 GO sur la Carte SD
On regarde les partitions avec la commande p :
Command (m for help): p
Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes
4 heads, 16 sectors/track, 492256 cylinders, total 31504384 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: 0x000c21e5
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 194559 96256 c W95 FAT32 (LBA)
/dev/mmcblk0p2 194560 3862527 1833984 83 Linux |
Command (m for help): p
Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes
4 heads, 16 sectors/track, 492256 cylinders, total 31504384 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: 0x000c21e5
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 194559 96256 c W95 FAT32 (LBA)
/dev/mmcblk0p2 194560 3862527 1833984 83 Linux
On supprime la partition 2 afin de la refaire pour nos 16GO, il est possible si vous le désirez de partionner d’une autre manière mais cela reste le même principe
Command (m for help): d
Partition number (1-4): 2
Partition 2 is deleted |
Command (m for help): d
Partition number (1-4): 2
Partition 2 is deleted
On peut vérifier le résultat :
Command (m for help): p
Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes
4 heads, 16 sectors/track, 492256 cylinders, total 31504384 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: 0x000c21e5
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 194559 96256 c W95 FAT32 (LBA) |
Command (m for help): p
Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes
4 heads, 16 sectors/track, 492256 cylinders, total 31504384 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: 0x000c21e5
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 194559 96256 c W95 FAT32 (LBA)
On crée une nouvelle partition avec les mêmes infos seul le last sector change.
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (194560-31504383, default 194560):
Using default value 194560
Last sector, +sectors or +size{K,M,G} (194560-31504383, default 31504383):
Using default value 31504383
Partition 2 of type Linux and of size 15 GiB is set |
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (194560-31504383, default 194560):
Using default value 194560
Last sector, +sectors or +size{K,M,G} (194560-31504383, default 31504383):
Using default value 31504383
Partition 2 of type Linux and of size 15 GiB is set
On enregistre avec la commande w
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks. |
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
On redémarre.
Le travail n’est pas terminé, il faut l’appliquer pour le filesystem.
Pour cela on resize, c’est assez long.
# resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mmcblk0p2 to 3913728 (4k) blocks. |
# resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mmcblk0p2 to 3913728 (4k) blocks.
Et après, c’est terminé ! On reboot notre système et voila 🙂
Après un petit redémarrage on peut faire les mises à jour, ainsi que changer le nom de la machine.
Pour les mises à jour :
On modifie notre nom de machine.
Et si vous désirez installer des packages qui ne sont pas présents dans le mirror list pour ARM mais présent sur les dépôts pour x86 et x86_64 :
On récupère un package, on modifie son PKGBUILD de manière à remplacer les architectures existantes par la notre : uname -m
Et après c’est la routine : makepkg –asroot PKGBUILD et voilà
Après on installe notre archive. Dans mon cas, cela a été nécessaire lors de l’installation du package dsniff.
It’s OverSimple, isn’t it ?