Once the sdcard is inserted in your linux laptop, prepare partitions:
# create 1 fat32 partition (100MB)
# create 1 linux partition (remaining space)
# see http://archlinuxarm.org/platforms/armv6/raspberry-pi
# prepare mount points
$ cd /tmp
$ mkfs.vfat /dev/mmcblk0p1
$ mkfs.ext4 /dev/mmcblk0p2
$ mkdir boot root
$ mount /dev/mmcblk0p1 boot
$ mount /dev/mmcblk0p2 root
# populate them
$ wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz
$ bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root
$ mv root/boot/* boot
$ sync
Now that the standard installation is over, let's start preparing our system:
$ nano boot/cmdline.txt
# replace "rw" with "ro" after device name
$ echo rpi > root/etc/hostname # choose your own here
$ cat > root/etc/fstab
/dev/mmcblk0p1 /boot vfat defaults,ro,noatime,errors=remount-ro,nodev,nosuid,noexec 0 0
/dev/mmcblk0p2 / ext4 defaults,ro,noatime,errors=remount-ro,data=ordered 0 1
tmpfs /var/tmp tmpfs defaults,mode=1777 0 0
tmpfs /var/log tmpfs defaults,mode=1777 0 0
tmpfs /tmp tmpfs defaults,mode=1777,nodev,nosuid 0 0
^D
$ cat > root/usr/bin/rw
#!/bin/bash
mount -o rw,remount /
mount -o rw,remount /boot
^D
$ cat > root/usr/bin/ro
#!/bin/bash
mount -o ro,remount /
mount -o ro,remount /boot
^D
$ chmod +x root/usr/bin/ro root/usr/bin/rw
$ cat >> root/etc/skel/.bashrc
export HISTFILE=/tmp/.$USER-bash_history
^D
$ cat >> root/root/.bashrc
export HISTFILE=/tmp/.root-bash_history
^D
$ cat >> root/home/alarm/.bashrc
export HISTFILE=/tmp/.alarm-bash_history
^D
$ sync
$ umount boot root
Insert the sdcard in the raspberry pi.
Boot on the new system.
Log in as root
with the password root
.
$ rw
$ localectl status
$ localectl list-locales
$ localectl set-locale LANG=fr_FR.UTF-8 # choose your own here
$ localectl list-keymaps
$ localectl set-keymap fr # choose your own here
$ timedatectl
$ timedatectl list-timezones
$ timedatectl set-timezone Europe/Paris # choose your own here
$ pacman -Rns logrotate man-db man-pages jfsutils reiserfsprogs xfsprogs mdadm cryptsetup s-nail lvm2 haveged
$ sync
$ ro
Reboot to apply settings.
The system is ready now.
After booting, /
and /boot
are read-only.
Run rw
to get both /
and /boot
writable.
Run ro
to set them back to read-only.