Commit ce44a928 authored by Natanael Copa's avatar Natanael Copa

main/lxc: add lxc-bridge subpackage

add a subpackage with a default lxcbr0 bridge interface with dnsmasq

This makes it very convenient to set up a private network for lxc
containers with a config that works out of the box.
parent f05576a3
......@@ -5,7 +5,7 @@
pkgname=lxc
pkgver=2.0.7
_pkgver=${pkgver/_rc/.rc}
pkgrel=2
pkgrel=3
pkgdesc="Userspace interface for the Linux kernel containment features"
url="https://linuxcontainers.org/lxc/"
arch="all"
......@@ -13,11 +13,11 @@ license="GPL"
depends="gzip"
depends_dev="libcap-dev"
makedepends="$depends_dev lvm2 util-linux automake autoconf libtool lua5.2-dev
linux-headers bash tar docbook2x libseccomp-dev python3-dev"
linux-headers bash tar docbook2x libseccomp-dev python3-dev dnsmasq"
options="suid"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lvm::noarch lua5.2-lxc:_lua52
$pkgname-download:_download:noarch $pkgname-templates::noarch $pkgname-libs
py3-$pkgname:_py3"
py3-$pkgname:_py3 $pkgname-bridge"
source="https://github.com/lxc/lxc/archive/lxc-$_pkgver.tar.gz
version.patch
lxc.initd
......@@ -119,6 +119,34 @@ dev() {
mv "$subpkgdir"/usr/bin/lxc-config "$pkgdir"/usr/bin/
}
bridge() {
depends="dnsmasq"
pkgdesc="Bridge interface for LXC with dhcp"
mkdir -p "$subpkgdir"/etc/conf.d \
"$subpkgdir"/etc/init.d \
"$subpkgdir"/etc/lxc
ln -s dnsmasq "$subpkgdir"/etc/init.d/dnsmasq.lxcbr0
cat ->>"$subpkgdir"/etc/conf.d/dnsmasq.lxcbr0 <<EOF
BRIDGE_ADDR="10.0.3.1"
BRIDGE_NETMASK="255.255.255.0"
BRIDGE_NETWORK="10.0.3.0/24"
BRIDGE_DHCP_RANGE="10.0.3.2,10.0.3.254"
BRIDGE_DHCP_MAX="253"
BRIDGE_MAC="00:16:3e:00:00:00"
DNSMASQ_CONFFILE="/etc/lxc/dnsmasq.conf"
EOF
cat ->>"$subpkgdir"/etc/lxc/dnsmasq.conf <<EOF
#dhcp-host=somehost,10.0.3.3
#dhcp-host=otherhost,10.0.3.4
EOF
cat ->>"$subpkgdir"/etc/conf.d/lxc <<EOF
rc_need="lxc-bridge"
EOF
}
sha512sums="eb48dc800ce43d2f4d46e0cecc4d0a714b3e22c6a4975776b54d17d1d20d5a1411e6b605215282f1f77286ddf22b61c80b86b83752191fc18023894ef7a1c44d lxc-2.0.7.tar.gz
e2ffcbf55447291a8434a4f37255c3a6a119bc4116c75d205006aa2b070bf6be28535cf6107bead14bbf64bf9fa415346ab544bd1c15e1add7d1c6380e6b2def version.patch
1037e0b773553aa04b619cec7cfc8fa504af830e58c8211eda367da7e36aeb88f45fca1f955a08fc4fa3f9da660017d5fe7145a326a2064cf15e24d1772d9e27 lxc.initd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment