diff options
author | Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | 2017-03-24 21:41:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-27 08:15:24 +0100 |
commit | 7ddcbc5eca0c09408bc3698561f8b913682232d4 (patch) | |
tree | 57f97a55a2e86b32cb91cc9108ec5efcc13552fc /scripts/contrib | |
parent | 6ce9cc464a8961251a10f7f8cb7565e2da22566c (diff) | |
download | openembedded-core-contrib-7ddcbc5eca0c09408bc3698561f8b913682232d4.tar.gz |
scripts/contrib: scripts that updates kernel templates
Updating the kernel templates (those use by the yocto-bsp script) is a mechanical
process (and prone to errors) which consists of copying latest kernel template then
applying string replacements from old to new kernel version. This script collects
these commands allowing quick updates in the future.
(From meta-yocto rev: 450313d9d8bb1e728ed5a7208decd30f50633be1)
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/yocto-bsp-kernel-update.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/scripts/contrib/yocto-bsp-kernel-update.sh b/scripts/contrib/yocto-bsp-kernel-update.sh new file mode 100755 index 00000000000..b3aa705603a --- /dev/null +++ b/scripts/contrib/yocto-bsp-kernel-update.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Copyright (c) 2017, Intel Corporation. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Description: creates a new set of kernel templates based on version +# + +set -o nounset +set -o errexit + +if [ $# -ne 4 ]; then + cat << EOF +usage: $0 from_mayor from_minor to_mayor to_minor +EOF + exit 1 +else + fma=$1 # from mayor + fmi=$2 # from minor + tma=$3 # to mayor + tmi=$4 # to minor +fi + +poky=$(readlink -e $(dirname $(dirname $(dirname $0)))) +arch=$poky/scripts/lib/bsp/substrate/target/arch + + +# copy/rename templates +for from in $(ls -1 $arch/*/recipes-kernel/linux/linux-yocto*_$fma\.$fmi.bbappend) +do + to=$(echo $from | sed s/$fma\.$fmi/$tma\.$tmi/) + cp $from $to +done + +# replace versions string inside new templates +for bbappend in $(ls -1 $arch/*/recipes-kernel/linux/linux-yocto*_$tma\.$tmi.bbappend) +do + sed -i 1s/$fma\.$fmi/$tma\.$tmi/ $bbappend + sed -i \$s/$fma\.$fmi/$tma\.$tmi/ $bbappend +done + +# update the noinstall files +for noinstall in $(ls -1 $arch/*/recipes-kernel/linux/kernel-list.noinstall) +do + sed -i s/$fma\.$fmi/$tma\.$tmi/g $noinstall; +done |