Deployment

339 views
Skip to first unread message

aaron.z...@seeingmachines.com

unread,
Dec 9, 2015, 5:35:47 PM12/9/15
to swupdate
Hi there,

I am after a little guidance on how I would actually deploy SWupdate onto a system initially. I am building under Yocto and have successfully used meta-swupdate to build my main OS image into a swu file with a sw-description included. I have also built swupdate-image which produced a "swupdate-image.ext3.gz.u-boot" file. I also have a bzImage for my main OS image.

The hardware I want to use SWupdate on doesn't have U-boot as far as I know, but has eMMc and SD card. Usually for the main OS image I just mount loop the ext4 raw image and copy the root filesystem onto the pre-partitioned eMMc and install GRUB.

I'm struggling to figure out what the ".ext3.gz.u-boot" file is and how to use it. Is it the initramfs rescue image? How can I apply that to eMMc as well as the initial main OS alongside it?

Thanks

Stefano Babic

unread,
Dec 10, 2015, 5:05:22 AM12/10/15
to aaron.z...@seeingmachines.com, swupdate
Hi Aaron,

On 09/12/2015 23:35, aaron.z...@seeingmachines.com wrote:
> Hi there,
>
> I am after a little guidance on how I would actually deploy SWupdate
> onto a system initially. I am building under Yocto and have
> successfully used meta-swupdate to build my main OS image into a swu
> file with a sw-description included. I have also built swupdate-image
> which produced a "swupdate-image.ext3.gz.u-boot" file. I also have a
> bzImage for my main OS image.
>
> The hardware I want to use SWupdate on doesn't have U-boot as far as
> I know, but has eMMc and SD card.

Well, it should have a bootloader. If not U-Boot, something else.

> Usually for the main OS image I
> just mount loop the ext4 raw image and copy the root filesystem onto
> the pre-partitioned eMMc and install GRUB.

Let's me guess...you have a Intel based hardware, maybe on a Quark
processor, you have a BIOS and GRUB is your bootloader.

>
> I'm struggling to figure out what the ".ext3.gz.u-boot" file is and
> how to use it. Is it the initramfs rescue image? How can I apply that
> to eMMc as well as the initial main OS alongside it?

There is something to do.
.ext3.gz.u-boot is a ramdisk in the u-boot format. The compressed image
is .ext3.gz (it is also built), that is .ext3.gz.u-boot without the
initial U-Boot 64 bytes header.

Then you need to add entries to your grub.cfg (if GRUB2) or menu.cfg.
An entry should be added, setting the rootfs to the ramdisk to start
swupdate in rescue mode.

The whole mechanism to switch again the rescue system using U-Boot
environemnt work together with U-Boot and must be added to have the same
features. I guess you can reach it modifying the default entry in the
grub configuration file. Prepartitioning the eMMC is not a must with
swupdate, this can be done by a preinstall script, but it depends where
the GRUB configuration is stored.

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

aaron.z...@seeingmachines.com

unread,
Dec 10, 2015, 12:54:04 PM12/10/15
to swupdate, aaron.z...@seeingmachines.com, sba...@denx.de
On Thursday, December 10, 2015 at 3:05:22 AM UTC-7, Stefano Babic wrote:
> Hi Aaron,
>
> On 09/12/2015 23:35, aaron.z...@seeingmachines.com wrote:
> > Hi there,
> >
> > I am after a little guidance on how I would actually deploy SWupdate
> > onto a system initially. I am building under Yocto and have
> > successfully used meta-swupdate to build my main OS image into a swu
> > file with a sw-description included. I have also built swupdate-image
> > which produced a "swupdate-image.ext3.gz.u-boot" file. I also have a
> > bzImage for my main OS image.
> >
> > The hardware I want to use SWupdate on doesn't have U-boot as far as
> > I know, but has eMMc and SD card.
>
> Well, it should have a bootloader. If not U-Boot, something else.
>

Yes, sorry we use BIOS/GRUB.

> > Usually for the main OS image I
> > just mount loop the ext4 raw image and copy the root filesystem onto
> > the pre-partitioned eMMc and install GRUB.
>
> Let's me guess...you have a Intel based hardware, maybe on a Quark
> processor, you have a BIOS and GRUB is your bootloader.
>

Yes, Intel Atom with BIOS/GRUB.

> >
> > I'm struggling to figure out what the ".ext3.gz.u-boot" file is and
> > how to use it. Is it the initramfs rescue image? How can I apply that
> > to eMMc as well as the initial main OS alongside it?
>
> There is something to do.
> .ext3.gz.u-boot is a ramdisk in the u-boot format. The compressed image
> is .ext3.gz (it is also built), that is .ext3.gz.u-boot without the
> initial U-Boot 64 bytes header.
>
> Then you need to add entries to your grub.cfg (if GRUB2) or menu.cfg.
> An entry should be added, setting the rootfs to the ramdisk to start
> swupdate in rescue mode.
>

So I should change swupdate-image.bb IMAGE_FSTYPES to output a different initramfs image format (cpio?)?

> The whole mechanism to switch again the rescue system using U-Boot
> environemnt work together with U-Boot and must be added to have the same
> features. I guess you can reach it modifying the default entry in the
> grub configuration file. Prepartitioning the eMMC is not a must with
> swupdate, this can be done by a preinstall script, but it depends where
> the GRUB configuration is stored.
>

In the default U-Boot setup what normally controls the "switch" or environment variable? Does SWupdate have any hard dependency on U-boot environment variables to store state?


I'm still a bit fuzzy on how the whole process works. In a BIOS/GRUB + eMMc configuration where does the rescue OS and main OS reside? Would they be on two partition on the eMMc? What is a good setup in your opinion?

Thanks

Stefano Babic

unread,
Dec 10, 2015, 1:37:08 PM12/10/15
to aaron.z...@seeingmachines.com, swupdate, sba...@denx.de
Hi Aaron,

On 10/12/2015 18:54, aaron.z...@seeingmachines.com wrote:

>>
>
> So I should change swupdate-image.bb IMAGE_FSTYPES to output a
> different initramfs image format (cpio?)?

Yes, you can change it to generate an image suitable for you.
>
>> The whole mechanism to switch again the rescue system using U-Boot
>> environemnt work together with U-Boot and must be added to have the
>> same features. I guess you can reach it modifying the default entry
>> in the grub configuration file. Prepartitioning the eMMC is not a
>> must with swupdate, this can be done by a preinstall script, but it
>> depends where the GRUB configuration is stored.
>>
>
> In the default U-Boot setup what normally controls the "switch" or
> environment variable?

swupdate sets U-Boot variable to communicate the status to the bootloader.

> Does SWupdate have any hard dependency on
> U-boot environment variables to store state?

swupdate will run reporting in the Log that it is not possible to update
the U-Boot environemnt, but it goes on. However, this feature is then
missing with other bootloaders. If a power-cut happens during an update,
your GRUB does not know. The mechanism to communicate with the
bootloader is implemented only with U-Boot.

>
>
> I'm still a bit fuzzy on how the whole process works. In a BIOS/GRUB
> + eMMc configuration where does the rescue OS and main OS reside?

I never had this case with Bios + GRUB - it is open. There is no rule
where to store the rescue OS, the rule of thumb is to put in a storage
that is not updated (I have several case with a SPI-NOR with write
protect). If you have only eMMC, there is no other choice and you have
to put it on eMMC.

> Would they be on two partition on the eMMc? What is a good setup in
> your opinion?

I guess you need a partition for rescue OS.

manjunat...@gmail.com

unread,
Jun 7, 2016, 8:33:46 AM6/7/16
to swupdate, aaron.z...@seeingmachines.com

Hey aaron,

Can you just attach the .bb file how you were able to generate a .ext3.gz.u-boot i really want to know.

Thanks to help.

Regards,
Manju

Aaron Zinghini

unread,
Jun 7, 2016, 5:29:03 PM6/7/16
to manjunat...@gmail.com, swupdate
Sorry Manju. I don't have the files anymore as the product I was working on didn't have U-boot so I abandoned my efforts.

Thanks

________________________________________
From: manjunat...@gmail.com <manjunat...@gmail.com>
Sent: Tuesday, 7 June 2016 5:33:46 AM
To: swupdate
Cc: Aaron Zinghini
Subject: Re: Deployment
Aaron Zinghini
Senior DSS Software Engineer










T +1 917 346 2993
M +1 917 346 2993
E aaron.z...@seeingmachines.com
W www.seeingmachines.com<http://www.seeingmachines.com>

[Seeing Machines]<https://www.seeingmachines.com/>

This email is confidential. If you are not the intended recipient, destroy all copies and do not disclose or use the information within. No warranties are given that this email does not contain viruses or harmful code.
Reply all
Reply to author
Forward
0 new messages