-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lists ROMFS files explicity instead of using GLOB_RECURSE #9107
Lists ROMFS files explicity instead of using GLOB_RECURSE #9107
Conversation
Previously, when ROMFS files that were not airframes were touched, the ROMFS would not be rebuilt. The ROMFS files are now specified explicityl in a CMakeLists.txt file that is located in the root ROMFS directory. Now when one of the ROMFS files is touched the whole ROMFS is rebuilt. When new files are added to the ROMFS, they need to be explicity added to the CMakeLists in the ROMFS root directory.
530a5e3
to
6c57c4e
Compare
What do you think about including the CMakeLists.txt in the deepest directory? At each higher level back to the root you can have a CMakeLists.txt that simply adds each directory ( I say this now because I'd like to come back and sort the airframes and mixers by group later. |
@dagar: Do you not think that might get a bit too confusing? Too many layers and levels of CMakeLists.txt? Especially when each of these CMakeLists will only be setting/appending to the lists and not actually creating targets/outputs. It is only the ROMFS/CMakeLists.txt that is currently creating any output. I guess, it depends on how often you think you might be modifying the ROMFS files. |
Personally I find lists and directories with ~ 100 things overwhelming and hard to sift through. The only way I know to get a handle on that complexity is to break it down and keep it modular. I started doing this last year, but never got it merged. #7628 Either way is fine for now, but this is what I'd like to consider doing later. |
@dagar: I can take a crack at adding in CMakeLists.txt files in each subdirectory. How do you want me to add the files in the deeper directories to the "master" list in the upper directory, though? In each subdirectory, do a
? |
In the top level ROMFS CMakeLists.txt you Then in each subdirectory you append
The other thing that just occurred to me is the exclude mechanism. We need to make sure that still works (available flash is currently quite limited on the original 1MB pixhawk). https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/13004_quad%2B_tailsitter#L19 |
This is becoming messy. Each level of CMakeLists adds a CMakeLists directory and .cmake file in the temp romfs directory. I I would have to prune these out, or we need to find a better solution to prevent CMake files from littering the temp ROMFS directory. - I think the px4fmu-v2 build overflowed because these additional cmake build files were copied into the ROMFS. |
If they're ending up in the tmp ROMFS at all I think you should change the path to avoid the conflict entirely. The location for ROMFS in the build directory is arbitrary, and placed at the top level for minor convenience. Unless it's trivial to tell genromfs what to exclude (or only include) I'd simply change the path. |
@dagar: I can't quite work out how to get CMake not to generate the cmake_install.cmake file and CMakeFiles directory in the romfs. You'll see that I tried to use a separate temp romfs directory with I'd rather like to not have to specifically prune those files or exclude them manually in the genromfs program if possible, because that will make the ROMFS build all the more obscure. Any ideas? Sorry to be a pain.... :-( |
It looks like whenever I have an |
This is all internal cmake stuff, so let's not try to prune. All we need to do is pick a folder in the build directory that doesn't overlap with the cmake tmp (corresponding to source tree) at all. Something like |
e8812fd
to
3796617
Compare
@dagar: Setting the I have had to add You will also see that in each of the subdirectory CMakeLists, I have had to add the |
Also moves the temporary ROMFS build directory to ${PX4_BINARY_DIR}/ROMFS/genromfs so that the cmake_install.cmake files and the CMakeFiles directories (generated whenever are not add_subdirectory() is called) are not generated in the temporary ROMFS directory from which the ROMFS binary is created.
3796617
to
7a98d07
Compare
How about something like this this? ksschwabe#1 |
The px4io.bin file was being generated in a directory one level deeper than in the ROMFS than the rest of the ROMFS files.
Looking good. To be paranoid let's check the romfs.txt (search the build dir) is identical in this PR and master. I'd also check that booting a pixhawk actually works (including IO flash). |
I've fixed the path issue. The ROMFS files are now generated in the temp directory I see two "issues"/problems still to discuss.
|
|
|
ROMFS/px4fmu_common/CMakeLists.txt
Outdated
@@ -0,0 +1,35 @@ | |||
############################################################################ | |||
# | |||
# Copyright (c) 2016 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong copyright year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the Copyright header with a 2018 header.
I also added a 2018 copyright header to the ROMFS/CMakeLists.txt file - it previously didn't have one at all. Should the one for the ROMFS/CMakeLists.txt be a purely 2018 copyright header, or should we make it a 20XX - 2018 header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018 only is fine for the new ones.
83c5fa0
to
87ccba6
Compare
I verified the ROMFS contents are identical vs master and did some actual testing on a pixhawk. |
Thank you! |
Fixes #9093.
Previously, when ROMFS files that were not airframes were touched, the ROMFS
would not be rebuilt. The ROMFS files are now specified explicityl in a
CMakeLists.txt file that is located in the root ROMFS directory.
Now when one of the ROMFS files is touched the whole ROMFS is rebuilt.
When new files are added to the ROMFS, they need to be explicity added to
the CMakeLists in the ROMFS root directory.