Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update preserve_rom function to check if /tmp/cbfs-init.rom should be used. #10

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions initrd/etc/ash_functions
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,19 @@ TRACE() {

preserve_rom() {
TRACE "Under /etc/ash_functions:preserve_rom"
if [ "$CONFIG_CBFS_VIA_FLASHROM" = "y" ]; then
CBFS_ARG=" -o /tmp/cbfs-init.rom"
else
CBFS_ARG=""
fi
new_rom="$1"
old_files=`cbfs -t 50 -l 2>/dev/null | grep "^heads/"`
old_files=`cbfs -t 50 -l $CBFS_ARG 2>/dev/null | grep "^heads/"`

for old_file in `echo $old_files`; do
new_file=`cbfs.sh -o $1 -l | grep -x $old_file`
if [ -z "$new_file" ]; then
echo "+++ Adding $old_file to $1"
cbfs -t 50 -r $old_file >/tmp/rom.$$ \
cbfs -t 50 $CBFS_ARG -r $old_file >/tmp/rom.$$ \
|| die "Failed to read cbfs file from ROM"
cbfs.sh -o $1 -a $old_file -f /tmp/rom.$$ \
|| die "Failed to write cbfs file to new ROM file"
Expand Down