-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workaround: postinst has been hardcoded due to config.txt edition issue
- Loading branch information
1 parent
0010caf
commit 8e0f8a9
Showing
2 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ pipeline: | |
commands: | ||
- curl https://apt.matrix.one/doc/apt-key.gpg | apt-key add - | ||
- echo "deb https://apt.matrix.one/raspbian ${CODENAME} main" > /etc/apt/sources.list.d/matrixlabs.list | ||
- apt install -y dkms | ||
- ${UPDATE_CMD} | ||
- debuild -us -uc -b | ||
- mv ../*.deb . | ||
|
@@ -31,16 +32,16 @@ pipeline: | |
secrets: [aws_access_key_id, aws_secret_access_key, gpg_key, gpg_pass] | ||
commands: | ||
# Prepare GPG | ||
- echo "$${GPG_KEY}" > /tmp/tmpkey && gpg --import /tmp/tmpkey && rm /tmp/tmpkey | ||
- echo "$${GPG_KEY}" > /tmp/tmpkey && gpg --import --batch /tmp/tmpkey && rm /tmp/tmpkey | ||
- echo "personal-digest-preferences SHA512" >> /root/.gnupg/gpg.conf | ||
|
||
# Only TAG events are published to main | ||
- export COMPONENT=$([ "${DRONE_BUILD_EVENT}" = "tag" ] && echo "main" || echo "unstable") | ||
- export PKG_VER=$(dpkg-parsechangelog --show-field Version -ldebian/changelog) | ||
|
||
# Upload packages | ||
- mv matrixio-kernel-modules_$${PKG_VER}_armhf.deb | ||
matrixio-kernel-modules_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_armhf.deb | ||
- mv matrixio-kernel-modules_$${PKG_VER}_all.deb | ||
matrixio-kernel-modules_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_all.deb | ||
|
||
- echo "$${GPG_PASS}" | deb-s3 upload --bucket apt.matrix.one | ||
--prefix $DISTRIBUTION | ||
|
@@ -50,7 +51,7 @@ pipeline: | |
--secret-access-key $${AWS_SECRET_ACCESS_KEY} | ||
--sign [email protected] | ||
--gpg-options="--batch --passphrase-fd 0" | ||
matrixio-kernel-modules_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_armhf.deb | ||
matrixio-kernel-modules_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_all.deb | ||
|
||
# Render the notification template for the notify-slack step | ||
- j2 --var-delimiter '%%' .drone/slack.tpl > notification.tpl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
DKMS_NAME=matrixio-kernel-modules | ||
DKMS_PACKAGE_NAME=$DKMS_NAME-dkms | ||
DKMS_VERSION=0.2.1 | ||
|
||
postinst_found=0 | ||
|
||
case "$1" in | ||
configure) | ||
for DKMS_POSTINST in /usr/lib/dkms/common.postinst /usr/share/$DKMS_PACKAGE_NAME/postinst; do | ||
if [ -f $DKMS_POSTINST ]; then | ||
$DKMS_POSTINST $DKMS_NAME $DKMS_VERSION /usr/share/$DKMS_PACKAGE_NAME "" $2 | ||
postinst_found=1 | ||
break | ||
fi | ||
done | ||
if [ "$postinst_found" -eq 0 ]; then | ||
echo "ERROR: DKMS version is too old and $DKMS_PACKAGE_NAME was not" | ||
echo "built with legacy DKMS support." | ||
echo "You must either rebuild $DKMS_PACKAGE_NAME with legacy postinst" | ||
echo "support or upgrade DKMS to a more current version." | ||
exit 1 | ||
else | ||
echo "Enable configurations in /boot/config.txt" | ||
cp /boot/config.txt /boot/config.txt.matrixio.bk \ | ||
&& /usr/share/matrixlabs/matrixio-devices/matrixlabs_edit_settings.py \ | ||
/boot/config.txt.matrixio.bk \ | ||
/usr/share/matrixlabs/matrixio-devices/config/kernel_modifications.txt > /boot/config.txt | ||
fi | ||
;; | ||
esac | ||
|