Skip to content

Commit c295ac7

Browse files
committed
Create an empty /etc/os-release file for systemd
1 parent b9902ab commit c295ac7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build-vm

+8
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,9 @@ vm_detect_2nd_stage() {
657657
mount -orw -n -t securityfs securityfs /sys/kernel/security 2>/dev/null || :
658658
fi
659659

660+
# delete dummy /etc/os-release file
661+
test -e /etc/os-release -a ! -s /etc/os-release && rm -f /etc/os-release
662+
660663
# qemu inside of xen does not work, check again with kvm later before enabling this
661664
# if test -e /dev/kqemu ; then
662665
# # allow abuild user to run qemu
@@ -1073,6 +1076,11 @@ vm_first_stage() {
10731076
fi
10741077

10751078
if test -n "$VM_ROOT" ; then
1079+
# create an empty os-release file unless it already exists. newer systemd version insist
1080+
# will not switch to the root unless it exists
1081+
if test ! -L "$BUILD_ROOT/etc/os-release" -a ! -e "$BUILD_ROOT/etc/os-release" ; then
1082+
touch "$BUILD_ROOT/etc/os-release"
1083+
fi
10761084
# copy out kernel & initrd (if they exist) during unmounting VM image
10771085
KERNEL_TEMP_DIR=
10781086
local vm_type="$VM_TYPE"

0 commit comments

Comments
 (0)