summaryrefslogtreecommitdiff
path: root/README.md
blob: 6b8f0f7445a8a6e78273a7ec256fa7df832b3520 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Arch Linux ARM for Odroid C4

This repository contains instructions and scripts for building a full Arch Linux ARM image for the Odroid C4 single board computer.

## Prerequisites

On your Arch Linux host system, install the required QEMU packages:

```bash
sudo pacman -S qemu-base qemu-user-static qemu-user-static-binfmt
```

## Building the Kernel

1. Clone the Armbian build repository:
```bash
git clone https://github.com/armbian/build
cd build
```

2. Run the kernel build:
```bash
./compile.sh \
  BOARD=odroidc4 \
  BRANCH=current \
  KERNEL_ONLY=yes \
  KERNEL_CONFIGURE=no \
  RELEASE=jammy  # Doesn't matter for kernel-only
```

## Extracting Kernel from Built Image

After the build completes, extract the kernel and related files:

```bash
# Your built image
IMAGE="output/images/Armbian_*.img"

# Mount the image locally using loop device
sudo losetup -P /dev/loop0 $IMAGE
sudo mkdir -p /mnt/armbian
sudo mount /dev/loop0p1 /mnt/armbian

# Backup kernel and boot files to current directory
sudo tar czf armbian-kernel.tar.gz -C /mnt/armbian \
  boot/ \
  lib/modules/ \
  lib/firmware/

# Unmount
sudo umount /mnt/armbian
sudo losetup -d /dev/loop0
```

## Notes

- The kernel build uses Armbian's build system to generate a compatible kernel for the Odroid C4
- The RELEASE parameter doesn't affect kernel-only builds
- QEMU user-static emulation is required for cross-compilation on x86_64 hosts