2017-12-14 21:17:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
startdir=$1
|
|
|
|
pkgname=$2
|
|
|
|
|
|
|
|
if [ -z "$startdir" ] || [ -z "$pkgname" ]; then
|
|
|
|
echo "ERROR: missing argument!"
|
2018-10-15 19:54:15 +00:00
|
|
|
echo "Please call $0 with \$startdir \$pkgname as arguments."
|
2017-12-14 21:17:18 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
srcdir="$startdir/src"
|
|
|
|
pkgdir="$startdir/pkg/$pkgname"
|
|
|
|
|
|
|
|
if [ ! -f "$srcdir/deviceinfo" ]; then
|
|
|
|
echo "NOTE: $0 is intended to be used inside of the package() function"
|
|
|
|
echo "of a device package's APKBUILD only."
|
|
|
|
echo "ERROR: deviceinfo file missing!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
install -Dm644 "$srcdir/deviceinfo" \
|
|
|
|
"$pkgdir/etc/deviceinfo"
|
|
|
|
|
|
|
|
if [ -f "$srcdir/90-$pkgname.rules" ]; then
|
|
|
|
install -Dm644 "$srcdir/90-$pkgname.rules" \
|
|
|
|
"$pkgdir/etc/udev/rules.d/90-$pkgname.rules"
|
|
|
|
fi
|
2019-01-31 18:29:22 +00:00
|
|
|
|
|
|
|
if [ -f "$srcdir/initfs-hook.sh" ]; then
|
|
|
|
install -Dm644 "$srcdir/initfs-hook.sh" \
|
|
|
|
"$pkgdir/etc/postmarketos-mkinitfs/hooks/00-$pkgname.sh"
|
|
|
|
fi
|