[PATCH 7/9] powerpc/ps3: Add check for otheros image size
Geoff Levand
geoff at infradead.org
Mon Mar 30 14:10:07 AEDT 2020
Hi Geert,
On 3/29/20 7:00 AM, Geert Uytterhoeven wrote:
>> --- a/arch/powerpc/boot/wrapper
>> +++ b/arch/powerpc/boot/wrapper
>>
>> odir="$(dirname "$ofile.bin")"
>> - rm -f "$odir/otheros.bld"
>> - gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
>> +
>> + # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
>> + # image. If a compressed image that exceeded this limit is written to
>> + # flash the loader will decompress that image until the 16 MiB limit is
>> + # reached, then enter the system reset vector of the partially decompressed
>> + # image. No warning is issued.
>> + rm -f "$odir"/{otheros,otheros-too-big}.bld
>> + size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
>> + bld="otheros.bld"
>> + [ $size -le 16777216 ] || bld="otheros-too-big.bld"
>> + gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
>> ;;
>> esac
>
> Why not print an error message and exit 1 instead, like is done for
> other fatal errors?
This is not really a fatal error for the entire build. The default
make target will build both a vmlinux file and a .bld file. The
.bld file is the one that can be programmed to the OtherOS flash
memory (bld = boot loader). Even if the .bld file is too big, a
big vmlinux file from such a build would be completely fine for
petitboot to load.
It may be good to print an 'info' message though. I'll post an
updated patch.
-Geoff
More information about the Linuxppc-dev
mailing list