diff options
author | Leah Rowe <leah@libreboot.org> | 2023-05-13 01:27:00 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-05-13 01:27:00 +0100 |
commit | 1e9ed989d32877103babbdc273e40a42a72ef7fb (patch) | |
tree | 4dec13b811e689a4f31e848b5c23b315cf8bd1ee /resources/scripts | |
parent | 5811e53e828504c0cdf6583d6d2dd1e82585b15d (diff) |
build/boot/roms: simplify moverom()
Diffstat (limited to 'resources/scripts')
-rwxr-xr-x | resources/scripts/build/boot/roms_helper | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/resources/scripts/build/boot/roms_helper b/resources/scripts/build/boot/roms_helper index 0c0b16eb..1a5c84e2 100755 --- a/resources/scripts/build/boot/roms_helper +++ b/resources/scripts/build/boot/roms_helper @@ -713,26 +713,6 @@ moverom() cp ${rompath} ${_newrom} - for romsize in 4 8 16; do - ifdgbe="descriptors/ich9m/ich9fdgbe_${romsize}m.bin" - if [ "${cuttype}" = "${romsize}MiB ICH9 IFD NOR flash" ]; then - if [ ! -f "${ifdgbe}" ]; then - ./build descriptors ich9m - fi - dd if=${ifdgbe} of=${_newrom} bs=1 count=12k \ - conv=notrunc - fi - cmpstr="${romsize}MiB ICH9 IFD NOGBE NOR flash" - ifdgbe="descriptors/ich9m/ich9fdnogbe_${romsize}m.bin" - if [ "${cuttype}" = "${cmpstr}" ]; then - if [ ! -f "${ifdgbe}" ]; then - ./build descriptors ich9m - fi - dd if=${ifdgbe} of=${_newrom} bs=1 count=4k \ - conv=notrunc - fi - done - if [ "${cuttype}" = "i945 laptop" ]; then dd if=${_newrom} of=top64k.bin bs=1 \ skip=$(($(stat -c %s ${_newrom}) - 0x10000)) \ @@ -741,7 +721,26 @@ moverom() seek=$(($(stat -c %s ${_newrom}) - 0x20000)) \ count=64k conv=notrunc rm -f top64k.bin + return 0 fi + + for romsize in 4 8 16; do + for x in "IFD" "IFD NOGBE"; do + if [ "${romsize}MiB ICH9 ${x} NOR flash" \ + != "${cuttype}" ]; then + continue + fi + c=4 + ifdgbe="descriptors/ich9m/ich9fdnogbe_${romsize}m.bin" + if [ "${x}" = "IFD" ]; then + c=12 + ifdgbe="descriptors/ich9m/ich9fdgbe_${romsize}m.bin" + fi + ./build descriptors ich9m + dd if=${ifdgbe} of=${_newrom} bs=1 count=${c}k \ + conv=notrunc + done + done } main $@ |