Skip to content
Snippets Groups Projects
Unverified Commit 5eb7c395 authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

postmarketos-mkinitfs: don't depend on osk-sdl, add to initfs conditionally (MR 2242)

osk-sdl is explicitly installed by pmbootstrap:
https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2066

As such, mkinitfs should conditionally add osk-sdl and its dependencies
to the initfs, based on whether it is installed or not.

This is kind of a 'quick and dirty' approach, the test is simple enough
(-x /usr/bin/osk-sdl) that it didn't seem worth adding a separate
function just for that.
parent 99c95f57
No related branches found
No related tags found
No related merge requests found
Pipeline #191235 passed
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=postmarketos-mkinitfs
pkgver=0.26
pkgrel=1
pkgver=0.27
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
......@@ -16,7 +16,6 @@ depends="
kmod
lddtree
lz4
osk-sdl>=0.64
parted
xz
"
......@@ -56,6 +55,6 @@ sha512sums="
1a267dd958609263a4f24657f602ac0e4e0c724bf1284adec85e82d05c9b07553085edea5a56f7fa09d1652af232c72d4d39a06858c2a580ff830577b5f37d67 init.sh.in
e72adfb06745ad596a02837c8d52837490a7940f4d5589b8937155ee1be1bc4176d79d3f24c40882d20592d00c23c2daf3ef1ceba6ef05cadb76906084373f1b init_functions.sh
54c8ea6c4b5313c0ca82bbc40498a35d4b5cbcdbf950dc01b5025238ea6b8caa2f9a9ee57a269fb78673fbcac186c33243188458ecda45deb3354d5d8a77fdfe mkinitfs.sh
0b89d1c43516d1be154fcf51082a89ab9dbff7de5f8dc3964399514584752b2356d34958923e66250af4639eb98b94f51ac9046c2d69c608fcf12794f78c2cca mkinitfs_functions.sh
dd8c34961fbd0c12b5766475b801c3423480f135c40c6ce1414d29ba6d55a78991572b4c24186dc3c1a234abd1c0adf67830ec7c82a914ff4e28fd1b34463fa6 mkinitfs_functions.sh
c7a3c33daeb12b33ac72207191941c4d634f15c22958273b52af381a70ebaba1d3a9299483f0c447d9e66c560151fe7b9588bb4bbef2c8914f83185984ee4622 mkinitfs_test.sh
"
......@@ -216,27 +216,32 @@ get_binaries_extra()
BINARIES_EXTRA="
$(find /usr/lib/directfb-* -name '*.so')
/lib/libz.so.1
/sbin/cryptsetup
/sbin/dmsetup
/sbin/e2fsck
/usr/bin/osk-sdl
/usr/lib/libGL.so.1
/usr/lib/libts*
/usr/lib/ts/*
/usr/sbin/parted
/usr/sbin/resize2fs
/usr/sbin/resize.f2fs
"
if [ -n "$deviceinfo_mesa_driver" ]; then
if [ -x /usr/bin/osk-sdl ]; then
BINARIES_EXTRA="
$BINARIES_EXTRA
/usr/lib/libEGL.so.1
/usr/lib/libGLESv2.so.2
/usr/lib/libgbm.so.1
/usr/lib/libudev.so.1
/usr/lib/xorg/modules/dri/${deviceinfo_mesa_driver}_dri.so
/usr/bin/osk-sdl
/sbin/cryptsetup
/usr/lib/libGL.so.1
/usr/lib/libts*
/usr/lib/ts/*
"
if [ -n "$deviceinfo_mesa_driver" ]; then
BINARIES_EXTRA="
$BINARIES_EXTRA
/usr/lib/libEGL.so.1
/usr/lib/libGLESv2.so.2
/usr/lib/libgbm.so.1
/usr/lib/libudev.so.1
/usr/lib/xorg/modules/dri/${deviceinfo_mesa_driver}_dri.so
"
fi
fi
tmp1=$(mktemp /tmp/mkinitfs.XXXXXX)
......@@ -497,10 +502,13 @@ generate_initramfs_extra()
{
echo "==> initramfs: creating $1"
osk_conf="$(get_osk_config)"
if [ $? -eq 1 ]; then
echo "ERROR: Font specified in /etc/osk.conf does not exist!"
exit 1
osk_conf=""
if [ -x /usr/bin/osk-sdl ]; then
osk_conf="$(get_osk_config)"
if [ $? -eq 1 ]; then
echo "ERROR: Font specified in /etc/osk.conf does not exist!"
exit 1
fi
fi
# Set up initramfs-extra in temp folder
......@@ -509,7 +517,7 @@ generate_initramfs_extra()
tmpdir_extra_cpio_img="$tmpdir_extra_cpio/extra.img"
mkdir -p "$tmpdir_extra"
copy_files "$(get_binaries_extra)" "$tmpdir_extra"
copy_files "$osk_conf" "$tmpdir_extra"
[ -n "$osk_conf" ] && copy_files "$osk_conf" "$tmpdir_extra"
create_cpio_image "$tmpdir_extra" "$tmpdir_extra_cpio_img"
rm -rf "$tmpdir_extra"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment