7.5. Enter chroot environment

Enter the target system with a clean environment and a login shell so package work runs inside the target tree.

Goal: start a clean chroot shell in $LBI_ROOT using the target layout paths and login profile.

Run this as root after completing the previous setup steps in chapter 7.

Enter chroot

chroot "$LBI_ROOT" /system/binaries/env -i \
    HOME=/system/charlie \
    TERM="$TERM" \
    SHELL=/bin/oksh \
    PS1='(chroot) %# ' \
    PATH=/system/binaries:/system/systembinaries \
    /bin/oksh -l

The login shell reads /system/configuration/profile, which is linked to the build variable profile created in the previous section.

Quick verification

pwd
echo "$PATH"

Command Explanations