├── .github └── workflows │ ├── build-aarch64.yml │ └── build-dev-6.yml ├── README.md └── ndk.patch /.github/workflows/build-aarch64.yml: -------------------------------------------------------------------------------- 1 | name: Build lxc for Android arm64 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | Build_stable_5: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout code 11 | uses: actions/checkout@v2 12 | 13 | - name: Install dependencies 14 | run: | 15 | sudo apt-get update -qq 16 | sudo apt-get install -qq --yes \ 17 | apparmor bash-completion bridge-utils build-essential \ 18 | busybox-static clang cloud-image-utils curl dbus debhelper debootstrap \ 19 | devscripts dnsmasq-base docbook2x doxygen ed fakeroot file gcc-12 g++-12 cmake graphviz \ 20 | git iptables meson net-tools libapparmor-dev libcap-dev libgnutls28-dev liblua5.2-dev \ 21 | libpam0g-dev libseccomp-dev libselinux1-dev libtool linux-libc-dev libpam-dev \ 22 | llvm lsb-release make openssl pkg-config python3-all-dev liburing-dev libpthread-stubs0-dev \ 23 | python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime systemd \ 24 | wget xz-utils systemd-coredump libdbus-1-dev libsystemd-dev gcc-aarch64-linux-gnu 25 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 26 | sudo apt-get remove --yes lxc-utils liblxc-common liblxc1 liblxc-dev 27 | 28 | - name: Get latest lxc version & Get NDK Toolchains 29 | id: env 30 | run: | 31 | git clone https://github.com/lxc/lxc.git 32 | cd lxc 33 | lxc_source_dir=$(pwd) 34 | latest_version=lxc-5.0.3 35 | echo "Latest lxc version: $latest_version" 36 | echo "::set-output name=latest_version::$latest_version" 37 | echo "::set-output name=lxc_source_dir::$lxc_source_dir" 38 | cd ../ 39 | work_dir=$(pwd) 40 | echo "::set-output name=work_dir::$work_dir" 41 | rm -rf lxc/ 42 | wget https://github.com/lxc/lxc/archive/refs/tags/$latest_version.tar.gz 43 | tar -zxvf $latest_version.tar.gz && mv lxc-$latest_version lxc 44 | wget https://googledownloads.cn/android/repository/android-ndk-r26b-linux.zip 45 | unzip -q android-ndk-r26b-linux.zip 46 | ndk_dir=$(pwd)/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin 47 | echo "::set-output name=ndk_dir::$ndk_dir" 48 | 49 | - name: Patch lxc 50 | run: | 51 | latest_version=${{ steps.env.outputs.latest_version }} 52 | lxc_source_dir=${{ steps.env.outputs.lxc_source_dir }} 53 | if [[ "$latest_version" > "lxc-5.0.0" && "$latest_version" < "lxc-5.9.9" ]]; then 54 | sed -i "s/threads = dependency('threads')/threads = dependency('threads', static : true)/g" $lxc_source_dir/meson.build 55 | sed -i "s/libseccomp = dependency('libseccomp', required: false)/libseccomp = dependency('libseccomp', required: false,static : true)/g" $lxc_source_dir/meson.build 56 | sed -i "s/libselinux = dependency('libselinux', required: false)/libselinux = dependency('libselinux', required: false,static : true)/g" $lxc_source_dir/meson.build 57 | sed -i "s/libapparmor = dependency('libapparmor', required: false)/libapparmor = dependency('libapparmor', required: false,static : true)/g" $lxc_source_dir/meson.build 58 | sed -i "s/libopenssl = dependency('openssl', required: false)/libopenssl = dependency('openssl', required: false,static : true)/g" $lxc_source_dir/meson.build 59 | sed -i "s/libcap = dependency('libcap', required: false)/libcap = dependency('libcap', required: false,static : true)/g" $lxc_source_dir/meson.build 60 | 61 | sed -i "s/liblxc = shared_library(/liblxc = static_library(/g" $lxc_source_dir/meson.build 62 | sed -i '/version: liblxc_version,/d' $lxc_source_dir/meson.build 63 | 64 | sed -i "s/cpuset.cpus/cpus/g" $lxc_source_dir/src/lxc/cgroups/cgfsng.c 65 | 66 | echo "The lxc version $latest_version is patch completed" 67 | else 68 | echo "The lxc version $latest_version is not between 5.0.0 and 5.9.9" 69 | fi 70 | 71 | - name: Configure the cross file 72 | run: | 73 | work_dir=${{ steps.env.outputs.work_dir }} 74 | ndk_dir=${{ steps.env.outputs.ndk_dir }} 75 | wget https://musl.cc/aarch64-linux-musl-cross.tgz 76 | tar -xzf aarch64-linux-musl-cross.tgz 77 | 78 | # aarch64-linux-gnu 79 | cat << EOF >> aarch64-linux-gnu 80 | [binaries] 81 | c = 'aarch64-linux-gnu-gcc' 82 | cpp = 'aarch64-linux-gnu-cpp' 83 | ar = 'aarch64-linux-gnu-ar' 84 | as = 'aarch64-linux-gnu-as' 85 | ld = 'aarch64-linux-gnu-ld' 86 | nm = 'aarch64-linux-gnu-nm' 87 | strip = 'aarch64-linux-gnu-strip' 88 | ranlib = 'aarch64-linux-gnu-ranlib' 89 | objcopy = 'aarch64-linux-gnu-objcopy' 90 | objdump = 'aarch64-linux-gnu-objdump' 91 | pkg-config = '/usr/bin/pkg-config' 92 | cmake = '/usr/bin/cmake' 93 | 94 | [built-in options] 95 | c_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types'] 96 | c_link_args = ['-Wl,-rpath', '-Wl,--as-needed'] 97 | cpp_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types'] 98 | cpp_link_args = ['-Wl,-rpath', '-Wl,--as-needed'] 99 | EOF 100 | 101 | # aarch64-linux-musl 102 | cat << EOF >> aarch64-linux-musl 103 | [binaries] 104 | c = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc' 105 | cpp = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-cpp' 106 | ar = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-ar' 107 | as = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-as' 108 | ld = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-ld' 109 | nm = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-nm' 110 | strip = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip' 111 | ranlib = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-ranlib' 112 | objcopy = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-objcopy' 113 | objdump = '$work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-objdump' 114 | pkg-config = '/usr/bin/pkg-config' 115 | cmake = '/usr/bin/cmake' 116 | 117 | [built-in options] 118 | c_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types'] 119 | c_link_args = ['-Wl,-rpath', '-Wl,--as-needed'] 120 | cpp_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types'] 121 | cpp_link_args = ['-Wl,-rpath', '-Wl,--as-needed'] 122 | EOF 123 | 124 | # NDK 125 | cat << EOF >> aarch64-NDK-API26 126 | [binaries] 127 | c = '$ndk_dir/aarch64-linux-android26-clang' 128 | cpp = '$ndk_dir/aarch64-linux-android26-clang++' 129 | ar = '$ndk_dir/llvm-ar' 130 | as = '$ndk_dir/aarch64-linux-android26-clang' 131 | ld = '$ndk_dir/ld' 132 | strip = '$ndk_dir/llvm-strip' 133 | ranlib = '$ndk_dir/llvm-ranlib' 134 | pkg-config = '/usr/bin/pkg-config' 135 | cmake = '/usr/bin/cmake' 136 | 137 | [built-in options] 138 | c_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types'] 139 | c_link_args = ['-Wl,-rpath', '-Wl,--as-needed'] 140 | cpp_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types'] 141 | cpp_link_args = ['-Wl,-rpath', '-Wl,--as-needed'] 142 | EOF 143 | 144 | - name: Check the compilation configuration 145 | run: | 146 | work_dir=${{ steps.env.outputs.work_dir }} 147 | ndk_dir=${{ steps.env.outputs.ndk_dir }} 148 | echo GNU C Verion: 149 | aarch64-linux-gnu-gcc -v 150 | echo 151 | echo MUSL C Verion: 152 | $work_dir/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc -v 153 | echo 154 | $ndk_dir/aarch64-linux-android26-clang -v 155 | echo 156 | echo PKG-CONFIG INFO: 157 | pkg-config --list-all 158 | pkg-config --variable pc_path pkg-config 159 | 160 | - name: Build lxc with GNU gcc 161 | if: true 162 | run: | 163 | latest_version=${{ steps.env.outputs.latest_version }} 164 | work_dir=${{ steps.env.outputs.work_dir }} 165 | cd lxc 166 | meson setup build -Dprefix=/data/lxc \ 167 | --default-library=static \ 168 | -Dinit-script=sysvinit \ 169 | -Druntime-path=/data/local/tmp \ 170 | -Dstrip=true \ 171 | -Dcapabilities=true \ 172 | -Dseccomp=true \ 173 | -Dselinux=true \ 174 | -Dapparmor=true \ 175 | -Dlog-path=/data/lxc/var/log/lxc \ 176 | -Ddata-path=/data/lxc/lib/lxc \ 177 | --localstatedir=/data/lxc/var \ 178 | -Dc_link_args="-static" \ 179 | --buildtype release \ 180 | --cross-file ../aarch64-linux-gnu 181 | meson compile -C build 182 | sudo ninja -C build install 183 | sudo bash -c "cd /data/lxc && tar -zcvf $work_dir/$latest_version-gnu-release.tar.gz ." 184 | sudo ninja -C build uninstall 185 | 186 | - name: Build lxc with musl gcc 187 | if: true 188 | run: | 189 | cd lxc 190 | latest_version=${{ steps.env.outputs.latest_version }} 191 | work_dir=${{ steps.env.outputs.work_dir }} 192 | meson setup build -Dprefix=/data/lxc \ 193 | --default-library=static \ 194 | -Dinit-script=sysvinit \ 195 | -Druntime-path=/data/local/tmp \ 196 | -Dstrip=true \ 197 | -Dcapabilities=true \ 198 | -Dseccomp=true \ 199 | -Dselinux=true \ 200 | -Dapparmor=true \ 201 | -Dlog-path=/data/lxc/var/log/lxc \ 202 | -Ddata-path=/data/lxc/lib/lxc \ 203 | --localstatedir=/data/lxc/var \ 204 | -Dc_link_args="-static" \ 205 | --buildtype release \ 206 | --cross-file ../aarch64-linux-musl \ 207 | --wipe 208 | meson compile -C build 209 | sudo ninja -C build install 210 | sudo bash -c "cd /data/lxc && tar -zcvf $work_dir/$latest_version-musl-release.tar.gz ." 211 | sudo ninja -C build uninstall 212 | 213 | - name: Build lxc with NDK r26b Android API 26 214 | run: | 215 | rm -rf lxc/ 216 | latest_version=${{ steps.env.outputs.latest_version }} 217 | tar -zxvf $latest_version.tar.gz && mv lxc-$latest_version lxc 218 | rm $latest_version.tar.gz 219 | work_dir=${{ steps.env.outputs.work_dir }} 220 | mv ndk.patch lxc/ 221 | sudo apt remove -y -qq meson 222 | sudo apt install -y -qq pipx 223 | pipx install meson 224 | PATH=$work_dir/.local/bin:$PATH 225 | cd lxc 226 | patch -p0 -R < ndk.patch 227 | sed -i "s/cpuset.cpus/cpus/g" ./src/lxc/cgroups/cgfsng.c 228 | meson setup build -Dprefix=/data/lxc \ 229 | -Dinit-script=sysvinit \ 230 | -Druntime-path=/data/local/tmp \ 231 | -Dstrip=true \ 232 | -Dd_lto=true \ 233 | -Dcapabilities=false \ 234 | -Dseccomp=false \ 235 | -Dselinux=false \ 236 | -Dapparmor=false \ 237 | -Dopenssl=false \ 238 | -Dlog-path=/data/lxc/var/log/lxc \ 239 | -Ddata-path=/data/lxc/lib/lxc \ 240 | --localstatedir=/data/lxc/var \ 241 | --buildtype release \ 242 | --cross-file ../aarch64-NDK-API26 \ 243 | --wipe 244 | meson compile -C build 245 | sudo ninja -C build install 246 | sudo bash -c "cd /data/lxc && tar -zcvf $work_dir/$latest_version-ndk-api26-release.tar.gz ." 247 | 248 | - name: Upload GNU release file 249 | uses: actions/upload-artifact@v3 250 | with: 251 | name: ${{ steps.env.outputs.latest_version }}-gnu-release-static 252 | path: ${{ steps.env.outputs.latest_version }}-gnu-release.tar.gz 253 | 254 | - name: Upload musl release file 255 | uses: actions/upload-artifact@v3 256 | with: 257 | name: ${{ steps.env.outputs.latest_version }}-musl-release-static 258 | path: ${{ steps.env.outputs.latest_version }}-musl-release.tar.gz 259 | 260 | - name: Upload NDK release file 261 | uses: actions/upload-artifact@v3 262 | with: 263 | name: ${{ steps.env.outputs.latest_version }}-ndk-api26-release-shared 264 | path: ${{ steps.env.outputs.latest_version }}-ndk-api26-release.tar.gz 265 | 266 | - name: Create Release and Upload Release Asset 267 | uses: softprops/action-gh-release@v1 268 | with: 269 | tag_name: ${{ steps.env.outputs.latest_version }} 270 | name: Release ${{ steps.env.outputs.latest_version }} 271 | body: TODO New Release. 272 | draft: false 273 | prerelease: false 274 | files: | 275 | ${{ steps.env.outputs.latest_version }}-gnu-release.tar.gz 276 | ${{ steps.env.outputs.latest_version }}-musl-release.tar.gz 277 | ${{ steps.env.outputs.latest_version }}-ndk-api26-release.tar.gz 278 | -------------------------------------------------------------------------------- /.github/workflows/build-dev-6.yml: -------------------------------------------------------------------------------- 1 | name: Build lxc dev master 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | lxc_version: 7 | description: 'LXC version' 8 | required: true 9 | default: '6.0.0' 10 | build_utils: 11 | description: 'openssl,dbus,libselinux,libcap,libseccomp,libapparmor' 12 | required: false 13 | default: 'true,true,true,true,true,true' 14 | 15 | jobs: 16 | Build-dev-6: 17 | runs-on: ubuntu-22.04-arm 18 | steps: 19 | - name: Checkout code 20 | uses: actions/checkout@v4 21 | 22 | - name: Install dependencies 23 | run: | 24 | sudo apt-get update -qq 25 | sudo apt-get install -qq --yes \ 26 | apparmor bash-completion bridge-utils build-essential \ 27 | busybox-static clang cloud-image-utils curl dbus debhelper debootstrap \ 28 | devscripts dnsmasq-base docbook2x doxygen ed fakeroot file gcc-12 g++-12 cmake graphviz \ 29 | git iptables net-tools libapparmor-dev libcap-dev libgnutls28-dev liblua5.2-dev \ 30 | libpam0g-dev libseccomp-dev libselinux1-dev libtool linux-libc-dev libpam-dev libssl-dev \ 31 | llvm lsb-release make openssl pkg-config python3-all-dev liburing-dev libpthread-stubs0-dev \ 32 | python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime systemd ninja-build libdbus-1-3 \ 33 | wget xz-utils systemd-coredump libdbus-1-dev libsystemd-dev gcc-aarch64-linux-gnu meson 34 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 35 | sudo apt-get remove --yes lxc-utils liblxc-common liblxc1 liblxc-dev 36 | #sudo apt install -y -qq pipx 37 | #pipx install meson 38 | 39 | - name: Set build parameters 40 | id: vars 41 | run: | 42 | echo "lxc_version=${{ github.event.inputs.lxc_version || '6.0.0' }}" >> $GITHUB_OUTPUT 43 | echo "build_utils=${{ github.event.inputs.build_utils || 'true,true,true,true,true,true' }}" >> $GITHUB_OUTPUT 44 | 45 | - name: Get target lxc version 46 | id: env 47 | run: | 48 | export VERSION=${{ steps.vars.outputs.lxc_version }} 49 | 50 | wget https://github.com/lxc/lxc/releases/download/v$VERSION/lxc-$VERSION.tar.gz 51 | tar -zxf lxc-$VERSION.tar.gz && mv lxc-$VERSION lxc 52 | cd lxc 53 | lxc_source_dir=$(pwd) 54 | echo "lxc_source_dir=$lxc_source_dir" >> $GITHUB_OUTPUT 55 | cd ../ 56 | work_dir=$(pwd) 57 | echo "work_dir=$work_dir" >> $GITHUB_OUTPUT 58 | 59 | - name: Patch lxc 60 | run: | 61 | sed -i "s/threads = dependency('threads')/threads = dependency('threads', static : true)/g" $lxc_source_dir/meson.build 62 | sed -i "s/libseccomp = dependency('libseccomp', required: false)/libseccomp = dependency('libseccomp', required: false,static : true)/g" $lxc_source_dir/meson.build 63 | sed -i "s/libselinux = dependency('libselinux', required: false)/libselinux = dependency('libselinux', required: false,static : true)/g" $lxc_source_dir/meson.build 64 | sed -i "s/libapparmor = dependency('libapparmor', required: false)/libapparmor = dependency('libapparmor', required: false,static : true)/g" $lxc_source_dir/meson.build 65 | sed -i "s/libopenssl = dependency('openssl', required: false)/libopenssl = dependency('openssl', required: false,static : true)/g" $lxc_source_dir/meson.build 66 | sed -i "s/libcap = dependency('libcap', required: false)/libcap = dependency('libcap', required: false,static : true)/g" $lxc_source_dir/meson.build 67 | 68 | sed -i "s/liblxc = shared_library(/liblxc = static_library(/g" $lxc_source_dir/meson.build 69 | sed -i '/version: liblxc_version,/d' $lxc_source_dir/meson.build 70 | 71 | sed -i "s/cpuset.cpus/cpus/g" $lxc_source_dir/src/lxc/cgroups/cgfsng.c 72 | sed -i "s/cpuset.mems/mems/g" $lxc_source_dir/src/lxc/cgroups/cgfsng.c 73 | 74 | echo "The lxc version $latest_version is patch completed" 75 | 76 | - name: Build lxc with NDK r26b Android API 26 77 | run: | 78 | lxc_source_dir=${{ steps.env.outputs.lxc_source_dir }} 79 | work_dir=${{ steps.env.outputs.work_dir }} 80 | mv ndk.patch lxc/ 81 | cd lxc 82 | PATH=$work_dir/.local/bin:$PATH 83 | patch -p0 -R < ndk.patch 84 | meson setup build -Dprefix=/data/lxc \ 85 | -Dinit-script=sysvinit \ 86 | -Druntime-path=/data/local/tmp \ 87 | -Dstrip=true \ 88 | -Dd_lto=true \ 89 | -Dcapabilities=true \ 90 | -Dseccomp=true \ 91 | -Dselinux=true \ 92 | -Dapparmor=true \ 93 | -Dopenssl=true \ 94 | -Ddbus=true \ 95 | -Dlog-path=/data/lxc/var/log/lxc \ 96 | -Ddata-path=/data/lxc/lib/lxc \ 97 | --localstatedir=/data/lxc/var \ 98 | --buildtype release 99 | meson compile -C build 100 | sudo ninja -C build install 101 | sudo bash -c "cd /data/lxc && tar -zcvf $work_dir/$latest_version-ndk-api26-release.tar.gz ." 102 | 103 | - name: Upload NDK release file 104 | uses: actions/upload-artifact@v3 105 | with: 106 | name: ${{ steps.env.outputs.latest_version }}-ndk-api26-release-shared 107 | path: ${{ steps.env.outputs.latest_version }}-ndk-api26-release.tar.gz 108 | 109 | - name: Create Release and Upload Release Asset 110 | uses: softprops/action-gh-release@v1 111 | with: 112 | tag_name: ${{ steps.env.outputs.latest_version }} 113 | name: Release ${{ steps.env.outputs.latest_version }} 114 | body: TODO New Release for dev 6.0.0 and later. 115 | draft: false 116 | prerelease: true 117 | files: | 118 | ${{ steps.env.outputs.latest_version }}-ndk-api26-release.tar.gz 119 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LXC-on-Android 2 | > 推荐将 Release 下载解压到`/data/lxc`目录下,配置基本环境和安装工具如`busybox,getopt,xz`等等,这些并不包含在 LXC 项目中。 3 | > 4 | > It is recommended to unzip the Release download to the `/data/lxc`, configure the basic environment and install tools such as `busybox,getopt,xz` and so on are not included in the LXC project. 5 | > 6 | > 对于GKI内核,请谨慎编译docker/lxc,他可能会导致你的设备无法启动。 7 | > 8 | > For the GKI kernel, please compile Docker/lxc with caution as it may cause your device to fail to start. 9 | > 10 | 11 | > [!WARNING] 12 | > 13 | > THIS PROJECT IS NOT MAINTAINED ANYMORE. 14 | > 15 | > PLEASE GO TO [Container-On-Android/lxc](https://github.com/Container-On-Android/lxc). 16 | 17 | # LXC-6.0.0-Dev 18 | | | NDK | GNU | MUSL | 19 | |------------------|-------|-------|--------| 20 | | start | [1] | | | 21 | | stop | √ | | | 22 | | apparmor-load | ? | | | 23 | | containers | ? | | | 24 | | ls | √ | | | 25 | | top | √ | | | 26 | | attach | [2] | | | 27 | | copy | ? | | | 28 | | monitor | × | | | 29 | | freeze/unfreeze | √ | | | 30 | | autostart | [3] | | | 31 | | create | [4] | | | 32 | | monitord | × | | | 33 | | unshare | ? | | | 34 | | cgroup | ? | | | 35 | | destroy | √ | | | 36 | | net | √ | | | 37 | | update-config | √ | | | 38 | | checkconfig | √ | | | 39 | | device | ? | | | 40 | | user-nic | ? | | | 41 | | checkpoint | √ | | | 42 | | execute | ? | | | 43 | | snapshot | [5] | | | 44 | | usernsexec | ? | | | 45 | | config | √ | | | 46 | | wait | ? | | | 47 | | console | √ | | | 48 | | info | √ | | | 49 | 50 | - [1] 需要在 share/lxc/config/common.conf 中注释/删除有关 tty,capabiities,seccomp 的配置,即第 10,13,82 行。 51 | - [2] 需要在终端变量 LD_LIBRARY_PATH 中插入 lib 。 52 | - [3] 需要在 lib/lxc/{container_name}/config 中添加 lxc.start.auto = 1 配置来开启容器自启。同时确保 lxc-autostart 拥有开机自启项。 53 | - [4] 需要来自 GNU 的标准的 curl/wget/tar/xz 二进制,来自 busybox/toybox 等可能无法解析某些命令行操作。 54 | - [5] 快照依赖于 copy 和其他组件,你需要确保其他组件能够正常工作。 55 | 56 | # LXC-5.0.0-Stable 57 | | | NDK | GNU | MUSL | 58 | |------------------|-------|-------|--------| 59 | | start | | | | 60 | | stop | | | | 61 | | apparmor-load | | | | 62 | | containers | | | | 63 | | ls | | | | 64 | | top | | | | 65 | | attach | | | | 66 | | copy | | | | 67 | | monitor | | | | 68 | | freeze/unfreeze | | | | 69 | | autostart | | | | 70 | | create | | | | 71 | | monitord | | | | 72 | | unshare | | | | 73 | | cgroup | | | | 74 | | destroy | | | | 75 | | net | | | | 76 | | update-config | | | | 77 | | checkconfig | | | | 78 | | device | | | | 79 | | user-nic | | | | 80 | | checkpoint | | | | 81 | | execute | | | | 82 | | snapshot | | | | 83 | | usernsexec | | | | 84 | | config | | | | 85 | | wait | | | | 86 | | console | | | | 87 | | info | | | | 88 | -------------------------------------------------------------------------------- /ndk.patch: -------------------------------------------------------------------------------- 1 | diff -uprN ../lxc-source/src/lxc/open_utils.h src/lxc/open_utils.h 2 | --- ../lxc-source/src/lxc/open_utils.h 2024-02-11 04:24:36.445225356 +0000 3 | +++ src/lxc/open_utils.h 2024-02-11 05:55:14.778199982 +0000 4 | @@ -19,13 +19,13 @@ 5 | * @mode: O_CREAT/O_TMPFILE file mode. 6 | * @resolve: RESOLVE_* flags. 7 | */ 8 | -/*#if !HAVE_STRUCT_OPEN_HOW 9 | +#if !HAVE_STRUCT_OPEN_HOW 10 | struct open_how { 11 | __u64 flags; 12 | __u64 mode; 13 | __u64 resolve; 14 | }; 15 | -#endif*/ 16 | +#endif 17 | 18 | /* how->resolve flags for openat2(2). */ 19 | #ifndef RESOLVE_NO_XDEV 20 | diff -uprN ../lxc-source/src/lxc/process_utils.h src/lxc/process_utils.h 21 | --- ../lxc-source/src/lxc/process_utils.h 2024-02-11 04:23:45.963837826 +0000 22 | +++ src/lxc/process_utils.h 2024-02-11 05:55:14.778199982 +0000 23 | @@ -164,7 +164,7 @@ 24 | #define u64_to_ptr(x) ((void *)(uintptr_t)x) 25 | #endif 26 | 27 | -/*#if !HAVE_STRUCT_CLONE_ARGS 28 | +#if !HAVE_STRUCT_CLONE_ARGS 29 | struct clone_args { 30 | __aligned_u64 flags; 31 | __aligned_u64 pidfd; 32 | @@ -178,7 +178,7 @@ struct clone_args { 33 | __aligned_u64 set_tid_size; 34 | __aligned_u64 cgroup; 35 | }; 36 | -#endif*/ 37 | +#endif 38 | 39 | __returns_twice static inline pid_t lxc_clone3(struct clone_args *args, size_t size) 40 | { 41 | diff -uprN ../lxc-source/src/lxc/rexec.c src/lxc/rexec.c 42 | --- ../lxc-source/src/lxc/rexec.c 2024-02-11 04:26:10.315805482 +0000 43 | +++ src/lxc/rexec.c 2024-02-11 05:55:14.778199982 +0000 44 | @@ -16,10 +16,9 @@ 45 | #include "string_utils.h" 46 | #include "syscall_wrappers.h" 47 | 48 | +#if IS_BIONIC && !HAVE_FEXECVE 49 | #include "fexecve.h" 50 | -/*#if IS_BIONIC && !HAVE_FEXECVE 51 | -#include "fexecve.h" 52 | -#endif*/ 53 | +#endif 54 | 55 | #define LXC_MEMFD_REXEC_SEALS \ 56 | (F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE) 57 | --------------------------------------------------------------------------------