mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 08:12:20 +00:00
busybox: simplify
Start relying on autodev for busybox template and wipe all the device creation. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
8829829deb
commit
b081cb55e4
@ -86,23 +86,6 @@ ${rootfs}/usr/lib64"
|
|||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
chmod 755 ${fstree} || return 1
|
chmod 755 ${fstree} || return 1
|
||||||
|
|
||||||
# minimal devices needed for busybox
|
|
||||||
if [ "${USERNS}" = "yes" ]; then
|
|
||||||
for dev in tty console tty0 tty1 ram0 null urandom; do
|
|
||||||
echo "lxc.mount.entry = /dev/${dev} dev/${dev} none bind,optional,create=file 0 0" >> "${path}/config"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
mknod -m 666 "${rootfs}/dev/tty" c 5 0 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/console" c 5 1 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/tty0" c 4 0 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/tty1" c 4 0 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/tty5" c 4 0 || res=1
|
|
||||||
mknod -m 600 "${rootfs}/dev/ram0" b 1 0 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/null" c 1 3 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/zero" c 1 5 || res=1
|
|
||||||
mknod -m 666 "${rootfs}/dev/urandom" c 1 9 || res=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make /tmp accessible to any user (with sticky bit)
|
# make /tmp accessible to any user (with sticky bit)
|
||||||
chmod 1777 "${rootfs}/tmp" || return 1
|
chmod 1777 "${rootfs}/tmp" || return 1
|
||||||
|
|
||||||
@ -227,7 +210,8 @@ cat <<EOF >> "${path}/config"
|
|||||||
lxc.signal.halt = SIGUSR1
|
lxc.signal.halt = SIGUSR1
|
||||||
lxc.signal.reboot = SIGTERM
|
lxc.signal.reboot = SIGTERM
|
||||||
lxc.uts.name = "${name}"
|
lxc.uts.name = "${name}"
|
||||||
lxc.tty.max = 1
|
lxc.autodev = 1
|
||||||
|
lxc.tty.max = 5
|
||||||
lxc.pty.max = 1
|
lxc.pty.max = 1
|
||||||
lxc.cap.drop = sys_module mac_admin mac_override sys_time
|
lxc.cap.drop = sys_module mac_admin mac_override sys_time
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user