Installing/Samus

From GalliumOS Wiki
< Installing
Revision as of 00:49, 27 February 2016 by Jdferron (talk | contribs) (Installing GalliumOS on the Google Pixel 2015 (Samus))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installing GalliumOS on the Google Pixel 2015 (Samus)

Download and Write GalliumOS to USB

  1. Download the appropriate iso from here. For this tutorial, you’ll need the Chromebook Broadwell ISO.
  2. Download Win32DiskImager from SourceForge and install it. Linux/Mac users will use a terminal.
  3. Insert an empty USB drive (all data will be erased during the write process!). Run Win32DiskImager. Make sure you have the correct USB drive selected under “Device.” Click on the blue folder icon. On the bottom right you’ll see, Disk Images (*.img *.IMG). Click on it and change it to *.* Now you’ll be able to locate the GalliumOS iso. Locate it and double-click it. Making sure that you have the correct USB selected, click on “Write.” When the USB is ready, eject it and put it aside for when you’ll need it later in this tutorial.
  4. Linux/Mac users need to follow the instructions found here.

Backup data

If you have any data stored locally on the chromebook that you would like to keep, backup the data to either a USB drive or to Google Drive. Enabling developer mode will wipe your device.

Enable Developer Mode and Boot Flags

  1. Boot into recovery by press and hold the Esc + Refresh keys, then press the power button.
  2. At the Recovery screen press Ctrl-D. It will ask you to confirm by pressing the RECOVERY BUTTON again. It will now enable Developer Mode. It will take about 10-15 minutes to complete. During this time, your chromebook will be wiped of all user data.
  3. You’ll see a white screen after rebooting. Press Ctrl-D and you’ll boot into ChromeOS with Developer Mode enabled.
  4. Connect to the Internet and accept the terms and agreements. You don’t have to login to ChromeOS using your account (you can if you want to, but I didn’t). Login as Guest and open up a Crosh session by pressing Ctrl-Alt-T. Type shell and hit enter to open bash. The prompt should look like this: chronos@localhost / $
  5. Alternatively, ou can immediately press Ctrl+Alt+F2 to get to a TTY.
  6. Type sudo crossystem dev_boot_usb=1 dev_boot_legacy=1 and hit enter.

Boot from USB

  1. Reboot your Chromebook
  2. Press Ctrl-L at the scary white screen.
  3. Press the ESC key when you see the prompt to do so. You’ll now be in the boot menu.(If you don’t press ESC in time just reboot and do it again.)
  4. At the boot menu you’ll see your boot options. Select to boot from USB.
  5. You’ll now get the option to live boot or install GalliumOS. You want to live boot.
  6. Test GalliumOS. Explore until you’re sure everything works fine. If you decide to install GalliumOS (and why wouldn’t you?), don’t install it while you’re live booted. For some reason that didn’t work for me, and I had to do it over again. Instead, reboot and follow the above steps until you get to the live boot or install GalliumOS menu. Choose Install GalliumOS. There’ll be a few prompts during the installation process.
    1. Disclaimer: From here on out once you install Gallium you will need to hit those keys after each reboot unless you are willing to open the Pixel and remove a Write Protect screw to allow you to disable that screen. Be aware you DON'T NEED TO DO THIS with that screw unless you don't want to hit those keys, the Pixel 2015 doesn't have the out of power glitch the original Pixel had and with the Developer Screen there it provides a very nice fail safe in case you severely screw up your install and want to move back to ChromeOS again.

Installing GalliumOS

  1. Installing Gallium is the easiest albeit the most flexible part of this process. Run the installer located on the desktop of the Live USB environment and follow through the prompts with your preferences (I'd recommend connecting to the internet if you can and also selecting the Download Extra Software option) until you get to Partitioning portion. This can be highly subjective on how you want to setup this partitioning BUT for me this is what I went with:
    1. After that hit the Plus Icon. This will be your main partition where everything will be run from, you can set it to be the full size of the disk if you want with no issues since Gallium uses ZRam. Set it to be formated to "EXT4" and for the Mount point select "/". Hit OK and give it a second to resize the partitions.
    2. After that hit next and a confirmation screen will ask for sure if you want to do this, select OK if you are.
  2. After that you will be prompted for Region, Keyboard, User name, yadayada you should know what to do here.
  3. At this point it will then install everything and prompt you to reboot. Reboot the unit and remove your install media at the prompt

Post GalliumOS Install

Update GalliumOS Packages

In terminal update the packages by executing the following command:

   sudo apt-get update
   sudo apt-get dist-upgrade

Reboot the unit and once you get it up and running we will need to install a few things to get this started.

Install Git

First we will need to install this, this is how you are going to build the kernel from Github where its hosted. Open a terminal window up and type:

    sudo apt-get install git

This will bring up a long list of dependencies and files to install, just hit "y" and let it do its thing.

Installing Kernel Source

Now for the Kernel work (thanks to Raphael, https://github.com/raphael/linux-samus). Open up a Terminal (it will start at /home/"Your Username" by default, so every command below is located in /home/"Your Username"/"cd command" as a reference for you) and Type:

   git clone https://github.com/raphael/linux-samus

This will start the download and compile of the Kernel, its a little less than 100,000 files so probably grab some coffee. Once that is done, navigate to the folder below or type:

   cd linux-samus/build/debian

After that install the kernel via:

   sudo dpkg -i *.deb

Now the kernel will be installed! For good measure to update grub, type:

   sudo update-grub

Now you should be able to reboot and once the unit comes back you should be able to use the touchpad far more effectively (still needs a little more configuring) and can start the final bits of setting up the sound, Xorg optimizations, and screen brightness key commands.

XOrg and Touchpad Tweaks

I'll list the easy ones first, Xorg and touchpad tweaks. With Xorg you will need to type into terminal:

   cd linux-samus/scripts/setup/xorg
   ./xaccel.sh

There won't be any confirmation message, if you get an error message you will want to confirm you are in the correct directory. After that we will do the touchpad tweaks. First we need to enable an Atmel script first, after that we will be setting up up a service to run the script. This is because since Linux 4.3 the Atmel chip needs to be reset on boot to guarantee that the touchpad works. First you will enter:

   cd linux-samus/scripts/setup/touchpad
   ./enable-atmel.sh

After that you will want to run the systemd script:

   ./setup.systemd.sh

At this point you should have a fully functioning trackpad and be able to avoid random unresponsive moments. Now we will setup the Brightness Keys. If you don't want to change the keys default behavior as F-Keys then don't bother with this step.

   cd scripts/setup/brightness
   ./brightness --help

This enables F6 and F7 to change screen brightness

   ./keyboard_led --help

This enables ALT-F6 and ALT-F7 to change keyboard brightness.

   ./setup.systemd.sh

This setups up these scripts as a service. At this point the easy stuff is done, last is the sound which is definitely the hardest part of the process.

Setting up Sound

Setting up sound can POSSIBLY be done via the sound script Raphael made but I rarely have luck with it. I still recommend doing it just to see if it works and to do some of the work for you, but its probably going to take doing each step separately. To run the script:

   cd linux-samus/scripts/setup/sound
   ./sound.sh

At this point you can try the speakers by clicking the PulseAudio tray icon and setting up the following: Default Server to (Numbers)unix:/run/user/1000/pulse/native Default Sink to bdw-rt677 Analog Stereo Volume Control/Output Devices/bdw-rt677 Analog Stereo and set to fallback and to the port you want to listen through (Headphones or Speakers). Give this a test, if it works you lucked out! If not, then we need to follow the script steps manually. Most of this is verbatim from Raphael's Readme with a few tweaks in areas I got confused on or fixed something for Gallium Specifically. The first thing to do is to copy over the firmware files from the firmware directory to wherever your distribution installs firmware (/lib/firmware).After that open a add a default.conf file in /etc/modprobe.d containing the following line:

   options snd slots=snd_soc_sst_bdw_rt5677_mach,snd-hda-intel

SHUTDOWN and POWER BACK ON (Reboot doesn't seem to work 100% with Gallium) your computer and after that open a Terminal windows and type:

   aplay -l

Hopefully it should output:

   **** List of PLAYBACK Hardware Devices ****
   card 0: bdwrt5677 [bdw-rt5677], device 0: System Playback (*) []
     Subdevices: 1/1
     Subdevice #0: subdevice #0
   card 1: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
     Subdevices: 1/1
     Subdevice #0: subdevice #0
   card 1: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
     Subdevices: 1/1
     Subdevice #0: subdevice #0
   card 1: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
     Subdevices: 1/1
     Subdevice #0: subdevice #0

If this doesn't show up check for errors through dmesg. At this point change directory to:

   cd linux-samus/scripts/setup/sound

After that type the command:

   ALSA_CONFIG_UCM=ucm/ alsaucm -c bdw-rt5677 set _verb HiFi

At this point we will have the speakers and headphones setup properly but we have a few more steps to get the mic working. Next you will be opening the PulseAudio config (default.pa) as root to load the mic modules located in:

   /etc/pulse/default.pa

You can also edit with commands:

   sudo mousepad /etc/pulse/default.pa

Add the lines above load-module module-udev-detect:

   load-module module-alsa-source device=hw:0,1
   load-module module-alsa-source device=hw:0,2

The guide recommends you just restart PulseAudio but I found it more consistent to just power down and back on. After that open Terminal again and run commands:

   cd linux-samus/scripts/setup/sound
   sudo alsactl restore --file alsa/asound.state

WOO! We did it! At this point you may need to power down and back on one more time to get it to work but for me it worked right after the restore state command. If it still doesn't work check these steps again:

  1. Default Server to (Numbers)unix:/run/user/1000/pulse/native
  2. Default Sink to bdw-rt677 Analog Stereo
  3. Volume Control/Output Devices/bdw-rt677 Analog Stereo and set to fallback and to the port you want to listen through (Headphones or Speakers).

Success

You now have GalliumOS installed. How cool is that?

If you run into problems or have any questions, the awesome people at #GalliumOS are happy to help in any way they can. You can also post on /r/galliumos.

Sources

https://www.reddit.com/r/GalliumOS/comments/47qeh0/pixel_setup_guide_for_gallium_os/

https://galliumos.org/wiki/index.php?title=Installing/Preparing