Shall 'bmp' uncompress automagically?

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Tue Mar 13 13:16:23 EDT 2012


On 11:23 Tue 13 Mar     , Wolfram Sang wrote:
> 
> > > since we have 'file_detect_type' in barebox, we could use it to automagically
> > > uncompress BMP files. Pseudo-code:
> > > 
> > > if (file_detect_type(bmp) != BMP) {
> > > 	/* No BMP? Try to depack stream */
> > > 	ret = uncompress(bmp, unpacked_bmp);
> > > 	if (ret < 0 || file_detect_type(unpacked_bmp) != BMP)
> > > 		return -ENOBMP;
> > > }
> > > 
> > > Is something like this wanted? Or shall this be done entirely via scripts?
> > > 
> > > if [ $file is somehow detected as compressed ]
> > > 	uncompress $file /bmp
> > > 	bmp /bmp
> > > 	rm /bmp
> > > else
> > > 	bmp $file
> > > fi
> > I prefer the second one
> 
> Care to explain why?
I the image could be embedeed in other format (uImage, android etc..)

And I'm using such command to boot a kernel via DFU too

Best Regards,
J.



More information about the barebox mailing list