Skip to content

Commit

Permalink
builddeb: remove redundant $objtree/
Browse files Browse the repository at this point in the history
This script works only when it is invoked in the $objtree, that is,
it is already relying on $objtree is '.'

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Jan 28, 2020
1 parent 1694e94 commit f9a4711
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions scripts/package/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ create_package() {
}

version=$KERNELRELEASE
tmpdir="$objtree/debian/linux-image"
kernel_headers_dir="$objtree/debian/linux-headers"
libc_headers_dir="$objtree/debian/linux-libc-dev"
dbg_dir="$objtree/debian/linux-image-dbg"
tmpdir=debian/linux-image
kernel_headers_dir=debian/linux-headers
libc_headers_dir=debian/linux-libc-dev
dbg_dir=debian/linux-image-dbg
packagename=linux-image-$version
kernel_headers_packagename=linux-headers-$version
libc_headers_packagename=linux-libc-dev
Expand All @@ -77,7 +77,7 @@ esac
BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)

# Setup the directory structure
rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" debian/files
mkdir -m 755 -p "$tmpdir/DEBIAN"
mkdir -p "$tmpdir/lib" "$tmpdir/boot"
mkdir -p "$kernel_headers_dir/lib/modules/$version/"
Expand Down Expand Up @@ -165,24 +165,24 @@ EOF
done

# Build kernel header package
(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > "$objtree/debian/hdrsrcfiles"
(cd $srctree; find include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > debian/hdrsrcfiles
(cd $srctree; find include scripts -type f -o -type l) >> debian/hdrsrcfiles
(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> debian/hdrsrcfiles
(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> debian/hdrsrcfiles
if is_enabled CONFIG_STACK_VALIDATION; then
echo tools/objtool/objtool >> "$objtree/debian/hdrobjfiles"
echo tools/objtool/objtool >> debian/hdrobjfiles
fi
(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
find arch/$SRCARCH/include Module.symvers include scripts -type f >> debian/hdrobjfiles
if is_enabled CONFIG_GCC_PLUGINS; then
(cd $objtree; find scripts/gcc-plugins -name \*.so) >> "$objtree/debian/hdrobjfiles"
find scripts/gcc-plugins -name \*.so >> debian/hdrobjfiles
fi
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 -)
(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
(cd $srctree; tar -c -f - -T -) < debian/hdrsrcfiles | (cd $destdir; tar -xf -)
tar -c -f - -T - < debian/hdrobjfiles | (cd $destdir; tar -xf -)
cp $KCONFIG_CONFIG $destdir/.config # copy .config manually to be where it's expected to be
ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
rm -f debian/hdrsrcfiles debian/hdrobjfiles

if [ "$ARCH" != "um" ]; then
create_package "$kernel_headers_packagename" "$kernel_headers_dir"
Expand Down

0 comments on commit f9a4711

Please sign in to comment.