mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-03 18:04:16 +00:00
Merge pull request #420 from crobinso/init-no-overwrite
rootfs: Don't overwrite /sbin/init if it already exists
This commit is contained in:
@@ -455,10 +455,18 @@ prepare_overlay()
|
|||||||
{
|
{
|
||||||
pushd "${ROOTFS_DIR}" > /dev/null
|
pushd "${ROOTFS_DIR}" > /dev/null
|
||||||
mkdir -p ./etc ./lib/systemd ./sbin ./var
|
mkdir -p ./etc ./lib/systemd ./sbin ./var
|
||||||
ln -sf ./usr/lib/systemd/systemd ./init
|
|
||||||
ln -sf ../../init ./lib/systemd/systemd
|
# This symlink hacking is mostly to make later rootfs
|
||||||
ln -sf ../init ./sbin/init
|
# validation work correctly for the dracut case.
|
||||||
# Kata sytemd unit file
|
# We skip this if /sbin/init exists in the rootfs, meaning
|
||||||
|
# we were passed a pre-populated rootfs directory
|
||||||
|
if [ ! -e ./sbin/init ]; then
|
||||||
|
ln -sf ./usr/lib/systemd/systemd ./init
|
||||||
|
ln -sf ../../init ./lib/systemd/systemd
|
||||||
|
ln -sf ../init ./sbin/init
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kata systemd unit file
|
||||||
mkdir -p ./etc/systemd/system/basic.target.wants/
|
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
|
ln -sf /usr/lib/systemd/system/kata-containers.target ./etc/systemd/system/basic.target.wants/kata-containers.target
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
Reference in New Issue
Block a user