Article 4T0PK Getting the stratum init ?

Getting the stratum init ?

by
ychaouche
from LinuxQuestions.org on (#4T0PK)
In the installer's archive, in bedrock/sbin/init, around line 371, this block of code

Code:if [ -n "${def_tuple}" ] && [ -d "/bedrock/strata/${def_stratum}" ]; then
sproc="/bedrock/strata/${def_stratum}/proc"
mkdir -p "${sproc}" 2>/dev/null || true
mount -t proc proc "${sproc}"
if def_link="$(chroot "/bedrock/strata/${def_stratum}" "/proc/1/root/bedrock/libexec/busybox" realpath "${def_cmd}" 2>/dev/null)"; then
def_path="/bedrock/strata/${def_stratum}${def_link}"
fi
umount "${sproc}"
fiThe difficult part for me was to understand what this assignement does :

Quote:
def_link="$(chroot "/bedrock/strata/${def_stratum}" "/proc/1/root/bedrock/libexec/busybox" realpath "${def_cmd}" 2>/dev/null)";
it seems to be trying to retrive the stratum's init binary but in a somewhat convoluted way. I'm sure it is necessary to do it this way, but I was wondering if anyone would like to explain the details of what's going on there ?latest?d=yIl2AUoC8zA latest?i=IcxSptyvFq8:hKyUM2LrTHs:F7zBnMy latest?i=IcxSptyvFq8:hKyUM2LrTHs:V_sGLiP latest?d=qj6IDK7rITs latest?i=IcxSptyvFq8:hKyUM2LrTHs:gIN9vFwIcxSptyvFq8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments