All Projects → clondroid → Lxc For Android 7.1.2

clondroid / Lxc For Android 7.1.2

The repository contains the lxc and related tools/packages for Android 7.1.2, build scripts are provide for compiling lxc with Android standalone NDK.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Lxc For Android 7.1.2

Lxd
Powerful system container and virtual machine manager
Stars: ✭ 3,115 (+9948.39%)
Mutual labels:  lxc
Lxdui
LXDUI is a web UI for the native Linux container technology LXD/LXC
Stars: ✭ 443 (+1329.03%)
Mutual labels:  lxc
Piston
A high performance general purpose code execution engine.
Stars: ✭ 658 (+2022.58%)
Mutual labels:  lxc
Cntr
A container debugging tool based on FUSE
Stars: ✭ 295 (+851.61%)
Mutual labels:  lxc
Vas Quod
🚡 Minimal linux container runtime.
Stars: ✭ 404 (+1203.23%)
Mutual labels:  lxc
Vulkan
Vulkan API bindings for Go programming language
Stars: ✭ 559 (+1703.23%)
Mutual labels:  android-ndk
BlowTorch
A tool for playing text based adventure games that communicate over Telnet. Features include simple alias replacement, triggers, timers, custom speedwalks, xterm256 color support, lua scripting, plugins and miniwindows.
Stars: ✭ 20 (-35.48%)
Mutual labels:  android-ndk
Ansible Lxc
Ansible Connection Plugin for lxc containers (https://linuxcontainers.org/)
Stars: ✭ 18 (-41.94%)
Mutual labels:  lxc
Hp Socket
High Performance TCP/UDP/HTTP Communication Component
Stars: ✭ 4,420 (+14158.06%)
Mutual labels:  android-ndk
Gainput
Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
Stars: ✭ 636 (+1951.61%)
Mutual labels:  android-ndk
Lxc
LXC - Linux Containers
Stars: ✭ 3,583 (+11458.06%)
Mutual labels:  lxc
Lxdock
Build and orchestrate your development environments with LXD - a.k.a. Vagrant is Too Heavy™
Stars: ✭ 350 (+1029.03%)
Mutual labels:  lxc
Lxcfs
FUSE filesystem for LXC
Stars: ✭ 602 (+1841.94%)
Mutual labels:  lxc
Lxdmosaic
Web interface to manage multiple instance of lxd
Stars: ✭ 270 (+770.97%)
Mutual labels:  lxc
Pjproject
PJSIP project
Stars: ✭ 786 (+2435.48%)
Mutual labels:  android-ndk
cbtool
Cloud Rapid Experimentation and Analysis Toolkit
Stars: ✭ 65 (+109.68%)
Mutual labels:  lxc
Lxc Web Panel
LXC Web Panel repository
Stars: ✭ 555 (+1690.32%)
Mutual labels:  lxc
Lxc Pkg Ubuntu
LXC Ubuntu packaging
Stars: ✭ 11 (-64.52%)
Mutual labels:  lxc
Cv4pve Api Java
Proxmox VE Client API JAVA
Stars: ✭ 17 (-45.16%)
Mutual labels:  lxc
Amicontained
Container introspection tool. Find out what container runtime is being used as well as features available.
Stars: ✭ 638 (+1958.06%)
Mutual labels:  lxc

Prerequisite

lxc requires some SELinux libs/tools and libcap which is not supported in essential Android, for easier maintenance, we collect the following required packages into this repository.

  • lxc android libcap (https://github.com/abstrakraft/lxc-android-libcap)
    • only libcap is required
  • SELinux libs and tools
    • for compatibility reasons, we use the SELinux package in essential Android source code base
    • external/selinux
      • libselinux: external/selinux/libselinux
        • NOT external/libselinux which is a small port of libselinuxfor Android framework
      • libsepol: external/selinux/libsepol
      • setfiles: external/selinux/policycoreutils/setfiles
    • lxc: lxc-2.0.7

Before you can start build these packages, please following the steps below to get prepared for compiling.

  • git clone this repsoitory (lxc-for-Android-7.1.2) source into, say "~/cba/lxc"
    • and "~/cba/lxc" will be $LXC_HOME
  • Create the following 2 directories
    • $LXC_HOME/android-libs
      • temporary directory for install include and libs required for building lxc
      • "$LXC_HOME/android-libs" will be $ANDROID_LIBS
    • /odm
      • This is directory on which lxc tools and libs will be installed
      • You can package this directory on to your Android development device
  • Install the following essential AOSP include and libraries
    • copy from your AOSP source
      • arm_64 platform
        • external/pcre/pcre.h --> ${ANDROID_LIBS}/arm_64/include/pcre.h
        • out/target/product/marlin/system/lib64/libpcre.so, libc++.so  --> ${ANDROID_LIBS}/arm_64/lib/
      • x86_64 platform
        • external/pcre/pcre.h --> ${ANDROID_LIBS}/x86_64/include/pcre.h
        • out/target/product/xxxooo/system/lib64/libpcre.so, libc++.so  --> ${ANDROID_LIBS}/x86_64/lib/
  • Android NDK
    • Android container project uses android-ndk-r15b, other NDK (android-ndk-r15b above) release should also work.
    • Install Android standalone NDK
      • sudo ${NDK}/build/tools/make_standalone_toolchain.py --arch arm64 --api 24 --stl=libc++ --install-dir=/opt/toolchain/android-toolchain-arm_64-4.9-android-24 --force
      • sudo ${NDK}/build/tools/make_standalone_toolchain.py --arch x86_64 --api 24 --stl=libc++ --install-dir=/opt/toolchain/android-toolchain-x86_64-4.9-android-24 --force

Environment setups

you can use the following target platform dependent environment setup script to build these packages.

  • please adjust $ANDROID_LIBS, $ANDROID_SDK_HOME, $ANDROID_NDK_HOME, $ANDROID_STANDALONE_TOOLCHAIN_HOME in the script accordingly

[envsetup_arm_64.sh]

export ANDROID_SDK_HOME=/home/sting/local/android-sdk-linux
export ANDROID_NDK_HOME=/home/sting/local/android-ndk-r15b
export ANDROID_STANDALONE_TOOLCHAIN_HOME=/opt/toolchain/android-toolchain-arm_64-4.9-android-24
export SYSROOT=$ANDROID_STANDALONE_TOOLCHAIN_HOME/sysroot

# User specific environment and startup programs
PATH=${ANDROID_NDK_HOME}
PATH=$PATH:${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/platform-tools
PATH=$PATH:${ANDROID_STANDALONE_TOOLCHAIN_HOME}/bin:/usr/local/sbin:/usr/local/bin
PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
export PATH=$PATH

# Tell configure what tools to use.
export BUILD_TARGET_HOST=aarch64-linux-android
export AR=$BUILD_TARGET_HOST-ar
export AS=$BUILD_TARGET_HOST-clang
export CC=$BUILD_TARGET_HOST-clang
export CXX=$BUILD_TARGET_HOST-clang++
export LD=$BUILD_TARGET_HOST-ld
export STRIP=$BUILD_TARGET_HOST-strip
export RANLIB=$BUILD_TARGET_HOST-ranlib

# Tell configure what flags Android requires.
export CFLAGS="-fPIE -fPIC --sysroot=$SYSROOT"
export LDFLAGS="-pie"

# SELinux specifics
BASEDIR=$(pwd)
export ANDROID_LIBS="$BASEDIR/../android-libs/arm_64"
export CFLAGS="$CFLAGS -I$ANDROID_LIBS/include"
export LDFLAGS="$LDFLAGS -L$ANDROID_LIBS/lib"

export ODMDIR=/odm

[envsetup_x86_64.sh]

export ANDROID_SDK_HOME=/home/sting/local/android-sdk-linux
export ANDROID_NDK_HOME=/home/sting/local/android-ndk-r15b
export ANDROID_STANDALONE_TOOLCHAIN_HOME=/opt/toolchain/android-toolchain-x86_64-4.9-android-24
export SYSROOT=$ANDROID_STANDALONE_TOOLCHAIN_HOME/sysroot

# User specific environment and startup programs
PATH=${ANDROID_NDK_HOME}
PATH=$PATH:${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/platform-tools
PATH=$PATH:${ANDROID_STANDALONE_TOOLCHAIN_HOME}/bin:/usr/local/sbin:/usr/local/bin
PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
export PATH=$PATH

# Tell configure what tools to use.
export BUILD_TARGET_HOST=x86_64-linux-android
export AR=$BUILD_TARGET_HOST-ar
export AS=$BUILD_TARGET_HOST-clang
export CC=$BUILD_TARGET_HOST-clang
export CXX=$BUILD_TARGET_HOST-clang++
export LD=$BUILD_TARGET_HOST-ld
export STRIP=$BUILD_TARGET_HOST-strip
export RANLIB=$BUILD_TARGET_HOST-ranlib

# Tell configure what flags Android requires.
export CFLAGS="-fPIE -fPIC --sysroot=$SYSROOT"
export LDFLAGS="-pie"

# SELinux specifics
BASEDIR=$(pwd)
export ANDROID_LIBS="$BASEDIR/../android-libs/x86_64"
export CFLAGS="$CFLAGS -I$ANDROID_LIBS/include"
export LDFLAGS="$LDFLAGS -L$ANDROID_LIBS/lib"

export ODMDIR=/odm

Building libcap

Following the steps below to build and install libcap

  • libcap include and static library will be install under "$ANDROID_LIBS"
$ cd $LXC_HOME
$ source ./envsetup_x86_64.sh  or  source ./envsetup_arm_64.sh

$ cd $LXC_HOME/lxc-android-libcap/libcap/
$ ./build.sh

Building SElinux

Following the steps below to build and install SELinux

  • SELinux include and static library will be install under "$ANDROID_LIBS"
  • SELinux tools and commands will be install in "$ODM/bin"
$ cd $LXC_HOME
$ source ./envsetup_x86_64.sh  or  source ./envsetup_arm_64.sh

$ cd $LXC_HOME/selinux-pixel_7.1.2_r17)
$ ./build.sh

Build lxc

Following the steps below to build and install lxc package

  • lxc package will be install under "$ODM"
$ cd $LXC_HOME
$ source ./envsetup_x86_64.sh  or  source ./envsetup_arm_64.sh

$ cd $LXC_HOME/lxc)
$ ./build.sh

Packaging lxc tools and packages binaries

After successfully building lxc tools and packages, the executalbe binaries will be install onto "/odm", you can directory copy this directory onto your device if necessary. 

/odm
├── bin
│   ├── avcstat
│   ├── ...
│   ├── getfilecon
│   ├── ...
│   ├── lxc-start
│   ├── lxc-stop
│   ├── ...
│   ├── setfiles
│   └── ...
├── containers
├── etc
│   ├── ...
│   └── lxc
│       └── default.conf
├── include
│   └── ...
├── lib
│   ├── ...
│   ├── liblxc.so
│   ├── lxc
│   │   └── ...
...
├── libexec
│   └── lxc
│       ├── ...
├── sbin
│   ├── ...
├── share
│   └── lxc
...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].