Package: depthcharge-tools
Version: 0.6.2-5
Severity: normal
Tags: patch upstream d-i
Control: found -1 0.6.1-1
X-Debbugs-CC: [email protected]

Images built with `depthchargectl build --board amd64-generic` including
the trixie d-i depthcharge images e.g. [1] do not work on a Thinkpad C13
Yoga Chromebook ("Morphius"), a model with an AMD Ryzen 3500C CPU.

Depthcharge-tools manually edits the x86 kernel binary to tell it the
memory location where the initramfs will end up getting loaded as part
of a signed image, to achieve initramfs support despite the bootloader
not explicitly supporting it. I had assumed this address of the signed
image is the same 1MiB for all x86 boards, but apparently it's not for
the newer AMD boards (Picasso, Cezanne, Mendocino, Phoenix) where it's
64MiB.

Attached is a patch series I'm considering applying upstream. These
split the "amd64-generic" pseudo-board into amd64-generic-{1M,64M} for
the two configurations. Correspondingly, we'd also need to generate two
x86 d-i depthcharge images to support the recent AMD boards.

[1] 
https://deb.debian.org/debian/dists/trixie/main/installer-amd64/current/images/netboot/depthcharge/


-- System Information:
Debian Release: forky/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64, armhf, i386

Kernel: Linux 7.1.8+deb14.1-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages depthcharge-tools depends on:
ii  cgpt                  0~R106-15054.B+dfsg-0.1
ii  device-tree-compiler  1.7.2-2+b3
ii  linux-base            4.16
ii  lz4                   1.10.0-10
ii  python3               3.13.9-3+b1
ii  python3-packaging     26.2-2
ii  u-boot-tools          2025.01-3.2
ii  vboot-kernel-utils    0~R106-15054.B+dfsg-0.1
ii  vboot-utils           0~R106-15054.B+dfsg-0.1
ii  xz-utils              5.8.3-1

depthcharge-tools recommends no packages.

Versions of packages depthcharge-tools suggests:
ii  bzip2  1.0.8-6+b2
ii  lzop   1.04-2
ii  zstd   1.5.7+dfsg-4

-- no debconf information
From 99c1ba8798e39f0dfdb5f13b29085bdb776ec0fe Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <[email protected]>
Date: Thu, 9 Jul 2026 11:23:08 +0300
Subject: [PATCH 1/4] boards.ini: Add correct start address for recent AMD
 boards

On the depthcharge repo, running the following command shows that recent
AMD boards tend to have their kernel start address shifted because of
their coreboot layout:

  $ git grep -B1 "CONFIG_KERNEL_START" \
      $(git grep CONFIG_ARCH_X86 configs | cut -d: -f1)
  [...]
  configs/config.zork-# Picasso uses 32 MiB + ~2 MiB for coreboot so place the kernel at 64 MiB
  configs/config.zork:CONFIG_KERNEL_START=0x4000000

Set the image-start-address value to 64MiB for the affected Picasso,
Cezanne, Mendocino, and Phoenix (not yet in boards.ini) boards. Tested
on a Thinkpad C13 Yoga Chromebook ("Morphius").

Unfortunately, this also means we can't pretend to have "amd64-generic"
which works on all Chromebooks anymore, which will be handled in other
commits.

Signed-off-by: Alper Nebi Yasak <[email protected]>
---
 depthcharge_tools/boards.ini | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/depthcharge_tools/boards.ini b/depthcharge_tools/boards.ini
index 21fb70dc0c51..2e196d27a10c 100644
--- a/depthcharge_tools/boards.ini
+++ b/depthcharge_tools/boards.ini
@@ -811,6 +811,7 @@ name = Lenovo ThinkCentre Chromebox
 
 [boards/amd64/cezanne]
 codename = chipset-cezanne
+image-start-address = 0x4000000
 
 [boards/amd64/cezanne/guybrush]
 codename = guybrush
@@ -1867,6 +1868,7 @@ name = ASUS Chromebook Flip C434
 
 [boards/amd64/mendocino]
 codename = chipset-mendocino
+image-start-address = 0x4000000
 
 [boards/amd64/mendocino/skyrim]
 codename = skyrim
@@ -1887,6 +1889,7 @@ name = Dell Latitude 3445 Chromebook
 
 [boards/amd64/picasso]
 codename = chipset-picasso
+image-start-address = 0x4000000
 
 [boards/amd64/picasso/zork]
 codename = zork

base-commit: 95d17c444ae3a9dec1c51ead6301ed04777314b9
-- 
2.55.0


From dcd88846cee488f76b644261139a1e0012009833 Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <[email protected]>
Date: Fri, 21 Aug 2026 22:51:23 +0300
Subject: [PATCH 2/4] boards.ini: Remove image-start-address from amd64-generic

Since "amd64-generic" is proven to not work for recent AMD boards
(Picasso, Cezanne, Mendocino, Phoenix) because the CONFIG_KERNEL_START
is different on those, move the related image-start-address config into
the chipset sections.

This means trying to build for "amd64-generic" will start failing
because the value is not given, which is sad but correct behaviour.

Signed-off-by: Alper Nebi Yasak <[email protected]>
---
 depthcharge_tools/boards.ini | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/depthcharge_tools/boards.ini b/depthcharge_tools/boards.ini
index 2e196d27a10c..bdfdd9105bb8 100644
--- a/depthcharge_tools/boards.ini
+++ b/depthcharge_tools/boards.ini
@@ -33,11 +33,11 @@
 arch = amd64
 codename = amd64-generic
 loads-zimage-ramdisk = False
-image-start-address = 0x100000
 image-format = zimage
 
 [boards/amd64/alderlake]
 codename = chipset-adl
+image-start-address = 0x100000
 
 [boards/amd64/alderlake/brya]
 codename = brya
@@ -160,6 +160,7 @@ name = Acer Chromebook Vero 712 (CV872, CV872T)
 
 [boards/amd64/alderlake-n]
 codename = chipset-adln
+image-start-address = 0x100000
 
 [boards/amd64/alderlake-n/nissa]
 codename = nissa
@@ -220,6 +221,7 @@ name = HP Chromebook 15.6”
 
 [boards/amd64/apollolake]
 codename = chipset-apl
+image-start-address = 0x100000
 
 [boards/amd64/apollolake/coral]
 codename = coral
@@ -437,6 +439,7 @@ name = HP Chromebook x360 11 G1 EE
 
 [boards/amd64/baytrail]
 codename = chipset-byt
+image-start-address = 0x100000
 
 [boards/amd64/baytrail/rambi]
 codename = rambi
@@ -603,6 +606,7 @@ name = Samsung Chromebook 2 11" - XE500C12
 
 [boards/amd64/braswell]
 codename = chipset-bsw
+image-start-address = 0x100000
 
 [boards/amd64/braswell/strago]
 codename = strago
@@ -746,6 +750,7 @@ name = Viglen Chromebook 360
 
 [boards/amd64/broadwell]
 codename = chipset-bdw
+image-start-address = 0x100000
 
 [boards/amd64/broadwell/auron]
 codename = auron
@@ -829,6 +834,7 @@ name = HP Elite c645 G2 Chromebook
 
 [boards/amd64/cometlake]
 codename = chipset-cml
+image-start-address = 0x100000
 
 [boards/amd64/cometlake/drallion]
 codename = drallion
@@ -971,6 +977,7 @@ name = Wyvern MobLab
 
 [boards/amd64/geminilake]
 codename = chipset-glk
+image-start-address = 0x100000
 
 [boards/amd64/geminilake/octopus]
 codename = octopus
@@ -1327,6 +1334,7 @@ name = Chromebook x360 11 G3 EE
 
 [boards/amd64/haswell]
 codename = chipset-hsw
+image-start-address = 0x100000
 
 [boards/amd64/haswell/beltino]
 codename = beltino
@@ -1394,6 +1402,7 @@ name = Dell Chromebook 11
 
 [boards/amd64/ivybridge]
 codename = chipset-ivb
+image-start-address = 0x100000
 
 [boards/amd64/ivybridge/link]
 codename = link
@@ -1415,6 +1424,7 @@ name = Lenovo Thinkpad X131e Chromebook
 
 [boards/amd64/jasperlake]
 codename = chipset-jsl
+image-start-address = 0x100000
 
 [boards/amd64/jasperlake/dedede]
 codename = dedede
@@ -1672,6 +1682,7 @@ name = ASUS Chromebook Flip CR1100 (CR1100FKA)
 
 [boards/amd64/kabylake]
 codename = chipset-kbl
+image-start-address = 0x100000
 
 [boards/amd64/kabylake/fizz]
 codename = fizz
@@ -1953,6 +1964,7 @@ name = ASUS Chromebook Flip CM5
 
 [boards/amd64/pinetrail]
 codename = chipset-pinetrail
+image-start-address = 0x100000
 
 [boards/amd64/pinetrail/alex]
 codename = alex
@@ -1991,6 +2003,7 @@ name = Chrome OS Flex
 
 [boards/amd64/sandybridge]
 codename = chipset-snb
+image-start-address = 0x100000
 
 [boards/amd64/sandybridge/butterfly]
 codename = butterfly
@@ -2018,6 +2031,7 @@ name = Samsung Chromebox Series 3
 
 [boards/amd64/skylake]
 codename = chipset-skl
+image-start-address = 0x100000
 
 [boards/amd64/skylake/glados]
 codename = glados
@@ -2065,6 +2079,7 @@ name = Lenovo ThinkPad 13
 
 [boards/amd64/stoneyridge]
 codename = chipset-stnyridge
+image-start-address = 0x100000
 
 [boards/amd64/stoneyridge/grunt]
 codename = grunt
@@ -2124,6 +2139,7 @@ name = NEC Chromebook Y1 Gen2A
 
 [boards/amd64/tigerlake]
 codename = chipset-tgl
+image-start-address = 0x100000
 
 [boards/amd64/tigerlake/volteer]
 codename = volteer
@@ -2208,6 +2224,7 @@ name = Acer Chromebook 514 (CB514-1W, CB514-1WT)
 
 [boards/amd64/whiskeylake]
 codename = chipset-whl
+image-start-address = 0x100000
 
 [boards/amd64/whiskeylake/sarien]
 codename = sarien
-- 
2.55.0


From 9a0f9100ce50f67a8e970293663e074d56c6ffa9 Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <[email protected]>
Date: Sat, 22 Aug 2026 09:25:39 +0300
Subject: [PATCH 3/4] boards.ini: Replace amd64-generic with two models for
 start address

Recent AMD boards have 64MiB as image-start-address, so we unset it from
the amd64-generic board which became therefore unbuildable. Technically,
we can still have two almost-generic images that cover existing cases,
but now have to specify any Intel board and an AMD board by name to
build them. But that doesn't convey that the images can be run on many
boards.

Instead, add "amd64-generic-1M" and "amd64-generic-64M" boards that
cover our almost-generic cases, replacing the initial "amd64-generic".
Trying to build for amd64-generic will fail with an error that the board
name is ambiguous and point the user towards the new names.

We have been able to use "amd64" as a shortcut for "amd64-generic".
Removing the codename causes an error so set a "amd64" codename. This
will also unfortunately continue to use the 1MiB default set in
mkdepthcharge, a future commit will change not specifying a start
address to an error.

It's still possible that we manage to implement a generic way to boot
both cases, like a chainloader or something, so I'm leaning to keep the
original section.

Signed-off-by: Alper Nebi Yasak <[email protected]>
---
 depthcharge_tools/boards.ini | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/depthcharge_tools/boards.ini b/depthcharge_tools/boards.ini
index bdfdd9105bb8..d2f35e8fd0b2 100644
--- a/depthcharge_tools/boards.ini
+++ b/depthcharge_tools/boards.ini
@@ -31,10 +31,20 @@
 
 [boards/amd64]
 arch = amd64
-codename = amd64-generic
+codename = amd64
 loads-zimage-ramdisk = False
 image-format = zimage
 
+[boards/amd64/1M]
+codename = amd64-generic-1M
+image-start-address = 0x100000
+name = Intel boards and older AMD boards
+
+[boards/amd64/64M]
+codename = amd64-generic-64M
+image-start-address = 0x4000000
+name = AMD boards since Picasso
+
 [boards/amd64/alderlake]
 codename = chipset-adl
 image-start-address = 0x100000
-- 
2.55.0


From 8a0fa6a8046f800042aefa0d832df0d6a88e48d9 Mon Sep 17 00:00:00 2001
From: Alper Nebi Yasak <[email protected]>
Date: Fri, 21 Aug 2026 23:11:10 +0300
Subject: [PATCH 4/4] mkdepthcharge: Remove default kernel-start for x86

Now that we know recent AMD boards have 64MiB as CONFIG_KERNEL_START
address, we can't safely assume it's 1MiB when running mkdepthcharge for
x86. Remove the default option value. Instead add an error when trying
to build a zimage without it that points out these usual two values.

Signed-off-by: Alper Nebi Yasak <[email protected]>
---
 depthcharge_tools/mkdepthcharge.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/depthcharge_tools/mkdepthcharge.py b/depthcharge_tools/mkdepthcharge.py
index 875f0cff290e..7d35bb539f3e 100644
--- a/depthcharge_tools/mkdepthcharge.py
+++ b/depthcharge_tools/mkdepthcharge.py
@@ -389,9 +389,6 @@ def kernel_start(self, addr=None):
         if addr is not None:
             return parse_bytesize(addr)
 
-        if self.arch in Architecture.x86:
-            return 0x100000
-
     @options.add
     @Argument(
         "--no-pad-vmlinuz", pad=False,
@@ -954,6 +951,12 @@ def subimage_by_type(fit_image, subimage_type):
             self.logger.info(proc.stdout)
 
         elif self.image_format == "zimage":
+            if not isinstance(self.kernel_start, int):
+                raise ValueError(
+                    "Can't build zimage without kernel start address, "
+                    "usually either 0x100000 or 0x4000000."
+                )
+
             # bzImage header has the address the kernel will decompress
             # to, and the amount of memory it needs there to work.
             # See Documentation/x86/boot.rst in Linux tree for offsets.
-- 
2.55.0

Reply via email to