From 1014d69454825cc984bccbd07b588a311ec95f91 Mon Sep 17 00:00:00 2001 From: Elias Bakken Date: Sun, 26 May 2024 00:40:35 +0200 Subject: [PATCH] Klipper PR has been accepted, remove local patch. Small fudge to Kconfig added. Also add Rebuild version to PRETTY_NAME --- armbian/customize-image-barebone.sh | 3 ++ rebuild.sh | 1 + .../overlay/install_components/klipper.sh | 5 ++- .../overlay/install_components/post_build.sh | 3 ++ userpatches/overlay/klipper/enable-i2c.patch | 43 ------------------- userpatches/overlay/klipper/stm32f0.config | 17 -------- .../klipper/stm32f031-32KB-serial.config | 1 - .../overlay/klipper/stm32f031-serial.config | 7 ++- 8 files changed, 15 insertions(+), 65 deletions(-) delete mode 100644 userpatches/overlay/klipper/enable-i2c.patch delete mode 100644 userpatches/overlay/klipper/stm32f0.config diff --git a/armbian/customize-image-barebone.sh b/armbian/customize-image-barebone.sh index c41003d..b5b816f 100644 --- a/armbian/customize-image-barebone.sh +++ b/armbian/customize-image-barebone.sh @@ -28,6 +28,9 @@ post_build() { cp /tmp/overlay/rebuild/rebuild-version /etc/ apt update apt install -y "$ADD_PACKAGE_LIST" + + TAG=$(cat /tmp/overlay/rebuild/rebuild-tag) + sed -i "s/PRETTY_NAME=\"/PRETTY_NAME=\"Rebuild ${TAG}\//" /etc/os-release } prep_install() { diff --git a/rebuild.sh b/rebuild.sh index 69a9574..6ddcbb3 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -67,6 +67,7 @@ cp armbian/watermark.png "${BUILD_DIR}"/packages/plymouth-theme-armbian/watermar mkdir -p "${BUILD_DIR}"/userpatches/overlay/rebuild/ echo "${NAME}" >"${BUILD_DIR}"/userpatches/overlay/rebuild/rebuild-version +echo "${TAG}" >"${BUILD_DIR}"/userpatches/overlay/rebuild/rebuild-tag cd "$BUILD_DIR" DOCKER_EXTRA_ARGS="--cpus=${cores}" ./compile.sh rebuild diff --git a/userpatches/overlay/install_components/klipper.sh b/userpatches/overlay/install_components/klipper.sh index 7b5e250..8d3dedd 100644 --- a/userpatches/overlay/install_components/klipper.sh +++ b/userpatches/overlay/install_components/klipper.sh @@ -5,6 +5,9 @@ install_klipper(){ echo "🍰 install Klipper" cd /home/debian git clone https://github.com/Klipper3d/klipper + + sed -i 's/select HAVE_GPIO_I2C if !MACH_STM32F031/select HAVE_GPIO_I2C/' klipper/src/stm32/Kconfig + cp /tmp/overlay/klipper/install-recore.sh /home/debian/klipper/scripts/ cp /tmp/overlay/klipper/generic-recore-a6.cfg /home/debian/klipper/config/ cp /tmp/overlay/klipper/generic-recore-a7.cfg /home/debian/klipper/config/ @@ -49,8 +52,6 @@ install_klipper(){ cp /home/debian/klipper/out/klipper.bin /opt/firmware/stm32.bin # Compile STM32-32KB - cp /tmp/overlay/klipper/enable-i2c.patch /home/debian/klipper/ - patch -p1 < enable-i2c.patch cp /tmp/overlay/klipper/stm32f031-32KB-serial.config /home/debian/klipper/.config make clean make olddefconfig diff --git a/userpatches/overlay/install_components/post_build.sh b/userpatches/overlay/install_components/post_build.sh index 3622bd8..db78616 100644 --- a/userpatches/overlay/install_components/post_build.sh +++ b/userpatches/overlay/install_components/post_build.sh @@ -22,4 +22,7 @@ post_build() { # Force debian to change password # Must be done as a final step chage -d 0 debian + + TAG=$(cat /tmp/overlay/rebuild/rebuild-tag) + sed -i "s/PRETTY_NAME=\"/PRETTY_NAME=\"Rebuild ${TAG}\//" /etc/os-release } \ No newline at end of file diff --git a/userpatches/overlay/klipper/enable-i2c.patch b/userpatches/overlay/klipper/enable-i2c.patch deleted file mode 100644 index 1cdc542..0000000 --- a/userpatches/overlay/klipper/enable-i2c.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/src/stm32/Kconfig b/src/stm32/Kconfig -index e3961176..66363170 100644 ---- a/src/stm32/Kconfig -+++ b/src/stm32/Kconfig -@@ -7,7 +7,7 @@ config STM32_SELECT - default y - select HAVE_GPIO - select HAVE_GPIO_ADC -- select HAVE_GPIO_I2C if !MACH_STM32F031 -+ select HAVE_GPIO_I2C - select HAVE_GPIO_SPI if !MACH_STM32F031 - select HAVE_GPIO_SDIO if MACH_STM32F4 - select HAVE_GPIO_HARD_PWM if MACH_STM32F1 || MACH_STM32F4 || MACH_STM32F7 || MACH_STM32G0 || MACH_STM32H7 -@@ -206,7 +206,7 @@ config CLOCK_FREQ - - config FLASH_SIZE - hex -- default 0x4000 if MACH_STM32F031 -+ default 0x8000 if MACH_STM32F031 - default 0x8000 if MACH_STM32F042 - default 0x20000 if MACH_STM32F070 || MACH_STM32F072 - default 0x10000 if MACH_STM32F103 || MACH_STM32L412 # Flash size of stm32f103x8 (64KiB) -diff --git a/src/stm32/stm32f0_i2c.c b/src/stm32/stm32f0_i2c.c -index e9cadccb..0157bd32 100644 ---- a/src/stm32/stm32f0_i2c.c -+++ b/src/stm32/stm32f0_i2c.c -@@ -22,6 +22,8 @@ struct i2c_info { - DECL_CONSTANT_STR("BUS_PINS_i2c1_PF1_PF0", "PF1,PF0"); - DECL_ENUMERATION("i2c_bus", "i2c1_PB8_PB9", 2); - DECL_CONSTANT_STR("BUS_PINS_i2c1_PB8_PB9", "PB8,PB9"); -+ DECL_ENUMERATION("i2c_bus", "i2c1_PB7_PB8", 3); -+ DECL_CONSTANT_STR("BUS_PINS_i2c1_PB7_PB8", "PB7,PB8"); - // Deprecated "i2c1a" style mappings - DECL_ENUMERATION("i2c_bus", "i2c1", 0); - DECL_CONSTANT_STR("BUS_PINS_i2c1", "PB6,PB7"); -@@ -89,6 +91,7 @@ static const struct i2c_info i2c_bus[] = { - { I2C1, GPIO('B', 6), GPIO('B', 7), GPIO_FUNCTION(1) }, - { I2C1, GPIO('F', 1), GPIO('F', 0), GPIO_FUNCTION(1) }, - { I2C1, GPIO('B', 8), GPIO('B', 9), GPIO_FUNCTION(1) }, -+ { I2C1, GPIO('B', 7), GPIO('B', 8), GPIO_FUNCTION(1) }, - #elif CONFIG_MACH_STM32F7 - { I2C1, GPIO('B', 6), GPIO('B', 7), GPIO_FUNCTION(1) }, - #elif CONFIG_MACH_STM32G0 diff --git a/userpatches/overlay/klipper/stm32f0.config b/userpatches/overlay/klipper/stm32f0.config deleted file mode 100644 index 7df91aa..0000000 --- a/userpatches/overlay/klipper/stm32f0.config +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG_LOW_LEVEL_OPTIONS=y -CONFIG_MACH_STM32=y -CONFIG_MACH_STM32F031=y -CONFIG_STM32_FLASH_START_0000=y -CONFIG_STM32_CLOCK_REF_INTERNAL=y -CONFIG_CLOCK_REF_FREQ=1 -CONFIG_STM32F0_TRIM=16 -CONFIG_STM32_SERIAL_USART2_ALT_PA15_PA14=y -CONFIG_SERIAL_BAUD=250000 -CONFIG_HAVE_GPIO=y -CONFIG_HAVE_GPIO_ADC=y -CONFIG_HAVE_STRICT_TIMING=y -CONFIG_HAVE_CHIPID=y -CONFIG_HAVE_STEPPER_BOTH_EDGE=y -CONFIG_INLINE_STEPPER_HACK=y -CONFIG_WANT_GPIO_BITBANGING=n -CONFIG_WANT_DISPLAYS=n diff --git a/userpatches/overlay/klipper/stm32f031-32KB-serial.config b/userpatches/overlay/klipper/stm32f031-32KB-serial.config index 7841450..dfdb558 100644 --- a/userpatches/overlay/klipper/stm32f031-32KB-serial.config +++ b/userpatches/overlay/klipper/stm32f031-32KB-serial.config @@ -1,7 +1,6 @@ # Base config file for STM32F031 boards with serial on PA14/PA15 CONFIG_MACH_STM32=y CONFIG_MACH_STM32F031=y -CONFIG_SERIAL=y CONFIG_STM32_FLASH_START_0000=y CONFIG_STM32_SERIAL_USART2_ALT_PA15_PA14=y CONFIG_STM32_CLOCK_REF_INTERNAL=y diff --git a/userpatches/overlay/klipper/stm32f031-serial.config b/userpatches/overlay/klipper/stm32f031-serial.config index 8a7131b..20e99e0 100644 --- a/userpatches/overlay/klipper/stm32f031-serial.config +++ b/userpatches/overlay/klipper/stm32f031-serial.config @@ -1,10 +1,13 @@ # Base config file for STM32F031 boards with serial on PA14/PA15 CONFIG_MACH_STM32=y CONFIG_MACH_STM32F031=y -CONFIG_SERIAL=y CONFIG_STM32_FLASH_START_0000=y -CONFIG_STM32_SERIAL_USART2_ALT_PA15_PA14=y CONFIG_STM32_CLOCK_REF_INTERNAL=y CONFIG_LOW_LEVEL_OPTIONS=y +CONFIG_STM32_SERIAL_USART2_ALT_PA15_PA14=y +CONFIG_HAVE_GPIO=y CONFIG_WANT_GPIO_BITBANGING=n CONFIG_WANT_DISPLAYS=n +CONFIG_WANT_SENSORS=n +CONFIG_WANT_LDC1612=n +CONFIG_WANT_SOFTWARE_I2C=n \ No newline at end of file