Skip to content

Instantly share code, notes, and snippets.

View data.md

Timings are represented as <extract> + <install> where:

  • <extract> - time in seconds to untar/gunzip the tar or img.gz file, and store the resulting content
  • <install> - time in seconds to copy SYSTEM, KERNEL and - for RPi - bootloader files to /flash

The RPi3+ <extract> and <install> times are highly variable when writing to /flash and /storage, which may suggest an issue with my RPi3+ hardware, SD card, or a kernel/driver bug (or some combination of all three). The total time to upgrade the RPi3+ via tar file can vary by as much as 80 seconds. We don't see this issue when extacting to tmpfs, but it is seen when installing to /flash, which might suggest a performance issue when writing to the SD card.

We currently use dd with bs=1M (and conv=fsync) to transfer data to /flash, I wonder if we can do better here - something for later.


View ACPI_PCI_SPI.patch
diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf
--- a/projects/Generic/linux/linux.x86_64.conf
+++ b/projects/Generic/linux/linux.x86_64.conf
@@ -1312,6 +1312,7 @@
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_SPI=y
CONFIG_DMA_SHARED_BUFFER=y
# CONFIG_DMA_FENCE_TRACE is not set
View CONFIG_MFD_INTEL_LPSS_ACPI_PCI.patch
diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf
--- a/projects/Generic/linux/linux.x86_64.conf
+++ b/projects/Generic/linux/linux.x86_64.conf
@@ -2852,8 +2852,9 @@
# CONFIG_INTEL_SOC_PMIC is not set
# CONFIG_INTEL_SOC_PMIC_CHTWC is not set
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
-# CONFIG_MFD_INTEL_LPSS_ACPI is not set
-# CONFIG_MFD_INTEL_LPSS_PCI is not set
+CONFIG_MFD_INTEL_LPSS=y
View CONFIG_MFD_INTEL_LPSS_PCI.patch
diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf
--- a/projects/Generic/linux/linux.x86_64.conf
+++ b/projects/Generic/linux/linux.x86_64.conf
@@ -2852,8 +2852,9 @@
# CONFIG_INTEL_SOC_PMIC is not set
# CONFIG_INTEL_SOC_PMIC_CHTWC is not set
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
+CONFIG_MFD_INTEL_LPSS=y
# CONFIG_MFD_INTEL_LPSS_ACPI is not set
-# CONFIG_MFD_INTEL_LPSS_PCI is not set
View CONFIG_MFD_INTEL_LPSS_ACPI.patch
diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf
--- a/projects/Generic/linux/linux.x86_64.conf
+++ b/projects/Generic/linux/linux.x86_64.conf
@@ -2852,7 +2852,8 @@
# CONFIG_INTEL_SOC_PMIC is not set
# CONFIG_INTEL_SOC_PMIC_CHTWC is not set
# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set
-# CONFIG_MFD_INTEL_LPSS_ACPI is not set
+CONFIG_MFD_INTEL_LPSS=y
+CONFIG_MFD_INTEL_LPSS_ACPI=y
View functions
setup_toolchain() {
if [ "$LTO_SUPPORT" = "yes" ]; then
if flag_enabled "lto-fat" "no"; then
TARGET_CFLAGS+=" $CFLAGS_OPTIM_LTO"
TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_LTO"
if flag_enabled "lto-parallel" "no"; then
TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_LTO_PARALLEL"
else
TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_LTO"
fi
View package.mk
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
View kmigrate.sh
#!/bin/bash
CONFIG=/flash/extlinux/extlinux.conf
if grep -qE "BOOT_IMAGE=" /proc/cmdline; then
echo "Unable to migrate - this installation is still using the BOOT_IMAGE= parameter"
elif [ -f ${CONFIG} ] && grep -qE "^ LINUX /(Image|zImage)$" ${CONFIG}; then
mount -o remount,rw /flash
[ -f /flash/Image ] && mv /flash/Image /flash/KERNEL
[ -f /flash/zImage ] && mv /flash/zImage /flash/KERNEL
View image.patch
diff --git a/scripts/image b/scripts/image
old mode 100755
new mode 100644
index 8859eca..9f01d36
--- a/scripts/image
+++ b/scripts/image
@@ -38,18 +38,21 @@ $SCRIPTS/build kmod:host
$SCRIPTS/build mtools:host
$SCRIPTS/build populatefs:host
View gist:7c4c265c102162b3b3b7cca9aeed2fa9
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,