At the end of stage1, we bind-mount takeover on top of init, and
then call telinit u. Unfortunately, in some distributions (like
Devuan) telinit is a symlink to init. In this case, we lose access
to telinit, because the symlink now points to what is effectively
takeover.
With this commit, we check if telinit is a symlink to init, and if
so, we make a safe copy of telinit so that we can call it after the
bind-mounting takes place.
Testing
Tried simple migrations from
Devuan ascii 2.0.0
RaspiOS 2023-12-11 arm64
RaspiOS 2023-12-11 armhf
to a fleet of device type raspberrypi3-64, on a Raspberry Pi 3 Model B+.
Checked the logs to confirm that the safety copy was made only for Devuan.
At the end of stage1, we bind-mount
takeover
on top ofinit
, and then calltelinit u
. Unfortunately, in some distributions (like Devuan)telinit
is a symlink toinit
. In this case, we lose access totelinit
, because the symlink now points to what is effectivelytakeover
.With this commit, we check if
telinit
is a symlink toinit
, and if so, we make a safe copy oftelinit
so that we can call it after the bind-mounting takes place.Testing
Tried simple migrations from
to a fleet of device type
raspberrypi3-64
, on a Raspberry Pi 3 Model B+.Checked the logs to confirm that the safety copy was made only for Devuan.
All migrations succeeded.