Skip to contentSkip to conversation

ACPICA: Linuxize: Add patch header fields for linuxized patches.

PATCH New Lv Zheng 1 participant 5 messages Jan 11, 2013 ACPI component architecture (acpica)

lore
Share & tools
lore

Lv Zheng

author
#0 lore raw

PATCH v2 1/2 ACPICA: Linuxize: Add patch header fields for linuxized patches.

Linuxized patches are lack of patch headers, thus can not be directly applied to the Linux source codes. This patch updates the scripts to allow patch headers to be generated for the linuxized patches.

Signed-off-by Lv Zheng <lv.zheng(a)intel.com>
---
 generate/linux/patches/make-patches.pl |   10 ++++++++++
 1 file changed, 10 insertions(+)
generate/linux/patches/make-patches.pl +10 -0
index 11d072a..a1f7699 100755
@@ -344,6 +344,16 @@ sub make_patch
 
     $linux_patch_count++;
 
+    # Append the header
+
+    open(PTCH, ">>$file_name") or die ("Cannot open $file_name for appending");
+    print(PTCH "From nobody\n");
+    print(PTCH "Subject: [Patch $linux_patch_count] ACPICA: $short_log\n");
+    print(PTCH "From: $patch_from\n");
+    print(PTCH "Date: $date\n");
+    print(PTCH "\n");
+    close(PTCH);
+
     # Format the log (eliminate long lines) and append it
 
     system("rm -f temp temp2");
Signature · 1 line
1.7.10
author
#1 lore raw

PATCH v2 2/2 ACPICA: Linuxize: Move acpisrc generation from make-patch.pl to linuxize.sh.

This fix can help to generate correct linuxized patch where the version of the acpisrc is critical.

Signed-off-by Lv Zheng <lv.zheng(a)intel.com>
---
 generate/linux/patches/linuxize.sh     |    5 +++++
 generate/linux/patches/make-patches.pl |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
generate/linux/patches/linuxize.sh +5 -0
index f4ac142..50163d3 100755
@@ -17,6 +17,11 @@ if [ ! -z "$version" ] ; then
 	)
 fi
 
+# Generate latest version of the acpisrc utility
+
+echo "[linuxize.sh] Generate acpisrc utility from source"
+sh acpisrc.sh $git_root > /dev/null
+
 rm -rf new.linux
 echo "[linuxize.sh] Coverting format (AcpiSrc)..."
 bin/acpisrc -ldqy $git_root/source new.linux > /dev/null
generate/linux/patches/make-patches.pl +0 -5
index a1f7699..f67f08b 100755
@@ -85,11 +85,6 @@ system("rm -rf $git_root; git clone $git_repo $git_root > /dev/null");
 system("cd $git_root; old_release=`git log --pretty=format:%H $old_release~1..$old_release`");
 system("cd $git_root; new_release=`git log --pretty=format:%H $new_release~1..$new_release`");
 
-# Generate latest version of the acpisrc utility
-
-system("echo [make-patches] Generate acpisrc utility from source");
-system("sh acpisrc.sh $git_root > /dev/null");
-
 
 # Create GIT log
 
Signature · 1 line
1.7.10
author
#2 lore raw

v2 cover ACPICA: Update linuxized scripts.

In reply to Lv Zheng

Update linuxized scripts to make proper genereated patches.

History:
v1:
1. Add header fields for linuxized patches, one per file.
2. Fix acpisrc generation position to allow copyright patches to be created.
v2:
1. Fix header fields for linuxized patches, mbox file.

Lv Zheng (2):
ACPICA: Linuxize: Add patch header fields for linuxized patches.
ACPICA: Linuxize: Move acpisrc generation from make-patch.pl to
linuxize.sh.

 generate/linux/patches/linuxize.sh     |    5 +++
 generate/linux/patches/make-patches.pl |   64 +++++++++++++++++++++++++++++---
 2 files changed, 64 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.10
author
#3 lore raw

PATCH v2 1/2 ACPICA: Linuxize: Add patch header fields for linuxized patches.

Linuxized patches are lack of patch headers, thus can not be directly applied to the Linux source codes. This patch updates the scripts to allow patch headers to be generated for the linuxized patches.

Signed-off-by Lv Zheng <lv.zheng(a)intel.com>
---
 generate/linux/patches/make-patches.pl |   59 ++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
generate/linux/patches/make-patches.pl +59 -0
index 11d072a..7e643f0 100755
@@ -125,6 +125,13 @@ system("echo [make-patches] Creating the Linux patches");
 system("echo [make-patches] Creating the mbox patch file");
 &make_mbox;
 
+
+# Purify the linux patches, one per file
+
+system("echo [make-patches] Purifying the Linux patches");
+&purify_patches;
+
+
 # Remove the temporary files/dirs 
 
 #system("rm -rf $git_root acpi_include bin drivers patches.git git.log");
@@ -234,6 +241,20 @@ sub make_mbox
 
 
 #
+# This function purifies the linux patches from the GIT log file.
+# Requires the git log and the git patch set (both created by git)
+#
+sub purify_patches
+{
+    $linux_patch_count = 0;
+    $patch_num = 0;
+
+    &walk_git_log (count_patches);
+    &walk_git_log (purify_patch);
+}
+
+
+#
 # Count the individual patches
 #
 sub count_patches
@@ -375,3 +396,41 @@ sub make_patch
     system("rm -f diff.linux");
 }
 
+
+
+#
+# This function purifies a linux patch from the corresponding
+# GIT patch against the original ACPICA source tree
+#
+sub purify_patch
+{
+    my $patch_name = @_[0];
+    my $date = @_[1];
+    my $file_name = @_[2];
+    my $short_log = @_[3];
+    my $long_log = @_[4];
+
+
+
+    open(PTCH, $file_name) or return;
+    close(PTCH);
+
+    $patch_num++;
+
+    # Append the header
+
+    system("rm -f temp");
+    open(PTCH, ">temp") or die ("Cannot open temp for writing");
+    print(PTCH "From nobody $mbox_date\n");
+    print(PTCH "Subject: [Patch $patch_num/$linux_patch_count] ACPICA: $short_log\n");
+    print(PTCH "From: $patch_from\n");
+    print(PTCH "Date: $date\n");
+    print(PTCH "\n");
+    close(PTCH);
+
+    # Append the full patch to the purified file
+
+    system("cat $file_name >> temp");
+    system("cat temp > $file_name");
+    system("rm -f temp");
+}
Signature · 1 line
1.7.10
author
#4 lore raw

PATCH v2 2/2 ACPICA: Linuxize: Move acpisrc generation from make-patch.pl to linuxize.sh.

In reply to Lv Zheng

This fix can help to generate correct linuxized patch where the version of the acpisrc is critical.

Signed-off-by Lv Zheng <lv.zheng(a)intel.com>
---
 generate/linux/patches/linuxize.sh     |    5 +++++
 generate/linux/patches/make-patches.pl |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
generate/linux/patches/linuxize.sh +5 -0
index f4ac142..50163d3 100755
@@ -17,6 +17,11 @@ if [ ! -z "$version" ] ; then
 	)
 fi
 
+# Generate latest version of the acpisrc utility
+
+echo "[linuxize.sh] Generate acpisrc utility from source"
+sh acpisrc.sh $git_root > /dev/null
+
 rm -rf new.linux
 echo "[linuxize.sh] Coverting format (AcpiSrc)..."
 bin/acpisrc -ldqy $git_root/source new.linux > /dev/null
generate/linux/patches/make-patches.pl +0 -5
index 7e643f0..1ed1cdc 100755
@@ -85,11 +85,6 @@ system("rm -rf $git_root; git clone $git_repo $git_root > /dev/null");
 system("cd $git_root; old_release=`git log --pretty=format:%H $old_release~1..$old_release`");
 system("cd $git_root; new_release=`git log --pretty=format:%H $new_release~1..$new_release`");
 
-# Generate latest version of the acpisrc utility
-
-system("echo [make-patches] Generate acpisrc utility from source");
-system("sh acpisrc.sh $git_root > /dev/null");
-
 
 # Create GIT log
 
Signature · 1 line
1.7.10