mirror of
https://git.proxmox.com/git/dab
synced 2025-10-04 08:05:07 +00:00
bootstrap: die if init binary could not get diverted
This is a safe guard check, as otherwise DAB might end up putting the
wrong 'init' executable in the final image, like it happened for
Ubuntu 24.04 before the fixing commit d2e70cf
("explicitly add
systemd-syv to required packages for systemd based releases").
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d2e70cf306
commit
267c2ecc9e
@ -1430,7 +1430,8 @@ sub bootstrap {
|
|||||||
write_file ("LANG=\"C\"\n", "$rootdir/etc/default/locale", 0644);
|
write_file ("LANG=\"C\"\n", "$rootdir/etc/default/locale", 0644);
|
||||||
|
|
||||||
# fake init
|
# fake init
|
||||||
rename ("$rootdir/sbin/init", "$rootdir/sbin/init.org");
|
rename ("$rootdir/sbin/init", "$rootdir/sbin/init.org")
|
||||||
|
or die "failed to backup distro 'init' for manual diversion - $!";
|
||||||
$self->run_command ("cp '$fake_init' '$rootdir/sbin/init'");
|
$self->run_command ("cp '$fake_init' '$rootdir/sbin/init'");
|
||||||
|
|
||||||
$self->run_command ("cp '$default_env' '$rootdir/sbin/defenv'");
|
$self->run_command ("cp '$default_env' '$rootdir/sbin/defenv'");
|
||||||
@ -1464,7 +1465,8 @@ sub bootstrap {
|
|||||||
$self->ve_dpkg ('unpack', $p);
|
$self->ve_dpkg ('unpack', $p);
|
||||||
}
|
}
|
||||||
|
|
||||||
rename ("$rootdir/sbin/init.org", "$rootdir/sbin/init");
|
rename ("$rootdir/sbin/init.org", "$rootdir/sbin/init")
|
||||||
|
or die "failed to restore distro 'init' for actual diversion - $!";
|
||||||
$self->ve_divert_add ("/sbin/init");
|
$self->ve_divert_add ("/sbin/init");
|
||||||
$self->run_command ("cp '$fake_init' '$rootdir/sbin/init'");
|
$self->run_command ("cp '$fake_init' '$rootdir/sbin/init'");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user