Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2017, Intel Corporation. |
| 4 | # All rights reserved. |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 2 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
| 14 | # the GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | # |
| 20 | # Description: creates a new set of kernel templates based on version |
| 21 | # |
| 22 | |
| 23 | set -o nounset |
| 24 | set -o errexit |
| 25 | |
| 26 | if [ $# -ne 4 ]; then |
| 27 | cat << EOF |
| 28 | usage: $0 from_mayor from_minor to_mayor to_minor |
| 29 | EOF |
| 30 | exit 1 |
| 31 | else |
| 32 | fma=$1 # from mayor |
| 33 | fmi=$2 # from minor |
| 34 | tma=$3 # to mayor |
| 35 | tmi=$4 # to minor |
| 36 | fi |
| 37 | |
| 38 | poky=$(readlink -e $(dirname $(dirname $(dirname $0)))) |
| 39 | arch=$poky/scripts/lib/bsp/substrate/target/arch |
| 40 | |
| 41 | |
| 42 | # copy/rename templates |
| 43 | for from in $(ls -1 $arch/*/recipes-kernel/linux/linux-yocto*_$fma\.$fmi.bbappend) |
| 44 | do |
| 45 | to=$(echo $from | sed s/$fma\.$fmi/$tma\.$tmi/) |
| 46 | cp $from $to |
| 47 | done |
| 48 | |
| 49 | # replace versions string inside new templates |
| 50 | for bbappend in $(ls -1 $arch/*/recipes-kernel/linux/linux-yocto*_$tma\.$tmi.bbappend) |
| 51 | do |
| 52 | sed -i 1s/$fma\.$fmi/$tma\.$tmi/ $bbappend |
| 53 | sed -i \$s/$fma\.$fmi/$tma\.$tmi/ $bbappend |
| 54 | done |
| 55 | |
| 56 | # update the noinstall files |
| 57 | for noinstall in $(ls -1 $arch/*/recipes-kernel/linux/kernel-list.noinstall) |
| 58 | do |
| 59 | sed -i s/$fma\.$fmi/$tma\.$tmi/g $noinstall; |
| 60 | done |