├── NOTES.md ├── install-minimal ├── scripts └── install-ubuntu.sh ├── shrink-chromeos └── README.md /NOTES.md: -------------------------------------------------------------------------------- 1 | ## Chrome OS Linux kernel command line 2 | 3 | Chrome OS uses quite a lot of kernel parameters. So here is the full line as i 4 | see it in dmesg after booting into Chrome OS. 5 | 6 | cros_secure console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 2506752 verity payload=PARTUUID=XXX/PARTNROFF=1 hashtree=PARTUUID=XXX/PARTNROFF=1 hashstart=2506752 alg=sha1 root_hexdigest=XXX salt=XXX" noinitrd vt.global_cursor_default=0 kern_guid=XXX add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic iTCO_vendor_support.vendorsupport=3 gpt 7 | 8 | ## Lightbar control 9 | 10 | The lightbar on the Pixel can be controlled through [EC](http://www.chromium.org/chromium-os/ec-development). The tool for this is `ectool` which is part of 11 | the Chrome OS installation. 12 | 13 | ### Konami code 14 | 15 | ectool lightbar seq stop 16 | ectool lightbar seq run 17 | 18 | ### Run the sequence 19 | 20 | ectool lightbar seq konami 21 | 22 | ### Stop sequences so you can play with the lightbar 23 | 24 | ectool lightbar seq stop 25 | 26 | ### Turn all lights to green 27 | 28 | ectool lightbar 4 00 ff 00 29 | 30 | ### Turn the first led to blue 31 | 32 | ectool lightbar 0 00 00 ff 33 | 34 | ### Turn the lightbar off 35 | 36 | ectool lightbar off 37 | 38 | ### Turn the lightbar on 39 | 40 | ectool lightbar on 41 | 42 | ### Start the sequence again and return things to normal 43 | 44 | ectool lightbar init 45 | ectool lightbar seq run 46 | 47 | To get all this on Linux we need the `ectool` binary. The source code and 48 | details is checked into [Chromium OS repository](https://chromium.googlesource.com/chromiumos/platform/ec). 49 | 50 | There is also a [Mainline Kernel patch](https://chromium-review.googlesource.com/#/c/187680/) available which exposes EC lightbar through 51 | sysfs. I might add this to my Kernel patches eventually. THis patch has been 52 | submitted to the upstream Kernel [here](https://lkml.org/lkml/2015/2/2/214). 53 | These patches require a modified ectool which seems to be available too. 54 | 55 | ## Building ectool 56 | 57 | git clone git://git.collabora.co.uk/git/user/javier/ec.git 58 | cd ec 59 | git checkout mainline-ioctl 60 | make BOARD=link CROSS_COMPILE= HOST_CROSS_COMPILE= build/link/util/ectool 61 | sudo ./build/link/util/ectool version 62 | 63 | ## Controlling the fan with ectool 64 | 65 | Once you have ectool built for Linux it can be used to get control on the fan. 66 | 67 | sudo ./build/link/util/ectool fanduty 0 68 | sudo ./build/link/util/ectool fanduty 100 69 | sudo ./build/link/util/ectool autofanctrl on 70 | 71 | ## Firmware event log 72 | 73 | http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/chromebook-pixel -------------------------------------------------------------------------------- /install-minimal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | target_disk="" 4 | ubuntu_arch="amd64" 5 | ubuntu_metapackage="ubuntu-minimal" 6 | ubuntu_version="latest" 7 | 8 | target_disk="`rootdev -d -s`" 9 | echo "Target disk is $target_disk ..." 10 | 11 | if [ "$ubuntu_version" = "lts" ] 12 | then 13 | ubuntu_version=`wget --quiet -O - http://changelogs.ubuntu.com/meta-release | grep "^Version:" | grep "LTS" | tail -1 | sed -r 's/^Version: ([^ ]+)( LTS)?$/\1/'` 14 | tar_file="http://cdimage.ubuntu.com/ubuntu-core/releases/$ubuntu_version/release/ubuntu-core-$ubuntu_version-core-$ubuntu_arch.tar.gz" 15 | elif [ "$ubuntu_version" = "latest" ] 16 | then 17 | ubuntu_version=`wget --quiet -O - http://changelogs.ubuntu.com/meta-release | grep "^Version: " | tail -1 | sed -r 's/^Version: ([^ ]+)( LTS)?$/\1/'` 18 | tar_file="http://cdimage.ubuntu.com/ubuntu-core/releases/$ubuntu_version/release/ubuntu-core-$ubuntu_version-core-$ubuntu_arch.tar.gz" 19 | elif [ $ubuntu_version = "dev" ] 20 | then 21 | ubuntu_version=`wget --quiet -O - http://changelogs.ubuntu.com/meta-release-development | grep "^Version: " | tail -1 | sed -r 's/^Version: ([^ ]+)( LTS)?$/\1/'` 22 | ubuntu_animal=`wget --quiet -O - http://changelogs.ubuntu.com/meta-release-development | grep "^Dist: " | tail -1 | sed -r 's/^Dist: (.*)$/\1/'` 23 | tar_file="http://cdimage.ubuntu.com/ubuntu-core/daily/current/$ubuntu_animal-core-$ubuntu_arch.tar.gz" 24 | else 25 | tar_file="http://cdimage.ubuntu.com/ubuntu-core/releases/$ubuntu_version/release/ubuntu-core-$ubuntu_version-core-$ubuntu_arch.tar.gz" 26 | fi 27 | 28 | echo "Installing Ubuntu ${ubuntu_version} with metapackage ${ubuntu_metapackage}" 29 | echo "Installing Ubuntu Arch: $ubuntu_arch" 30 | 31 | read -p "Press [Enter] to continue..." 32 | 33 | rootfs="/tmp/ubuntu-temp-root" 34 | 35 | if [ ! -d $rootfs ] 36 | then 37 | mkdir $rootfs 38 | fi 39 | 40 | wget -O - $tar_file | tar xzp -C $rootfs/ 41 | 42 | cp scripts/install-ubuntu.sh $rootfs 43 | 44 | cd $rootfs 45 | cp -f /etc/resolv.conf etc/ 46 | 47 | mount -o bind /proc $rootfs/proc 48 | mount -o bind /dev $rootfs/dev 49 | mount -o bind /dev/pts $rootfs/dev/pts 50 | mount -o bind /sys $rootfs/sys 51 | 52 | sed -i 's/http:\/\/archive./http:\/\/de.archive./g' etc/apt/sources.list 53 | 54 | cat > usr/sbin/policy-rc.d << EOF 55 | #!/bin/sh 56 | exit 101 57 | EOF 58 | chmod a+x usr/sbin/policy-rc.d 59 | 60 | # Make /tmp location usable for chroot. 61 | mount -o remount exec,suid,dev /tmp 62 | 63 | # Chroot. 64 | chmod a+x install-ubuntu.sh 65 | chroot $rootfs /bin/bash -c /install-ubuntu.sh 66 | 67 | # Make sure everything can boot. 68 | crossystem dev_boot_legacy=1 dev_boot_signed_only=1 69 | 70 | echo -e " 71 | Installation is complete! On reboot at the dev mode screen, you can press 72 | CTRL+L to boot Ubuntu or CTRL+D to boot Chrome OS. The Ubuntu login is: 73 | 74 | Username: user 75 | Password: user 76 | 77 | Enjoy! 78 | " 79 | -------------------------------------------------------------------------------- /scripts/install-ubuntu.sh: -------------------------------------------------------------------------------- 1 | export DEBIAN_FRONTEND=noninteractive 2 | 3 | target_disk="/dev/sda" 4 | root_partition="${target_disk}7" 5 | boot_partition="${target_disk}6" 6 | 7 | apt-get update 8 | apt-get install -y cryptsetup rsync 9 | 10 | # Create encrypted root. 11 | echo 12 | echo "Please enter the password for full disc encryption." 13 | cryptsetup luksFormat -q --cipher aes-xts-plain64 --key-size 512 --hash SHA512 --iter-time 20000 $root_partition 14 | 15 | echo 16 | echo "Created encrypted disk, provide the password again to open it." 17 | cryptsetup luksOpen $root_partition root 18 | 19 | echo "Creating file system in encrypted disk" 20 | mkfs.ext4 /dev/mapper/root 21 | 22 | echo "Creating boot file system" 23 | mkfs.ext2 $boot_partition 24 | 25 | rootfs="/tmp/rootfs" 26 | 27 | mkdir -p $rootfs 28 | 29 | mount /dev/mapper/root $rootfs 30 | mkdir -p $rootfs/boot 31 | mount $boot_partition $rootfs/boot 32 | 33 | echo "Syncing minimal system to encrypted disc ..." 34 | rsync -rax --exclude="/proc" --exclude="/dev" --exclude="/sys" --exclude="/tmp" --exclude="/install-ubuntu.sh" --exclude="/etc/resolv.conf" / $rootfs/ 35 | 36 | mkdir $rootfs/proc 37 | mkdir $rootfs/dev 38 | mkdir $rootfs/sys 39 | mkdir $rootfs/tmp 40 | 41 | mount -o bind /proc $rootfs/proc 42 | mount -o bind /dev $rootfs/dev 43 | mount -o bind /dev/pts $rootfs/dev/pts 44 | mount -o bind /sys $rootfs/sys 45 | 46 | bootuuid=`blkid -s UUID -o value ${boot_partition}` 47 | echo "Boot UUID $bootuuid" 48 | 49 | rootuuid=`blkid -s UUID -o value ${root_partition}` 50 | echo "Root UUID $rootuuid" 51 | 52 | cd $rootfs 53 | 54 | echo "Creating crypttab ..." 55 | cat > etc/crypttab << EOF 56 | root UUID=$rootuuid none luks,discard 57 | EOF 58 | 59 | echo "Creating fstab ..." 60 | cat > etc/fstab << EOF 61 | /dev/mapper/root / ext4 errors=remount-ro 0 1 62 | UUID=$bootuuid /boot ext2 defaults 0 2 63 | tmpfs /tmp tmpfs nodev,nosuid,mode=1777 0 0 64 | EOF 65 | 66 | echo "ubuntu" > etc/hostname 67 | 68 | echo -e "export DEBIAN_FRONTEND=noninteractive 69 | apt-get -y update 70 | apt-get -y dist-upgrade 71 | apt-get -y install ubuntu-minimal 72 | apt-get -y install wget 73 | apt-get -y install software-properties-common 74 | add-apt-repository main 75 | add-apt-repository universe 76 | add-apt-repository restricted 77 | add-apt-repository multiverse 78 | apt-get update 79 | apt-get -y install linux-generic 80 | apt-get -y install grub-pc 81 | grub-mkconfig -o /boot/grub/grub.cfg 82 | grub-install ${target_disk} --force 83 | useradd -m user -s /bin/bash 84 | echo user | echo user:user | chpasswd 85 | usermod -a -G adm,cdrom,lpadmin,sudo,dip,plugdev user 86 | " > third_stage 87 | chmod a+x third_stage 88 | 89 | cp /etc/resolv.conf etc/resolv.conf 90 | 91 | chroot $rootfs /bin/bash -c /third_stage 92 | 93 | echo "Check the created system now." 94 | bash 95 | 96 | echo "Cleaning up ..." 97 | rm -f usr/sbin/policy-rc.d 98 | umount -l $boot_partition 99 | umount -l $rootfs/proc 100 | umount -l $rootfs/dev/pts 101 | umount -l $rootfs/dev 102 | umount -l $rootfs/sys 103 | 104 | sleep 2 105 | 106 | umount -l $rootfs 107 | 108 | sleep 2 109 | 110 | cryptsetup luksClose root 111 | 112 | echo "Installation complete." 113 | -------------------------------------------------------------------------------- /shrink-chromeos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Determining boot support ..." 4 | LEGACY_LOCATION="`mosys -k eeprom map | grep RW_LEGACY`" 5 | if [ "$LEGACY_LOCATION" = "" ]; then 6 | echo "Error: The system does not seem to support CTRL+L Legacy SeaBIOS booting." 7 | exit 1 8 | fi 9 | echo "This system supports CTRL+L boot. Good." 10 | 11 | target_disk="`rootdev -d -s`" 12 | echo "Target disk is $target_disk ..." 13 | 14 | # Get sizes 15 | ckern_size="`cgpt show -i 6 -n -s -q ${target_disk}`" 16 | croot_size="`cgpt show -i 7 -n -s -q ${target_disk}`" 17 | state_size="`cgpt show -i 1 -n -s -q ${target_disk}`" 18 | 19 | # Calc max sizes 20 | max_ubuntu_size=$(($state_size/1024/1024/2)) 21 | rec_ubuntu_size=$(($max_ubuntu_size - 1)) 22 | 23 | # If KERN-C and ROOT-C are one, we partition, otherwise assume they're what they need to be 24 | if [ "$ckern_size" = "1" -o "$croot_size" = "1" ] 25 | then 26 | 27 | echo "We have to modify the partition table. This will damage Chrome OS but it" 28 | echo "will repair itself on the next boot." 29 | echo "THIS WILL WIPE ALL YOUR DATA !!!" 30 | read -p "Are you sure? (y/N) " -n 1 cont 31 | if [ "$cont" != "y" ]; then 32 | echo "Aborted." 33 | echo 34 | exit 1 35 | fi 36 | 37 | echo 38 | 39 | while : 40 | do 41 | echo "Enter the size in gigabytes you want to reserve for Ubuntu." 42 | read -p "5-$max_ubuntu_size, $rec_ubuntu_size recommended maximum: " ubuntu_size 43 | if [ ! $ubuntu_size -ne 0 2>/dev/null ] 44 | then 45 | echo "Please enter numbers only ..." 46 | continue 47 | fi 48 | if [ $ubuntu_size -lt 5 -o $ubuntu_size -gt $max_ubuntu_size ] 49 | then 50 | echo "That number is out of range. Enter a number 5 through $max_ubuntu_size." 51 | continue 52 | fi 53 | break 54 | done 55 | 56 | # We've got our size in GB for ROOT-C so do the math... 57 | # Calculate sector size for rootc. 58 | rootc_size=$(($ubuntu_size*1024*1024*2)) 59 | 60 | # kernc we use 256MB for kernc 61 | kernc_size=$((256*1024*2)) 62 | 63 | # New stateful size with rootc and kernc subtracted from original 64 | stateful_size=$(($state_size - $rootc_size - $kernc_size)) 65 | 66 | # Start stateful at the same spot it currently starts at 67 | stateful_start="`cgpt show -i 1 -n -b -q ${target_disk}`" 68 | 69 | # Start kernc at stateful start plus stateful size 70 | kernc_start=$(($stateful_start + $stateful_size)) 71 | 72 | # Start rootc at kernc start plus kernc size 73 | rootc_start=$(($kernc_start + $kernc_size)) 74 | 75 | # Do the real work... 76 | echo "Modifying partition table to make room for Ubuntu." 77 | umount -f /mnt/stateful_partition 78 | 79 | # Stateful first 80 | cgpt add -i 1 -b $stateful_start -s $stateful_size -l STATE ${target_disk} 81 | # Now kernc 82 | cgpt add -i 6 -b $kernc_start -s $kernc_size -l KERN-C -t "kernel" ${target_disk} 83 | # Finally rootc 84 | cgpt add -i 7 -b $rootc_start -s $rootc_size -l ROOT-C ${target_disk} 85 | 86 | echo "Complete. Reboot your system to apply the changes and to repair Chrome OS." 87 | 88 | else 89 | 90 | echo "Stateful size : $(($state_size/1024/2)) MB" 91 | echo "CKern size : $(($ckern_size/1024/2)) MB" 92 | echo "CRoot sizse : $(($croot_size/1024/2)) MB" 93 | echo 94 | echo "Noting to do, did you run this script already?" 95 | 96 | fi 97 | 98 | echo 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Install Ubuntu 14.10 on Chromebook Pixel (2013) 2 | =============================================== 3 | 4 | With this instructions you get a Ubuntu 15.04 on Chromebook Pixel, installed 5 | on the SSD without removing Chrome OS. This means dual boot from development 6 | mode prompt to either Chrome OS or Ubuntu. All relevant components work on 7 | Ubuntu as you would expect it, including Bluetooth, touch and Wifi. 8 | 9 | This guide is for the Chromebook Pixel from 2013. Most of the things here 10 | will work for the Pixel 2015 as well. You will have issues with the Kernel as 11 | it is lacking some drivers required for the newer Pixel. If anyone wants to 12 | send me a Pixel 2015 get in touch by email (simon AT longsleep DOT org) and I 13 | will see what I can do. 14 | 15 | ## Assumptions 16 | 17 | - Chromebook Pixel is already in developer mode. 18 | - You are willing to shrink Chrome OS (this will remove all data). 19 | 20 | So just get this repository and extract it into ~/Downloads. You need to be able 21 | to run the various scripts shipped in this repository. 22 | 23 | This repository provides all the gear to install Ubuntu along side with Chrome 24 | OS. During this process Chrome OS will be shrunk and will reset all its data. 25 | You have been warned! 26 | 27 | ## Shrink Chrome OS 28 | 29 | sudo bash shrink-chromeos 30 | 31 | ## Install Ubuntu 32 | 33 | The Chrome Book Pixel hardware works out of the box with Ubuntu 15.04. No 34 | extra equipment is required. 35 | 36 | sudo bash install-minimal 37 | 38 | ## Kernel settings 39 | 40 | - Add line `i915.modeset=1` into /etc/modules. 41 | - Add `tpm_tis.force=1 tpm_tis.interrupts=0` to GRUB_CMDLINE_LINUX_DEFAULT in 42 | /etc/default/grub and run `sudo update-grub` afterwards. 43 | 44 | ## Disable bluetooth on startup 45 | 46 | Edit /etc/rc.local and add `rfkill block bluetooth` before the `exit 0`. 47 | 48 | ## Dim screen on startup 49 | 50 | The Pixel's screen is very bright and boots up at full intensity. So I find 51 | it a good idea to dim it on startup. Edit /etc/rc.local and add 52 | `echo 2800 > /sys/class/backlight/intel_backlight/brightness`. 53 | 54 | ## Hot keys 55 | 56 | - I use the CTRL key to rebind audio hotkeys in keyboard settings. 57 | - For keyboard backlight I use a custom trigger CTRL+TAB with my 58 | `pixel-keyboard-brightness` from my [bin-scripts](https://github.com/longsleep/bin-scripts) repository. 59 | - Display backlight keys can be bound to a custom action using `xdotool`. 60 | Install `xdotool` with apt-get and bind `xdotool key --clearmodifies XF86MonBrightnessUp` 61 | and `xdotool key --clearmodifies XF86MonBrightnessDown` to the designated 62 | keys within keyboard settings. I have a script for this in my bin-scripts 63 | repository as well. 64 | 65 | ## Known issues 66 | 67 | - Chromebooks forget about Dev mode when completely out of battery. This is 68 | very annoying. See [here](http://dev.chromium.org/chromium-os/developer-information-for-chrome-os-devices/workaround-for-battery-discharge-in-dev-mode) for 69 | details. 70 | 71 | ## Dual boot with Chrome OS 72 | 73 | So now we have Ubuntu. Chrome OS is still there and functional. You can boot 74 | it from the boot screen with CTRL+D. 75 | 76 | ## Install Chromebrew into Chrome OS 77 | 78 | [Chromebrew](http://skycocker.github.io/chromebrew/) is a package manager for 79 | Chrome OS which allows to easily install various tools into your Chrome OS 80 | environment. It installs directly into Chrome OS, no chroot what so ever. 81 | 82 | wget -q -O - https://raw.github.com/skycocker/chromebrew/master/install.sh | bash 83 | 84 | This gives you a decent start for working with Chrome OS on the command line, 85 | including Git support. 86 | 87 | Then try it out and install vim. 88 | 89 | crew install vim 90 | 91 | Yay! 92 | 93 | ## Install Chrome Dev editor (works on both Ubuntu and Chrome OS) 94 | 95 | [Chrome Dev Editor](https://chrome.google.com/webstore/detail/chrome-dev-editor-develop/pnoffddplpippgcfjdhbmhkofpnaalpg) 96 | is a Chrome App which works offline and provides you a Graphical Text editor. 97 | It supports Git directly (but do no use that) as it works great together with 98 | commandline Git. I use the Monokai color theme there as this is the theme I 99 | usually have in Sublime Text too. 100 | 101 | ## Use Kernel 4.1 102 | 103 | I recommend running the Pixel with Linux Kernel 4.1 as it brings lots of 104 | changes and improvements for the Intel Platform. I have a Kernel patches 105 | tree and configuration for the Chromebook Pixel in my [Kernel patches](https://github.com/longsleep/linux_patches/tree/pixel) repository. 106 | 107 | ## Extra packages 108 | 109 | I also have a [ppa for the Pixel on Ubuntu](https://launchpad.net/~longsleep/+archive/ubuntu/pixel-extras). This adds some extra functionality and tools i use of the 110 | time. Most of it requires Kernel 4.1 though. 111 | 112 | ## My result/ recommendation 113 | 114 | For me the Chromebook Pixel is working great with Linux. I am using it as 115 | main laptop for development when i am at home and travelling. Below you find 116 | a list of the best and worst items which are relevant to me. 117 | 118 | ### Pro's 119 | 120 | + Great QWERTY keyboard which has all be buttons at the right place and in 121 | the correct size to type quickly and fluidly. 122 | + Great, large touchpad. 123 | + Solid aluminium case, which maches the whole thing pretty much 124 | indestructable. 125 | + Linux support is good (using my custom Kernel). 126 | + Brilliant HiDPI 4:3 screen. 127 | + Fan is off when not doing very much / no noise! 128 | + Mini display port connector to attach external HiDPI display. 129 | + Good 720p UVC camera. 130 | + Reasonable CPU performance (14367.41 BogoMIPS). 131 | 132 | ### Con's 133 | 134 | - Gets rather hot (+loud fan) when CPU and GPU is loaded. 135 | - Moderate battery live (5 to 6 hours at best). 136 | - No secure boot / have to keep Chrome OS in dev mode. 137 | - Very small SSD, need to use extra SDCard to be useful. 138 | - Only has USB2 / no USB3. 139 | - Keyboard is missing some keys, requires extra Kernal patches to get 140 | POS1, END, PAGE-UP/DOWN. 141 | - Need to keep Chrome OS on the SSD to be able to recover from complete 142 | power loss. See [here](http://dev.chromium.org/chromium-os/developer-information-for-chrome-os-devices/workaround-for-battery-discharge-in-dev-mode) for 143 | reasons. 144 | 145 | ### Additional things 146 | 147 | - Check if we can improve battery life with Kernel 4.2 and 148 | by setting `pcie_aspm=force i915.enable_fbc=1 i915.enable_rc6=7` 149 | Kernel parameters. Also check `i915.enable_psr=1` parameter. 150 | 151 | 152 | To sum this up, the Chromebook Pixel is the platform of choice and can only 153 | be recommended if you are willing to work around the issues to get Linux on 154 | it and all. Usually in other similar 13" Ultrabooks the list of problems is 155 | a lot longer. The Pixel is almost flawless, now if it had a 512GB SSD and a 156 | customizeable EFI BIOS .. well dreams. 157 | 158 | -- 159 | Simon Eisenmann 160 | --------------------------------------------------------------------------------