[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: android-style boot image support for flash-kernel



Dear Vagrant,

Appreciate your response!

On Sun, Apr 30, 2023 at 3:40 PM Vagrant Cascadian <vagrant@debian.org> wrote:
>
> On 2023-04-30, Roger Shimizu wrote:
> > I'm trying to support an ARM based RB3 / DB845c [1] dev-board with
> > android-style boot image to flash-kernel.
> ...
> > My question is:
> > - Currently flash-kernel is mainly u-boot based, is it proper to add
> > "mkbootimg" based devices?
>
> My main worry here is investing too much in flash-kernel, rather than
> replacing it... both require possibly significant effort, and I wonder
> if that effort would not be better spent writing a more modular
> replacement for flash-kernel? That said, I have not mustered the energy
> to do this myself...
>
> To some degree, I have been the de-facto maintainer for flash-kernel,
> but I am hesitant to make significant changes to it... it is not easy
> code to read...

Yes, I agree that flash-kernel is difficult to understand and maintain.
But we have to use it (at least before any alternative appears), and extend it
a bit to adapt to our recent needs.

> > - Does mkbootimg need to support udeb in order to support D-I for this
> > dev-board in the future?
>
> I *think* that the udeb (indirectly?) calls flash-kernel inside the
> chroot... so I am not sure that would be necessary. There's no
> "u-boot-tools" udeb, and many boards use mkimage from "u-boot-tools".

Thanks for the info!
I'll dig it deeper.


> > gzip -c9 /boot/vmlinuz-6.1.0-8-arm64 > vmlinuz.gz
> > cat vmlinuz.gz /usr/lib/linux-image-6.1.0-8-arm64/qcom/sdm845-db845c.dtb > Image
> > mkbootimg \
> >     --kernel Image \
> >     --ramdisk /boot/initrd.img-6.1.0-8-arm64 \
> >     --output boot.img \
> >     --pagesize "4096" \
> >     --base "0x80000000" \
> >     --kernel_offset "0x8000" \
> >     --ramdisk_offset "0x1000000" \
> >     --tags_offset "0x100" \
> >     --cmdline "root=PARTLABEL=rootfs console=tty0
> > console=ttyMSM0,115200n8 clk_ignore_unused pd_ignore_unused"
>
> That seems "simple" enough, given you're using a Debian packaged kernel
> and all. Not so different from the mkimage-style support for u-boot.

I have some more good news.
I found mkbootimg can be replaced by abootimg command, which is
already supported by flash-kernel.
And I already try to patch flash-kernel to work with the board.
The only issue is we need to gzip the debian kernel, which is #831003
[1], and we already have two
patches [2][3] for the ticket.

I'm not sure which patch do you prefer, since they existed for so
long, but still not merged yet.
I tried the 2nd patch [3], and found it needs slightly update,
otherwise it cannot be used.
I posted the update on the MR.
My patch already works well with this path.

[1] https://bugs.debian.org/831003
[2] https://bugs.debian.org/831003#10
[3] https://salsa.debian.org/installer-team/flash-kernel/-/merge_requests/15

If you prefer the 1st patch, which is simpler and straightforward,
just let me know, and I can test it and
make adaptations if necessary.

> It is a frustrating that there are so many ways to boot arm systems...
> but that is the reality out there actually implemented in hardware...
>
>
> live well,
>   vagrant

Variety always costs.
I just hope that could be limited to an acceptable level.

Cheers,
Roger


Reply to: