Compare commits

...

2 Commits

Author SHA1 Message Date
Leah Rowe a36504aa31 delete u-boot test/lib/strlcat.c using nuke()
we don't need to do it in the release function

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-30 07:38:32 +01:00
Leah Rowe cdce8ba70b make nuke function more generic
i'm merging it into lbmk after this commit. in lbmk, it
will be used for deleting certain files such as u-boot's
strlcat.c. it will not be used in libreboot for deblobbing;
that's what canoeboot is for (deblobbed coreboot distro).

Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-30 07:24:13 +01:00
2 changed files with 4 additions and 5 deletions

1
build
View File

@ -134,7 +134,6 @@ fetch_trees()
[ ! -f "$x" ] || [ -L "$xp" ] || x_ rm -Rf "src/$xp/$xp"
done
rmgit .
rm -Rf tmp .git src/u-boot/*/test/lib/strlcat.c || $err "$_xm !rm"
}
fail()

View File

@ -197,8 +197,8 @@ nuke()
pjsrcdir="${pjsrcdir#src/}"
[ ! -f "config/$pjcfgdir/nuke.list" ] && return 0
while read -r blobfile; do
rmf="$(realpath "src/$pjsrcdir/$blobfile" 2>/dev/null)" || \
while read -r nukefile; do
rmf="$(realpath "src/$pjsrcdir/$nukefile" 2>/dev/null)" || \
continue
[ -L "$rmf" ] && continue # we will delete the actual file
[ "${rmf#"$PWD/src/$pjsrcdir"}" = "$rmf" ] && continue
@ -206,12 +206,12 @@ nuke()
rmf="${rmf#"$PWD/"}"
[ -e "$rmf" ] || continue
del="y"
rm -Rf "$rmf" || $err "$pjcfgdir/blobs: can't rm \"$blobfile\""
rm -Rf "$rmf" || $err "$nuke pjcfgdir: can't rm \"$nukefile\""
printf "nuke %s: deleted \"%s\"\n" "$pjcfgdir" "$rmf"
done < "config/$pjcfgdir/nuke.list"
[ "${del}" = "y" ] && return 0
printf "nuke %s: no defined blobs exist in dir, src/%s\n" 1>&2 \
printf "nuke %s: no defined files exist in dir, src/%s\n" 1>&2 \
"$pjcfgdir" "$pjsrcdir"
printf "(this is not an error)\n" 1>&2
}