forked from Mirror/pmbootstrap
pmb.chroot: merge_usr earlier (MR 2252)
We currently do stuff in the chroot before merging /usr, this could lead to weird side effects due to the recursive nature of chroot.init being called every time we run a command. Let's reorder a bit to reduce the risk of weirdness here. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
2d232200f8
commit
3322eab30c
1 changed files with 6 additions and 6 deletions
|
@ -166,6 +166,12 @@ def init(args: PmbArgs, chroot: Chroot=Chroot.native(), usr_merge=UsrMerge.AUTO,
|
|||
"--initdb", "--arch", arch,
|
||||
"add", "alpine-base"])
|
||||
|
||||
# Merge /usr
|
||||
if usr_merge is UsrMerge.AUTO and pmb.config.is_systemd_selected(args):
|
||||
usr_merge = UsrMerge.ON
|
||||
if usr_merge is UsrMerge.ON:
|
||||
init_usr_merge(args, chroot)
|
||||
|
||||
# Building chroots: create "pmos" user, add symlinks to /home/pmos
|
||||
if not chroot.type == ChrootType.ROOTFS:
|
||||
pmb.chroot.root(args, ["adduser", "-D", "pmos", "-u",
|
||||
|
@ -182,12 +188,6 @@ def init(args: PmbArgs, chroot: Chroot=Chroot.native(), usr_merge=UsrMerge.AUTO,
|
|||
pmb.chroot.user(args, ["ln", "-s", target, link_name], chroot)
|
||||
pmb.chroot.root(args, ["chown", "pmos:pmos", target], chroot)
|
||||
|
||||
# Merge /usr
|
||||
if usr_merge is UsrMerge.AUTO and pmb.config.is_systemd_selected(args):
|
||||
usr_merge = UsrMerge.ON
|
||||
if usr_merge is UsrMerge.ON:
|
||||
init_usr_merge(args, chroot)
|
||||
|
||||
# Upgrade packages in the chroot, in case alpine-base, apk, etc. have been
|
||||
# built from source with pmbootstrap
|
||||
command = ["--no-network", "upgrade", "-a"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue