fs: ensure hard links in TARGET_DIR are correctly copied for filesystem input
PATCH 1/1 fs: ensure hard links in TARGET_DIR are correctly copied for filesystem input
Fixes #11046
Commit bb2a57a17a7 (fs: run packages' filesystem hooks in a copy of target/) changed the file system logic to run file system hooks from packages on a copy of TARGET_DIR, and finally use this copy as input for the file system generation.
This copy was done with rsync, which by default does not preserve hard links, leading to an expansion of the file system images when hard links are present.
Fix it by passing the -H option to rsync (preserve hard links).
---
Alternatively we can use 'cp -a' instead of rsync.
fs/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/common.mk +1 -1
@@ -71,7 +71,7 @@ $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize @$(call MESSAGE,"Generating common rootfs tarball") rm -rf $(FS_DIR) mkdir -p $(FS_DIR) - rsync -au $(BASE_TARGET_DIR)/ $(TARGET_DIR) + rsync -auH $(BASE_TARGET_DIR)/ $(TARGET_DIR) echo '#!/bin/sh' > $(FAKEROOT_SCRIPT) echo "set -e" >> $(FAKEROOT_SCRIPT) echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
Signature · 1 line
2.11.0
PATCH 1/1 fs: ensure hard links in TARGET_DIR are correctly copied for filesystem input
Peter, All,
On 2018-05-27 22:48 +0200, Peter Korsgaard spake thusly:
Quoted 7 lines
Fixes #11046
Commit
bb2a57a17a7(fs: run packages' filesystem hooks in a copy of target/) changed the file system logic to run file system hooks from packages on a copy ofTARGET_DIR, and finally use this copy as input for the file system generation.
Quoted 7 lines
This copy was done with rsync, which by default does not preserve hard links, leading to an expansion of the file system images when hard links are present.
Fix it by passing the -H option to rsync (preserve hard links).
Signed-off-by Peter Korsgaard <[email protected]>
Not sure how I was not able to reproduce the issue. But the rsync docs say we should use it, so:
Regards,
Yann E. MORIN.
Quoted 22 lines
---
Alternatively we can use 'cp -a' instead of rsync.fs/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/common.mk +1
-1@@ -71,7 +71,7 @@ $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize @$(call MESSAGE,"Generating common rootfs tarball") rm -rf $(FS_DIR) mkdir -p $(FS_DIR) - rsync -au $(BASE_TARGET_DIR)/ $(TARGET_DIR) + rsync -auH $(BASE_TARGET_DIR)/ $(TARGET_DIR) echo '#!/bin/sh' > $(FAKEROOT_SCRIPT) echo "set -e" >> $(FAKEROOT_SCRIPT) echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)Signature · 1 line
2.11.0
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 fs: ensure hard links in TARGET_DIR are correctly copied for filesystem input
In reply to Peter KorsgaardQuoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Fixes #11046
Commitbb2a57a17a7(fs: run packages' filesystem hooks in a copy of target/) changed the file system logic to run file system hooks from packages on a copy ofTARGET_DIR, and finally use this copy as input for the file system generation.This copy was done with rsync, which by default does not preserve hard links, leading to an expansion of the file system images when hard links are present.
Quoted 5 lines
Fix it by passing the -H option to rsync (preserve hard links).
Signed-off-by Peter Korsgaard <[email protected]>---
Alternatively we can use 'cp -a' instead of rsync.
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard