Skip to contentSkip to conversation

Fix getopt parsing of long options

PATCH In review Ross Lagerwall 2 participants 6 messages Jul 20, 2016 – Jul 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Fix getopt parsing of long options

---
 livepatch-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
livepatch-build +1 -1
index 7395b49..d9d9da3 100755
@@ -185,7 +185,7 @@ usage() {
 
 find_tools || die "can't find supporting tools"
 
-options=$(getopt -o hs:p:c:o:j:k:d -l "help,srcdir:patch:config:output:cpus:,skip:,debug,xen-debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed"
+options=$(getopt -o hs:p:c:o:j:k:d -l "help,srcdir:,patch:,config:,output:,cpus:,skip:,debug,xen-debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed"
 
 eval set -- "$options"
 
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH 2/2 Prevent spurious rebuilding

Don't change the timestamp of arch/x86/Makefile when editing it since it forces much of the Xen tree to be rebuilt and then requires many invocations of create-diff-tool.

This is safe since the Makefile change only changes the final link rule, and xen will be relinked anyway.

---
 livepatch-build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
livepatch-build +4 -1
index d9d9da3..c057fa1 100755
@@ -98,10 +98,13 @@ function build_special()
     # Build with special GCC flags
     cd "${SRCDIR}/xen" || die
     sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/' Rules.mk
+    cp -p arch/x86/Makefile arch/x86/Makefile.bak
     sed -i 's/--section-alignment=0x200000/--section-alignment=0x1000/' arch/x86/Makefile
+    # Restore timestamps to prevent spurious rebuilding
+    touch --reference=arch/x86/Makefile.bak arch/x86/Makefile
     make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" || die
     sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS += -nostdinc/' Rules.mk
-    sed -i 's/--section-alignment=0x1000/--section-alignment=0x200000/' arch/x86/Makefile
+    mv -f arch/x86/Makefile.bak arch/x86/Makefile
 
     unset LIVEPATCH_BUILD_DIR
     unset LIVEPATCH_CAPTURE_DIR
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

Re: [PATCH LIVEPATCH-BUILD-TOOLS 2/2] Prevent spurious rebuilding

Quoted 6 lines · Ross Lagerwall

Don't change the timestamp of arch/x86/Makefile when editing it since it forces much of the Xen tree to be rebuilt and then requires many invocations of create-diff-tool.

This is safe since the Makefile change only changes the final link rule, and xen will be relinked anyway.

That looks good, but the patch is missing your SoB.

Quoted 26 lines
---
 livepatch-build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
livepatch-build +4 -1
index d9d9da3..c057fa1 100755
@@ -98,10 +98,13 @@ function build_special()
     # Build with special GCC flags
     cd "${SRCDIR}/xen" || die
     sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/' Rules.mk
+    cp -p arch/x86/Makefile arch/x86/Makefile.bak
     sed -i 's/--section-alignment=0x200000/--section-alignment=0x1000/' arch/x86/Makefile
+    # Restore timestamps to prevent spurious rebuilding
+    touch --reference=arch/x86/Makefile.bak arch/x86/Makefile
     make "-j$CPUS" $XEN_DEBUG &> "${OUTPUT}/build_${name}_compile.log" || die
     sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS += -nostdinc/' Rules.mk
-    sed -i 's/--section-alignment=0x1000/--section-alignment=0x200000/' arch/x86/Makefile
+    mv -f arch/x86/Makefile.bak arch/x86/Makefile
 
     unset LIVEPATCH_BUILD_DIR
     unset LIVEPATCH_CAPTURE_DIR
Signature · 1 line
2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw

Re: [PATCH LIVEPATCH-BUILD-TOOLS 2/2] Prevent spurious rebuilding

Quoted 10 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Ross Lagerwall

Don't change the timestamp of arch/x86/Makefile when editing it since it forces much of the Xen tree to be rebuilt and then requires many invocations of create-diff-tool.

This is safe since the Makefile change only changes the final link rule, and xen will be relinked anyway.

That looks good, but the patch is missing your SoB.

Sorry about that.

I pushed both after adding my SoB.

Signature · 6 lines
Ross Lagerwall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#4 lore raw

Re: [PATCH LIVEPATCH-BUILD-TOOLS 2/2] Prevent spurious rebuilding

Quoted 9 lines · Ross Lagerwall
Quoted 8 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Ross Lagerwall

Don't change the timestamp of arch/x86/Makefile when editing it since it forces much of the Xen tree to be rebuilt and then requires many invocations of create-diff-tool.

This is safe since the Makefile change only changes the final link rule, and xen will be relinked anyway.

Quoted 6 lines
Quoted 2 lines

That looks good, but the patch is missing your SoB.

Sorry about that.

I pushed both after adding my SoB.

Thanks!

Quoted 3 lines
Signature · 2 lines
-- 
Ross Lagerwall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw
In reply to Ross Lagerwall

On Wed, Jul 20, 2016 at 03:49:43PM +0100, Ross Lagerwall wrote:

What happend to your SoB?

The patch is fine otherwise.

Quoted 20 lines
---
 livepatch-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
livepatch-build +1 -1
index 7395b49..d9d9da3 100755
@@ -185,7 +185,7 @@ usage() {
 
 find_tools || die "can't find supporting tools"
 
-options=$(getopt -o hs:p:c:o:j:k:d -l "help,srcdir:patch:config:output:cpus:,skip:,debug,xen-debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed"
+options=$(getopt -o hs:p:c:o:j:k:d -l "help,srcdir:,patch:,config:,output:,cpus:,skip:,debug,xen-debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed"
 
 eval set -- "$options"
 
Signature · 1 line
2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel