From Fedora Project Wiki
Line 17: Line 17:
===Preparing Fedora===
===Preparing Fedora===


Start by downloading your Fedora, here we use the XFCE variant, but you can choose another at the hyperlink bellow:
Start by downloading your Fedora, here we use the XFCE variant, but you can choose another at the download site:
 
http://download.fedoraproject.org/pub/fedora/linux/releases/22/Images/armhfp/
http://download.fedoraproject.org/pub/fedora/linux/releases/22/Images/armhfp/


<pre>
<pre>
cd /tmp
$ cd /tmp
wget http://mirror.pnl.gov/fedora/linux/releases/22/Images/armhfp/Fedora-Xfce-armhfp-22-3-sda.raw.xz
 
unxz -v Fedora-Xfce-armhfp-22-3-sda.raw.xz
$ wget http://download.fedoraproject.org/pub/fedora/linux/releases/22/Images/armhfp/Fedora-Xfce-armhfp-22-3-sda.raw.xz
 
$ unxz -v Fedora-Xfce-armhfp-22-3-sda.raw.xz
</pre>
</pre>




Next you mount the raw disk image, and extract the rootfs.
Next you mount the raw disk image, and extract the rootfs. (Note the loop devices in the output)
<pre>
<pre>
$ sudo kpartx -av /tmp/Fedora-Xfce-armhfp-22-3-sda.raw
$ sudo kpartx -av /tmp/Fedora-Xfce-armhfp-22-3-sda.raw
add map loop0p1 (253:10): 0 999424 linear /dev/loop0 2048
add map loop0p2 (253:11): 0 1000482 linear /dev/loop0 1001472
add map loop0p3 (253:12): 0 6835937 linear /dev/loop0 2001954


$ sudo dd if=/dev/mapper/loop0p3 of=/tmp/Fedora-22-Xfce-rootfs.ext4 conv=fsync
$ sudo dd if=/dev/mapper/loop0p3 of=/tmp/Fedora-22-Xfce-rootfs.ext4 conv=fsync
6835937+0 records in
6835937+0 records out
3499999744 bytes (3.5 GB) copied, 6.73428 s, 520 MB/s


$ sudo kpartx -dv /tmp/Fedora-Xfce-armhfp-22-3-sda.raw
$ sudo kpartx -d /tmp/Fedora-Xfce-armhfp-22-3-sda.raw
del devmap : loop0p3
del devmap : loop0p2
del devmap : loop0p1
loop deleted : /dev/loop0
</pre>
</pre>


At this point you may optionally shrink ext4 rootfs.
 
At this point you may optionally shrink ext4 rootfs. (It will be expanded in a later step)
<pre>
<pre>
$ sudo e2fsck -f /tmp/Fedora-22-Xfce-rootfs.ext4
$ sudo e2fsck -f /tmp/Fedora-22-Xfce-rootfs.ext4
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
_/: 104380/213840 files (0.1% non-contiguous), 626133/854492 blocks


$ sudo resize2fs -fM /tmp/Fedora-22-Xfce-rootfs.ext4
$ sudo resize2fs -fM /tmp/Fedora-22-Xfce-rootfs.ext4
resize2fs 1.42.12 (29-Aug-2014)
Resizing the filesystem on /tmp/Fedora-22-Xfce-rootfs.ext4 to 691002 (4k) blocks.
The filesystem on /tmp/Fedora-22-Xfce-rootfs.ext4 is now 691002 (4k) blocks long.
</pre>
</pre>


Line 66: Line 50:
Label the rootfs, and apply a new UUID
Label the rootfs, and apply a new UUID
<pre>
<pre>
UUID=$(uuidgen)
$ UUID=$(uuidgen)
LABEL='ROOTFS'
 
$ LABEL='ROOTFS'


$ sudo tune2fs -U "$UUID" -L "$LABEL" /tmp/Fedora-22-Xfce-rootfs.ext4
$ sudo tune2fs -U "$UUID" -L "$LABEL" /tmp/Fedora-22-Xfce-rootfs.ext4
tune2fs 1.42.12 (29-Aug-2014)
</pre>
</pre>




Create  
Create the partitions
<pre>
<pre>
$ truncate --size=7GiB /tmp/chromebook-xfce.raw
$ truncate --size=7GiB /tmp/chromebook-xfce.raw


$ sgdisk -a 8192 -n 1:0:+30M -t 1:7F00 -c 1:"KERN-A" \
$ sgdisk -a 8192 -n 1:0:+30M -t 1:7F00 -c 1:"KERN-A" -A 1:=:0x011F000000000000 \
                 -n 2:0:+30M -t 2:7F00 -c 2:"KERN-B" \
                 -n 2:0:+30M -t 2:7F00 -c 2:"KERN-B" -A 2:=:0x011A000000000000 \
                 -n 3:0:+30M -t 3:7F00 -c 3:"KERN-C" \
                 -n 3:0:+30M -t 3:7F00 -c 3:"KERN-C" -A 3:=:0x0115000000000000 \
                 -n 4:0:+1G  -t 4:8300 -c 4:"BOOT"  \
                 -n 4:0:+1G  -t 4:8300 -c 4:"BOOT"  \
                 -n 5:0:+1G  -t 5:8200 -c 5:"SWAP"  \
                 -n 5:0:+1G  -t 5:8200 -c 5:"SWAP"  \
Line 88: Line 71:




Write the Xfce rootfs to the partition.
<pre>
$ sudo kpartx -avg /tmp/chromebook-xfce.raw
$ dd if=/tmp/Fedora-22-Xfce-rootfs.ext4 of=/dev/mapper/loop0p6 bs=2M conv=fsync
$ sudo resize2fs -f /dev/mapper/loop0p6
$ UUID_SWAP=$(uuidgen)
$ sudo swapon -v -U "$UUID_SWAP" -L 'SWAP' /dev/mapper/loop0p5
$ UUID_BOOT=$(uuidgen)
$ sudo mkfs.ext4 -m0 -U "$UUID_BOOT" -L 'BOOT' /dev/mapper/loop0p4
</pre>
Mount the filesystems
<pre>
$ sudo mount /dev/mapper/loop0p6 /mnt
$ sudo mount /dev/mapper/loop0p4 /mnt/boot
(to be continued)
(to be continued)

Revision as of 20:28, 23 October 2015

There's currently a number of ARM (currently all are ARMv7) based Chromebooks base on a few specific SoCs.

They are:

Samsung Exynos:

  • Snow (Exynos 5240)
  • CB2 (Exynos 5800, 1080p, microSD)

NVIDIA Tegra K1:

  • Acer nyan-big (1080p HD version, and non-HD variant)
  • HP nyan-blaze (discontinued)

Rockchips:

  • Asus flip


Preparing Fedora

Start by downloading your Fedora, here we use the XFCE variant, but you can choose another at the download site:

http://download.fedoraproject.org/pub/fedora/linux/releases/22/Images/armhfp/

$ cd /tmp

$ wget http://download.fedoraproject.org/pub/fedora/linux/releases/22/Images/armhfp/Fedora-Xfce-armhfp-22-3-sda.raw.xz

$ unxz -v Fedora-Xfce-armhfp-22-3-sda.raw.xz


Next you mount the raw disk image, and extract the rootfs. (Note the loop devices in the output)

$ sudo kpartx -av /tmp/Fedora-Xfce-armhfp-22-3-sda.raw

$ sudo dd if=/dev/mapper/loop0p3 of=/tmp/Fedora-22-Xfce-rootfs.ext4 conv=fsync

$ sudo kpartx -d /tmp/Fedora-Xfce-armhfp-22-3-sda.raw


At this point you may optionally shrink ext4 rootfs. (It will be expanded in a later step)

$ sudo e2fsck -f /tmp/Fedora-22-Xfce-rootfs.ext4

$ sudo resize2fs -fM /tmp/Fedora-22-Xfce-rootfs.ext4


Label the rootfs, and apply a new UUID

$ UUID=$(uuidgen)

$ LABEL='ROOTFS'

$ sudo tune2fs -U "$UUID" -L "$LABEL" /tmp/Fedora-22-Xfce-rootfs.ext4


Create the partitions

$ truncate --size=7GiB /tmp/chromebook-xfce.raw

$ sgdisk -a 8192 -n 1:0:+30M -t 1:7F00 -c 1:"KERN-A" -A 1:=:0x011F000000000000 \
                 -n 2:0:+30M -t 2:7F00 -c 2:"KERN-B" -A 2:=:0x011A000000000000 \
                 -n 3:0:+30M -t 3:7F00 -c 3:"KERN-C" -A 3:=:0x0115000000000000 \
                 -n 4:0:+1G  -t 4:8300 -c 4:"BOOT"   \
                 -n 5:0:+1G  -t 5:8200 -c 5:"SWAP"   \
                 -n 6:0:0    -t 6:8300 -c 6:"ROOTFS" /tmp/chromebook-xfce.raw


Write the Xfce rootfs to the partition.

$ sudo kpartx -avg /tmp/chromebook-xfce.raw

$ dd if=/tmp/Fedora-22-Xfce-rootfs.ext4 of=/dev/mapper/loop0p6 bs=2M conv=fsync

$ sudo resize2fs -f /dev/mapper/loop0p6

$ UUID_SWAP=$(uuidgen)
$ sudo swapon -v -U "$UUID_SWAP" -L 'SWAP' /dev/mapper/loop0p5

$ UUID_BOOT=$(uuidgen)
$ sudo mkfs.ext4 -m0 -U "$UUID_BOOT" -L 'BOOT' /dev/mapper/loop0p4


Mount the filesystems

$ sudo mount /dev/mapper/loop0p6 /mnt

$ sudo mount /dev/mapper/loop0p4 /mnt/boot
(to be continued)