Go Down

Topic: [SOLVED] How to sysupgrade Yun after SD expansion? (Read 2377 times) previous topic - next topic

yun_

Aug 24, 2014, 06:00 pm Last Edit: Aug 27, 2014, 01:52 am by yun_ Reason: 1
The standard syupgrade tutorial/link does not appear to work for a Yun that is already expanded to SD.

Sysupgrade tutorial/link works great, thank you Arduino Developers...for my other-Yun-that-is-not-yet-expanded to SD card.

Regarding the SD-expanded-yun, here's what I tried before posting:

  • assumed upgrade binary must be on the same SD card as it was expanded to, otherwise expanded-Yun would not even boot. But which partition to put binary, and which folder?

  • copied binary first to /mnt/sda1/ where I expected webpanel to look, then to other folders and even the other partition

  • after webpanel could not detect the binary, I ssh'd into my yun. It was as if the binary had disappeared

  • running out of ideas, but thinking it a risky move, I eventually pressed wifi reset for >30 seconds hoping for a "factory reset". Did nothing (I guess expanding to SD card messes with uboot?). Fortunately it did not brick my yun!


Before starting a new topic, I searched the forum for how to do this (sorry if I missed an obvious solution), which showed only a couple of posts relating to sysupgrading SD-expanded yuns. One of the posts is by a user wishing to preserve config files (not wishing for a clean "factory reset"). That owner does include several steps on the linux side of things to preserve config files. But the closest post discussing a clean sysupgrade for expanded yun was this topic http://forum.arduino.cc/index.php?topic=255439.msg1807231#msg1807231 where Frederico suggests it is possible to do a simple "factory reset", simply with the -n flag set from webpanel.

Frederico notes that using the -n flag will remove all configs and give a clean "factory default" sysupgrade...which is exactly what many SD-expanded-yun owners, like me, may also want.  I looked through "configuration" on webpanel for manual upgrade flags/settings and the -n flag, but could not find them.

Where to place sysupgrade binary of SD-expanded yun so webpanel detects it and shows -n option?

yun_

For others with an SD-expanded yun in the same boat, here's an update...

I found on webpanel, under configure->advanced configuration panel->System->Backup / Flash Firmware. Here you'll find a section "Flash new firmware image" with a checkbox "keep settings".

Looks like the right place to effect a sysupgrade!

Before I do this, could anyone experienced with SD-expanded-yun upgrades please confirm:

  • that unchecking the "keep settings" box is equivalent to setting the -n flag

  • which specific binary (for an SD-expanded-yun) to choose from from http://download.linino.org/linino_distro/master/latest/


Of the 10 generic yun binaries listed, I narrowed it down to the 4 binaries that include "sysupgrade" in the name, but it's not clear to me which one to use for an SD-expanded-yun:
[ ]   openwrt-ar71xx-generic-linino-yun-16M-250k-jffs2-sysupgrade.bin        21-Aug-2014 21:58    15M   
[ ]   openwrt-ar71xx-generic-linino-yun-16M-250k-squashfs-sysupgrade.bin   21-Aug-2014 21:59    15M   
[ ]   openwrt-ar71xx-generic-linino-yun-16M-jffs2-sysupgrade.bin     21-Aug-2014 21:57    15M    
[ ]   openwrt-ar71xx-generic-linino-yun-16M-squashfs-sysupgrade.bin     21-Aug-2014 21:59    15M   

federicofissore


that unchecking the "keep settings" box is equivalent to setting the -n flag


Yes


which specific binary (for an SD-expanded-yun) to choose from from http://download.linino.org/linino_distro/master/latest/


That's the wrong url. Please refer to http://arduino.cc/en/Main/Software#toc8

enduro

does that mean I have to run again the SD expansion script from my Arduino IDE again ? Will I lose all of my data and installed software ?

yun_

#4
Aug 27, 2014, 01:54 am Last Edit: Aug 27, 2014, 02:43 am by yun_ Reason: 1
@Frederico: Thanks very much for your reply. Two perfect sysupgrades and SD expansions for my yuns.

@enduro: yes, I believe you must run SD-expansion again after sysupgrade. At least that is what I did. Regarding keeping-of-files. I did a sysupgrade with -n flag, and had read that is supposed to clear all files and downloaded packages...everything. Expanding to SD (after sysupgrade) is not supposed to affect your files or installed packages, although Frederico suggests everyone to back files as a standard precaution in another post.

But I have to tell about a most unusual result...my scripts/files magically reappeared on the SD card, along with my downloaded packages, so I didn't have to reload them. That's after sysupgrade with -n flag, and redoing SD expansion. And all this after I had erased both partitions of the SD card using iMac Disk Utility.

So I had to do nothing as it was indeed all there. One of those rare times when things go pleasantly easier than you'd think.

May I suggest yun SD-expanders first check your usb cables before SD expansion
In case it helps others, you may read (in this forum) of people bricking their yuns with faulty USB cables. That surprised me, so I checked my own usb cables. Sure enough, from the 6 or 7 cables I had, one turned out to be power-only (no data), and one that had transmitted data with other applications was intermittently faulty when I tested it connecting yun to desktop.

Like me, you might plan on simply sysupgrading through wifi. But you'll find you have to expand to SD using cable (Frederico or other dev, please correct me if I'm wrong about that). My guess is that using an intermittently faulty cable during SD expansion could give you all sorts of trouble. Solution: check a cable uploading the blink sketch before you load the SD expansion sketch.

yun_

#5
Aug 27, 2014, 02:33 am Last Edit: Aug 27, 2014, 02:40 am by yun_ Reason: 1
@Frederico: I removed my SD card, and it surprised me that the yun worked perfectly. I uploaded a new sketch, and SSH'd into it without a problem. Of course there was no sd1 folder in /mnt/. Is the upgraded kernel supposed to remain on the onboard flash, or did I do my upgrade wrong?

Reason I ask is that now that I've reinserted the SD card, if I download more packages, will they go on the SD card automatically with opkg install, or do I have to specify /mnt/sd1 (otherwise risk filling up the onboard flash)?

enduro

@yun

while browsing the openwrt documentation i found these useful hint :

http://wiki.openwrt.org/doc/howto/extroot

Code: [Select]

If the non-overlay extroot mount fails before r26311 it will appear mounted to /tmp/rom-disabled, while after r26311 it will appear mounted to /tmp/whole_root-disabled.

If the system on the extroot is obtained from a prebuilt image the md5sums will not match and you need to copy the md5sum from the active system:

cp /.extroot.md5sum /tmp/whole_root-disabled/etc/extroot.md5sum

or

cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum


basically it says that after a sysupgrade the extroot will be no longer active and you have to perform a simple procedure to restore it. Can't we find a way to "cheat" the system by finding a workaround for the md5sum ?

yun_

Thanks for that note, enduro.

I know this does not directly answer the question of getting around mis-matched md5sums. But I found that installing sftp on my yun made it so much easier to back-up, edit files etc on my yun.

On the yun:
opkg update
opkg install openssh-sftp-server

On your development machine:
If you you are running a linux distro like Ubuntu, you may find that all you have to do to browse and edit your yun files is follow this http://www.lessons4you.info/how-to-connect-ssh-sftp-and-ftp-servers-using-nautilus-ubuntu-13-04/


yun_

In case it helps others who are curious, it looks like the following link answers the earlier question of whether extroot does by default allow new packages to be installed on the SD after an SD expansion (i.e. without specifying a new installation target). Also answers the question as to why the yun still works without the SD card...even after expanding to the SD card. http://wiki.openwrt.org/doc/howto/extroot

Part way down that page, the author describes what happens when extroot fails to boot: "...the normal configuration is loaded that is still in the JFFS2 partition on the main flash, which is the old configuration that you copied to the external root device and have since changed from there..."

federicofissore

If you have a recent openwrt-yun installed and have expanded to the SD card, you can skip sysupgrade all together. Instead, run script "upgrade-all": that will upgrade all your installed packages with the latest versions

The drawback is that this will NOT upgrade the kernel. The good news is that there aren't many kernel updates: since openwrt-yun inception (may 2014) there has been just one

Go Up