Skip to content

ci: bundle ccid drivers for keycard usb support #18196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siddarthkay
Copy link
Contributor

Summary

  • attempt to bundle ccid usb drivers for usb support in keycard.

@siddarthkay siddarthkay self-assigned this Jun 20, 2025
@siddarthkay siddarthkay requested review from a team as code owners June 20, 2025 05:30
@siddarthkay siddarthkay linked an issue Jun 20, 2025 that may be closed by this pull request
@siddarthkay siddarthkay requested review from iurimatias and removed request for a team June 20, 2025 05:30
@status-im-auto
Copy link
Member

status-im-auto commented Jun 20, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 3f812b0 #1 2025-06-20 05:38:31 ~7 min tests/nim 📄log
3f812b0 #1 2025-06-20 05:38:34 ~8 min linux/x86_64 📄log
✔️ 3f812b0 #1 2025-06-20 05:40:29 ~9 min macos/aarch64 🍎dmg
✔️ 3f812b0 #1 2025-06-20 05:42:41 ~12 min tests/ui 📄log
✔️ f5d5620 #2 2025-06-20 05:48:33 ~5 min macos/aarch64 🍎dmg
✔️ f5d5620 #2 2025-06-20 05:50:51 ~8 min tests/nim 📄log
✔️ f5d5620 #2 2025-06-20 05:55:27 ~12 min tests/ui 📄log
✔️ f5d5620 #2 2025-06-20 05:58:15 ~15 min linux/x86_64 📦tgz
✔️ f5d5620 #2 2025-06-20 06:06:18 ~23 min windows/x86_64 💿exe
✔️ f5d5620 #2 2025-06-20 06:06:38 ~23 min macos/x86_64 🍎dmg

@siddarthkay siddarthkay force-pushed the 18149-keycard-not-detected branch from 3f812b0 to f5d5620 Compare June 20, 2025 05:42
Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate everything about scripts/init_app_dir.sh.

Comment on lines 98 to +112
&& cd builddir \
&& ninja \
&& ninja install \
&& cd /tmp \
&& wget https://ccid.apdu.fr/files/ccid-1.6.2.tar.xz \
&& tar -xJf ccid-1.6.2.tar.xz \
&& cd ccid-1.6.2 \
&& meson setup builddir \
--prefix=/usr \
&& cd builddir \
&& meson compile \
&& meson install \
&& ldconfig \
&& cd / \
&& rm -rf /tmp/pcsc-lite* \
&& rm -rf /tmp/pcsc-lite* /tmp/ccid* \
Copy link
Member

@jakubgs jakubgs Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we mixing build steps into installation step? What is this clusterfuck?


# Debug: Check if drivers are present
echo "Checking for CCID drivers in ${APPDIR}/usr/lib/pcsc/drivers:"
ls -la "${APPDIR}/usr/lib/pcsc/drivers/" || echo "No drivers directory found"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this PR to get more info from failure in frank's system

else
mkdir -p "${APP_DIR}"/usr/lib/{gstreamer1.0,gstreamer-1.0,nss}
mkdir -p "${APP_DIR}"/usr/libexec

echo "${GST_PLUGIN_SYSTEM_PATH_1_0}" | tr ':' '\n' | sort -u | xargs -I {} find {} -name "*.so" | xargs -I {} cp {} "${APP_DIR}/usr/lib/gstreamer-1.0/"
echo "${GST_PLUGIN_SYSTEM_PATH_1_0}" | tr ':' '\n' | sort -u | xargs -I {} find {} -name "*.so" | grep -v "\.so\." | xargs -I {} cp {} "${APP_DIR}/usr/lib/gstreamer-1.0/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? Why are we first using -name "*.so" in find and then using grep -v "\.so\."?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is a mistake, i will revert

Comment on lines +56 to +66
if [ -d "/usr/lib/pcsc/drivers" ]; then
cp -r /usr/lib/pcsc/drivers/* "${APP_DIR}/usr/lib/pcsc/drivers/"
echo "CCID drivers copied successfully"
ls -la "${APP_DIR}/usr/lib/pcsc/drivers/"
else
echo "No CCID drivers found at /usr/lib/pcsc/drivers"
fi

if [ -f "/usr/lib/x86_64-linux-gnu/libccid.so" ]; then
cp -L /usr/lib/x86_64-linux-gnu/libccid.so* "${APP_DIR}/usr/lib/" || true
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in if clauses? Shouldn't it fail if it can't find them?

@siddarthkay siddarthkay marked this pull request as draft June 20, 2025 09:07
@siddarthkay
Copy link
Contributor Author

I didn't make this PR for review yet, made it to get a build and to test ccid drivers bundling.
I've converted to draft.

@jrainville
Copy link
Member

I just tried the Linux build and I still have these logs at the top

mkdir: /tmp/.mount_StatushKZKEF/usr/lib/libselinux.so.1: no version information available (required by mkdir)
Checking for CCID drivers in /tmp/.mount_StatushKZKEF/usr/lib/pcsc/drivers:
ls: /tmp/.mount_StatushKZKEF/usr/lib/libselinux.so.1: no version information available (required by ls)
total 0
drwxr-xr-x 3 root root 0 Jun 20 01:52 ifd-ccid.bundle
starting pcscd with /tmp/.mount_StatushKZKEF/usr/bin/pcscd -f &
00000000 [126577184982976] ../src/ccid_usb.c:740:OpenUSBByName() Can't claim interface 3/5: LIBUSB_ERROR_BUSY
00000465 [126577184982976] ../src/ifdhandler.c:139:CreateChannelByNameOrChannel() failed
00000003 [126577184982976] ../src/readerfactory.c:1132:RFInitializeReader() Open Port 0x200000 Failed (usb:058f/9540:libudev:0:/dev/bus/usb/003/005)
00000002 [126577184982976] ../src/readerfactory.c:371:RFAddReader() Alcor Micro AU9540 init failed.
00000030 [126577184982976] ../src/hotplug_libudev.c:517:HPAddDevice() Failed adding USB device: Alcor Micro AU9540

and it doesn't detect my reader:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keycard not detected
4 participants