FS#23300 - [AIF core] cleaner method for obtaining disk size
Attached to Project:
Release Engineering
Opened by CalimeroTeknik (Calimero) - Wednesday, 16 March 2011, 19:10 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Monday, 26 November 2012, 04:43 GMT
Opened by CalimeroTeknik (Calimero) - Wednesday, 16 March 2011, 19:10 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Monday, 26 November 2012, 04:43 GMT
|
Details
The method to obtain the size of a block peripheral is
currently parsing the output of fdisk.
In /usr/lib/aif/core/libs/lib-blockdevices-filesystems.sh, line 875: bytes=$((`fdisk -l $1 2>/dev/null | sed -n '2p' | cut -d' ' -f5`)) When using a fork of AIF for my livecd, I figured out that if the locale is not English, this causes problems (returns nothing) and the installer crashes on an arithmetic syntax error. The cause may be an insecable space or something, I don't know. Anyway, parsing fdisk's output isn't careful, no matter how you consider it. So I suggest to change line 875 of /usr/lib/aif/core/libs/lib-blockdevices-filesystems.sh to: bytes=$(($(</sys/dev/block/$((16#$(stat -c %t $1))):$((16#$(stat -c %T $1)))/size)*512)) This doesn't depend on how fdisk's output is formatted, at least. |
This task depends upon
Closed by Gerardo Exequiel Pozzi (djgera)
Monday, 26 November 2012, 04:43 GMT
Reason for closing: Deferred
Monday, 26 November 2012, 04:43 GMT
Reason for closing: Deferred
can be used as well then.