Browse Source

Merge pull request #889 from PX4/romfs_clean

Do not copy hidden or backup files to ROMFS
sbg
Lorenz Meier 11 years ago
parent
commit
5bbb76231f
  1. 5
      Tools/px_romfs_pruner.py
  2. 2
      makefiles/firmware.mk

5
Tools/px_romfs_pruner.py

@ -43,6 +43,7 @@ from __future__ import print_function @@ -43,6 +43,7 @@ from __future__ import print_function
import argparse
import os
def main():
# Parse commandline arguments
@ -56,7 +57,7 @@ def main(): @@ -56,7 +57,7 @@ def main():
for (root, dirs, files) in os.walk(args.folder):
for file in files:
# only prune text files
if ".zip" in file or ".bin" in file:
if ".zip" in file or ".bin" or ".swp" in file:
continue
file_path = os.path.join(root, file)
@ -64,7 +65,7 @@ def main(): @@ -64,7 +65,7 @@ def main():
# read file line by line
pruned_content = ""
with open(file_path, "r") as f:
for line in f:
for line in f:
# handle mixer files differently than startup files
if file_path.endswith(".mix"):

2
makefiles/firmware.mk

@ -371,6 +371,8 @@ $(ROMFS_IMG): $(ROMFS_SCRATCH) $(ROMFS_DEPS) $(GLOBAL_DEPS) @@ -371,6 +371,8 @@ $(ROMFS_IMG): $(ROMFS_SCRATCH) $(ROMFS_DEPS) $(GLOBAL_DEPS)
$(ROMFS_SCRATCH): $(ROMFS_DEPS) $(GLOBAL_DEPS)
$(Q) $(MKDIR) -p $(ROMFS_SCRATCH)
$(Q) $(COPYDIR) $(ROMFS_ROOT)/* $(ROMFS_SCRATCH)
# delete all files in ROMFS_SCRATCH which start with a . or end with a ~
$(Q) $(RM) $(ROMFS_SCRATCH)/*/.[!.]* $(ROMFS_SCRATCH)/*/*~
ifneq ($(ROMFS_EXTRA_FILES),)
$(Q) $(MKDIR) -p $(ROMFS_SCRATCH)/extras
$(Q) $(COPY) $(ROMFS_EXTRA_FILES) $(ROMFS_SCRATCH)/extras

Loading…
Cancel
Save