Skip to content

Commit 687c3da

Browse files
author
Sam Ravnborg
committed
uml: Make deb-pkg build target build a Debian-style user-mode-linux package
From: Ryan Anderson <ryan@michonline.com> Make the deb-pkg build target understand the "um" arch and set up the package and directory structure to match a mainline-Debian style user-mode-linux package. This is primarily so that it stops matching, exactly, the naming convention used by normal, non-UML kernels generated by this command. Installing "linux-2.6.11" and "linux-2.6.11", where one is a UML kernel doesn't do the right thing. This fixes that. Signed-off-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent d80e224 commit 687c3da

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

‎scripts/package/builddeb‎

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,38 @@ set -e
1414
# Some variables and settings used throughout the script
1515
version=$KERNELRELEASE
1616
tmpdir="$objtree/debian/tmp"
17+
packagename=linux-$version
18+
19+
if [ "$ARCH" == "um" ] ; then
20+
packagename=user-mode-linux-$version
21+
fi
1722

1823
# Setup the directory structure
1924
rm -rf "$tmpdir"
2025
mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot"
26+
if [ "$ARCH" == "um" ] ; then
27+
mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin"
28+
fi
2129

2230
# Build and install the kernel
23-
cp System.map "$tmpdir/boot/System.map-$version"
24-
cp .config "$tmpdir/boot/config-$version"
25-
cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
31+
if [ "$ARCH" == "um" ] ; then
32+
$MAKE linux
33+
cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
34+
cp .config "$tmpdir/usr/share/doc/$packagename/config"
35+
gzip "$tmpdir/usr/share/doc/$packagename/config"
36+
cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version"
37+
else
38+
cp System.map "$tmpdir/boot/System.map-$version"
39+
cp .config "$tmpdir/boot/config-$version"
40+
cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"
41+
fi
2642

2743
if grep -q '^CONFIG_MODULES=y' .config ; then
2844
INSTALL_MOD_PATH="$tmpdir" make modules_install
45+
if [ "$ARCH" == "um" ] ; then
46+
mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
47+
rmdir "$tmpdir/lib/modules/$version"
48+
fi
2949
fi
3050

3151
# Install the maintainer scripts
@@ -60,11 +80,11 @@ Priority: optional
6080
Maintainer: $name
6181
Standards-Version: 3.6.1
6282
63-
Package: linux-$version
83+
Package: $packagename
6484
Architecture: any
65-
Description: Linux kernel, version $version
85+
Description: Linux kernel, version $packagename
6686
This package contains the Linux kernel, modules and corresponding other
67-
files version $version.
87+
files version $packagename
6888
EOF
6989

7090
# Fix some ownership and permissions

0 commit comments

Comments
 (0)