Skip to contentSkip to conversation

Shall 'bmp' uncompress automagically?

DISCUSSION Wolfram Sang 2 participants 5 messages Mar 10, 2012 – Mar 23, 2012

lore
Share & tools
lore
#0 lore raw

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

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw
Quoted 14 lines · Wolfram Sang

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?

Quoted 7 lines

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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw
Quoted 13 lines
Quoted 13 lines

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?

Quoted 8 lines
Quoted 7 lines

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?

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 20 lines · Wolfram Sang
Quoted 20 lines
Quoted 20 lines

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

Quoted 3 lines
Quoted 1 line

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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

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

Quoted 4 lines
Quoted 3 lines
Quoted 1 line

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?

Quoted 1 line

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

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

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox