README.md 2 KB
Newer Older
Robert Foss's avatar
Robert Foss committed
1
## Android
Tomeu Vizoso's avatar
Tomeu Vizoso committed
2

Robert Foss's avatar
Robert Foss committed
3
    mkdir aosp; cd aosp
Robert Foss's avatar
Robert Foss committed
4 5 6

Install repo as per https://source.android.com/setup/build/downloading

Robert Foss's avatar
Robert Foss committed
7
    repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r10
8
    git clone https://gitlab.collabora.com/spurv/android_manifest.git .repo/local_manifests/
9
    repo sync -j15
Robert Foss's avatar
Robert Foss committed
10 11 12
    . build/envsetup.sh
    lunch spurv-eng
    make -j12
Tomeu Vizoso's avatar
Tomeu Vizoso committed
13

Robert Foss's avatar
Robert Foss committed
14
## Kernel
Tomeu Vizoso's avatar
Tomeu Vizoso committed
15

16
    git clone https://gitlab.collabora.com/spurv/linux.git -b android-container
Robert Foss's avatar
Robert Foss committed
17 18 19 20
    cd linux
    sh ../aosp/device/freedesktop/spurv/build-kernel.sh

The kernel image is at arch/arm/boot/zImage and the DT at arch/arm/boot/dts/imx6qp-zii-rdu2.dtb
Tomeu Vizoso's avatar
Tomeu Vizoso committed
21

Robert Foss's avatar
Robert Foss committed
22
## Root filesystem
Tomeu Vizoso's avatar
Tomeu Vizoso committed
23

Robert Foss's avatar
Robert Foss committed
24
    sudo apt install debootstrap qemu-user-static
25
    sudo debootstrap --include=systemd,weston,systemd-container,udev,sudo,openssh-server,iputils-ping,pulseaudio,psmisc,bc --arch armhf --variant minbase testing rootfs http://deb.debian.org/debian/
Robert Foss's avatar
Robert Foss committed
26
    sudo chroot rootfs adduser aosp --ingroup sudo
27
    
Robert Foss's avatar
Robert Foss committed
28 29
#### Prepare sdcard

Robert Foss's avatar
Robert Foss committed
30
    mkfs.ext4 /dev/mmcblk0
31
    sudo mkdir /mnt/sdcard
Robert Foss's avatar
Robert Foss committed
32
    sudo mount /dev/mmcblk0 /mnt/sdcard
33

Robert Foss's avatar
Robert Foss committed
34 35
#### Copy files to sdcard

Robert Foss's avatar
Robert Foss committed
36
    sudo cp linux/arch/arm/boot/zImage linux/arch/arm/boot/dts/imx6qp-zii-rdu2.dtb rootfs/boot/.
Robert Foss's avatar
Robert Foss committed
37
    cp aosp/device/freedesktop/spurv/run.sh rootfs/home/aosp/.
Robert Foss's avatar
Robert Foss committed
38 39 40 41
    cp aosp/out/target/product/spurv/system.img rootfs/home/aosp/aosp.img
    cp aosp/out/target/product/spurv/vendor.img rootfs/home/aosp/.
    cp aosp/out/target/product/spurv/userdata.img rootfs/home/aosp/.
    sudo cp -rfa rootfs/* /mnt/sdcard/.
Robert Foss's avatar
Robert Foss committed
42

Tomeu Vizoso's avatar
Tomeu Vizoso committed
43

Robert Foss's avatar
Robert Foss committed
44 45 46
## Boot SD card

#### In barebox's console
Tomeu Vizoso's avatar
Tomeu Vizoso committed
47

Robert Foss's avatar
Robert Foss committed
48 49 50 51
    # Enable RAVE-SP - which controls things like backligt
    memset -b -d /dev/main-eeprom 0xa2 1 0

    # Set up boot options
Robert Foss's avatar
Robert Foss committed
52 53
    detect mmc1
    global.linux.bootargs.base="console=ttymxc0,115200 console=tty0 enforcing=0 ip=dhcp rw rootwait root=/dev/mmcblk0 log_buf_len=16M cma=512M vmalloc=512M" 
54 55 56 57
    global.bootm.oftree=/mnt/mmc1/boot/imx6qp-zii-rdu2.dtb
    global.bootm.image=/mnt/mmc1/boot/zImage
    global.bootm.initrd=
    bootm
Tomeu Vizoso's avatar
Tomeu Vizoso committed
58

Robert Foss's avatar
Robert Foss committed
59 60 61
#### Run!

Log in as aosp/aosp
Tomeu Vizoso's avatar
Tomeu Vizoso committed
62

Robert Foss's avatar
Robert Foss committed
63
    sudo sh run.sh