ilbers / isar

Integration System for Automated Root filesystem generation
Other
177 stars 72 forks source link

postinst in example-raw needs rework ? #75

Open ydirson opened 2 years ago

ydirson commented 2 years ago

example-raw/files/postinst reads:

if ! getent passwd isar >/dev/null; then
        useradd --system --gid isar --create-home \
                --home /var/lib/isar --no-user-group \
                --comment "My isar user" \
                isar
fi

# since the homedir was part of the package, useradd did not include skel
cp -RTn /etc/skel ~isar

This last comment about "homedir was part of the package" does not seem to be correct (any more?), so likely the skel copy should occur on useradd. After removing this line the generated image still gets those files populated. Possibly more should be cleaned up at the same time ?

henning-schild commented 2 years ago

Please go more into detail here. Steps to reproduce and problems you see.

https://github.com/ilbers/isar/blob/8650997867c43d4d676e3bcd1864b0b38cbc75d9/meta-isar/recipes-app/example-raw/example-raw_0.3.bb#L40

https://github.com/ilbers/isar/blob/8650997867c43d4d676e3bcd1864b0b38cbc75d9/meta-isar/recipes-app/example-raw/example-raw_0.3.bb#L35

At the end you want to see both these files in the homedir, and possibly more coming from /etc/skel via other packages.

amikan commented 2 years ago

Tried debian-stretch and debian-bullseye: both do not copy skel in useradd even if explicitly set -k /etc/skel. So we can't remove that hack so far.

henning-schild commented 2 years ago

Is is a hack? Does any distro copy skel if HOME exists on useradd?

amikan commented 2 years ago

At least it looks like a hack. Maybe we can add a user other then isar with other homedir here to make things more clear.

henning-schild commented 2 years ago

Maybe it is too many examples in one but it serves the purpose to show how to populate a users homedir from multiple sources.

But please stay on topic so we can close this. I will stop here because we do not do issues in this project but unfortunately they are not disabled.