On 5/9/25 4:17 PM, Josh Poimboeuf wrote: > +copy_patched_objects() { > + local found > + local files=() > + local opts=() > + > + rm -rf "$PATCHED_DIR" > + mkdir -p "$PATCHED_DIR" > + > + # Note this doesn't work with some configs, thus the 'cmp' below. > + opts=("-newer") > + opts+=("$TIMESTAMP") > + > + find_objects "${opts[@]}" | mapfile -t files > + > + xtrace_save "processing all objects" > + for _file in "${files[@]}"; do > + local rel_file="${_file/.ko/.o}" > + local file="$OBJ/$rel_file" > + local orig_file="$ORIG_DIR/$rel_file" > + local patched_file="$PATCHED_DIR/$rel_file" > + > + [[ ! -f "$file" ]] && die "missing $(basename "$file") for > $_file" > + > + cmp -s "$orig_file" "$file" && continue > + > + mkdir -p "$(dirname "$patched_file")" > + cp -f "$file" "$patched_file" > + found=1 > + done > + xtrace_restore > + > + [[ -n "$found" ]] || die "no changes detected" > +
Minor nit here, I gave it a patch for files that didn't compile and because because files() was presumably empty: ./scripts/livepatch/klp-build: line 564: found: unbound variable since found was only declared local, but never set inside the loop. -- Joe