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" \
|
2023-06-07 17:10:24 +00:00
|
|
|
"$pkgdir/usr/share/deviceinfo/$pkgname"
|
|
|
|
ln -s "$pkgname" "$pkgdir/usr/share/deviceinfo/deviceinfo"
|
2020-05-15 17:41:48 +00:00
|
|
|
install -Dm644 "$srcdir/machine-info" \
|
|
|
|
"$pkgdir/etc/machine-info"
|
2017-12-14 21:17:18 +00:00
|
|
|
|
|
|
|
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" \
|
2023-02-18 23:18:36 +00:00
|
|
|
"$pkgdir/usr/share/mkinitfs/hooks/00-$pkgname.sh"
|
2019-01-31 18:29:22 +00:00
|
|
|
fi
|
2020-04-04 14:06:27 +00:00
|
|
|
|
2023-06-27 16:55:53 +00:00
|
|
|
# All the installation paths for the modules conflict with those from
|
|
|
|
# devicepkg_subpackage_kernel. See comment there for details
|
2023-07-28 11:11:54 +00:00
|
|
|
if [ -f "$srcdir/modules-initfs" ]; then
|
|
|
|
install -Dm644 "$srcdir/modules-initfs" \
|
2023-06-09 18:55:52 +00:00
|
|
|
"$pkgdir/usr/share/mkinitfs/modules/00-$pkgname.modules"
|
2023-06-27 16:55:53 +00:00
|
|
|
mkdir -p "$pkgdir/usr/share/mkinitfs/files"
|
|
|
|
echo "/usr/share/mkinitfs/modules/00-$pkgname.modules:/lib/modules/initramfs.load" \
|
|
|
|
> "$pkgdir/usr/share/mkinitfs/files/00-$pkgname-modules.files"
|
2023-06-09 18:55:52 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-04 14:06:27 +00:00
|
|
|
if [ -f "$srcdir/modules-load.conf" ]; then
|
|
|
|
install -Dm644 "$srcdir/modules-load.conf" \
|
|
|
|
"$pkgdir/etc/modules-load.d/00-$pkgname.conf"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$srcdir/modprobe.conf" ]; then
|
|
|
|
install -Dm644 "$srcdir/modprobe.conf" \
|
|
|
|
"$pkgdir/etc/modprobe.d/$pkgname.conf"
|
|
|
|
fi
|