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
9 if [ -n "${k_dir}" ]; then
10 printf "%s: \`%s': not a Linux kernel source tree\n" \
11 "${my_name}" "${k_dir}"
13 printf "Usage: %s /path/to/kernel/dir\n" "${my_name}"
18 # Save current version
19 k_cset_old=$( head -n 1 .version |awk '{ print $(2); }' )
21 # Get the kernel version
22 eval $( head -n 5 "${k_dir}/Makefile" \
23 |sed -r -e 's/^/K_/; s/"//g; s/ = ?/="/; s/$/"/;' \
25 k_cset="$( cd "${k_dir}"; \
26 git log -n 1 --pretty='format:%H' \
28 printf "Found Linux kernel %d.%d.%d%s '%s' (%7.7s)\n" \
29 "${K_VERSION}" "${K_PATCHLEVEL}" "${K_SUBLEVEL}" \
30 "${K_EXTRAVERSION}" "${K_NAME}" "${k_cset}"
32 # Get the kconfig-frontends version
33 kf_version="$( tail -n 1 .version )"
35 # Store the new version
36 printf "%d.%d.%d%s %s %s\n%s\n" \
37 "${K_VERSION}" "${K_PATCHLEVEL}" \
38 "${K_SUBLEVEL}" "${K_EXTRAVERSION}" \
39 "${k_cset}" "${K_NAME}" \
45 while read k_file trash kf_file; do
46 k_files="${k_files} ${k_file}"
47 mkdir -p "${kf_file%/*}"
48 cp -v "${k_dir}/${k_file}" "${kf_file}"
49 if [ -f "${kf_file}.patch" ]; then
50 patch --no-backup-if-mismatch -g0 -F1 -p1 -f <"${kf_file}.patch"
52 done <scripts/ksync.list
54 # Save the changelog between the old cset and now
55 printf "Synced-up these changes:\n"
57 git log --no-merges --pretty='tformat:%s' \
58 "${k_cset_old}..${k_cset}" \
60 )|tee -a "scripts/ksync.log" \