Archlinux on C.H.I.P


#1

EDIT: if you want to install archlinux on your C.H.I.P., please follow steps found in http://www.chip-community.org/index.php/Archlinuxarm_on_chip, I will leave rest of my first post here, but it may contain out-of-date information.


I received my chip two weeks ago, and I was really disappointed that my favorite distribution does not support it, so I spent a lot of time and learned a lot of things and the result arrived: working arch linux running on chip :slight_smile:

What works:
well, I got basic system, usb, uart1 console and wifi working, maybe few other things work too, but if you need anything specific, you need to try and find out.

Installation prerequisites:
you need “sunxi-fel” and “fastboot” binaries on your system, fastboot can be installed in package “android-tools” and sunxi-fel in package “sunxi-tools” on arch linux, other distributions may have different packages for these.

How to install:
Clone my repository:
git clone https://github.com/mydzor/chip-arch.git
make sure you are in the directory of cloned repository
cd chip-arch
download rootfs image (make sure you download this to the directory of the repository)

(old link removed - find current version at http://www.chip-community.org/index.php/Archlinuxarm_on_chip)

run flashing script (it willl ask for root privileges to flash your device)
./flash_arch.sh
now you should be set, arch linux should be installed on your device, if there is a problem, let me know.

After install:
you need USB<>UART converter to connect to chip, you should see login prompt (there may also be a lot of debug information, just ignore it, it will not affect your interaction with terminal) - enter “alarm” as user name and “alarm” as password, then you can run “wifi-menu wlan0” as root (root’s password is “root”)and connect to your network. Afterwards, you can connect to you chip via ssh and do whatever you want.

DISCLAIMER: this is the first time I tried to create installation image for arm device, I am pretty sure that there are a lot of “good practice” conventions that I missed and I probably also made a few errors that may result in strange behavior of the system, if you think that you found one of those, let me know.

What I plan to do next:
I hope that I will find out how to do that “console on power usb” thing that normal chip does, so that you will not need usb<>uart converter, I will also try to create PKGBUILD for kernel and RTL8723BS, that will make this look a bit more like real distribution with kernel as a package,. After that, I will check what does not work (probably most of the things on SOC) and try to fix that.

Update: I fixed the scripts so they should actually work now without any adjustments, included newer u-boot and I also created new system image with 4.4.11 kernel, it seems to run smoother now.


Flash chip using Archlinux
PocketC.H.I.P. and txt mode
What OSes are Available for the C.H.I.P.?
MicroSD SD Interface (SDIO) vs SPI Interface & Arch Linux
#2

Thanks a ton!
Will give it a try ASAP.

/Marc


#3

I have it up and running! Thank you very much!

Additionally, it looks like the AV video cable and my USB keyboard were working pretty well out of the box, but there is a lot of debug messages to the screen, which makes it hard to use. If that’s easier to remove than adding the console on power usb, it would work nearly as well.


#4

New image is ready, changelist:

  • working tty on g_serial (that “console on power usb” thing I mentioned earlier :slight_smile: )
  • significantly reduced debug info produced by RTL871X
  • configured journald to use volatile storage
  • added “links” text web browser, this will allow using wifi networks that reqire accepting their terms (by clicking a button on web page) before allowing you to connect to internet

I also tested gpio and it seems to be working fine.

TLDR: you dont need usb<>uart converter anymore!

Download:
https://drive.google.com/file/d/0B_MnKtiYl5uvMXFvVHh3eWQ1RjA


#5

Thanks a lot!

One typo found

echo “Falshing done, hopefully now the device will boot correctly to Arch”… S/b Flashing…


#6

@Myd this is great! Thanks so much for working on this!! =-)

Is there an official download page or repository for this project yet?


#7

@chrisvollo I still don`t have the build properly automated, but I will try to do that soon and then create the repository


#8

@Myd, thank you. ArchLinux would be my first choice of OS for this device, since it is what we currently use. I have no experience with building the OS for a device from scratch, but if you would like any help, I would be happy to try to help you. =-)

We had experimented with the CHIP before and the out of the box OS gave us difficulties with getting IP redirection working.


#9

I created wiki page for archlinux on chip here:
http://www.chip-community.org/index.php/Archlinuxarm_on_chip

The download link there will always contain latest version of rootfs image.

I also created repository for my build scripts, this is still early version and I hope to polish it, add cross-compiling support and a few other things during the weekend.

The most usefull help right now would be if everyone interested it this tried to install and use it and reported anything that does not work here:


#10

Thank you! I have successfully flashed my CHIP with arch


#11

Thanks for porting it! It does not really work for me yet - when I am firing up pacman to install some packages CHIP just shuts down after a while (I would guess a thermal cut-off).


#12

Are you compiling your own Kernel or using the CHIP kernel? I’m looking for something that can run Docker.


#13

@NeoTheFox did you try the latest rootfs from http://www.chip-community.org/index.php/Archlinuxarm_on_chip? I had exactly same problems with first builds, but after changing to newer kernel in later builds they disappeared. Just to make this less confusing, I removed the link to old rootfs from original post and replaced it with link to the wiki page.


#14

I am compiling kernel from https://github.com/NextThingCo/CHIP-linux/tree/4.4.11-ntc-9, with custom config. When I have some time, I will check what is needed for docker and include it.


#15

I finally got Docker working on the 4.3 branch with a Kernel that was posted here. There’s info in that thread on what’s needed for Docker in general. I think I might spend some time learning enough about it all to automate the build and submit a PR to NTC to include those modules in the official releases. Seems silly for the kernel to be so restrictive.


#16

I’ve got my copy of rootfs from the wiki, but I’ll give it another go today to see if the problem is gone.

UPD: Yup, this problem is gone now! Thanks for help!


#17

@smiller171 I have updated kernel to “/nextthing/4.4/chip” branch and created new config which enables everything I found usefull at least as a module. Docker should now run fine:
http://pastebin.com/AJKkxdbD

This also fixes the microphone complains in dmesg and “SECCOMP” issue I had lately. New version is on wiki page, I decided to start versioning the rootfs releases from now, this version is “0.4”.


#18

I’ve been trying to get PocketCHIP to work, but it looks like it needs custom kernel - moving configs around really does not help. I’ll be looking into this.


#19

@NeoTheFox I also have PocketCHIP, so when I have some time (definitely not in next few weeks) I will also try to get it working with arch. If you make some progress, let me know.


#20

So, the framebuffer works, so does the voltage control, etc.
There are no files in /sys/class/backlight, so I am guessing the display brightness controller is not being detected at all. There is an i2c GPIO expander, so I would try reading the schematics to find out what pin it is…