Last active
August 29, 2015 14:20
-
-
Save s4l1h/301080bf31daf5202f70 to your computer and use it in GitHub Desktop.
RASPBERRY PI ARCH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Packages required | |
# dosfstools parted | |
# Can be run on any Linux system | |
# loop.max_part=15 must be in kernel cmdline (cmdline.txt for rpi) | |
# then reboot | |
echo "creating image to fit on 2Gb card" | |
dd if=/dev/zero of=arch-rpi.img bs=1M count=1850 | |
echo "Partitioning" | |
fdisk arch-rpi.img <<EOF | |
o | |
n | |
p | |
1 | |
+100M | |
t | |
c | |
n | |
p | |
2 | |
w | |
EOF | |
sleep 5 | |
losetup -f arch-rpi.img | |
sleep 5 | |
echo "Formatting vfat" | |
mkfs.vfat /dev/loop0p1 | |
sleep 5 | |
mkdir boot | |
echo "Mounting boot" | |
mount /dev/loop0p1 boot | |
echo "Installing" | |
echo "Formatting ext4" | |
mkfs.ext4 /dev/loop0p2 | |
sleep 5 | |
mkdir root | |
echo "Mounting root" | |
mount /dev/loop0p2 root | |
wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz | |
echo "Installing" | |
bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root | |
sync | |
mv root/boot/* boot | |
sync | |
umount boot root | |
losetup -d /dev/loop0p1 | |
losetup -d /dev/loop0p1 | |
losetup -d /dev/loop0 | |
echo "All complete, image arch-rpi.img created, compressing...." | |
zip -9 arch-rpi.img.zip arch-rpi.img | |
#Install LXDE: | |
#pacman -S openbox lxde gamin dbus #Lxde and needed dependancies | |
#pacman -S xorg-server xorg-xinit xorg-server-utils #Xorg | |
#pacman -S mesa xf86-video-fbdev xf86-video-vesa #Video Drivers | |
#To use startx, you will need to define LXDE in your ~/.xinitrc file: | |
#echo “exec ck-launch-session startlxde” >> ~/.xinitrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment