WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

start.elf and rpi-update or apt-get upgrade

Wed Jul 09, 2014 10:06 am

Hello,

Question.

We have a customised start.elf file, and want to be able to do rpi-updates or apt-get upgrades to get normal system upgrades for Raspbian, however when these commands are executed, the start.elf file on SD card get replaced, and our system no longer boots.

Replacing them with our custom file again resolves the issue, however I was just wanting to know why this file gets updated/replaced, or if there is a way to do an update of everything else but exclude this file from being replaced?

I appreciate any input anyone has

Kind Regards
WanaGo

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: start.elf and rpi-update or apt-get upgrade

Wed Jul 09, 2014 10:33 am

start.elf is the firmware that is loaded on to the GPU. It usually needs to match the ARM side code (in case a feature was added in ARM that needed firmware support).

So when you do an update of the ARM side using rpi-update it will also update the firmware. I think apt-get stuff will be safe though.

Note that the firmware is being improved all the time with bug fixes and new code.

Out of interest, what have you changed in the start.elf? You really shouldn't be touching it in normal usage (and you have seen why). The only thing I can think of is that you are removing the Raspi logo and replacing it with your own.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: start.elf and rpi-update or apt-get upgrade

Wed Jul 09, 2014 3:20 pm

Isn't the Raspi Logo baked into kernel.img ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: start.elf and rpi-update or apt-get upgrade

Wed Jul 09, 2014 3:29 pm

ghans wrote:Isn't the Raspi Logo baked into kernel.img ?

ghans
It's built as part of the kernel from
../linux/drivers/video/logo/logo_linux_clut224.* by processing a 224 colour ppm image file.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: start.elf and rpi-update or apt-get upgrade

Wed Jul 09, 2014 4:01 pm

I wonder if the OP has simply confused the filenames, and they actually have a customised kernel.img ?

In which case, they just need to have a look at https://github.com/Hexxeh/rpi-update#skip_kernel :)

Edit: Or they could rename their own customised kernel to custom-kernel.img, and then add a kernel=custom-kernel.img option to config.txt, and then it won't matter if apt-get overwrites the 'normal' kernel.img

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: start.elf and rpi-update or apt-get upgrade

Wed Jul 09, 2014 8:00 pm

ghans wrote:Isn't the Raspi Logo baked into kernel.img ?

ghans
Good point. Ignore my nonsense talk.

Still intrigued as to why he may have a modified start.elf
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 12:28 am

Thanks for the reply everyone.
jamesh wrote: Out of interest, what have you changed in the start.elf? You really shouldn't be touching it in normal usage (and you have seen why).
Well, its all a bit hush hush at the moment, however we are working with Broadcom on a custom product which will be released in the next few months. The start.elf has been customised due to our hardware setup and what we have connected to the BCM2835.

I guess I really need to go back to them and get more information and see if these customisations can be detached from start.elf and put somewhere else, so if the code does need to be updated then our customisations remain intact. Getting information from them is not a quick process though, which is why I turned here to see if anyone might know.

From the tests I did, both the apt-get upgrade and the rpi-update caused the start.elf file to be 'updated' / 'overwritten' for whatever reason.

No we are not changing the Raspberry Pi logo or anything as trivial as that. Without the modifications we have in place, our system simply does not start.

I wish I could say more.

What I don't know however is what the specific modifications are, all I know is what they provide us. I assume the source used in the start.elf file is protected and only privy to certain people/companies? or is it openly available, do you know? I need to do more research myself. I am sort of only the messenger in this particular issue.

Kind Regards
WanaGo

WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 12:32 am

AndrewS wrote:I wonder if the OP has simply confused the filenames, and they actually have a customised kernel.img ?

In which case, they just need to have a look at https://github.com/Hexxeh/rpi-update#skip_kernel :)

Edit: Or they could rename their own customised kernel to custom-kernel.img, and then add a kernel=custom-kernel.img option to config.txt, and then it won't matter if apt-get overwrites the 'normal' kernel.img
Thanks for this reply also

I had seen this, but didnt see anything specific to start.elf.
No, I havent mistaken what file has been modified, it is start.elf, not kernel.img
Can this same method however be applied to start.elf and we split out our changes as you described for kernel.img, or is that a bit of an unknown and is subject to what the changes are?

Regards
WanaGo

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 12:38 am

In that case you'll simply need to remember to copy your custom start.elf file back to the /boot folder every time after running 'apt-get upgrade' or 'rpi-update' before rebooting.

AFAIK you're possibly the only person running a RaspberryPi with a custom start.elf that hasn't come from https://github.com/raspberrypi/firmware
I assume the source used in the start.elf file is protected and only privy to certain people/companies?
Correct.

WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 12:44 am

Yes, as I suspected.

I will talk to Broadcom and see what can be done about this.
If the solution is simply copying back the start.elf and overwriting the one which was updated, then that is a step which should be fine to do - however I guess my concern is, why was it updated in the first place. Surely it would only be updated if there was a change that needed to be implemented, to compliment any changes that were made on the ARM side, as was described above. So my simply copying the start.elf file we have back over top of the updated one, then we break that link, and thus the update.

I am not sure what the solution is for this. hmm.

I have not heard of many other companies who have done what we have been working on, which is a good thing in a way. But I suppose it also means we are in uncharted waters to an extent, so may have to result to work arounds rather than solutions. It has been a hard road to get to this point I can tell you that. Light is at the end of the tunnel though.

Regards
WanaGo

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 12:58 am

WanaGo wrote:however I guess my concern is, why was it updated in the first place.
You can find that out by reading through the full history https://github.com/raspberrypi/firmware/commits/master

I suspect many of the changes will be to fix bugs or add new features, that probably won't affect your product?
But of course that's just my uninformed guess ;)

OTOH, if your product is being released in a few months, are you really at the stage where you still need to be pulling in constant (and often untested) updates?

WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 1:42 am

Pretty much if it runs on the Pi (Raspbian only), then it will run on ours.

If there are fixed or features added then ideally I would like us to be able to get them also. The aim was that our product used as many standard parts of Raspbian as possible so it was easy for people to update as required and dont have to muck around with custom kernels and the like.
Seems we are mostly there, its just this one file.

User avatar
Paul Webster
Posts: 822
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
Contact: Twitter

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 6:25 am

Looks like a few alternatives here ...

- You might have to persuade Broadcom / RPi Foundation to incorporate the Broadcom changes for your device into the RPi start.elf ... assuming it can detect the difference between the devices at run time and handle it all properly. That makes extra work for BCM /RPi which they might want to charge for
- get rpi-update modified to handle alternate start.elf ... with the danger that a change is made elsewhere that requires a particular version of start.elf and it breaks things horribly
- persuade BCM to move the start.elf changes out to somewhere special and then have a way for start.elf to load external stuff and have that mechanism incorporated into the RPi start.elf

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 8:49 am

WanaGo wrote:Pretty much if it runs on the Pi (Raspbian only), then it will run on ours.

If there are fixed or features added then ideally I would like us to be able to get them also. The aim was that our product used as many standard parts of Raspbian as possible so it was easy for people to update as required and dont have to muck around with custom kernels and the like.
Seems we are mostly there, its just this one file.
Who are you dealing with at Broadcom? Because this is the first I've heard of it and I work for Broadcom and generally know all the Raspi stuff!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 8:58 am

Who are you dealing with at Broadcom? Because this is the first I've heard of it and I work for Broadcom and generally know all the Raspi stuff!
Ditto, I am responsible for the hardware side and thus far believed I know all our customers.

WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 11:41 am

Naren but dealing directly with EDOM.
Last edited by WanaGo on Fri Jul 11, 2014 3:52 am, edited 1 time in total.

WanaGo
Posts: 21
Joined: Wed Oct 10, 2012 1:04 am

Re: start.elf and rpi-update or apt-get upgrade

Thu Jul 10, 2014 11:46 am

Have sent you two PM's.

Return to “Troubleshooting”