mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-09 20:07:49 +00:00
osbuilder: Fix D-Bus enabling in the dracut case
- D-Bus enabling now occurs only in setup_rootfs (instead of
prepare_overlay and setup_rootfs)
- Adjust permissions of / so dbus-broker will be able to traverse FS
These changes enables kata-agent to successfully communicate with D-Bus.
Fixes #6677
Signed-off-by: Vladimir <amigo.elite@gmail.com>
(cherry picked from commit 3e7b902265
)
Signed-off-by: Vladimir <amigo.elite@gmail.com>
This commit is contained in:
parent
5e360d4f58
commit
8db3dfb305
@ -472,11 +472,6 @@ prepare_overlay()
|
||||
ln -sf /init ./sbin/init
|
||||
fi
|
||||
|
||||
# Kata systemd unit file
|
||||
mkdir -p ./etc/systemd/system/basic.target.wants/
|
||||
ln -sf /usr/lib/systemd/system/kata-containers.target ./etc/systemd/system/basic.target.wants/kata-containers.target
|
||||
mkdir -p ./etc/systemd/system/kata-containers.target.wants/
|
||||
ln -sf /usr/lib/systemd/system/dbus.socket ./etc/systemd/system/kata-containers.target.wants/dbus.socket
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
@ -625,9 +620,12 @@ EOF
|
||||
if [ "${AGENT_INIT}" == "yes" ]; then
|
||||
setup_agent_init "${AGENT_DEST}" "${init}"
|
||||
else
|
||||
# Setup systemd service for kata-agent
|
||||
# Setup systemd-based environment for kata-agent
|
||||
mkdir -p "${ROOTFS_DIR}/etc/systemd/system/basic.target.wants"
|
||||
ln -sf "/usr/lib/systemd/system/kata-containers.target" "${ROOTFS_DIR}/etc/systemd/system/basic.target.wants/kata-containers.target"
|
||||
mkdir -p "${ROOTFS_DIR}/etc/systemd/system/kata-containers.target.wants"
|
||||
ln -sf "/usr/lib/systemd/system/dbus.socket" "${ROOTFS_DIR}/etc/systemd/system/kata-containers.target.wants/dbus.socket"
|
||||
chmod g+rx,o+x "${ROOTFS_DIR}"
|
||||
fi
|
||||
|
||||
info "Check init is installed"
|
||||
|
Loading…
Reference in New Issue
Block a user