fix(gen_tmpfiles): Don't include /var/tmp, systemd defines this one.

This commit is contained in:
Michael Marineau 2013-08-20 22:16:37 -04:00
parent efac054f54
commit ad908d0820
2 changed files with 7 additions and 1 deletions

View File

@ -209,9 +209,10 @@ create_base_image() {
emerge_to_image --root="${root_fs_dir}" ${BASE_PACKAGE} emerge_to_image --root="${root_fs_dir}" ${BASE_PACKAGE}
# Record directories installed to the stateful partition. # Record directories installed to the stateful partition.
# Ignore /var/tmp, systemd covers this entry.
sudo "${SCRIPTS_DIR}/gen_tmpfiles.py" --root="${root_fs_dir}" \ sudo "${SCRIPTS_DIR}/gen_tmpfiles.py" --root="${root_fs_dir}" \
--output="${root_fs_dir}/usr/lib/tmpfiles.d/base_image.conf" \ --output="${root_fs_dir}/usr/lib/tmpfiles.d/base_image.conf" \
"${root_fs_dir}/var" --ignore=/var/tmp "${root_fs_dir}/var"
# Set /etc/lsb-release on the image. # Set /etc/lsb-release on the image.
"${BUILD_LIBRARY_DIR}/set_lsb_release" \ "${BUILD_LIBRARY_DIR}/set_lsb_release" \

View File

@ -19,6 +19,8 @@ def main():
parser = optparse.OptionParser(description=__doc__) parser = optparse.OptionParser(description=__doc__)
parser.add_option('--root', help='Remove root prefix from output') parser.add_option('--root', help='Remove root prefix from output')
parser.add_option('--output', help='Write output to the given file') parser.add_option('--output', help='Write output to the given file')
parser.add_option('--ignore', action='append', default=[],
help='Ignore one or more paths (use multiple times)')
opts, args = parser.parse_args() opts, args = parser.parse_args()
if opts.root: if opts.root:
@ -56,6 +58,9 @@ def main():
else: else:
stripped = path stripped = path
if stripped in opts.ignore:
continue
info = os.stat(path) info = os.stat(path)
assert stat.S_ISDIR(info.st_mode) assert stat.S_ISDIR(info.st_mode)
mode = stat.S_IMODE(info.st_mode) mode = stat.S_IMODE(info.st_mode)