Learning Center
Plans & pricing Sign in
Sign Out



									                              Re: online updates of flash card images

Re: online updates of flash card images


     • From: Lee Thalblum <lee_t@xxxxxxxxxxx>
     • Date: Wed, 21 Apr 2010 07:29:46 −0700 (PDT)

On Apr 21, 4:32 am, "ryan.raa...@xxxxxxxxx" <ryan.raa...@xxxxxxxxx>

       On Apr 19, 3:11 pm, Lee Thalblum <le...@xxxxxxxxxxx> wrote:

              On Apr 17, 7:17 am, Vitus Jensen <vi...@xxxxxxxxxxxxxxxx> wrote:

                      On Fri, 16 Apr 2010, Lee Thalblum wrote:

                             On Apr 16, 1:17 am, Vitus Jensen
                             <vi...@xxxxxxxxxxxxxxxx> wrote:

                                     On Tue, 13 Apr 2010, Lee
                                     Thalblum wrote:

                                            have any
                                            for a
                                            method of
                                            flash card
                                            images over
                                            a network?
                                            I'm using a
                                            of linux,
                                            which uses

Re: online updates of flash card images                                                      1
                             Re: online updates of flash card images
                                            the syslinux
                                            boot. My
                                            code image
                                            will be
                                            about 2 Gig,
                                            and I
                                            only have
                                            512M of
                                            RAM, so
                                            things out
                                            of RAM. I
                                            can use a
                                            larger CF
                                            card, so I'd
                                            be able to
                                            store a
                                            image as
                                            Any ideas?

                                    Use 2 partitions on your CF
                                    (1: active rootfs, 2:
                                    download area) and
                                    switch to a second, small
                                    rootfs to do the actual
                                    update. The small
                                    rootfs only has to contain
                                    the neccessary tools to do
                                    the update (mkfs,
                                    tar, gz or nandwrite in case
                                    of internal flash) and may
                                    reside in RAM.
                                    You can keep a tar.gz for
                                    the small rootfs or build it
                                    from things
                                    available on the old rootfs.

                                    Download image to 2
                                    Shutdown services, change
                                    Construct a rootfs in RAM,

Re: online updates of flash card images                                2
                              Re: online updates of flash card images
                                      Unmount/clear old rootfs,
                                      copy image to rootfs
                                      Sync, reboot

                             That's similar to what I'm considering, but
                             I'm thinking along the
                             lines of keeping the bootloader in a separate
                             partition, and then
                             keeping the current and updated copies of
                             the flash image in separate
                             paritions. The bootloader config file can be
                             modified to tell it
                             where to boot from when the new image is
                             received and validated.

                     Ah, you want to fall back to the old version if the new one
                     isn't working
                     correctly? Do you have means to define "working
                     correctly"? One way to
                     do it is to let the new version connect to some host after
                     startup and let
                     the host do the permanent switching. This way you can be
                     pretty sure that
                     you will always have a working host−device connection.

                     If your bootloader doesn't support this kind of switching you
                     may involve
                     an initramfs (cpio.gz loaded into a ramfs) and start that first.
                     would be an all−linux solution.


                     PS: in embedded devices I know about the bootloader is
                     always in a
                     seperate partition.

Re: online updates of flash card images                                                 3
                                 Re: online updates of flash card images

                        Vitus Jensen, Hannover, Germany, Earth, Universe
                        (current)− Hide quoted text −

                        − Show quoted text −

                By correctly I meant the new image checksum and header info has been
                validated (we'll have our own header layout to assure the data
                actually comes from us). Once it starts running the bootloader
                doesn't really have any way to assure it's doing what it's supposed


        Hey. We have been tackling the same challenge and came up with 2

        1. Use initramfs and link fs, disk driver, etc. statically. When the
        boot process
        reaches the rcS level, check for the new fs file root.tar.gz. If the
        file exists, rm existings
        fs and copy/extract the new one. Since the initramfs is in RAM, you
        have not chroot'd to the
        mounted the rootfs yet. This will not use the bootloader at all. Once
        the new fs has been written,
        remove the root.tar.gz file, and reboot.

        2. Use kexec. This needs to be investigated more, but it a pretty cool

        Ryan− Hide quoted text −

        − Show quoted text −

I suppose I could check if there's a new image and copy it over the
old image. I'm not sure what that would get me besides not having to
check what partition to use on boot. My image isn't going to be
tar's, so there's no extraction process. I'm still leaning towards
having the bootloader make the decision. It will give the option of
reverting back to the original image if it's needed.


Re: online updates of flash card images                                                4

To top