mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 00:07:16 +00:00
Merge pull request #647 from pmores/fix-unbootable-dracut-initramfs
rootfs-builder: fix unbootable dracut-based initramfs on Fedora
This commit is contained in:
commit
1ab1d0e728
@ -186,14 +186,20 @@ check_rootfs() {
|
||||
OK "init is installed"
|
||||
|
||||
|
||||
systemd_path="/lib/systemd/systemd"
|
||||
systemd="${rootfs}${systemd_path}"
|
||||
candidate_systemd_paths="/usr/lib/systemd/systemd /lib/systemd/systemd"
|
||||
|
||||
# check agent or systemd
|
||||
case "${AGENT_INIT}" in
|
||||
"no")
|
||||
if [ ! -x "${systemd}" ] && [ ! -L "${systemd}" ]; then
|
||||
error "${systemd_path} is not installed in ${rootfs}"
|
||||
for systemd_path in $candidate_systemd_paths; do
|
||||
systemd="${rootfs}${systemd_path}"
|
||||
if [ -x "${systemd}" ] || [ -L "${systemd}" ]; then
|
||||
found="yes"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ! $found ]; then
|
||||
error "None of ${candidate_systemd_paths} is installed in ${rootfs}"
|
||||
return 1
|
||||
fi
|
||||
OK "init is systemd"
|
||||
@ -207,10 +213,13 @@ check_rootfs() {
|
||||
return 1
|
||||
fi
|
||||
# checksum must be different to system
|
||||
if [ -f "${systemd}" ] && cmp -s "${systemd}" "${agent}"; then
|
||||
error "The agent is not the init process. ${agent_path} is systemd"
|
||||
return 1
|
||||
fi
|
||||
for systemd_path in $candidate_systemd_paths; do
|
||||
systemd="${rootfs}${systemd_path}"
|
||||
if [ -f "${systemd}" ] && cmp -s "${systemd}" "${agent}"; then
|
||||
error "The agent is not the init process. ${agent_path} is systemd"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
OK "Agent installed"
|
||||
;;
|
||||
|
@ -441,8 +441,7 @@ prepare_overlay()
|
||||
# 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
|
||||
ln -sf /init ./sbin/init
|
||||
fi
|
||||
|
||||
# Kata systemd unit file
|
||||
|
Loading…
Reference in New Issue
Block a user