Commit c9360035 authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge branch 'redpine-firmware' into 'master'

Redpine firmware

See merge request Librem5/kernel-builder!3
parents 95ce917b 81555dac
......@@ -16,6 +16,7 @@ node {
string(name: 'dot_config', defaultValue: "librem5-evk_defconfig", description: 'Which kernel config should get built?')
string(name: 'build_type', defaultValue: "latest", description: 'What type of build is this?')
string(name: 'publish', defaultValue: "false", description: 'Should the image get published?')
string(name: 'flash_pkg', defaultValue: "false", description: 'Build the firmware packages?')
string(name: 'MAKE_OPTS', defaultValue: "", description: 'extra make options')
}
......@@ -23,7 +24,11 @@ node {
git poll: true, url: gitUrl, branch: branch
}
stage('Build kernel') {
sh "KERNEL_REPO=${kernel_url} KERNEL_BRANCH=${kernel_branch} MAKE_OPTS=${MAKE_OPTS} DOT_CONFIG=${dot_config} ./build_kernel_deb.sh -b ${board}"
extra_args = ""
if( "${params.flash_pkg}"=="true" ) {
extra_args = "-r"
}
sh "KERNEL_REPO=${kernel_url} KERNEL_BRANCH=${kernel_branch} MAKE_OPTS=${MAKE_OPTS} DOT_CONFIG=${dot_config} ./build_kernel_deb.sh -b ${board} ${extra_args}"
}
stage('Publish') {
if( "${params.publish}"=="true" ) {
......
......@@ -22,7 +22,7 @@ COMPILER_ARCH=arm64
GIT_OPTS=(--depth 1)
DTS_FILE=""
RSI_VER=RS9116.NB0.NL.LNX.PURISM_FW_UPGRADE.1.0.5
KERNEL_VER=""
build_redpine () {
tar -xf "files/${RSI_VER}.tgz"
......@@ -32,10 +32,16 @@ build_redpine () {
sed "s/KERNELDIR=.*/KERNELDIR=${ESCAPED_KERNEL_DIR}/" -i "${RSI_BUILD_PATH}/Makefile"
mv "${CWD}/${RSI_VER}/Firmware/RS9116_NLINK_WLAN_BT_IMAGE.rps" "${CWD}/${RSI_VER}/Firmware/RS9116_NLINK_WLAN_BT_IMA
GE.HW1_1.rps"
cp files/RS9116_NLINK_WLAN_BT_IMAGE.rps "${CWD}/${RSI_VER}/Firmware/RS9116_NLINK_WLAN_BT_IMAGE.HW1_2.rps"
ln -s "RS9116_NLINK_WLAN_BT_IMAGE.HW1_2.rps" "${CWD}/${RSI_VER}/Firmware/RS9116_NLINK_WLAN_BT_IMAGE.rps"
cp files/update_redpine.sh "${CWD}/${RSI_VER}/Firmware/"
cd ${RSI_BUILD_PATH}
make -j "${NPROC}" "${MAKE_OPTS[@]}" ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILER}" -C "${CWD}/${LINUX_DIR}" M="$PWD" modules
cd "${CWD}/${RSI_BUILD_PATH}" && tar -cf "${OUTPUT_DIR}/rsi_upgrade.tar" ./*.ko
cd "${CWD}/${RSI_VER}/Firmware" && tar -cf "${OUTPUT_DIR}/rsi_firmware.tar" ./*
cd "${CWD}/${RSI_BUILD_PATH}" && tar -cf "${OUTPUT_DIR}/rsi_upgrade_${KERNEL_VER}.tar" ./*.ko
cd "${CWD}/${RSI_VER}/Firmware" && tar -cf "${OUTPUT_DIR}/rsi_firmware_${KERNEL_VER}.tar" ./*
cd "${CWD}"
}
......@@ -89,9 +95,9 @@ case ${pureos_board} in
DOT_CONFIG="${DOT_CONFIG:-emcraft-som-imx8_defconfig}"
;;
devkit)
KERNEL_BRANCH="${KERNEL_BRANCH:-imx8-4.18-wip}"
KERNEL_REPO="${KERNEL_REPO:-https://source.puri.sm/Librem5/linux-emcraft.git}"
DOT_CONFIG="${DOT_CONFIG:-librem5-evk_defconfig}"
KERNEL_BRANCH="${KERNEL_BRANCH:-imx8-5.2-devkit}"
KERNEL_REPO="${KERNEL_REPO:-https://source.puri.sm/Librem5/linux-next.git}"
DOT_CONFIG="${DOT_CONFIG:-librem5-devkit_defconfig}"
;;
\?)
echo "unrecognized board type ${pureos_board}"
......@@ -133,7 +139,8 @@ mkdir -p "${OUTPUT_DIR}"
mv "${CWD}"/*"${COMPILER_ARCH}".deb "${CWD}"/*.buildinfo "${CWD}"/*.changes "${OUTPUT_DIR}"
echo "${KERNEL_REPO}" > "${OUTPUT_DIR}/kernel-git-${ARCH}.txt"
git log | head -n 1 | awk '{ print $2 };' >> "${OUTPUT_DIR}/kernel-git-${ARCH}.txt"
KERNEL_VER=$(git log | head -n 1 | awk '{ print $2 };')
echo "${KERNEL_VER}" >> "${OUTPUT_DIR}/kernel-git-${ARCH}.txt"
cd "${CWD}"
......
#!/bin/bash
show_warning() {
echo "Redpine SDIO module $1 already loaded the upgrade will probably not work."
echo "If it does not please blacklist $1 in /etc/modprobe/librem5-devkit.conf"
echo "then reboot and try the upgrade again."
}
MODULES=$(lsmod | grep rsi_sdio)
if [ -z "${MODULES}" ]; then
show_warning $1
fi
MODULES=$(lsmod | grep redpine_sdio)
if [ -z "${MODULES}" ]; then
show_warning $1
fi
set -e
tar -xf rsi_firmware.tar
tar -xf rsi_upgrade.tar
mkdir -p /lib/firmware
cp RS9116_NLINK_WLAN_BT_IMAGE.HW1_2.rps /lib/firmware/RS9116_NLINK_WLAN_BT_IMAGE.rps
modprobe bluetooth
modprobe cfg80211
modprobe mac80211
modprobe rfkill
insmod ./rsi_91x.ko dev_oper_mode=13 rsi_zone_enabled=1
insmod ./rsi_sdio.ko
sleep 5
rm /lib/firmware/RS9116_NLINK_WLAN_BT_IMAGE.rps
echo "Please remove the blacklist and reboot now."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment