Skip to content

Commit

Permalink
Also keep around /var/home by default
Browse files Browse the repository at this point in the history
A lot of backstory here, but essentially, we want Ignition to be able to
add users in RHCOS. This requires `/var/home` existing. To do this,
we either need to run systemd-tmpfiles, like FCOS, or just leave it
hanging around after Anaconda.

Since we're already doing the latter for `/var/lib` and `/var/log`, this
patch just extends it for `/var/home`. It's just easier to do this for
now rather than more involved fixes. This will be fixed the proper way
once RHCOS is bumped to spec 3 and inherits all the work that happened
in FCOS to support it.

Some more information about this in:
coreos/ignition-dracut#79
  • Loading branch information
jlebon authored and cgwalters committed Jun 11, 2019
1 parent c8cab23 commit f7b22b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gf-anaconda-cleanup
Expand Up @@ -50,10 +50,14 @@ done
# see https://github.com/coreos/ignition-dracut/pull/79#issuecomment-488446949
# For now we retain just /var/lib/systemd (for the random seed) and /var/log
# for the journal, which init before systemd-tmpfiles.
# Also just leave /var/home and /var/roothome; this allows early Ignition in
# RHCOS to add users and drop files in /root. (On FCOS, we don't strictly
# *need* this because we run systemd-tmpfiles).
var="${stateroot}/var"
coreos_gf ls "${var}" | while read -r x; do
case "$x" in
log|lib) continue;;
home|roothome) coreos_gf glob rm-rf "${var}/${x}/*";;
*) coreos_gf rm-rf "${var}/${x}"
esac
done
Expand Down

0 comments on commit f7b22b6

Please sign in to comment.