Difference between revisions of "Acer C710 Chromebook"

From ArchWiki
Jump to: navigation, search
m (Compile A Custom Kernel (optional): copy with git; then config the kernel; then make)
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
[[Category:Acer]]
 
[[Category:Acer]]
The following is a work in progress, of getting arch working on Acer's new C7 200$ [[Chromebook]]. From opening the box to an Arch Linux command line.
+
The following is a work in progress guide to getting Arch working on the $200 Acer C7 [[Chromebook]].
  
Currently you'll need a second computer already running *nix. In the future If there's enough requests I'll create a way to install Arch without the need for a second computer. Much like the cr48-ubuntu script. If you're already running Ubuntu on your C7 then you can just skip to creating your own arch image.
+
For now you'll need a second computer already running *nix. If you're already running ChrUbuntu on your C7 then you can just skip to creating your own Arch image.
  
 
== Installing Arch onto an Acer C7 Chromebook ==
 
== Installing Arch onto an Acer C7 Chromebook ==
Currently Archlinux does work on the C7 but the install process is a bit odd. Currently I have no way to replace the chromeos kernel, and I'd really like to. If you manage to figure it out PLEASE let me know how. In the mean time the system does work really well (for a chromebook) with Arch.
+
At present, Arch runs well on the C7, however most testing has been done with stock i686 ChromeOS kernels. "Patches welcome" when it comes to x86_64 Chromium kernels or completely custom ones. The recommend install is x86 as it has PAE, so your RAM will be used even if you upgrade to more than 4GB, the kernel is more up to date and stable, and it's not much faster on x64. Unless you need to boot x64 (or are going to custom compile your own kernel regardless) please use x86.
 
+
=== Backup all your data! ===
+
I'm assuming you're buying the system to install Arch, and that there's no personal data on the device. But if that's not the case
+
  
 
{{Warning|'''*BACK UP YOUR DATA.*'''}}
 
{{Warning|'''*BACK UP YOUR DATA.*'''}}
  
Off device too, the hard disk gets wiped clean by design when you enter Dev Mode.
+
Seriously. All of it. Somewhere *other* than on the device - the entire data partition will be purged a couple times over during the install process. USB keys, Google Drive, printed paper messages stored in bottles, something.
  
 
=== Enabling Dev Mode ===
 
=== Enabling Dev Mode ===
Line 18: Line 15:
  
 
To enter Dev Mode:  
 
To enter Dev Mode:  
* Press hold down the {{Keypress|Esc+F3 (Refresh)}} keys, and press the {{Keypress|Power}} button.
+
* Press hold down the {{ic|Esc+F3 (Refresh)}} keys, and press the {{ic|Power}} button.
 
::This enters recovery mode,
 
::This enters recovery mode,
* Now press {{Keypress|Ctrl+d}} (there's no prompt). It will ask you to confirm, then the system will reboot into dev-mode.
+
* Now press {{ic|Ctrl+d}} (there's no prompt). It will ask you to confirm, then the system will reboot into dev-mode.
::Dev Mode will always show the scary boot screen and you need to press {{Keypress|Ctrl+d}} or wait 30 seconds to continue booting.
+
::Dev Mode will always show the scary boot screen and you'll need to press {{ic|Ctrl+d}} or wait 30 seconds to continue booting.
  
If you want to boot fromDirect_bootstrapping_Archlinux a chromium type usb drive you'll have to run "crossystem dev_boot_usb=1" from ChromeOS and reboot once to boot from USB drives with {{Keypress|Ctrl+u}}. But we don't care about that.
+
{{Note|If you ever need to hard reset, press the {{ic|Esc+F3 (Refresh)}} combo. This will hard reset the system much like the small reset buttons on the front of tower PCs. The same warnings as on towers apply - the OS has no chance to save itself from this, and data loss is possible. You've been warned.}}
  
{{Note|If you need to hard reset. Press the refresh/F3 and press the power button. This will hard reset the system. It's occasionally useful, but use it with care - it wont sync the disk or shut down nicely, so there's a nonzero chance of trashing the contents of your disk.}}
+
See Also: [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c7-chromebook]
  
(all of this was stolen from [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c7-chromebook])
+
=== Install ChrUbuntu ===
Direct_bootstrapping_Archlinux
+
While it sounds completely backwards to install Ubuntu on our Chromebook just to install Arch, at present it's the most automated and safe way. Scripts are in work-in-progress stages to try mashing the ChrUbuntu installer with [https://github.com/tokland/arch-bootstrap arch-bootstrap]; stay tuned for details if they arrive.
=== Partitioning For Arch ===
+
Next you need to make room for Arch by repartitioning the Chromebook.
+
  
You can use the following script to repartition your C7 to make room for Arch Linux. (It will also probably work on other chromebooks as well.)
+
* After enabling dev mode on your Chromebook, boot to the ChromeOS setup screen. Set keyboard layout, language, and connect to a network. Do *not* log in to an account.
 
+
* Press {{ic|Ctrl+Alt+F2}} and login as "chronos"
It will prompt you for sizes, then it will partition your disk for installing Arch, then reboot. After it reboots the C7 will reinstall ChromeOS to factory, but you'll have the partitions needed for installing Arch in the later sections.
+
* Bring up a bash prompt
 
+
# bash
{{bc|<nowiki>if [ "$1" != "" ]; then
+
* Download Crubuntu installer and run it.
  target_disk=$1
+
# curl -L -O goo.gl/s9ryd
  echo "Got ${target_disk} as target drive"
+
# sudo bash ./s9ryd
  echo ""
+
::Here is where you set the partition sizing for what will eventually be your Arch install. For example, I told the script "90", so Arch would be using the majority of my 128GB M4 SSD
  echo "WARNING! All data on this device will be wiped out! Continue at your own risk!"
+
* Wait for the system reboot
  echo ""
+
* Wait 3-5 minutes for the system "repair" job to run
  read -p "Press [Enter] to partition for Arch Linux on ${target_disk} or CTRL+C to quit"
+
* Reset keyboard layout, language, and reconnect to a network. Still don't log in to an account.
 
+
* {{ic|Ctrl+Alt+F2}} again, log in as "chronos" again
  ext_size="`blockdev --getsz ${target_disk}`"
+
* Bring up a bash prompt (again)
  aroot_size=$((ext_size - 65600 - 33))
+
# bash
  parted --script ${target_disk} "mktable gpt"
+
* Download Crubuntu installer and run it. (again)
  cgpt create ${target_disk}
+
# curl -L -O goo.gl/s9ryd
  cgpt add -i 6 -b 64 -s 32768 -S 1 -P 5 -l KERN-A -t "kernel" ${target_disk}
+
  # sudo bash ./s9ryd
  cgpt add -i 7 -b 65600 -s $aroot_size -l ROOT-A -t "rootfs" ${target_disk}
+
* Let Ubuntu's installer do its thing. You'll get asked a few setup-related questions along the way, it's safe to just hit {{ic|Enter}} for everything as we'll never let Ubuntu see light of day.
  sync
+
* While that installs, let's install Arch on our spare *nix box!
  blockdev --rereadpt ${target_disk}
+
{{Note|When the installer finishes, it will ask you to press {{ic|Enter}} to reboot. DO NOT DO THIS. Instead hit {{ic|Ctrl+C}} to drop back to a shell. You have been warned.}}
  partprobe ${target_disk}
+
  crossystem dev_boot_usb=1
+
else
+
  target_disk="`rootdev -d -s`"
+
  # Do partitioning (if we haven't already)
+
  ckern_size="`cgpt show -i 6 -n -s -q ${target_disk}`"
+
  croot_size="`cgpt show -i 7 -n -s -q ${target_disk}`"
+
  state_size="`cgpt show -i 1 -n -s -q ${target_disk}`"
+
 
+
  max_archlinux_size=$(($state_size/1024/1024/2))
+
  rec_archlinux_size=$(($max_archlinux_size - 1))
+
  # If KERN-C and ROOT-C are one, we partition, otherwise assume they're what they need to be...
+
  if [ "$ckern_size" = "1" -o "$croot_size" = "1" ]
+
  then
+
    while :
+
    do
+
      read -p "Enter the size in gigabytes you want to use for Arch Linux. Acceptable range is 5 to $max_archlinux_size  but $rec_archlinux_size is the recommended maximum: " archlinux_size
+
      if [ ! $archlinux_size -ne 0 2>/dev/null ]
+
      then
+
        echo -e "\n\nNumbers only please...\n\n"
+
        continue
+
      fi
+
      if [ $archlinux_size -lt 5 -o $archlinux_size -gt $max_archlinux_size ]
+
      then
+
        echo -e "\n\nThat number is out of range. Enter a number 5 through $max_archlinux_size\n\n"
+
        continue
+
      fi
+
      break
+
    done
+
    # We've got our size in GB for ROOT-C so do the math...
+
 
+
    #calculate sector size for rootc
+
    rootc_size=$(($archlinux_size*1024*1024*2))
+
 
+
    #kernc is always 16mb
+
    kernc_size=32768
+
 
+
    #new stateful size with rootc and kernc subtracted from original
+
    stateful_size=$(($state_size - $rootc_size - $kernc_size))
+
 
+
    #start stateful at the same spot it currently starts at
+
    stateful_start="`cgpt show -i 1 -n -b -q ${target_disk}`"
+
 
+
    #start kernc at stateful start plus stateful size
+
    kernc_start=$(($stateful_start + $stateful_size))
+
 
+
    #start rootc at kernc start plus kernc size
+
    rootc_start=$(($kernc_start + $kernc_size))
+
 
+
    #Do the real work
+
   
+
    echo -e "\n\nModifying partition table to make room for Arch."
+
    echo -e "Your Chromebook will reboot, wipe your data and then"
+
    echo -e "you should re-run this script..."
+
    umount /mnt/stateful_partition
+
   
+
    # stateful first
+
    cgpt add -i 1 -b $stateful_start -s $stateful_size -l STATE ${target_disk}
+
 
+
    # now kernc
+
    cgpt add -i 6 -b $kernc_start -s $kernc_size -l KERN-C ${target_disk}
+
 
+
    # finally rootc
+
    cgpt add -i 7 -b $rootc_start -s $rootc_size -l ROOT-C ${target_disk}
+
 
+
    reboot
+
    exit
+
  fi
+
fi</nowiki>}}
+
 
+
=== Create Arch Disk Image ===
+
  
 
==== Create Image File ====
 
==== Create Image File ====
* First we need to create an Arch Image to do things with. It's recommended that you use arch to create this image (because that's how I did it), but you can probably do this from any linux system.
+
* First we need to create an Arch Image to do things with. This can be done an any *nix box.
 
  # truncate -s 1G arch.img
 
  # truncate -s 1G arch.img
  
 
==== Convert Image To A Partition ====
 
==== Convert Image To A Partition ====
* Convert image to a ext3 filesystem.
+
* Convert image to a ext4 filesystem.
  # mkfs.ext3 arch.img
+
  # mkfs.ext4 -m 1 arch.img
 
* Mount image to install to
 
* Mount image to install to
 
  # mkdir /mnt/arch_install
 
  # mkdir /mnt/arch_install
  # mount -o arch.img /mnt/arch_install
+
  # mount arch.img /mnt/arch_install
  
 
==== Install Arch onto this new image ====
 
==== Install Arch onto this new image ====
There's plenty of ways to go about this, the method I recommend is  [[Install_from_Existing_Linux#Method_2:_Bootstrapping_the_arch_installation_scripts|Directly bootstrapping Archlinux.]] If you go this way you can just follow the [[Installation_Guide]]. But anyway you choose to create your Arch linux install should work, unless you do something very strange, in that case good luck!
+
At this point, run through the [https://wiki.archlinux.org/index.php/Installation_Guide Installation Guide] as you normally would. I strongly recommend doing this from a system with the Arch install scripts package installed; while this is a doable process with misc. *nix systems (many of such processes are well documented here on the Wiki), it's going to be much smoother with the install scripts.
  
=== Copy Arch Image To C7 ===
+
For 32 bit (x86),
The following is a quick mockup to get you started. It's incomplete, be careful, you'll be left with an unworking system if you follow this guide!
+
# pacstrap /mnt/arch_install base base-devel --arch i686
 +
{{Note|The `--arch i686` part is important if you're on an x86_64 system. As ChrUbuntu does not support 64 bit with the C7 currently. If you want to boot x86_64, you will need to install a different kernel detailed later.}}
  
You should now have the following
+
For 64 bit (x64)
# An image of Arch Linux
+
# pacstrap /mnt/arch_install base base-devel --arch x86_64
# A freshly partitioned Acer C7
+
When setting up fstab, you'll need to mount "/dev/sda7" at "/". UUIDs aren't really an option here as data is about to get sorted all over the place.
# A copy of the kernel
+
# A copy of the kernel modules
+
  
From there all you need to do is;
+
=== Copy Arch Image To C7 ===
 
+
Here's where things start to become a mess. By now you should have a ready-to-go Ubuntu install that you did not reboot into yet (meaning you're back at the bash shell in ChromeOS), and a ready-to-go Arch install on the arch.img file. You'll need to find a way to get this arch.img file to the Chromebook - be it a USB HDD, uploading it somewhere, SSHFS, whatever, make it happen.
* get the arch.img on the C7
+
* download a copy of your kernel
+
* download a copy of your kernel modules
+
* mount your image
+
* mount your root-c partition
+
* repack/resign the kernel
+
* dd the kernel
+
* copy over the kernel modules
+
* copy over cgpt
+
* set boot with cgpt
+
* reboot
+
* be happy
+
 
+
== Compile A Custom Kernel (optional) ==
+
 
+
The following is a work in progress as I try to get it working myself. Most of it has been stolen from http://superuser.com/questions/583269/chrubuntu-acer-how-to-load-kernel-3-8-0-16-instead-3-4-0 and
+
http://velvet-underscore.blogspot.com/2013/01/chrubuntu-virtualbox-with-kvm.html
+
  
{{bc|#
+
* Copy the Arch image to the Chromebook.
# Grab verified boot utilities from ChromeOS.
+
* Create working directories.
#
+
# mkdir mnt mnt2 mnt3 backup
mkdir -p /usr/share/vboot
+
* If your Arch image is on a USB key or drive, run "mount /dev/sdb1 mnt" (replacing /dev/sdb1 with the identifier of your USB drive according to ChromeOS). Then run "mount mnt/arch.img mnt2" (replacing arch.img with the name of your Arch image).
mount -o ro /dev/sda3 /mnt
+
* Otherwise, I'm assuming your Arch image was downloaded to the Chromebook somehow. So run "mount /path/to/arch.img mnt2"
cp /mnt/usr/bin/vbutil_* /usr/bin
+
* Mount Ubuntu's root at mnt3.
cp /mnt/usr/bin/dump_kernel_config /usr/bin
+
# mount /dev/sda7 mnt3
rsync -avz /mnt/usr/share/vboot/ /usr/share/vboot/
+
* Copy all firmware and kernel modules, which we'll need to successfully boot Arch.
umount /mnt
+
# cp -a mnt3/lib/{firmware,modules} backup/
}}
+
* Save all module configs.
 +
# cp -a mnt3/etc/modprobe.d/*.conf backup/
 +
* Remove old Ubuntu install
 +
# rm -rf mnt3/*
 +
{{Warning|Make 100% certain you typed "mnt3/*" and not some other mountpoint or you may toast your USB stick or Arch install.}}
 +
* Copy your Arch install off to what was Ubuntu's root directory.
 +
# cp -a mnt2/* mnt3/
 +
* Restore module configs.
 +
# cp -a backup/*.conf mnt3/etc/modprobe.d/
 +
If running x86
 +
* Run "cp -a backup/modules/* mnt3/lib/modules/". This will restore kernel modules.
 +
If running x86_64
 +
# wget http://grayhatter.com/C7/zgb-x64-modules.tar.bz2
 +
# tar xf zgb-x64-modules.tar.bz2
 +
# sudo cp -R 3.4.0 mnt3/lib/modules/
 +
* Restore kernel firmwares.
 +
# cp -a backup/firmware mnt3/lib/
 +
* Copy CGPT to arch so we can boot back and fourth.
 +
# cp /usr/bin/cgpt mnt3/usr/bin/
 +
# mkdir mnt3/usr/bin/old_bins
 +
# cp /usr/bin/old_bins/cgpt mnt3/usr/bin/old_bins
 +
* "umount" mnt3, mnt2, and mnt. In that order.
  
probably need this
+
=== Installing an x86_64 kernel (if installing x64) ===
 +
* Run these commands from within ChromeOS before rebooting.
  
pacman -S lib32-glibc
+
# wget http://grayhatter.com/C7/zgb-x64-kernel-partition.bz2
 +
# bunzip2 zgb-x64-kernel-partition.bz2
 +
# use_kernfs="zgb-x64-kernel-partition"
 +
# target_kern="/dev/sda6"
 +
# vbutil_kernel --repack $use_kernfs \
 +
  --keyblock /usr/share/vboot/devkeys/kernel.keyblock \
 +
  --version 1 \
 +
  --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
 +
  --oldblob $use_kernfs
 +
# dd if=$use_kernfs of=${target_kern}
  
 +
=== Finishing up ===
  
=== prep and make kernel ===
+
* Reboot and enjoy your Arch install! Note that ChrUbuntu's installer only told cgpt to boot to the Linux partition one time, so if anything is hosed, a reboot will send you back to ChromeOS. If all went well and you are happy with everything, you can reboot to ChromeOS, drop to the {{ic|Ctrl+Alt+F2}} console, and run a `sudo cgpt add -i 6 -P 5 -S 1 /dev/sda` to make the Chromebook always boot Arch.
{{bc|#
+
# Fetch ChromeOS kernel sources from the Git repo.
+
#
+
apt-get install git-core
+
cd /usr/src
+
git clone  https://git.chromium.org/git/chromiumos/third_party/kernel-next.git
+
cd kernel-next
+
git checkout origin/chromeos-3.8
+
  
#
+
== Optional - Reducing boot times (DANGEROUS) ===
# Configure the kernel
+
There is a way to "Neuter" the developer screen, and reduce the auto boot time to 3 seconds (vs the 30 seconds) and remove the beep in order to prevent the need to hit {{ic|Ctrl+d}} on every boot. This is dangerous because if you do this wrong, you can brick your chromebook completely, requiring a jtag to recover. However, these steps have been fully tested several times on several chromebooks of different versions (Acer C7 only, but several revisions). The BIOS flash also does not start the flash if the anything is unstable, so it has built in protection. Still, proceed with caution.
#
+
# First we patch ``base.config`` to set ``CONFIG_SECURITY_CHROMIUMOS``
+
# to ``n`` ...
+
cp ./chromeos/config/base.config ./chromeos/config/base.config.orig
+
sed -e \
+
  's/CONFIG_SECURITY_CHROMIUMOS=y/CONFIG_SECURITY_CHROMIUMOS=n/' \
+
  ./chromeos/config/base.config.orig > ./chromeos/config/base.config
+
./chromeos/scripts/prepareconfig chromeos-intel-pineview
+
#
+
# ... and then we proceed as per Olaf's instructions
+
#
+
yes "" | make oldconfig}}
+
  
== Problems AKA: Work In Progress ==
+
* Make sure the battery is completely full, and the machine is plugged in and booted in ChromeOS.
{{Stub}}
+
* Press {{ic|Ctrl+Alt+F2}} or {{ic|Ctrl+Alt+T}} to get to a terminal (log in if you use {{ic|Ctrl+Alt+F2}})
 +
# cd ~/Downloads
 +
# shell
 +
# sudo -s
 +
# flashrom -r bios.bin # Back up old BIOS
 +
# gbb_utility –set –flags=0×01 bios.bin bios.new # Modifies the BIOS as needed
 +
* Refer to this image to find the "Write Protect Jumper" http://goo.gl/4OuGrw
 +
* Short the BIOS protect jumper, and make sure the connection is stable. Jumpers form an old IDE HDD should work, I used a small knife and was very careful.
 +
# flashrom” again – “flashrom -w bios.new # Flashes the modified BIOS
 +
* If this command fails, the jumpers are not shorted completely, or the connection became unstable on the jumpers. It will not flash unless it's stable the whole time. It will revert if the connection becomes unstable at any time. If it failed while in a flash, DO NOT REBOOT! Flash again until it works if it started the flash to unsure that you don't have a bad flash and the tools recovery feature didn't fail. Just because it has a built in check doesn't mean you should rely on it.
 +
* If the connection was stable, you should have a working BIOS mod and you can reboot to see the changes. Congratulations you should now have a developer mode screen which flashes by in 2 seconds and doesn't beep!
 +
* Back up the bios.bin and bios.new on another machine in case you ever want to revert (google drive is also a good place to back these up to)
  
== See alse ==
+
== See also ==
 
* [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c7-chromebook Developer information on Official site]
 
* [http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c7-chromebook Developer information on Official site]
 +
* [http://chromeos-cr48.blogspot.com/2013/05/chrubuntu-one-script-to-rule-them-all_31.html ChrUbuntu script used in the installation, has useful tips on cgpt commands in case they are needed.]
 +
* [http://johnlewis.ie/neutering-the-developer-mode-screen-on-your-chromebook/ Source for BIOS modification (for different device, this page shows correct procedure for C7)]

Revision as of 11:57, 1 September 2013

The following is a work in progress guide to getting Arch working on the $200 Acer C7 Chromebook.

For now you'll need a second computer already running *nix. If you're already running ChrUbuntu on your C7 then you can just skip to creating your own Arch image.

Installing Arch onto an Acer C7 Chromebook

At present, Arch runs well on the C7, however most testing has been done with stock i686 ChromeOS kernels. "Patches welcome" when it comes to x86_64 Chromium kernels or completely custom ones. The recommend install is x86 as it has PAE, so your RAM will be used even if you upgrade to more than 4GB, the kernel is more up to date and stable, and it's not much faster on x64. Unless you need to boot x64 (or are going to custom compile your own kernel regardless) please use x86.

Warning: *BACK UP YOUR DATA.*

Seriously. All of it. Somewhere *other* than on the device - the entire data partition will be purged a couple times over during the install process. USB keys, Google Drive, printed paper messages stored in bottles, something.

Enabling Dev Mode

First step is to enable Dev mode on the system so we can run some unsigned code. This will wipe all your data!

To enter Dev Mode:

  • Press hold down the Esc+F3 (Refresh) keys, and press the Power button.
This enters recovery mode,
  • Now press Ctrl+d (there's no prompt). It will ask you to confirm, then the system will reboot into dev-mode.
Dev Mode will always show the scary boot screen and you'll need to press Ctrl+d or wait 30 seconds to continue booting.
Note: If you ever need to hard reset, press the Esc+F3 (Refresh) combo. This will hard reset the system much like the small reset buttons on the front of tower PCs. The same warnings as on towers apply - the OS has no chance to save itself from this, and data loss is possible. You've been warned.

See Also: [1]

Install ChrUbuntu

While it sounds completely backwards to install Ubuntu on our Chromebook just to install Arch, at present it's the most automated and safe way. Scripts are in work-in-progress stages to try mashing the ChrUbuntu installer with arch-bootstrap; stay tuned for details if they arrive.

  • After enabling dev mode on your Chromebook, boot to the ChromeOS setup screen. Set keyboard layout, language, and connect to a network. Do *not* log in to an account.
  • Press Ctrl+Alt+F2 and login as "chronos"
  • Bring up a bash prompt
# bash
  • Download Crubuntu installer and run it.
# curl -L -O goo.gl/s9ryd
# sudo bash ./s9ryd
Here is where you set the partition sizing for what will eventually be your Arch install. For example, I told the script "90", so Arch would be using the majority of my 128GB M4 SSD
  • Wait for the system reboot
  • Wait 3-5 minutes for the system "repair" job to run
  • Reset keyboard layout, language, and reconnect to a network. Still don't log in to an account.
  • Ctrl+Alt+F2 again, log in as "chronos" again
  • Bring up a bash prompt (again)
# bash
  • Download Crubuntu installer and run it. (again)
# curl -L -O goo.gl/s9ryd
# sudo bash ./s9ryd
  • Let Ubuntu's installer do its thing. You'll get asked a few setup-related questions along the way, it's safe to just hit Enter for everything as we'll never let Ubuntu see light of day.
  • While that installs, let's install Arch on our spare *nix box!
Note: When the installer finishes, it will ask you to press Enter to reboot. DO NOT DO THIS. Instead hit Ctrl+C to drop back to a shell. You have been warned.

Create Image File

  • First we need to create an Arch Image to do things with. This can be done an any *nix box.
# truncate -s 1G arch.img

Convert Image To A Partition

  • Convert image to a ext4 filesystem.
# mkfs.ext4 -m 1 arch.img
  • Mount image to install to
# mkdir /mnt/arch_install
# mount arch.img /mnt/arch_install

Install Arch onto this new image

At this point, run through the Installation Guide as you normally would. I strongly recommend doing this from a system with the Arch install scripts package installed; while this is a doable process with misc. *nix systems (many of such processes are well documented here on the Wiki), it's going to be much smoother with the install scripts.

For 32 bit (x86),

# pacstrap /mnt/arch_install base base-devel --arch i686
Note: The `--arch i686` part is important if you're on an x86_64 system. As ChrUbuntu does not support 64 bit with the C7 currently. If you want to boot x86_64, you will need to install a different kernel detailed later.

For 64 bit (x64)

# pacstrap /mnt/arch_install base base-devel --arch x86_64

When setting up fstab, you'll need to mount "/dev/sda7" at "/". UUIDs aren't really an option here as data is about to get sorted all over the place.

Copy Arch Image To C7

Here's where things start to become a mess. By now you should have a ready-to-go Ubuntu install that you did not reboot into yet (meaning you're back at the bash shell in ChromeOS), and a ready-to-go Arch install on the arch.img file. You'll need to find a way to get this arch.img file to the Chromebook - be it a USB HDD, uploading it somewhere, SSHFS, whatever, make it happen.

  • Copy the Arch image to the Chromebook.
  • Create working directories.
# mkdir mnt mnt2 mnt3 backup
  • If your Arch image is on a USB key or drive, run "mount /dev/sdb1 mnt" (replacing /dev/sdb1 with the identifier of your USB drive according to ChromeOS). Then run "mount mnt/arch.img mnt2" (replacing arch.img with the name of your Arch image).
  • Otherwise, I'm assuming your Arch image was downloaded to the Chromebook somehow. So run "mount /path/to/arch.img mnt2"
  • Mount Ubuntu's root at mnt3.
# mount /dev/sda7 mnt3
  • Copy all firmware and kernel modules, which we'll need to successfully boot Arch.
# cp -a mnt3/lib/{firmware,modules} backup/
  • Save all module configs.
# cp -a mnt3/etc/modprobe.d/*.conf backup/
  • Remove old Ubuntu install
# rm -rf mnt3/*
Warning: Make 100% certain you typed "mnt3/*" and not some other mountpoint or you may toast your USB stick or Arch install.
  • Copy your Arch install off to what was Ubuntu's root directory.
# cp -a mnt2/* mnt3/
  • Restore module configs.
# cp -a backup/*.conf mnt3/etc/modprobe.d/

If running x86

  • Run "cp -a backup/modules/* mnt3/lib/modules/". This will restore kernel modules.

If running x86_64

# wget http://grayhatter.com/C7/zgb-x64-modules.tar.bz2
# tar xf zgb-x64-modules.tar.bz2
# sudo cp -R 3.4.0 mnt3/lib/modules/
  • Restore kernel firmwares.
# cp -a backup/firmware mnt3/lib/
  • Copy CGPT to arch so we can boot back and fourth.
# cp /usr/bin/cgpt mnt3/usr/bin/
# mkdir mnt3/usr/bin/old_bins
# cp /usr/bin/old_bins/cgpt mnt3/usr/bin/old_bins
  • "umount" mnt3, mnt2, and mnt. In that order.

Installing an x86_64 kernel (if installing x64)

  • Run these commands from within ChromeOS before rebooting.
# wget http://grayhatter.com/C7/zgb-x64-kernel-partition.bz2
# bunzip2 zgb-x64-kernel-partition.bz2
# use_kernfs="zgb-x64-kernel-partition"
# target_kern="/dev/sda6"
# vbutil_kernel --repack $use_kernfs \
 --keyblock /usr/share/vboot/devkeys/kernel.keyblock \
 --version 1 \
 --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
 --oldblob $use_kernfs
# dd if=$use_kernfs of=${target_kern}

Finishing up

  • Reboot and enjoy your Arch install! Note that ChrUbuntu's installer only told cgpt to boot to the Linux partition one time, so if anything is hosed, a reboot will send you back to ChromeOS. If all went well and you are happy with everything, you can reboot to ChromeOS, drop to the Ctrl+Alt+F2 console, and run a `sudo cgpt add -i 6 -P 5 -S 1 /dev/sda` to make the Chromebook always boot Arch.

Optional - Reducing boot times (DANGEROUS) =

There is a way to "Neuter" the developer screen, and reduce the auto boot time to 3 seconds (vs the 30 seconds) and remove the beep in order to prevent the need to hit Ctrl+d on every boot. This is dangerous because if you do this wrong, you can brick your chromebook completely, requiring a jtag to recover. However, these steps have been fully tested several times on several chromebooks of different versions (Acer C7 only, but several revisions). The BIOS flash also does not start the flash if the anything is unstable, so it has built in protection. Still, proceed with caution.

  • Make sure the battery is completely full, and the machine is plugged in and booted in ChromeOS.
  • Press Ctrl+Alt+F2 or Ctrl+Alt+T to get to a terminal (log in if you use Ctrl+Alt+F2)
# cd ~/Downloads
# shell
# sudo -s
# flashrom -r bios.bin # Back up old BIOS
# gbb_utility –set –flags=0×01 bios.bin bios.new # Modifies the BIOS as needed
  • Refer to this image to find the "Write Protect Jumper" http://goo.gl/4OuGrw
  • Short the BIOS protect jumper, and make sure the connection is stable. Jumpers form an old IDE HDD should work, I used a small knife and was very careful.
# flashrom” again – “flashrom -w bios.new # Flashes the modified BIOS
  • If this command fails, the jumpers are not shorted completely, or the connection became unstable on the jumpers. It will not flash unless it's stable the whole time. It will revert if the connection becomes unstable at any time. If it failed while in a flash, DO NOT REBOOT! Flash again until it works if it started the flash to unsure that you don't have a bad flash and the tools recovery feature didn't fail. Just because it has a built in check doesn't mean you should rely on it.
  • If the connection was stable, you should have a working BIOS mod and you can reboot to see the changes. Congratulations you should now have a developer mode screen which flashes by in 2 seconds and doesn't beep!
  • Back up the bios.bin and bios.new on another machine in case you ever want to revert (google drive is also a good place to back these up to)

See also