5 # If an argument is given, it's the location
6 # of the Linux kernel source tree
8 if [ -n "${k_dir}" -a -d "${k_dir}/kernel" ]; then
10 eval $( head -n 5 "${k_dir}/Makefile" \
11 |sed -r -e 's/^/K_/; s/"//g; s/ = ?/="/; s/$/"/;' \
13 printf "Found Linux kernel %d.%d.%d%s '%s'\n" \
14 "${K_VERSION}" "${K_PATCHLEVEL}" "${K_SUBLEVEL}" \
15 "${K_EXTRAVERSION}" "${K_NAME}"
17 if [ -n "${k_dir}" ]; then
18 printf "%s: \`%s': not a Linux kernel source tree\n" \
19 "${my_name}" "${k_dir}"
21 printf "Usage: %s /path/to/kernel/dir\n" "${my_name}"
26 exec <misc/kernel2kfrontends.list
28 while read k_file trash kf_file; do
29 cp -v "${k_dir}/${k_file}" "${kf_file}"
30 if [ -f "${kf_file}.patch" ]; then
31 patch --no-backup-if-mismatch -g0 -F1 -p1 -f <"${kf_file}.patch"