6 # If an argument is given, it's the location
7 # of the Linux kernel source tree
9 if [ ! \( -n "${k_dir}" -a -d "${k_dir}/kernel" \) ]; then
10 if [ -n "${k_dir}" ]; then
11 printf "%s: \`%s': not a Linux kernel source tree\n" \
12 "${my_name}" "${k_dir}"
14 printf "Usage: %s /path/to/kernel/dir\n" "${my_name}"
19 # Save current version
20 k_cset_old=$( head -n 1 .version |awk '{ print $(2); }' )
22 # Get the kernel version
23 eval $( head -n 5 "${k_dir}/Makefile" \
24 |sed -e 's/^/K_/; s/"//g; s/ = \{0,1\}/="/; s/$/"/;' \
26 k_cset="$( cd "${k_dir}"; \
27 git log -n 1 --pretty='format:%H' \
29 printf "Found Linux kernel %d.%d.%d%s '%s' (%7.7s)\n" \
30 "${K_VERSION}" "${K_PATCHLEVEL}" "${K_SUBLEVEL}" \
31 "${K_EXTRAVERSION}" "${K_NAME}" "${k_cset}"
33 # Get the kconfig-frontends version
34 kf_version="$( tail -n 1 .version )"
36 # Store the new version
37 printf "%d.%d.%d%s %s %s\n%s\n" \
38 "${K_VERSION}" "${K_PATCHLEVEL}" \
39 "${K_SUBLEVEL}" "${K_EXTRAVERSION}" \
40 "${k_cset}" "${K_NAME}" \
46 while read k_file trash kf_file; do
47 k_files="${k_files} ${k_file}"
48 mkdir -p "${kf_file%/*}"
49 cp -v "${k_dir}/${k_file}" "${kf_file}"
50 if [ -f "${kf_file}.patch" ]; then
51 patch --no-backup-if-mismatch -g0 -F1 -p1 -f <"${kf_file}.patch"
53 done <scripts/ksync.list
55 # Save the changelog between the old cset and now
56 printf "Synced-up these changes:\n"
58 git log --no-merges --pretty='tformat:%h %s' \
59 "${k_cset_old}..${k_cset}" \
62 |tee -a "scripts/ksync.log" \