Install Arch Linux on Samsung Chromebook
I decided to try out Arch Linux on the Samsung Chromebook. Before I was running Ubuntu, to check out the install process for Chrubuntu check out my previous posts:
The Ubuntu install was working out well but I just kept hearing good things about Arch Linux, so I decided to give it a try.
Installing Arch Linux
The install process is described here. I already had developer mode and usb boot enabled, so I went to the next steps. Once in ChromeOS open up the crosh shell:
- Press Ctrl + Alt + T keys. This will open up the crosh shell
- Type shell to get into a bash shell.
- Type sudo su to become root.
Now let’s proceed with the install:
Since ChromeOS will automatically mount any partitions it finds, unmount everything now:
Create a new disk label for GPT. Type y when prompted after running:
Partition the USB drive or SD card:
To create the rootfs partition, we first need to calculate how big to make the partition using information from cgpt show. Look for the number under the start column for Sec GPT table which is 15633375 in this example:
Replace the xxxxx string in the following command with that number to create the root partition:
Tell the system to refresh what it knows about the disk partitions:
Format the partitions:
Download and extract rootfs tarball:
Copy the kernel to the kernel partition:
Copy the U-Boot script to the script partition:
Unmount the root partition:
Reboot the computer.
At the splash screen, instead of pressing Ctrl-D to go to CromeOS, press Ctrl-U to boot to the external drive.
You will see U-Boot start after a moment and start counting down from 3. Press any key at this time to interrupt the boot process and get a prompt that looks like:
At this prompt type this to reset the environment and save it to flash:
Type reset and press enter (it’ll reboot), pressing Ctrl-U at the splash screen again, and let U-Boot count down and load Arch Linux ARM.
Upgrade Arch Linux
After you boot into Arch Linux you can login with username root, and a blank password. To get on the wireless network launch:
That will give you an ncurses Terminal UI, at which point you can select your desired access point and enter the password if applicable. Before we upgrade the system we need to make sure the boot partition is mounted. This is accomplished by editing the /etc/fstab file and un-commenting this line:
Then mount /boot by running:
To upgrade the system run the following:
After the update is done, reboot your system. Prior to the reboot, you can add your own user if you want and give him sudo privileges:
Install Window Manager and Display Manager
I use icewm and lighdm for my display environment. Let’s install the necessary packages.
Install Xorg
First let’s install Xorg and the necessary video/synaptics drivers.
Now let’s apply the appropriate video driver and trackpad settings for the chromebook:
Install Window Manager
At this point we can manually start X, but we don’t have a window manager yet. So let’s install that:
If you are really eager, you can add the following into your
Install Display Manager
I wanted to use lightdm as my display manager, so let’s go ahead and install that:
Now let’s enable the service on startup:
If you reboot you will notice that all the icons are missing for lightdm. To install the icons run the following:
At this point, I was able to start an icewm session from lightdm with out issues. I also removed my
/.xinitrc file so it wouldn’t launch icewm a second time after lightdm did.
SSH-Agent with IceWM
I noticed that ssh-agent was not starting on login. From this Arch Linux wiki page, it’s recommended to start that from your bashrc file, but that would launch multiple ssh-agents. So I decided to launch that when X starts. I complished that by creating /etc/X11/xinit/xinitrc.d/40-ssh-agent and adding the following contents to it:
I was then able to run ssh-add without any issues.
Desktop Notifications
By default no notification mechanism is enabled, so you might miss out on some OS notification when using IceWM. There are a couple of options available described here. I usually use xfce4-notifyd, but I decided to try out something else: notification-daemon. First let’s install the package:
The package doesn’t actually create the appropriate dbus configuration files, this is done by creating the /usr/share/dbus-1/services/org.gnome.Notifications.service file with the following contents:
Now any time there is a notification that comes through dbus, you will see it. As a quick test run the following to make sure you see the OSD:
Brightness
Systemd comes with tmpfiles.d which can set permissions and contents of any file on the system on boot. With that functionality, let’s set a custom brightness level on boot. This is acomplished by creating the /etc/tmpfiles.d/brightness.conf file with the following contents:
Now upon boot that file will have the permission of 666 (rw for all users) and contain the value of 800 (possible values are ** — **2800).
Keyboard Shortcuts for Brightness keys
I did a similar setup on Ubuntu. Since I am using icewm I added the following into my .icewm/keys file:
and the content of my /usr/local/bin/chbr is the following:
Sound Configurations
First let’s install alsa and make sure we can hear sound from the speakers:
Then start alsamixer and un-mute the following mixers:
‘Left Speaker Mixer Left DAC1 Switch’ ‘Left Speaker Mixer Right DAC1 Switch’ ‘Right Speaker Mixer Left DAC1 Switch’ ‘Right Speaker Mixer Right DAC1 Switch’ ‘Right Headphone Mixer Left DAC1 Switch’ ‘Right Headphone Mixer Right DAC1 Switch’ ‘Left Headphone Mixer Left DAC1 Switch’ ‘Left Headphone Mixer Right DAC1 Switch’
To un-mute the mixer just type m when you are on the mixer. As a quick test run the following and make sure you hear sound:
Install PulseAudio
I remember I had some trouble in Ubuntu with this, so I wanted to give it another try. First install the necessary packages:
Now let’s ensure the appropriate alsa sink is loaded. This is done by editing the /etc/pulse/default.pa file and un-commenting/modify the following line:
Now we can restart X or start pulseaudio manually
Your sound should still works as expected.
Configure Libao to Use PulseAudio
I tried running pianobar, but it would fail. The issue is described here. It’s fixed by changing the /etc/libao.conf file to look like this:
Keyboard Modifications
I ended up emulating the configuration from the Ubuntu install.
Change the Search Key to be Caps-Lock
This is done by creating/modifying the
/.Xmodmap file with the following contents:
Change Fn Keys for Volume
Similar to the way I handled the brightness, I did the same thing for sound. Here is what I added into my
Enable End and Home Keys with Key Combinations
I ended up using xbindkeys with xvkbd again:
First find out what they keys are called:
Those are our keys. Now capture the key combination, this is done by running the following:
and then clicking “Alt + down” and it will show you what those keys correspond to. After we have all the combinations, we can create the xbindkeys configuration. First create the initial configuration:
Then edit the file and add the following to it (add the combination that you captured above):
Now add /usr/bin/xbindkeys to the
/.icewm/startup file and the shortcuts should be done.
Power Button
For some reason when I pushed the power button nothing happened. Running xev and watching the output, showed me that I was pressing the right key, but nothing would happen. To fix my power button, I installed acpid:
And then added an extra command to the /etc/acpi/handler.sh script:
After that, pushing the power button would shut down the laptop.
Configure the Rest of the System
Now for the finishing touches
Enable rsyslog
Rsyslog was not enabled by default. Here is what I ran to install and enable that:
Configure Networking
After you run the wifi-menu script a profile is generated automatically. You can check the profiles by running the following:
To enable that profile on boot, just run the following:
By default it uses dhcp to grab the IP. To set a static IP, edit the /etc/netctl/mlan0-wifi file and add/modify the following:
You will also notice that the password will be clear text in that profile file. We can use wpa_passphrase to hide the password. First generate the WPA password:
Not grab the string after psk= and add it to the /etc/netctl/mlan0-wifi file:
Now if you restart the machine, it should automatically connect to the wireless network and grab a static IP as well.