-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchromeOSArch.sh
More file actions
80 lines (64 loc) · 1.91 KB
/
chromeOSArch.sh
File metadata and controls
80 lines (64 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
function start {
echo "Unmounting /dev/$sd...";
umount /dev/${sd}*;
echo "Creating disk label for GPT";
partx -t gpt -u /dev/$sd;
echo "Creating partitions";
cgpt create -z /dev/$sd;
cgpt create /dev/$sd;
cgpt add -i 1 -t kernel -b 8192 -s 32768 -l U-Boot -S 1 -T 5 -P 10 /dev/$sd;
cgpt add -i 2 -t data -b 40960 -s 32768 -l Kernel /dev/$sd;
cgpt add -i 12 -t data -b 73728 -s 32768 -l Script /dev/$sd;
cgpt show /dev/$sd;
echo "How large do you want your root partition?";
read size;
cgpt add -i 3 -t data -b 106496 -s `expr $size - 106496` -l Root /dev/$sd;
echo "Refreshing disk partition list";
partx -l /dev/$sd;
echo "Formating new partitions";
mkfs.ext2 /dev/${sd}p2;
mkfs.ext4 /dev/${sd}p3;
mkfs.vfat -F 16 /dev/${sd}p12;
echo "Moving to tmp folder";
cd /tmp;
echo "Downloading latest version of Arch chromebook...";
wget http://archlinuxarm.org/os/ArchLinuxARM-chromebook-latest.tar.gz;
mkdir root;
echo "Mounting root partition in tmp to extract Arch";
mount /dev/${sd}p3 root;
tar -xvzf ArchLinuxARM-chromebook-latest.tar.gz -C root;
mkdir mnt;
mount /dev/${sd}p2 mnt;
cp root/boot/vmlinux.uimg mnt;
umount mnt;
mount /dev/${sd}p12 mnt;
mkdir mnt/u-boot;
wget http://archlinuxarm.org/os/exynos/boot.scr.uimg;
cp boot.scr.uimg mnt/u-boot;
umount mnt;
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/${sd}p1;
umount root;
sync;
echo "Done";
}
echo "Drive label?"
read sd;
echo "Target drive is=/dev/$sd";
echo "Is this correct (Yes, No)?";
read ans;
if [[ "$ans" == "y" || "$ans" == "yes" || "$ans" == "Yes" ]];
then
start;
else
if [[ "$ans" == "n" || "$ans" == "no" || "$ans" == "No" ]];
then
echo "Retrying...";
./ArchSD-Install.sh;
else
echo "Please answer (Yes or No)";
echo "Retrying...";
./ArchSD-Install.sh;
fi
fi