Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 13349|Reply: 5

Setting up arch + mainline kernel on Orange Pi

[Copy link]

3

Threads

12

Posts

63

Credits

Registered member

Rank: 2

Credits
63
Post time 2015-12-16 05:50:56 | Show all posts |Read mode
Edited by jeancf at 2015-12-16 17:05

Hi,

I want to report that I managed to get arch installed and running on the Orange Pi using the latest mainline u-boot and mainline linux kernel from arch (4.3.2).

You will find below the description of the process (.md file in attachment also). Once it is done, you can keep the installation updated using pacman, except for the u-boot as the package does not exist yet. I am going to check what it takes to officialize the support in arch. Probably contribute the u-boot package which I am happy to do.

Compile u-boot

### Download and configure toolchain ###

Go to http://www.linaro.org/downloads/, scroll down to *Linaro Toolchain* and download the file linked next to *linaro-toolchain-binaries (little-endian)*. The file should be named something like `gcc-linaro-<version>-<date>-x86_64-arm-linux-gnueabihf.tar.xz`

Extract the content of the archive to a folder and make sure that the `bin` folder of the package is in your `PATH`. It can be added for the current session only by using:
  1. export PATH="$PATH":/home/user/folder/gcc-linaro-<VERSION>-<DATE>-x86_64_arm-linux-gnueabihf/bin/
Copy the Code
Specify that cross compilation to ARM should be used:
  1. export CROSS_COMPILE=arm-linux-gnueabihf-
Copy the Code

### Download and compile u-boot ###

Get latest stable u-boot from `ftp://ftp.denx.de/pub/u-boot/` and unpack.
In the main u-boot folder, execute `make Orangepi_defconfig` to configure u-boot.
Execute `make all` to build all the u-boot images for OrangePi.

Install archlinux on SD card

1. Clean up the beginning of the SD Card:
    Identify the name of your SD card by using `lsblk`.
  1. dd if=/dev/zero of=/dev/sdX bs=1M count=8
Copy the Code
   where `/dev/sdX` is the name of the SD Card.
2. Partition the SD Card.
    Start by deleting all partitions that may already exist on the card.
    Create a primary partition starting and 2048 and extending to the end of the card
    Write the partition and exit
3. Create and mount the ext4 filesystem:
  1.     mkfs.ext4 /dev/sdX1
  2.     mkdir mnt
  3.     mount /dev/sdX1 mnt
Copy the Code
   where `/dev/sdX1' is the name of the partition on the SD Card
4. Download and extract the root filesystem:
  1.     wget [url]http://archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz[/url]
  2.     bsdtar -xpf ArchLinuxARM-armv7-latest.tar.gz -C mnt
  3.     sync
Copy the Code

Copy u-boot on SD card
1. Install the U-Boot bootloader:
    In the main u-boot folder where you compiled u-boot you will find the bootloader file called `u-boot-sunxi-with-spl.bin`
  1. dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
Copy the Code
2. Create a file called `boot.txt` with the following content
  1.     part uuid ${devtype} ${devnum}:${bootpart} uuid
  2.     setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait

  3.     if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
  4.       if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
  5.         if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
  6.           bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
  7.         else
  8.           bootz ${kernel_addr_r} - ${fdt_addr_r};
  9.         fi;
  10.       fi;
  11.     fi

  12.     if load ${devtype} ${devnum}:${bootpart} 0x48000000 /boot/uImage; then
  13.       if load ${devtype} ${devnum}:${bootpart} 0x43000000 /boot/script.bin; then
  14.         setenv bootm_boot_mode sec;
  15.         bootm 0x48000000;
  16.       fi;
  17.     fi
Copy the Code
3. Convert it to binary format:
    Install uboot-tools with `pacman -S uboot-tools`
  1.     mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr
  2.     cp boot.scr mnt/boot
  3.     sync
  4.     unmount /dev/sdX
Copy the Code
4. Insert the micro SD card into the pcDuino3, connect the USB or SATA drive, connect ethernet, and apply 5V power.
    Use the serial console or SSH to the IP address given to the board by your router.
    Login as the default user `alarm` with the password `alarm`.
    The default root password is `root`.


This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

0

Threads

1

Posts

8

Credits

Novice

Rank: 1

Credits
8
Post time 2016-1-14 15:26:25 | Show all posts
What about `script.bin` and `uImage` files? Aren't they needed?

1

Threads

4

Posts

29

Credits

Novice

Rank: 1

Credits
29
Post time 2016-2-28 19:34:30 | Show all posts
@Jeancf thank you for your post, same question, no need of 'script.bin' ?
Ethernet is working?

4

Threads

1128

Posts

7680

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
7680
Post time 2016-2-28 19:47:15 | Show all posts
Mainline kernel doesn't use script.bin. It uses device tree instead for configuration. There is currently no ethernet driver in mainline, but first draft exist on linux-sunxi mail list.

2

Threads

4

Posts

34

Credits

Novice

Rank: 1

Credits
34
Post time 2016-5-28 19:50:56 | Show all posts
I tried to build archlinux for my Orange Pi PC, i used the lgcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf as toolchain and exactly followed the tutorial. But if i try to boot it doesnt work. I cant identify my problem. Could you help me?

1

Threads

4

Posts

21

Credits

Novice

Rank: 1

Credits
21
Post time 2016-11-8 15:01:07 | Show all posts
Any idea of I can use Archlinux + mainline uBoot + mainline kernel on Orange PI One? I don't care much about the ethernet, but HDMI would be nice to have. Or instead of the mainline uBoot should I try this tree?
https://github.com/jelly/u-boot/tree/h3_video_hdmi

regards.
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2020-7-13 03:50 GMT+8 , Processed in 0.031122 second(s), 23 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list