Skip to contentSkip to conversation

deb-pkg: Don't run find across mountpoints

PATCH In review Gabriel de Perthuis 2 participants 6 messages Jun 9, 2013 – Jun 10, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 deb-pkg: Don't run find across mountpoints

---
 scripts/package/builddeb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/package/builddeb +2 -2
index acb8650..1435f5a 100644
@@ -16,11 +16,11 @@ create_package() {
 	local pname="$1" pdir="$2"
 
 	cp debian/copyright "$pdir/usr/share/doc/$pname/"
 	cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
 	gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
-	sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
+	sh -c "cd '$pdir'; find . -xdev -type f ! -path './DEBIAN/*' -printf '%P\0' \
 		| xargs -r0 md5sum > DEBIAN/md5sums"
 
 	# Fix ownership and permissions
 	chown -R root:root "$pdir"
 	chmod -R go-w "$pdir"
@@ -241,11 +241,11 @@ Description: Linux kernel, version $version
 EOF
 
 fi
 
 # Build header package
-(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
+(cd $srctree; find . -xdev -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
 (cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
 (cd $objtree; find arch/$SRCARCH/include .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
 (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
Signature · 1 line
1.8.3.222.g430da9e
#1 lore raw
Quoted 10 lines · Gabriel de Perthuis
---
 scripts/package/builddeb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/package/builddeb +0 -0
index acb8650..1435f5a 100644

scripts/package/builddeb create_package() { · line 21

Quoted 7 lines
scripts/package/builddeb +1 -1
@@ -16,11 +16,11 @@ create_package() {
 	local pname="$1" pdir="$2"
 
 	cp debian/copyright "$pdir/usr/share/doc/$pname/"
 	cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
 	gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
-	sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
+	sh -c "cd '$pdir'; find . -xdev -type f ! -path './DEBIAN/*' -printf '%P\0' \

What kind of mountpoint zoo do you maintain in your build tree? :) We run a find in make clean, make mrproper and other targets. So you might need to fix more places. But please explain your use case.

Michal

#2 lore raw
Quoted 5 lines · Michal Marek

What kind of mountpoint zoo do you maintain in your build tree? :) We run a find in make clean, make mrproper and other targets. So you might need to fix more places. But please explain your use case.

Michal

I happened to be running a fuse thing (git fs, mounted under .git/fs); recursing that can take a *long* time.

find . is the only one that actually runs into trouble, although it might be good if -xdev could be the default (through a shell function maybe?).

#3 lore raw
Quoted 11 lines · Gabriel de Perthuis
Quoted 3 lines · Michal Marek

What kind of mountpoint zoo do you maintain in your build tree? :) We run a find in make clean, make mrproper and other targets. So you might need to fix more places. But please explain your use case.

I happened to be running a fuse thing (git fs, mounted under .git/fs); recursing that can take a *long* time.

find . is the only one that actually runs into trouble, although it might be good if -xdev could be the default (through a shell function maybe?).

Or it would be even better if the scripts used git ls-files, if it seems a reasonable requirement to have the kernel build from git.

#4 lore raw
Quoted 6 lines · Gabriel de Perthuis
Quoted 5 lines · Gabriel de Perthuis
Quoted 3 lines · Michal Marek

What kind of mountpoint zoo do you maintain in your build tree? :) We run a find in make clean, make mrproper and other targets. So you might need to fix more places. But please explain your use case.

Quoted 6 lines
Quoted 6 lines

I happened to be running a fuse thing (git fs, mounted under .git/fs); recursing that can take a *long* time.

find . is the only one that actually runs into trouble, although it might be good if -xdev could be the default (through a shell function maybe?).

So make deb-pkg saves the md5sums of all files under .git?? Then the right fix would be to export RCS_FIND_IGNORE and use it in the builddeb script.

Quoted 2 lines

Or it would be even better if the scripts used git ls-files, if it seems a reasonable requirement to have the kernel build from git.

No, the build has to work without any git repository.

Michal

#5 lore raw
Quoted 10 lines · Michal Marek
Quoted 9 lines · Gabriel de Perthuis
Quoted 8 lines · Gabriel de Perthuis
Quoted 3 lines · Michal Marek

What kind of mountpoint zoo do you maintain in your build tree? :) We run a find in make clean, make mrproper and other targets. So you might need to fix more places. But please explain your use case.

I happened to be running a fuse thing (git fs, mounted under .git/fs); recursing that can take a *long* time.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

find . is the only one that actually runs into trouble, although it might be good if -xdev could be the default (through a shell function maybe?).

So make deb-pkg saves the md5sums of all files under .git?? Then the right fix would be to export RCS_FIND_IGNORE and use it in the builddeb script.

Sounds like a good idea. It doesn't work as is because the backslashes in \( seem to be delayed by make and can't be used as is, removing the backslashes doesn't work either, and it takes a long time to test.