mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 11:13:50 +00:00
lxc lxc-sshd using new lxc.mount.entry keyword
Signed-off-by: Michel Normand <michel_mno@laposte.net> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
70dd139727
commit
0079c6c0da
@ -348,7 +348,6 @@ untar_tarball() {
|
|||||||
|
|
||||||
NAME="sshd"
|
NAME="sshd"
|
||||||
CONFFILE="lxc.conf"
|
CONFFILE="lxc.conf"
|
||||||
MNTFILE="mount.conf"
|
|
||||||
UTSNAME=
|
UTSNAME=
|
||||||
IPV4="172.20.0.20/24"
|
IPV4="172.20.0.20/24"
|
||||||
|
|
||||||
@ -390,26 +389,21 @@ lxc.network.flags = up
|
|||||||
lxc.network.link = br0
|
lxc.network.link = br0
|
||||||
lxc.network.ipv4 = $IPV4
|
lxc.network.ipv4 = $IPV4
|
||||||
lxc.network.name = eth0
|
lxc.network.name = eth0
|
||||||
lxc.mount = $MNTFILE
|
|
||||||
lxc.rootfs = $ROOTFS
|
lxc.rootfs = $ROOTFS
|
||||||
EOF
|
lxc.mount.entry=/lib $(pwd)/$ROOTFS/lib none ro,bind 0 0
|
||||||
|
lxc.mount.entry=/bin $(pwd)/$ROOTFS/bin none ro,bind 0 0
|
||||||
cat <<EOF > $MNTFILE
|
lxc.mount.entry=/usr $(pwd)/$ROOTFS/usr none ro,bind 0 0
|
||||||
/lib $(pwd)/$ROOTFS/lib none ro,bind 0 0
|
lxc.mount.entry=/sbin $(pwd)/$ROOTFS/sbin none ro,bind 0 0
|
||||||
/bin $(pwd)/$ROOTFS/bin none ro,bind 0 0
|
|
||||||
/usr $(pwd)/$ROOTFS/usr none ro,bind 0 0
|
|
||||||
/sbin $(pwd)/$ROOTFS/sbin none ro,bind 0 0
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "$(uname -m)" = "x86_64" ]; then
|
if [ "$(uname -m)" = "x86_64" ]; then
|
||||||
cat <<EOF >> $MNTFILE
|
cat <<EOF >> $CONFFILE
|
||||||
/lib64 $(pwd)/$ROOTFS/lib64 none ro,bind 0 0
|
lxc.mount.entry=/lib64 $(pwd)/$ROOTFS/lib64 none ro,bind 0 0
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@BINDIR@/lxc-create -n $NAME -f $CONFFILE
|
@BINDIR@/lxc-create -n $NAME -f $CONFFILE
|
||||||
|
|
||||||
rm -f $MNTFILE
|
|
||||||
rm -f $CONFFILE
|
rm -f $CONFFILE
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
Loading…
Reference in New Issue
Block a user