Commit 4f66199b authored by Frans Pop's avatar Frans Pop Committed by Sam Ravnborg

kbuild, deb-pkg: minor general improvements in builddeb script

Minor coding style improvements and typo fix in leading comment.
Signed-off-by: default avatarFrans Pop <elendil@planet.nl>
Cc: Andres Salomon <dilinger@debian.org>
Acked-by: default avatarmaximilian attems <max@stro.at>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent af6c1598
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Copyright 2003 Wichert Akkerman <wichert@wiggy.net> # Copyright 2003 Wichert Akkerman <wichert@wiggy.net>
# #
# Simple script to generate a deb package for a Linux kernel. All the # Simple script to generate a deb package for a Linux kernel. All the
# complexity of what to do with a kernel after it is installer or removed # complexity of what to do with a kernel after it is installed or removed
# is left to other scripts and packages: they can install scripts in the # is left to other scripts and packages: they can install scripts in the
# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on # /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on
# package install and removal. # package install and removal.
...@@ -13,13 +13,13 @@ set -e ...@@ -13,13 +13,13 @@ set -e
# Some variables and settings used throughout the script # Some variables and settings used throughout the script
version=$KERNELRELEASE version=$KERNELRELEASE
revision=`cat .version` revision=$(cat .version)
tmpdir="$objtree/debian/tmp" tmpdir="$objtree/debian/tmp"
fwdir="$objtree/debian/fwtmp" fwdir="$objtree/debian/fwtmp"
packagename=linux-$version packagename=linux-$version
fwpackagename=linux-firmware-image fwpackagename=linux-firmware-image
if [ "$ARCH" == "um" ] ; then if [ "$ARCH" = "um" ] ; then
packagename=user-mode-linux-$version packagename=user-mode-linux-$version
fi fi
...@@ -27,12 +27,12 @@ fi ...@@ -27,12 +27,12 @@ fi
rm -rf "$tmpdir" "$fwdir" rm -rf "$tmpdir" "$fwdir"
mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot"
mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" mkdir -p "$fwdir/DEBIAN" "$fwdir/lib"
if [ "$ARCH" == "um" ] ; then if [ "$ARCH" = "um" ] ; then
mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin"
fi fi
# Build and install the kernel # Build and install the kernel
if [ "$ARCH" == "um" ] ; then if [ "$ARCH" = "um" ] ; then
$MAKE linux $MAKE linux
cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
cp .config "$tmpdir/usr/share/doc/$packagename/config" cp .config "$tmpdir/usr/share/doc/$packagename/config"
...@@ -46,7 +46,7 @@ fi ...@@ -46,7 +46,7 @@ fi
if grep -q '^CONFIG_MODULES=y' .config ; then if grep -q '^CONFIG_MODULES=y' .config ; then
INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install
if [ "$ARCH" == "um" ] ; then if [ "$ARCH" = "um" ] ; then
mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
rmdir "$tmpdir/lib/modules/$version" rmdir "$tmpdir/lib/modules/$version"
fi fi
...@@ -77,9 +77,8 @@ linux ($version-$revision) unstable; urgency=low ...@@ -77,9 +77,8 @@ linux ($version-$revision) unstable; urgency=low
EOF EOF
# Generate a control file # Generate a control file
if [ "$ARCH" == "um" ]; then if [ "$ARCH" = "um" ]; then
cat <<EOF > debian/control
cat <<EOF > debian/control
Source: linux Source: linux
Section: base Section: base
Priority: optional Priority: optional
...@@ -101,7 +100,7 @@ Description: User Mode Linux kernel, version $version ...@@ -101,7 +100,7 @@ Description: User Mode Linux kernel, version $version
EOF EOF
else else
cat <<EOF > debian/control cat <<EOF > debian/control
Source: linux Source: linux
Section: base Section: base
Priority: optional Priority: optional
...@@ -116,6 +115,7 @@ Description: Linux kernel, version $version ...@@ -116,6 +115,7 @@ Description: Linux kernel, version $version
This package contains the Linux kernel, modules and corresponding other This package contains the Linux kernel, modules and corresponding other
files version $version files version $version
EOF EOF
fi fi
# Fix some ownership and permissions # Fix some ownership and permissions
...@@ -143,4 +143,3 @@ dpkg-gencontrol -isp -p$packagename ...@@ -143,4 +143,3 @@ dpkg-gencontrol -isp -p$packagename
dpkg --build "$tmpdir" .. dpkg --build "$tmpdir" ..
exit 0 exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment