mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Shall 'bmp' uncompress automagically?
@ 2012-03-10 22:10 Wolfram Sang
  2012-03-13  3:57 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2012-03-10 22:10 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 700 bytes --]

Hi,

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

?

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shall 'bmp' uncompress automagically?
  2012-03-10 22:10 Shall 'bmp' uncompress automagically? Wolfram Sang
@ 2012-03-13  3:57 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-03-13 10:23   ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-03-13  3:57 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: barebox

On 23:10 Sat 10 Mar     , Wolfram Sang wrote:
> Hi,
> 
> 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

I send a patch to known the type via command

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shall 'bmp' uncompress automagically?
  2012-03-13  3:57 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-03-13 10:23   ` Wolfram Sang
  2012-03-13 17:16     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2012-03-13 10:23 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 791 bytes --]


> > 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?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shall 'bmp' uncompress automagically?
  2012-03-13 10:23   ` Wolfram Sang
@ 2012-03-13 17:16     ` Jean-Christophe PLAGNIOL-VILLARD
  2012-03-23  9:46       ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-03-13 17:16 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: barebox

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.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shall 'bmp' uncompress automagically?
  2012-03-13 17:16     ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-03-23  9:46       ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2012-03-23  9:46 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 783 bytes --]


> > > > 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..)

A BMP in a uImage??? But even if, there is no difference if bmp command
calls 'uncompress' or a script?

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

Which command? What does it have to do wtih BMP?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-23  9:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-10 22:10 Shall 'bmp' uncompress automagically? Wolfram Sang
2012-03-13  3:57 ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 10:23   ` Wolfram Sang
2012-03-13 17:16     ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-23  9:46       ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox