Current-Users archive

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

Re: Script to create bootable arm images?




> On Jun 24, 2022, at 9:55 AM, Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost> wrote:
> 
> martin@ wrote:
> 
>> On Thu, Jun 23, 2022 at 02:17:28PM -0600, Brook Milligan wrote:
>>> Is there a script somewhere that is being used to create the bootable
>>> arm issues that are available on https://nycdn.netbsd.org/pub/arm/?  If
>>> so, where?
>> 
>> It is build by build.sh, e.g. this is the invocation for a recent earmv7hf
>> build run:
>> 
>> ===> build.sh command:    /home/source/ab/HEAD/src/build.sh -m evbarm -a earmv7hf -B 202206240040Z -V NETBSD_OFFICIAL_RELEASE=no -D /home/builds/ab/HEAD/evbarm-earmv7hf/202206240040Z-dest -M /home/builds/ab/HEAD/evbarm-earmv7hf/202206240040Z-obj -R /home/builds/ab/HEAD/evbarm-earmv7hf/202206240040Z-rlse -T /home/builds/ab/HEAD/evbarm-earmv7hf/202206240040Z-tools -U -X /home/source/ab/HEAD/xsrc -P -x -N2 -V TMPDIR=/tmp -V BUILD=yes -V MAKECONF=/home/builds/etc/make.conf -V MKDEBUG=yes -j16 release install-image
> 
> I doubt install-image supports all arm's ones.
> I guess several of them use src/distrib/embedded.
> 
> - "build.sh install-image" uses "install_image" targets in
>  src/distrib/${MACHINE}/Makefile, currently prepared for
>  amd64, evbarm (looks like only for UEFI based ones?), i386
> 
> - for several arm boards such as Raspberry Pi etc, the image binaries
>  are built during "make release" in src/etc by scripts and Makefile
>  in src/distrib/embedded and they are invoked from
>  src/etc/etc.evbarm/Makefile.inc via targets like "snap_md_post" and
>  "smp_rpi" etc.
> - src/distrib/utils/embedded/mkimage calls makefs(8), fdisk(8),
>   disklabel(8), and other tools to create board specific images
>   persrc/distrib/utils/embedded/conf/${h}.conf settings

Thanks for all of this.  It’s very helpful.

build.sh works great to create, for example, binary/gzimg/armv7.img.gz.  

However, that is not necessarily a bootable image, at least on some systems.  In addition, various u-boot magic files must be added to the FAT partition at the beginning of armv7.img to make it bootable.

All the images on https://nycdn.netbsd.org/pub/arm/ have those bits added, and differ because those extra bits are different for different platforms.  Thus, there must be some extra processing being done between creating armv7.img.gz and those bootable images.

I am wondering about the scripts that accomplish that last step (assuming of course that all the u-boot stuff is already built somewhere).

Cheers,
Brook



Home | Main Index | Thread Index | Old Index