Created
August 3, 2014 19:16
-
-
Save cscorley/93302015ecd6970fe1d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
umount /dev/sda* | |
# Create a new disk label for GPT. Type y when prompted after running: | |
parted /dev/sda mklabel gpt | |
#Partition the USB drive or SD card: | |
cgpt create -z /dev/sda | |
cgpt create /dev/sda | |
cgpt add -i 1 -t kernel -b 8192 -s 32768 -l U-Boot -S 1 -T 5 -P 10 /dev/sda | |
cgpt add -i 2 -t data -b 40960 -s 32768 -l Kernel /dev/sda | |
cgpt add -i 12 -t data -b 73728 -s 32768 -l Script /dev/sda | |
cgpt add -i 3 -t data -b 106496 -s `expr 15633375 - 106496` -l Root /dev/sda | |
# Tell the system to refresh what it knows about the disk partitions: | |
partprobe /dev/sda | |
#Format the partitions: | |
mkfs.ext2 /dev/sda2 | |
mkfs.ext4 /dev/sda3 | |
mkfs.vfat -F 16 /dev/sda12 | |
#Download and extract rootfs tarball: | |
cd /tmp | |
wget http://archlinuxarm.org/os/ArchLinuxARM-chromebook-latest.tar.gz | |
mkdir root | |
mount /dev/sda3 root | |
tar -xf ArchLinuxARM-chromebook-latest.tar.gz -C root | |
#Copy the kernel to the kernel partition: | |
mkdir mnt | |
mount /dev/sda2 mnt | |
cp root/boot/vmlinux.uimg mnt | |
umount mnt | |
#Copy the U-Boot script to the script partition: | |
mount /dev/sda12 mnt | |
mkdir mnt/u-boot | |
cp root/boot/boot.scr.uimg mnt/u-boot | |
umount mnt | |
#Install nv-U-Boot: | |
wget -O - http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow.kpart.bz2 | bunzip2 > nv_uboot-snow.kpart | |
dd if=nv_uboot-snow.kpart of=/dev/sda1 | |
#Unmount the root partition: | |
umount root | |
sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment