Commit e7442d62 authored by Matthijs van Duin's avatar Matthijs van Duin

build a debian package

parent 95f46991
......@@ -31,13 +31,49 @@ _make
build_output=eurasia_km/eurasiacon/binary2_omap_linux_release/target/kbuild
modules=( pvrsrvkm.ko )
install_dir="lib/modules/$uname_r/extra"
install_dir="tmp/lib/modules/$uname_r/extra"
mkdir -vp "$install_dir"
cp "${modules[@]/#/"$build_output/"}" "$install_dir"
mkdir -p tmp/DEBIAN
cat >tmp/DEBIAN/control <<END
Package: sgx-modules-$uname_r
Version: 1cross
Section: base
Priority: optional
Architecture: armhf
Depends: linux-image-$uname_r
Recommends: sgx-userspace-1.14.3699939
Maintainer: Matthijs van Duin <matthijsvanduin@gmail.com>
Description: sgx kernel modules for linux $uname_r
END
cat >tmp/DEBIAN/postinst <<END
#!/bin/sh
depmod $uname_r
END
chmod a+x tmp/DEBIAN/postinst
cat >tmp/DEBIAN/postrm <<END
#!/bin/sh
if [[ -d /lib/modules/$uname_r ]]; then
depmod $uname_r
fi
END
chmod a+x tmp/DEBIAN/postrm
chmod -R g=rX,o=rX tmp
#echo ""
#echo "creating $deploy_dir/sgx-335x-$uname_r.tar.xz"
#tar cavf "$deploy_dir/sgx-335x-$uname_r.tar.xz" \
# --owner=root --group=root --mode="g=rX,o=rX" \
# "${modules[@]/#/"$install_dir/"}"
echo ""
echo "creating $deploy_dir/sgx-335x-$uname_r.tar.xz"
tar cavf "$deploy_dir/sgx-335x-$uname_r.tar.xz" \
--owner=root --group=root --mode="g=rX,o=rX" \
"${modules[@]/#/"$install_dir/"}"
echo "creating $deploy_dir/sgx-modules-$uname_r.deb"
fakeroot dpkg-deb --build tmp "$deploy_dir/sgx-modules-$uname_r.deb"
rm -rf tmp
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