install: fix crash if /etc/skel is missing (MR 2001)
Create an empty home dir if /etc/skel does not exist in the target rootfs. Due to changes in packaging, this can happen now, previously /etc/skel would always have existed.
This commit is contained in:
parent
799f4b925b
commit
2401423e2b
|
@ -178,7 +178,10 @@ def create_home_from_skel(args):
|
||||||
rootfs = args.work + "/chroot_native/mnt/install"
|
rootfs = args.work + "/chroot_native/mnt/install"
|
||||||
homedir = rootfs + "/home/" + args.user
|
homedir = rootfs + "/home/" + args.user
|
||||||
pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"])
|
pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"])
|
||||||
pmb.helpers.run.root(args, ["cp", "-a", rootfs + "/etc/skel", homedir])
|
if os.path.exists(f"{rootfs}/etc/skel"):
|
||||||
|
pmb.helpers.run.root(args, ["cp", "-a", f"{rootfs}/etc/skel", homedir])
|
||||||
|
else:
|
||||||
|
pmb.helpers.run.root(args, ["mkdir", homedir])
|
||||||
pmb.helpers.run.root(args, ["chown", "-R", "10000", homedir])
|
pmb.helpers.run.root(args, ["chown", "-R", "10000", homedir])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue