https://www.coreboot.org/index.php?title=Fallback_mechanism/normal.sh&feed=atom&action=historyFallback mechanism/normal.sh - Revision history2024-03-28T16:35:56ZRevision history for this page on the wikiMediaWiki 1.40.0https://www.coreboot.org/index.php?title=Fallback_mechanism/normal.sh&diff=17936&oldid=prevGNUtoo: Created page with " #!/bin/sh # In the cases where this work is copyrightable, it falls under the GPLv2 # or later license that is available here: # https://www.gnu.org/licenses/gpl-2.0.txt..."2016-01-29T00:25:50Z<p>Created page with " #!/bin/sh # In the cases where this work is copyrightable, it falls under the GPLv2 # or later license that is available here: # https://www.gnu.org/licenses/gpl-2.0.txt..."</p>
<p><b>New page</b></p><div> #!/bin/sh<br />
# In the cases where this work is copyrightable, it falls under the GPLv2<br />
# or later license that is available here:<br />
# https://www.gnu.org/licenses/gpl-2.0.txt<br />
<br />
image="$1"<br />
if [ $# -ne 1 ] ; then<br />
echo "Usage $0 <image>"<br />
exit 1<br />
fi<br />
<br />
die()<br />
{<br />
echo "$1 Failed"<br />
exit 1<br />
}<br />
<br />
cbfs_add()<br />
{<br />
name=$1<br />
file=$2<br />
cbfs_remove ${name}<br />
./util/cbfstool/cbfstool ./build/coreboot.rom add -n ${name} -t raw -f ${file}<br />
}<br />
<br />
cbfs_remove()<br />
{<br />
name=$1<br />
./util/cbfstool/cbfstool ./build/coreboot.rom remove -n ${name}<br />
}<br />
<br />
cbfs_reuse_payload()<br />
{<br />
./util/cbfstool/cbfstool ./build/coreboot.rom extract -f ./build/payload.elf -n fallback/payload<br />
./util/cbfstool/cbfstool ./build/coreboot.rom add -f ./build/payload.elf -n normal/payload -t payload<br />
}<br />
<br />
check_config()<br />
{<br />
grep "^CONFIG_CBFS_PREFIX=\"normal\"$" .config > /dev/null || die "Not using normal cbfs prefix"<br />
grep "^CONFIG_UPDATE_IMAGE=y$" .config > /dev/null || die "Not using CONFIG_UPDATE_IMAGE"<br />
grep "^CONFIG_SKIP_MAX_REBOOT_CNT_CLEAR=y" .config > /dev/null || die "Not using CONFIG_SKIP_MAX_REBOOT_CNT_CLEAR"<br />
}<br />
<br />
check_config<br />
make oldconfig || die "make oldconfig"<br />
make clean || die "clean"<br />
mkdir build/ || die "mkdir build"<br />
<br />
cp ${image} ./build/coreboot.rom || die "cp"<br />
<br />
cbfs_remove normal/romstage<br />
cbfs_remove normal/ramstage<br />
cbfs_remove normal/payload<br />
cbfs_remove normal/dsdt.aml<br />
cbfs_remove config<br />
cbfs_remove revision<br />
<br />
# it now adds it automatically<br />
cbfs_remove etc/ps2-keyboard-spinup<br />
<br />
make || die "make"<br />
<br />
# uncomment if you want to reuse fallback's payload<br />
# cbfs_reuse_payload<br />
<br />
./util/cbfstool/cbfstool ./build/coreboot.rom print</div>GNUtoo