How to properly update my application

46 views
Skip to first unread message

Brent

unread,
Sep 6, 2014, 6:02:02 PM9/6/14
to beagl...@googlegroups.com
I have a Qt application that runs at start up.  Currently, I update my application by allowing the user to press a button inside of my application which copies the updated application files from the USB drive to the eMMC.  It then sets a flag inside of a text file to "1", and reboots.  When my start up script is ran, it firsts checks the text file to see if there is a "1", and if so it overwrites the old files with the new ones and then launches the application.  This works most of the time, but there are occasions where something gets messed up and the new application does not start.

I was wondering if there is a better way of updating my application.  Could I use opkg to do this, and if so, how?  Will it allow my application to be running while it is updating it?  What is the proper way to do this?  Thanks in advance for your help!

William Hermans

unread,
Sep 6, 2014, 6:33:33 PM9/6/14
to beagl...@googlegroups.com
Define "something gets messed up". You're going to have to know what this something *is* before solving the issue. But perhaps you could use an MD5 sum to verify the file ? Then when there is a mismatch you delete the target file and try again ?


On Sat, Sep 6, 2014 at 3:02 PM, Brent <bren...@hotmail.com> wrote:
I have a Qt application that runs at start up.  Currently, I update my application by allowing the user to press a button inside of my application which copies the updated application files from the USB drive to the eMMC.  It then sets a flag inside of a text file to "1", and reboots.  When my start up script is ran, it firsts checks the text file to see if there is a "1", and if so it overwrites the old files with the new ones and then launches the application.  This works most of the time, but there are occasions where something gets messed up and the new application does not start.

I was wondering if there is a better way of updating my application.  Could I use opkg to do this, and if so, how?  Will it allow my application to be running while it is updating it?  What is the proper way to do this?  Thanks in advance for your help!

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brent Sink

unread,
Sep 6, 2014, 6:58:08 PM9/6/14
to beagl...@googlegroups.com
I can't quite define it, but something seems to get corrupted.  When the new "corrupted" application runs, it only shows a white rectangle, rather than the application.  I guess I was wondering how others update their own software applications - if they do something similar to what I'm doing or if they are using opkg/apt-get/etc.  The MD5 sum may be something I could look into... I'm not familiar on how to implement that, but I'll do some research.  Thanks,


You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/4FY8Owh_i_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-brent

John Syn

unread,
Sep 6, 2014, 7:31:07 PM9/6/14
to beagl...@googlegroups.com

From: Brent Sink <brent...@gmail.com>
Reply-To: "beagl...@googlegroups.com" <beagl...@googlegroups.com>
Date: Saturday, September 6, 2014 at 3:57 PM
To: "beagl...@googlegroups.com" <beagl...@googlegroups.com>
Subject: Re: [beagleboard] How to properly update my application

I can't quite define it, but something seems to get corrupted.  When the new "corrupted" application runs, it only shows a white rectangle, rather than the application.  I guess I was wondering how others update their own software applications - if they do something similar to what I'm doing or if they are using opkg/apt-get/etc.  The MD5 sum may be something I could look into... I'm not familiar on how to implement that, but I'll do some research.  Thanks,
I haven’t done this myself, but it is something I am looking into as I was planning to create a QT5 package for Debian. Here is a good reference:


I’ve seen Debian application update while they are open and the new version is used the next time the application is launched, and I’ve seen application update from within the application and then relaunch when the update is complete. 

Regards,
John

Frank Hunleth

unread,
Sep 7, 2014, 9:08:31 PM9/7/14
to beagl...@googlegroups.com
On Sat, Sep 6, 2014 at 6:57 PM, Brent Sink <brent...@gmail.com> wrote:
I can't quite define it, but something seems to get corrupted.  When the new "corrupted" application runs, it only shows a white rectangle, rather than the application.  I guess I was wondering how others update their own software applications - if they do something similar to what I'm doing or if they are using opkg/apt-get/etc.  The MD5 sum may be something I could look into... I'm not familiar on how to implement that, but I'll do some research.  Thanks,

I've gotten frustrated with corrupt root filesystems enough that I keep mine read-only and ping-pong the firmware updates between two partitions. I.e., the BBB starts out booting off the rootfs in the 2nd partition (uboot, etc are in the 1st). The updater writes the new rootfs to the 3rd partition and then when it's done, the 3rd partition becomes the new active one. I keep all of my application data on a writable 4th partition so that it doesn't get overwritten by the firmware updates. This setup is a bit old school, but it has worked well for me. I also don't usually have access to devices to investigate corruption issues, so it can be hard to figure out the root cause.

I use Buildroot to create my root filesystems. For an open-source project that I'm working on, I had to put together a firmware update utility to manage updates. It seems to work for me and for what I need on the other project, but it's not battle tested (the battle tested one is tied to a product). If you're interested, you can look at it here: https://github.com/fhunleth/fwup. I just updated an example project to show how it can be used on the BBB: https://github.com/fhunleth/bbb-buildroot-fwup.

Frank

Brent

unread,
Sep 9, 2014, 10:28:25 PM9/9/14
to beagl...@googlegroups.com
The MD5 sum seems like a good approach.  For anyone reading this, I found this link useful:


find -exec md5sum "{}" \; > checklist.chk
md5sum -c checklist.chk   # runs through the list to check them

William Hermans

unread,
Sep 9, 2014, 10:36:00 PM9/9/14
to beagl...@googlegroups.com
Now hopefully, your issue is related to corrupt or otherwise unusable file.
Reply all
Reply to author
Forward
0 new messages