Line 110: | Line 110: | ||
EOF | EOF | ||
</pre> | </pre> | ||
Optionally chroot into the mounted rootfs. You may want to make configuration changes, or install packages. (Note: this requires you be operating from an ARMv7 system already) | |||
<pre> | |||
$ sudo chroot /mnt bash | |||
# dnf download vboot-utils | |||
# exit | |||
</pre> | |||
Dis-mount the filesystems and teardown the loop device | |||
<pre> | |||
$ sudo umount --recursive /mnt | |||
$ sudo kpartx -dvg /tmp/chromebook-xfce.raw | |||
</pre> | |||
Write the Fedora image to your SDcard (Note: for example purpose the fictional sdcard device is "/dev/sdz", and it will most certainly be different for you) | |||
<pre> | |||
$ sudo dd if=/tmp/chromebook-xfce.raw of=/dev/sdz bs=2M conv=fsync | |||
$ sudo partprobe /dev/sdz | |||
</pre> | |||
Move the GPT backup header to the end of storage, expand the ROOTFS partition, and grow the rootfs within. | |||
<pre> | |||
$ sgdisk -a8192 -e -d6 -n6:0:0 -t6:8300 -c6:'ROOTFS' -p /dev/sdz | |||
$ resize2fs /dev/sdz6 | |||
</pre> | |||
===From within ChromeOS=== | |||
* Enable developer mode by simultaneously pressing 'POWER + REFRESH + ESC' | |||
* In the boot recovery screen press 'CTRL + D' | |||
* After an arbitrary amount of time passes you will reboot into developer mode | |||
* To boot into ChromeOS, Press 'CTRL + D' | |||
* [Optionally, wait for ChromeOS to update it's kernel before proceeding.] | |||
* Once you have login to ChromeOS, open the terminal by pressing 'CTRL + ALT + T' | |||
* From the terminal, get root by typing 'shell' and then 'sudo -i' | |||
* Insert the prepared Fedora sdcard into the chromebook. | |||
Re-pack the ChromeOS kernel | |||
<pre> | |||
# dd if=/dev/mmcblk0p2 of=/tmp/kern-a.blob conv=fsync | |||
# | |||
</pre> | |||
Make a backup copy of your ChromeOS kernel | |||
(to be continued) | (to be continued) |
Revision as of 21:14, 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
Setup the swap device
$ UUID_SWAP=$(uuidgen) $ sudo swapon -v -U "$UUID_SWAP" -L 'SWAP' /dev/mapper/loop0p5
Setup the Fedora boot partition
$ 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
Configure the filesystem table
cat <<-EOF > /mnt/etc/fstab UUID=$UUID / ext4 defaults 1 1 UUID=$UUID_SWAP swap swap defaults 0 0 UUID=$UUID_BOOT /boot ext4 defaults 0 2 EOF
Optionally chroot into the mounted rootfs. You may want to make configuration changes, or install packages. (Note: this requires you be operating from an ARMv7 system already)
$ sudo chroot /mnt bash # dnf download vboot-utils # exit
Dis-mount the filesystems and teardown the loop device
$ sudo umount --recursive /mnt $ sudo kpartx -dvg /tmp/chromebook-xfce.raw
Write the Fedora image to your SDcard (Note: for example purpose the fictional sdcard device is "/dev/sdz", and it will most certainly be different for you)
$ sudo dd if=/tmp/chromebook-xfce.raw of=/dev/sdz bs=2M conv=fsync $ sudo partprobe /dev/sdz
Move the GPT backup header to the end of storage, expand the ROOTFS partition, and grow the rootfs within.
$ sgdisk -a8192 -e -d6 -n6:0:0 -t6:8300 -c6:'ROOTFS' -p /dev/sdz $ resize2fs /dev/sdz6
From within ChromeOS
- Enable developer mode by simultaneously pressing 'POWER + REFRESH + ESC'
- In the boot recovery screen press 'CTRL + D'
- After an arbitrary amount of time passes you will reboot into developer mode
- To boot into ChromeOS, Press 'CTRL + D'
- [Optionally, wait for ChromeOS to update it's kernel before proceeding.]
- Once you have login to ChromeOS, open the terminal by pressing 'CTRL + ALT + T'
- From the terminal, get root by typing 'shell' and then 'sudo -i'
- Insert the prepared Fedora sdcard into the chromebook.
Re-pack the ChromeOS kernel
# dd if=/dev/mmcblk0p2 of=/tmp/kern-a.blob conv=fsync #
Make a backup copy of your ChromeOS kernel
(to be continued)