mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 07:01:13 +02:00
fix(gen_tmpfiles): Don't include /var/tmp, systemd defines this one.
This commit is contained in:
parent
efac054f54
commit
ad908d0820
@ -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" \
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user