modem/msm-modem: embed keepfileopen utility
This is only used in this program, so we can have one less package Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7495>
This commit is contained in:
parent
5781f22c48
commit
7e145bad88
2 changed files with 31 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
pkgname=msm-modem
|
||||
pkgver=10
|
||||
pkgver=11
|
||||
pkgrel=0
|
||||
pkgdesc="Common support for Qualcomm MSM modems"
|
||||
url="https://postmarketos.org/"
|
||||
|
|
@ -16,6 +16,7 @@ subpackages="
|
|||
"
|
||||
|
||||
source="
|
||||
keepfileopen.c
|
||||
msm-modem-downstream.initd
|
||||
msm-modem-uim-selection
|
||||
msm-modem-uim-selection.confd
|
||||
|
|
@ -26,9 +27,15 @@ source="
|
|||
"
|
||||
options="!check"
|
||||
|
||||
build() {
|
||||
gcc -o keepfileopen "$srcdir"/keepfileopen.c
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm755 "$srcdir"/msm-modem-uim-selection \
|
||||
-t "$pkgdir"/usr/libexec/
|
||||
install -Dm755 keepfileopen \
|
||||
-t "$pkgdir"/usr/bin/
|
||||
|
||||
install -Dm644 "$srcdir"/msm-modem-uim-selection.service \
|
||||
-t "$pkgdir"/usr/lib/systemd/system/
|
||||
|
|
@ -56,7 +63,9 @@ uim_selection_openrc() {
|
|||
|
||||
downstream() {
|
||||
pkgdesc="$pkgdesc (downstream)"
|
||||
depends="$pkgname libqipcrtr4msmipc libsmdpkt_wrapper keepfileopen"
|
||||
depends="$pkgname libqipcrtr4msmipc libsmdpkt_wrapper"
|
||||
|
||||
amove usr/bin/keepfileopen
|
||||
|
||||
install -Dm644 "$srcdir/udev-downstream.rules" "$subpkgdir/usr/lib/udev/rules.d/55-$pkgname.rules"
|
||||
}
|
||||
|
|
@ -79,6 +88,7 @@ openrc() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
ac9ed0f6ec07ef813ce3a539919acbe8a5a70d5765a5fff267674a3fb239cdb1dba58a14d72a64f990bdcb87c6476d30ef7add21f152df7cb48e36932ef14dbb keepfileopen.c
|
||||
3172f8c409f552f13d1da29f14ab6c79072cd6da4acab151a1a0ea1858a416974456852609f14fe29cf97a6a45e60b99d0a57ddcde751da243ee5ac6fa8b672c msm-modem-downstream.initd
|
||||
cea8a74d705a53e0f8a5d5da11f3ffc8ba25410906c4fe048617cb5a0d18b86070129d51fc7d6ec90906abe0d0e1dc2df1b19206824eb106237af2c9737544a6 msm-modem-uim-selection
|
||||
abc985c76170601a22a1d5ab0c68bdf63fa2be2796593048ea3ba0d7e5cd26b2fcee2043703e46c2910c53b01e9e8092b7a8e715d57baf243a5f4612dd595443 msm-modem-uim-selection.confd
|
||||
|
|
|
|||
19
modem/msm-modem/keepfileopen.c
Normal file
19
modem/msm-modem/keepfileopen.c
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: keepfileopen <file>\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (open(argv[1], O_RDONLY) < 0) {
|
||||
perror("Failed to open file");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
pause();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue