commit 883b1f94df28962a807f1c3712c5cf59f1d0e49a Author: Kevin Mihelich Date: Thu Nov 26 11:24:57 2015 -0700 initial commit diff --git a/Asus_Chromebook_Flip_C100P.md b/Asus_Chromebook_Flip_C100P.md new file mode 100644 index 0000000..edd4129 --- /dev/null +++ b/Asus_Chromebook_Flip_C100P.md @@ -0,0 +1,4 @@ +## Additional Packages + +* X.org video driver package: xf86-video-armsoc-rockchip +* Mali EGL and GLES drivers: veyron-libgl \ No newline at end of file diff --git a/Contributing.md b/Contributing.md new file mode 100644 index 0000000..612fd88 --- /dev/null +++ b/Contributing.md @@ -0,0 +1,25 @@ +This wiki is designed as a simple collection of markdown-formatted articles, providing information strictly related to Arch Linux ARM and its supported platforms. + +All of the guidelines discussed here must be adhered to in all contributions. Failure to comply will result in a rejected submission. + +## Git +This wiki is available [on GitHub](https://github.com/archlinuxarm/wiki). To contribute: clone the repository, make your modifications, and submit a pull request. See these pages for help: + +* [Creating a pull request](https://help.github.com/articles/creating-a-pull-request/) +* [Working with forks](https://help.github.com/articles/working-with-forks/) + +Rules for pull requests: + +1. **One pull request per topic.** If you want to address multiple topics on this wiki, create separate pull requests for each. +2. **Squash commits.** Your commits should be meaningful. If you make incremental changes or fixes, they must [be squashed](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Squashing-Commits) before the pull request will be merged. +3. **Annotate changes.** The pull request description as well as the commits must clearly summarize the changes being made. +4. **Supported platforms only.** Information on unsupported platforms may be discussed on the forum. +5. **Accurate information.** Inaccuracies, guesses, opinions, or any other non-factual or dangerous information is not permitted. + +## Style Requirements + +* Page file names must be named for the title of the page using only the permitted ASCII characters, with the file extension .mdx, and using proper capitalization. + * Permitted characters: A-Z, a-z, 0-9, underscore, hyphen +* Spaces must be comverted to underscores in the filename. +* Page names, including the top header, are derived from the filename, and are rendered using the <h1> tag. Therefore, headers within the file must be second level (##) or lower. +* Links to other wiki pages can be made by enclosing the page name (with proper capitalization) in double brackets, such as [[Contributing]]. \ No newline at end of file diff --git a/Developers.md b/Developers.md new file mode 100644 index 0000000..b6181b8 --- /dev/null +++ b/Developers.md @@ -0,0 +1,5 @@ +These guides will help you with package and software development in Arch Linux ARM: + +* [[Distcc Cross-Compiling]] +* [[Distributed Compiling]] +* [Building in a Clean Chroot](https://wiki.archlinux.org/index.php/DeveloperWiki:Building_in_a_Clean_Chroot) \ No newline at end of file diff --git a/Distcc_Cross-Compiling.md b/Distcc_Cross-Compiling.md new file mode 100644 index 0000000..27dd5e7 --- /dev/null +++ b/Distcc_Cross-Compiling.md @@ -0,0 +1,94 @@ +## Introduction +*Disclaimer: This guide will appear vague and incomplete if you aren't sure what you're doing. This is intentional. This is specifically not designed for users new to software compilation and toolchain components.* + +This is the official cross-compiling method used at Arch Linux ARM. If you plan on building a lot of packages and want to speed up the process, the following guide will turn an x86 Linux computer into an ARM cross-compiler. It's also much easier than most cross-compile setups. + +This guide makes use of distcc in order to not have to build a full ARM development environment on x86. As the distcc project website states, "distcc does not require all machines to share a filesystem, have synchronized clocks, or to have the same libraries or header files installed." This is particularly advantageous to us since all that is needed is a working cross-compiler for ARM on a faster machine, while controlling the build from an ARM computer that has all of the current libraries and headers. + +## Distcc +Before beginning, a distcc environment needs to be set up. Follow the [[Distributed Compiling]] guide to establish a master device. The x86 machines will be known as the clients. + +## Pre-built crosstool-ng toolchains +In lieu of building the toolchain as detailed below, if you are running a 64-bit Linux installation you can use these packaged toolchains that are employed in the official build system. + +It is *highly recommended* to use these tarballs as they have been thoroughly tested, and are maintained to be version- and source-matched to the current toolchain components for our ARM architectures. If you build the toolchain yourself, you must assemble patched source tarballs to build versions that match what is in use here. + +* [ARMv5te soft](/builder/xtools/x-tools.tar.xz) (df3fe198c989fe36e6209e65e4d6ae57) +* [ARMv6l hard](/builder/xtools/x-tools6h.tar.xz) (89905d219fb8dbdce02ed57694e9419c) +* [ARMv7l hard](/builder/xtools/x-tools7h.tar.xz) (577b4ce8f5dbd2c0b3b760701aaa05cd) +* [ARMv8](/builder/xtools/x-tools8.tar.xz) (bcd483b67915b22397dd77f926e948d3) + +If you want to save yourself time and configuration, see [WarheadsSE's distccd-alarm](https://github.com/WarheadsSE/PKGs/tree/master/distccd-alarm) package. This will generate 3 packages (one for each architecture), and contains configuration and systemd service units for each. It is for x86_64 only, like these toolchain tarballs. + +## Install crosstool-ng +This process is very automated, courtesy of [crosstool-ng](http://crosstool-ng.org). As a normal user (not root!), clone revision b634280 of the git repository into a directory called "cross" in your home directory. Enter the source directory and configure with a prefix for the "cross" directory, make, and make install. If you are missing any pre-requisites, the configure script will let you know what they are. + +``` +mkdir -p cross/src +cd cross +git clone https://github.com/crosstool-ng/crosstool-ng.git +cd crosstool-ng +git checkout b634280 +./bootstrap +./configure --prefix=/home/your_user/cross +make +make install +``` + +At this point crosstool-ng is ready to be configured. The program "ct-ng" in the "bin" directory is where the magic happens. It also has a menu configuration like the Linux kernel. + +## Downloading a CrossTool Configuration +Download the default .config file to place in "~/cross/bin" as shown below. Once you do this, do not run "menuconfig" or values will be overwritten. Choose either v5, v6, or v7 depending on the target platform. + +``` +cd /home/your_user/cross/bin +wget http://archlinuxarm.org/builder/xtools/xtools-dotconfig-[v5|v6|v7] -O .config +``` + +## Build the cross-toolchain + +``` +cd /home/your_user/cross/bin +./ct-ng build +``` + +## Make nice with distcc +The toolchain will install under "~/x-tools" for armv5, "~/x-tools6h" for armv6 hard-float, "~/x-tools7h" for armv7 hard-float, and "~/x-tools8" for AArch64. You can move this somewhere else if you like, or leave it where it is. Before we can use the compiler binaries that were created, links need to be created to make their names more appropriate. When compile jobs are sent to distcc, the program specified in the CC environment variable on the build master is what gets executed on the build clients. All the binaries that have been produced by crosstool-ng are in the correct format specifying the target platform as a prefix, though not with the correct platform and lacking tuple-less variants. This script will fix our problem. Make "~/x-tools[6h|7h|8]/arm-unknown-linux-gnueabi[hf]/bin/" writable and in there create a file called "link" and paste the following into it. Uncomment for your target architecture and run it. + +```bash +#!/bin/bash +for file in `ls`; do + if [[ "$file" == "link" ]]; then + continue + fi + # uncomment for v5 + # ln -s $file ${file#arm-unknown-linux-gnueabi-} + # ln -s $file armv5tel-unknown-linux-gnueabi-${file#arm-unknown-linux-gnueabi-} + # uncomment for v6 + # ln -s $file ${file#arm-unknown-linux-gnueabihf-} + # ln -s $file armv6l-unknown-linux-gnueabihf-${file#arm-unknown-linux-gnueabihf-} + # uncomment for v7 + # ln -s $file ${file#arm-unknown-linux-gnueabihf-} + # ln -s $file armv7l-unknown-linux-gnueabihf-${file#arm-unknown-linux-gnueabihf-} + # uncomment for v8 + # ln -s $file ${file#aarch64-unknown-linux-gnueabi-} + # ln -s $file aarch64-unknown-linux-gnu-${file#aarch64-unknown-linux-gnueabi-} +done +``` + +Now the "bin" directory contains links with names that distcc will play nice with. To get distcc to use these binaries instead of the default system ones, we need to place this directory into the path for the distcc daemon: + +* Debian/Ubuntu: Edit "/etc/init.d/distcc" +* Arch Linux: Edit "/etc/conf.d/distccd" + +After the initial header block, add this line or modify PATH if it already exists in the file. Note that we are placing our binary directory at the very front. After making the change, restart the distccd daemon. + +``` +PATH=/home/your_user/x-tools[6h|7h|8]/arm-unknown-linux-gnueabi[hf]/bin:$PATH +``` + +## Compile! +Back on ARM "master" device, make sure that distcc has been enabled in makepkg.conf per the [[Distributed Compiling]] guide, and specify the cross-compiler computer's IP address in the DISTCC_HOSTS variable. Now all builds using makepkg will make use of the distcc and cross compiler setup. + +## Crap, it's not working +If you've followed this guide to the letter and you know you've done everything right, the likely problem is that the user distccd is running as does not have permission to access the location of the crosstool-ng binaries. Either change distccd's user or relocate the x-tools directory to somewhere it can read it, then be sure the PATH set above reflects the new location. \ No newline at end of file diff --git a/Distributed_Compiling.md b/Distributed_Compiling.md new file mode 100644 index 0000000..4727b63 --- /dev/null +++ b/Distributed_Compiling.md @@ -0,0 +1,55 @@ +If you have multiple devices, using distcc is a very simple way to get all of them in on compiling packages. makepkg is already set up for using distcc, all that's needed is to enable the functionality. + +Before you begin, you will need to make sure you have base-devel installed. Each device will need to have the same packages installed that are required for compiling the package you're about to build using this method. See the [Arch Wiki](https://wiki.archlinux.org) for makepkg, pacman, etc. + +Install distcc on all devices to be used: + +``` +pacman -S distcc +``` + +## Configuration: Introduction +For the purposes of this example, all of the hosts are in the local network of 10.3.0.0/24, and access is allowed from that entire subnet. If you want to restrict access further, you will have to specify individual IPs. Be sure to change the address from the examples to fit your local network configuration. + +Additionally, this example assumes that you are starting compiles from one specific device (master), which is sending out to the other device(s) (client). If you want to compile from any device, simply apply the client configuration to the master device, and the master device configuration to the client device(s). + +If you want to use the master device to compile as well, apply the client configuration to it. + +## Configuration: Master Device +This is what you run on the ARM device you'll be running "makepkg" from and using to coordinate builds. + +In /etc/makepkg.conf, change BUILDENV to un-negate the distcc option: + +``` +BUILDENV=(distcc color !ccache check !sign) +``` + +Change DISTCC_HOSTS to a space-delimited list of the distcc clients on your network. If you want to use the master plug, be sure to put it's IP address in there too. The hosts listed will be prioritized in the order listed. To keep configurations simple, use the LAN IP address for the local plug, not "localhost" or "127.0.0.1". + +``` +DISTCC_HOSTS="10.3.0.6 10.3.0.2" +``` + +Change MAKEFLAGS -j flag to reflect the total number of processors available +1. For example, with 2 plugs (1 master and 1 client): + +``` +MAKEFLAGS="-j3" +``` + +## Configuration: Client Device(s) +This is what you'd run on a second ARM device or a cross-compiling computer. + +In /etc/conf.d/distccd, change DISTCC_ARGS to reflect the hosts or network you're allowing to connect: + +``` +DISTCC_ARGS="--user nobody --allow 10.3.0.0/24" +``` + +Enable and start the distcc daemon: + +``` +systemctl enable distccd +systemctl start distccd +``` + +You can now run *makepkg* as you normally would and the hosts specified will start receiving work. If the hosts are unavailable, the package will simply compile locally. \ No newline at end of file diff --git a/Hisense_Chromebook_C11.md b/Hisense_Chromebook_C11.md new file mode 100644 index 0000000..edd4129 --- /dev/null +++ b/Hisense_Chromebook_C11.md @@ -0,0 +1,4 @@ +## Additional Packages + +* X.org video driver package: xf86-video-armsoc-rockchip +* Mali EGL and GLES drivers: veyron-libgl \ No newline at end of file diff --git a/ODROID-C1.md b/ODROID-C1.md new file mode 100644 index 0000000..107f4fd --- /dev/null +++ b/ODROID-C1.md @@ -0,0 +1,35 @@ +## Additional Packages + +* X.org video driver package: xf86-video-odroid-c1 + Note: Add your user to the "video" group to be able to access /dev/mali and /dev/ump. +* Mali EGL and GLES drivers (installed with xf86-video-odroid-c1): odroid-c1-libgl +* wiringPi modified for the ODROID-C1: wiringc1 +* Kodi: kodi-c1 + +## IR + +To make use of the IR receiver, load module meson-ir + +## PWM + +For one PWM (pin 33) and one SPI: + +``` +sudo modprobe pwm-peson npwm=1 +sudo modprobe pwm-ctrl +``` + +For two PWM (pins 33 and 19) and no SPI + +``` +sudo modprobe pwm-peson npwm=2 +sudo modprobe pwm-ctrl +``` + +You can control the PWM via simple sysfs entries. In /sys/devices/platform/pwm-ctrl you'll find the following files: + +* duty0: Duty cycle in percent: `echo 50 > duty0 # 50% duty cycle` +* enable0: Enable/Disable this PWM: `echo 1 > enable0 # enable PWM0` +* freq0: PWM Frequency in Hertz: `echo 100000 > freq0 # set frequency to 100kHz` + * On PWM0 you can test higher frequencies; however, 1Mhz is the maximum supported frequency. +* Note: If you are using the two PWM setup, you will have: enable0, freq0, duty0 AND enable1, freq1, duty1. \ No newline at end of file diff --git a/ODROID-U2.md b/ODROID-U2.md new file mode 100644 index 0000000..42712c7 --- /dev/null +++ b/ODROID-U2.md @@ -0,0 +1,14 @@ +## HDMI audio + +To enable audio over HDMI, add the following to your asound.conf: + +``` +pcm.!default { + type hw + card 0 +} +ctl.!default { + type hw + card 0 +} +``` \ No newline at end of file diff --git a/Platforms.md b/Platforms.md new file mode 100644 index 0000000..7222252 --- /dev/null +++ b/Platforms.md @@ -0,0 +1,10 @@ +These are pages containing additional information for running Arch Linux ARM on the supported devices. Pages listed here are also available under the Wiki tab on the respective platform page. + +* ARMv7 + * Rockchip + * [[Hisense Chromebook C11]] + * [[Asus Chromebook Flip C100P]] + * Samsung + * [[ODROID-C1]] + * [[ODROID-U2]] + * [[Samsung Chromebook]] \ No newline at end of file diff --git a/Samsung_Chromebook.md b/Samsung_Chromebook.md new file mode 100644 index 0000000..0b16afb --- /dev/null +++ b/Samsung_Chromebook.md @@ -0,0 +1,54 @@ +## Better touchpad responsiveness + +Create the file /etc/X11/xorg.conf.d/50-touchpad.conf and add the following to it: + +``` +Section "InputClass" + Identifier "touchpad" + MatchIsTouchpad "on" + Option "FingerHigh" "5" + Option "FingerLow" "5" +EndSection +``` + +## Enable audio + +1. Install alsa-utils: `pacman -S alsa-utils` +2. Run alsamixer as root. +3. Arrow right until you see four items starting with Left Speaker Mixer, and press M on all four channels to un-mute them. +4. Arrow right some more until you find four more starting with Right Speaker Mixer and un-mute them as well. +5. Arrow all the way back left to the Speaker channel and raise the volume a little. Keep it low (< 50ish), since alsa will let you get dangerously high for these speakers. + +## Suspend when closing the lid + +Install acpid and pm-utils: `pacman -S acpid pm-utils` + +Edit /etc/acpi/handler.sh and near the bottom you'll see the button/lid section. Add pm-suspend to the close section to look like: + +``` +button/lid) + case "$3" in + close) + logger 'LID closed' + pm-suspend + ;; +``` + +Enable and start acpid: + +``` +systemctl enable acpid +systemctl start acpid +``` + +Closing the lid will now trigger a suspend, and opening it will wake the system. + +## User permissions for backlight control + +To allow all users to modify the backlight control at */sys/class/backlight/pwm-backlight.0/brightness*, create and edit the file */etc/tmpfiles.d/brightness.conf* with these contents: + +``` +f /sys/class/backlight/pwm-backlight.0/brightness 0666 - - - 800 +``` + +On boot, systemd will now set the permissions of that control file to be world writable. Acceptable values are 0-2800. \ No newline at end of file diff --git a/Wiki.md b/Wiki.md new file mode 100644 index 0000000..dcc308d --- /dev/null +++ b/Wiki.md @@ -0,0 +1,8 @@ +This is a collection of knowledge for Arch Linux ARM. For general Arch Linux related topics, please see the excellent [Arch Wiki](https://wiki.archlinux.org). + +Categories: + +* [[Developers]] - Resources for building packages on Arch Linux ARM. +* [[Platforms]] - Additional information on supported platforms + +To contibute to this wiki, see the [[Contributing]] page.