Skip to contentSkip to conversation

Patch selection by prepare-kernel.sh (again)

Xenomai-core Jan Kiszka 3 participants 5 messages Jan 21, 2008 – Jan 22, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Philippe,

what was the idea behind commit #3256 [1]? It breaks the original behavior of selection adeos-ipipe-2.6.23-... in the presence of 2.6.23.x
- and leaves a bad first impression for beginners (I received such a notice here...). Was this for the special case adeos-ipipe-2.6.20.21-i386-1.12-02.patch? But I think the common case should take precedence over this corner case here. Unless there are more issues with the original version, I would vote for restoring it.

Alternatively, we could add a safety belt by trying to apply the patch with --dry-run first and only continue if this works out without failures. Can hack this up if it's acceptable.

Jan

[1]http://svn.gna.org/viewcvs/xenomai/trunk/scripts/prepare-kernel.sh?rev=3257&view=diff&r1=3257&r2=3256&p1=trunk/scripts/prepare-kernel.sh&p2=/trunk/scripts/prepare-kernel.sh

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
author
#1 lore raw
Quoted 10 lines · Jan Kiszka

Philippe,

what was the idea behind commit #3256 [1]? It breaks the original behavior of selection adeos-ipipe-2.6.23-... in the presence of 2.6.23.x
- and leaves a bad first impression for beginners (I received such a notice here...). Was this for the special case adeos-ipipe-2.6.20.21-i386-1.12-02.patch? But I think the common case should take precedence over this corner case here. Unless there are more issues with the original version, I would vote for restoring it.

Quoted 3 lines

Alternatively, we could add a safety belt by trying to apply the patch with --dry-run first and only continue if this works out without failures. Can hack this up if it's acceptable.

Oh, this check already exists!

So let's try this version, which additionally cleans up the related documentation. Catches both 2.6.23* and 2.6.24* for me here, but I may miss some cases (2.4?).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
---
 README.INSTALL            |    5 ++++-
 scripts/prepare-kernel.sh |    8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)
README.INSTALL +4 -1
Index: xenomai/README.INSTALL
===================================================================
@@ -66,7 +66,6 @@ support:
 $ cd xenomai-2.4
 $ scripts/prepare-kernel.sh
   --linux=/usr/src/linux-2.6.23-ipipe
-  --adeos=/tmp/adeos-ipipe-2.6.23-i386-1.10-12.patch
   --arch=i386
 
 Note: The script will infer the location of the Xenomai kernel code
@@ -75,6 +74,10 @@ if /usr/src/xenomai-2.4/script/prepare-k
 Xenomai's kernel support available from /usr/src/xenomai-2.4/ksrc will
 be bound to the target kernel.
 
+Second note: If the script fails to figure out a matching Adeos patch,
+it will ask for the correct patch file. Suitable patches are available
+under ksrc/arch/<target-arch>/patches.
+
 1.2 Configuring and building the target kernel
 ----------------------------------------------
 
scripts/prepare-kernel.sh +4 -4
Index: xenomai/scripts/prepare-kernel.sh
===================================================================
@@ -353,10 +353,10 @@ eval linux_`grep '^PATCHLEVEL =' $linux_
 eval linux_`grep '^SUBLEVEL =' $linux_tree/Makefile | sed -e 's, ,,g'`
 eval linux_`grep '^VERSION =' $linux_tree/Makefile | sed -e 's, ,,g'`
 
-linux_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL$linux_EXTRAVERSION"
+linux_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL"
 
 if test x$verbose = x1; then
-echo "Preparing kernel $linux_version in $linux_tree..."
+echo "Preparing kernel $linux_version$linux_EXTRAVERSION in $linux_tree..."
 fi
 
 if test -r $linux_tree/include/linux/ipipe.h; then
@@ -369,7 +369,7 @@ elif test -r $linux_tree/include/linux/a
    exit 2
 else
    if test x$adeos_patch = x; then
-      default_adeos_patch=`( ls $xenomai_root/ksrc/arch/$xenomai_arch/patches/adeos-ipipe-$linux_version-$linux_arch-*|sort -r ) 2>/dev/null | head -n1`
+      default_adeos_patch="`( ls $xenomai_root/ksrc/arch/$xenomai_arch/patches/adeos-ipipe-$linux_version*-{$linux_arch,$xenomai_arch}-*|sort -r ) 2>/dev/null | head -n1`"
    fi
    if test x$default_adeos_patch = x; then
       default_adeos_patch=/dev/null
@@ -393,7 +393,7 @@ else
    curdir=$PWD
    cd $linux_tree && patch --dry-run -p1 -f < $adeos_patch || { 
         cd $curdir;
-        echo "$me: Unable to patch kernel $linux_version with `basename $adeos_patch`." >&2
+        echo "$me: Unable to patch kernel $linux_version$linux_EXTRAVERSION with `basename $adeos_patch`." >&2
         exit 2;
    }
    patch -p1 -f -s < $adeos_patch
author
#2 lore raw
Quoted 15 lines · Jan Kiszka
Quoted 10 lines · Jan Kiszka

Philippe,

what was the idea behind commit #3256 [1]? It breaks the original behavior of selection adeos-ipipe-2.6.23-... in the presence of 2.6.23.x
- and leaves a bad first impression for beginners (I received such a notice here...). Was this for the special case adeos-ipipe-2.6.20.21-i386-1.12-02.patch? But I think the common case should take precedence over this corner case here. Unless there are more issues with the original version, I would vote for restoring it.

Quoted 3 lines

Alternatively, we could add a safety belt by trying to apply the patch with --dry-run first and only continue if this works out without failures. Can hack this up if it's acceptable.

Quoted 5 lines

Oh, this check already exists!

So let's try this version, which additionally cleans up the related documentation. Catches both 2.6.23* and 2.6.24* for me here, but I may miss some cases (2.4?).

The documentation hunk was nonsense, here is a hopefully better version.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
---
 README.INSTALL            |   11 +++++------
 scripts/prepare-kernel.sh |    8 ++++----
 2 files changed, 9 insertions(+), 10 deletions(-)
README.INSTALL +5 -6
Index: xenomai/README.INSTALL
===================================================================
@@ -51,8 +51,10 @@ $ scripts/prepare-kernel.sh --linux=<lin
     valid either way.
 
     --adeos specifies the path of the Adeos patch to apply against the
-    kernel tree. This parameter can be omitted if Adeos has already
-    been patched in. In any case, the script will not try to apply it
+    kernel tree. Suitable patches are available with Xenomai under
+    ksrc/arch/<target-arch>/patches. This parameter can be omitted if
+    Adeos has already been patched in or the script shall suggest an
+    appropriate one. In any case, the script will not try to apply it
     again whenever a former patch is detected.
 
     --arch tells the script about the target architecture. If
@@ -64,10 +66,7 @@ located at /usr/src/linux-2.6.23-ipipe i
 support:
 
 $ cd xenomai-2.4
-$ scripts/prepare-kernel.sh
-  --linux=/usr/src/linux-2.6.23-ipipe
-  --adeos=/tmp/adeos-ipipe-2.6.23-i386-1.10-12.patch
-  --arch=i386
+$ scripts/prepare-kernel.sh --linux=/usr/src/linux-2.6.23-ipipe
 
 Note: The script will infer the location of the Xenomai kernel code
 from its own location within the Xenomai source tree. In other words,
scripts/prepare-kernel.sh +4 -4
Index: xenomai/scripts/prepare-kernel.sh
===================================================================
@@ -353,10 +353,10 @@ eval linux_`grep '^PATCHLEVEL =' $linux_
 eval linux_`grep '^SUBLEVEL =' $linux_tree/Makefile | sed -e 's, ,,g'`
 eval linux_`grep '^VERSION =' $linux_tree/Makefile | sed -e 's, ,,g'`
 
-linux_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL$linux_EXTRAVERSION"
+linux_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL"
 
 if test x$verbose = x1; then
-echo "Preparing kernel $linux_version in $linux_tree..."
+echo "Preparing kernel $linux_version$linux_EXTRAVERSION in $linux_tree..."
 fi
 
 if test -r $linux_tree/include/linux/ipipe.h; then
@@ -369,7 +369,7 @@ elif test -r $linux_tree/include/linux/a
    exit 2
 else
    if test x$adeos_patch = x; then
-      default_adeos_patch=`( ls $xenomai_root/ksrc/arch/$xenomai_arch/patches/adeos-ipipe-$linux_version-$linux_arch-*|sort -r ) 2>/dev/null | head -n1`
+      default_adeos_patch="`( ls $xenomai_root/ksrc/arch/$xenomai_arch/patches/adeos-ipipe-$linux_version*-{$linux_arch,$xenomai_arch}-*|sort -r ) 2>/dev/null | head -n1`"
    fi
    if test x$default_adeos_patch = x; then
       default_adeos_patch=/dev/null
@@ -393,7 +393,7 @@ else
    curdir=$PWD
    cd $linux_tree && patch --dry-run -p1 -f < $adeos_patch || { 
         cd $curdir;
-        echo "$me: Unable to patch kernel $linux_version with `basename $adeos_patch`." >&2
+        echo "$me: Unable to patch kernel $linux_version$linux_EXTRAVERSION with `basename $adeos_patch`." >&2
         exit 2;
    }
    patch -p1 -f -s < $adeos_patch
#3 lore raw
Quoted 15 lines · Jan Kiszka
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Jan Kiszka

Philippe,

what was the idea behind commit #3256 [1]? It breaks the original behavior of selection adeos-ipipe-2.6.23-... in the presence of 2.6.23.x
- and leaves a bad first impression for beginners (I received such a notice here...). Was this for the special case adeos-ipipe-2.6.20.21-i386-1.12-02.patch? But I think the common case should take precedence over this corner case here. Unless there are more issues with the original version, I would vote for restoring it.

Alternatively, we could add a safety belt by trying to apply the patch with --dry-run first and only continue if this works out without failures. Can hack this up if it's acceptable.

Quoted 8 lines
Quoted 5 lines

Oh, this check already exists!

So let's try this version, which additionally cleans up the related documentation. Catches both 2.6.23* and 2.6.24* for me here, but I may miss some cases (2.4?).

The documentation hunk was nonsense, here is a hopefully better version.

Makes sense and works fine for the kernel/arch combos I've tested so far. Merged, thanks.

Signature · 1 line
Philippe.
#4 lore raw
Quoted 23 lines · Philippe Gerum
Quoted 21 lines · Jan Kiszka
Quoted 19 lines · Jan Kiszka
Quoted 10 lines · Jan Kiszka

Philippe,

what was the idea behind commit #3256 [1]? It breaks the original behavior of selection adeos-ipipe-2.6.23-... in the presence of 2.6.23.x
- and leaves a bad first impression for beginners (I received such a notice here...). Was this for the special case adeos-ipipe-2.6.20.21-i386-1.12-02.patch? But I think the common case should take precedence over this corner case here. Unless there are more issues with the original version, I would vote for restoring it.

Quoted 3 lines

Alternatively, we could add a safety belt by trying to apply the patch with --dry-run first and only continue if this works out without failures. Can hack this up if it's acceptable.

Oh, this check already exists!

So let's try this version, which additionally cleans up the related documentation. Catches both 2.6.23* and 2.6.24* for me here, but I may miss some cases (2.4?).

Quoted 5 lines
Quoted 2 lines

The documentation hunk was nonsense, here is a hopefully better version.

Makes sense and works fine for the kernel/arch combos I've tested so far. Merged, thanks.

configure.in probably needs a similar fix for the --enable-linux-build option to work with the -x86 patches.

Signature · 1 line
                                               Gilles Chanteperdrix
configure.in +1 -0
Index: configure.in
===================================================================
@@ -337,6 +337,7 @@
   fi
   case "$ADEOS_PATCH" in
 	*-powerpc-*) XENO_LINUX_ARCH=powerpc;;
+	*-x86-*) XENO_LINUX_ARCH=x86;;
   esac
   AC_SUBST(ADEOS_PATCH)