On 2022-12-12, Arnaud Ferraris wrote: > It is common practice for /boot to be on a separate partition, requiring DTBs > to be synced to this partition for u-boot to be able to access them.
Thanks for working on this! > From: Arnaud Ferraris <arnaud.ferra...@collabora.com> > Date: Mon, 12 Dec 2022 13:57:47 +0100 > Subject: [PATCH 1/2] u-boot-update: split config file reading to a separate > script > > The logic of reading the configuration file and determining whether > `/boot` is on a separate partition can be useful to other scripts, such > as the kernel postinst/postrm ones. This commit moves this code to a > separate, source-able script to make it more easily reusable. ... > debian/u-boot-menu.install | 1 + > read-config | 70 ++++++++++++++++++++++++++++++++++++++ > u-boot-update | 70 +------------------------------------- > 3 files changed, 72 insertions(+), 69 deletions(-) > create mode 100644 read-config Conceptually this change looks fine to me, though needs a bit of a refresh. > From: Arnaud Ferraris <arnaud.ferra...@collabora.com> > Date: Mon, 12 Dec 2022 14:14:27 +0100 > Subject: [PATCH 2/2] Allow to automatically sync DTBs when /boot is on a > separate partition > > Having `/boot` on a separate partition is a very common use-case, > requiring device tree binary files to be copied over to this partition > as `u-boot` won't be searching other partitions for those. > > Up until now, users had to manually copy (and potentially edit) the > provided `zz-sync-dtb` example script if their system was using a > separate `/boot` partition, which isn't practical. > > This patch implements a way to automate this synchronization process > in such cases, and remove the synchronized files when the corresponding > kernel is removed as well. Yay! > In order to maintain the current behaviour, this feature is disabled by > default and must be enabled by setting the `U_BOOT_SYNC_DTBS` > configuration variable to `true`. Mixed feelings on weather it should be guarded in the long-term, but that makes sense at least at when first introducing this... > diff --git a/debian/u-boot-menu.install b/debian/u-boot-menu.install > index 695129f..4816e32 100644 > --- a/debian/u-boot-menu.install > +++ b/debian/u-boot-menu.install > @@ -1,4 +1,4 @@ > -read-config usr/share/u-boot-menu > -u-boot-update usr/sbin > -zz-u-boot-menu etc/kernel/postinst.d > -zz-u-boot-menu etc/kernel/postrm.d > +read-config usr/share/u-boot-menu > +u-boot-update usr/sbin > +postinst/zz-u-boot-menu etc/kernel/postinst.d > +postrm/zz-u-boot-menu etc/kernel/postrm.d As mentioned, please minimize the whitespace differences on a rebase or refresh of this patch. > diff --git a/default b/default > index 2e29c83..21801b4 100644 > --- a/default > +++ b/default > @@ -13,4 +13,4 @@ > #U_BOOT_FDT_DIR="/usr/lib/linux-image-" > #U_BOOT_FDT_OVERLAYS="" > #U_BOOT_FDT_OVERLAYS_DIR="/boot/dtbo/" > - > +#U_BOOT_SYNC_DTBS="false" I almost wish to kill off /etc/default/u-boot entirely... all of the defaults are commented out and could instead be shipped in /usr/share/u-boot-menu/conf.d/default.conf rather than embedded in the u-boot-update script (or the new read-config snippet). > diff --git a/postinst/zz-u-boot-menu b/postinst/zz-u-boot-menu ... > diff --git a/postrm/zz-u-boot-menu b/postrm/zz-u-boot-menu Those looked reasonable at a quick glance. > diff --git a/u-boot-update.8 b/u-boot-update.8 > index 12852ee..3f47c1b 100644 > --- a/u-boot-update.8 > +++ b/u-boot-update.8 > @@ -111,7 +111,8 @@ The default is 50. > .IP "U_BOOT_FDT_DIR=""\fB/usr/lib/linux-image-\fR""" 4 > This variable specifies the unversioned stem of paths > where U\-BOOT should look for the flattened device tree binaries. > -Default is '/usr/lib/linux-image-'. > +Default is '/usr/lib/linux-image-', or '/dtb-' when u\-boot\-update > +detects /boot is on a separate partition. ... and the configuration has U_BOOT_SYNC_DTBS=true (described later)? E.g. it does not detect a /boot partition unless U_BOOT_SYNC_DTBS=true? So it seems at the very least it needs a refresh, but looking over it all it looks conceptually good. live well, vagrant
signature.asc
Description: PGP signature