All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: redefine OPT_APPEND and OPT_RAMDISK
       [not found] <CGME20200414085411eucas1p240d872905d55681ab4a3d9bb9f584563@eucas1p2.samsung.com>
@ 2020-04-14  8:52 ` Łukasz Stelmach
       [not found]   ` <CGME20200415105859eucas1p2db849d89aa9a338077a01784f73dad52@eucas1p2.samsung.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Łukasz Stelmach @ 2020-04-14  8:52 UTC (permalink / raw)
  To: horms, kexec; +Cc: Łukasz Stelmach

Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
Redefine OPT_RAMDISK to avoid such problems in the future

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 kexec/arch/arm/include/arch/options.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/arch/arm/include/arch/options.h b/kexec/arch/arm/include/arch/options.h
index abbf349..9272378 100644
--- a/kexec/arch/arm/include/arch/options.h
+++ b/kexec/arch/arm/include/arch/options.h
@@ -4,12 +4,12 @@
 #define OPT_DT_NO_OLD_ROOT	(OPT_MAX+0)
 #define OPT_ARCH_MAX		(OPT_MAX+1)
 
-#define OPT_APPEND	'a'
-#define OPT_RAMDISK	'r'
 #define OPT_DTB		(OPT_ARCH_MAX+0)
 #define OPT_ATAGS	(OPT_ARCH_MAX+1)
 #define OPT_IMAGE_SIZE	(OPT_ARCH_MAX+2)
 #define OPT_PAGE_OFFSET	(OPT_ARCH_MAX+3)
+#define OPT_APPEND	(OPT_ARCH_MAX+4)
+#define OPT_RAMDISK	(OPT_ARCH_MAX+5)
 
 /* Options relevant to the architecture (excluding loader-specific ones),
  * in this case none:
-- 
2.25.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2] arm: redefine OPT_APPEND and OPT_RAMDISK
       [not found]   ` <CGME20200415105859eucas1p2db849d89aa9a338077a01784f73dad52@eucas1p2.samsung.com>
@ 2020-04-15 10:58     ` Łukasz Stelmach
  2020-04-16  8:44       ` Simon Horman
  2020-04-20 14:33       ` Lukasz Stelmach
  0 siblings, 2 replies; 7+ messages in thread
From: Łukasz Stelmach @ 2020-04-15 10:58 UTC (permalink / raw)
  To: horms, kexec; +Cc: Łukasz Stelmach

Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
Redefine OPT_RAMDISK to avoid such problems in the future

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 kexec/arch/arm/include/arch/options.h | 6 +++---
 kexec/arch/arm/kexec-zImage-arm.c     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kexec/arch/arm/include/arch/options.h b/kexec/arch/arm/include/arch/options.h
index abbf349..6fabfb7 100644
--- a/kexec/arch/arm/include/arch/options.h
+++ b/kexec/arch/arm/include/arch/options.h
@@ -4,12 +4,12 @@
 #define OPT_DT_NO_OLD_ROOT	(OPT_MAX+0)
 #define OPT_ARCH_MAX		(OPT_MAX+1)
 
-#define OPT_APPEND	'a'
-#define OPT_RAMDISK	'r'
 #define OPT_DTB		(OPT_ARCH_MAX+0)
 #define OPT_ATAGS	(OPT_ARCH_MAX+1)
 #define OPT_IMAGE_SIZE	(OPT_ARCH_MAX+2)
 #define OPT_PAGE_OFFSET	(OPT_ARCH_MAX+3)
+#define OPT_APPEND	(OPT_ARCH_MAX+4)
+#define OPT_RAMDISK	(OPT_ARCH_MAX+5)
 
 /* Options relevant to the architecture (excluding loader-specific ones),
  * in this case none:
@@ -45,7 +45,7 @@
 	{ "image-size",		1, 0, OPT_IMAGE_SIZE }, \
 	{ "page-offset",	1, 0, OPT_PAGE_OFFSET },
 
-#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR "a:r:s:"
+#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ""
 
 extern unsigned int kexec_arm_image_size;
 
diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 2a7eea9..d1aa8f6 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -418,7 +418,7 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
 		{ "page-offset",	1, 0, OPT_PAGE_OFFSET },
 		{ 0, 			0, 0, 0 },
 	};
-	static const char short_options[] = KEXEC_ARCH_OPT_STR "a:r:";
+	static const char short_options[] = KEXEC_ARCH_OPT_STR "";
 
 	/*
 	 * Parse the command line arguments
-- 
2.25.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] arm: redefine OPT_APPEND and OPT_RAMDISK
  2020-04-15 10:58     ` [PATCH v2] " Łukasz Stelmach
@ 2020-04-16  8:44       ` Simon Horman
  2020-04-20 14:33       ` Lukasz Stelmach
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Horman @ 2020-04-16  8:44 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: kexec

On Wed, Apr 15, 2020 at 12:58:45PM +0200, Łukasz Stelmach wrote:
> Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
> Redefine OPT_RAMDISK to avoid such problems in the future
> 
> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>

Hi Łukasz,

I am slightly concerned that this will break things for users.
But OTOH perhaps we already broke things when adding OPT_KEXEC_SYSCALL_AUTO.
Do you have any thoughts on this?

> ---
>  kexec/arch/arm/include/arch/options.h | 6 +++---
>  kexec/arch/arm/kexec-zImage-arm.c     | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kexec/arch/arm/include/arch/options.h b/kexec/arch/arm/include/arch/options.h
> index abbf349..6fabfb7 100644
> --- a/kexec/arch/arm/include/arch/options.h
> +++ b/kexec/arch/arm/include/arch/options.h
> @@ -4,12 +4,12 @@
>  #define OPT_DT_NO_OLD_ROOT	(OPT_MAX+0)
>  #define OPT_ARCH_MAX		(OPT_MAX+1)
>  
> -#define OPT_APPEND	'a'
> -#define OPT_RAMDISK	'r'
>  #define OPT_DTB		(OPT_ARCH_MAX+0)
>  #define OPT_ATAGS	(OPT_ARCH_MAX+1)
>  #define OPT_IMAGE_SIZE	(OPT_ARCH_MAX+2)
>  #define OPT_PAGE_OFFSET	(OPT_ARCH_MAX+3)
> +#define OPT_APPEND	(OPT_ARCH_MAX+4)
> +#define OPT_RAMDISK	(OPT_ARCH_MAX+5)
>  
>  /* Options relevant to the architecture (excluding loader-specific ones),
>   * in this case none:
> @@ -45,7 +45,7 @@
>  	{ "image-size",		1, 0, OPT_IMAGE_SIZE }, \
>  	{ "page-offset",	1, 0, OPT_PAGE_OFFSET },
>  
> -#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR "a:r:s:"
> +#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ""
>  
>  extern unsigned int kexec_arm_image_size;
>  
> diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
> index 2a7eea9..d1aa8f6 100644
> --- a/kexec/arch/arm/kexec-zImage-arm.c
> +++ b/kexec/arch/arm/kexec-zImage-arm.c
> @@ -418,7 +418,7 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
>  		{ "page-offset",	1, 0, OPT_PAGE_OFFSET },
>  		{ 0, 			0, 0, 0 },
>  	};
> -	static const char short_options[] = KEXEC_ARCH_OPT_STR "a:r:";
> +	static const char short_options[] = KEXEC_ARCH_OPT_STR "";
>  
>  	/*
>  	 * Parse the command line arguments
> -- 
> 2.25.0
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] arm: redefine OPT_APPEND and OPT_RAMDISK
  2020-04-15 10:58     ` [PATCH v2] " Łukasz Stelmach
  2020-04-16  8:44       ` Simon Horman
@ 2020-04-20 14:33       ` Lukasz Stelmach
  2020-04-22  8:01         ` Simon Horman
  1 sibling, 1 reply; 7+ messages in thread
From: Lukasz Stelmach @ 2020-04-20 14:33 UTC (permalink / raw)
  To: horms; +Cc: kexec


[-- Attachment #1.1: Type: text/plain, Size: 1085 bytes --]

> On Wed, Apr 15, 2020 at 12:58:45PM +0200, Łukasz Stelmach wrote:
>> Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
>> Redefine OPT_RAMDISK to avoid such problems in the future
>>
>> Signed-off-by: Łukasz Stelmach <l.stelmach at samsung.com>
>
> I am slightly concerned that this will break things for users.
> But OTOH perhaps we already broke things when adding
> OPT_KEXEC_SYSCALL_AUTO.
> Do you have any thoughts on this?

I am aware of this, but the current appears to be broken more. When I
was using '-a' it didn't work as advertised in the usage message. Short
*arch* options aren't documented there, so I suppose most people didn't
use them. ARM is the only architecture that supports short options by
defining OPT_* as characters. HPPA appears to be using them in the
optstring (copied from ARM?) but not in OPT_*. Would you like me to
clean this up too in v3?

In summary: undocumented, on one platform.

P.S. Please, cc me. I am not subscribed to the list.
-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] arm: redefine OPT_APPEND and OPT_RAMDISK
  2020-04-20 14:33       ` Lukasz Stelmach
@ 2020-04-22  8:01         ` Simon Horman
       [not found]           ` <CGME20200422194517eucas1p11d2ab9f4f68b891ea963633045f31ce9@eucas1p1.samsung.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2020-04-22  8:01 UTC (permalink / raw)
  To: Lukasz Stelmach; +Cc: kexec

On Mon, Apr 20, 2020 at 04:33:11PM +0200, Lukasz Stelmach wrote:
> > On Wed, Apr 15, 2020 at 12:58:45PM +0200, Łukasz Stelmach wrote:
> >> Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
> >> Redefine OPT_RAMDISK to avoid such problems in the future
> >>
> >> Signed-off-by: Łukasz Stelmach <l.stelmach at samsung.com>
> >
> > I am slightly concerned that this will break things for users.
> > But OTOH perhaps we already broke things when adding
> > OPT_KEXEC_SYSCALL_AUTO.
> > Do you have any thoughts on this?
> 
> I am aware of this, but the current appears to be broken more. When I
> was using '-a' it didn't work as advertised in the usage message. Short
> *arch* options aren't documented there, so I suppose most people didn't
> use them. ARM is the only architecture that supports short options by
> defining OPT_* as characters. HPPA appears to be using them in the
> optstring (copied from ARM?) but not in OPT_*. Would you like me to
> clean this up too in v3?
> 
> In summary: undocumented, on one platform.
> 
> P.S. Please, cc me. I am not subscribed to the list.

Thanks Łukasz,

I take your point with regards to these features being undocumented.
And I think the extra clean-up you suggest sounds good.
Could you post a v3 with that included?


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3] arm: redefine OPT_APPEND and OPT_RAMDISK
       [not found]           ` <CGME20200422194517eucas1p11d2ab9f4f68b891ea963633045f31ce9@eucas1p1.samsung.com>
@ 2020-04-22 19:45             ` Łukasz Stelmach
  2020-04-24  9:40               ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Łukasz Stelmach @ 2020-04-22 19:45 UTC (permalink / raw)
  To: horms, svens, kexec; +Cc: Łukasz Stelmach

Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
Redefine OPT_RAMDISK to avoid such problems in the future

Minor cleanup in HPPA too.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
Sven,

I removed some arch specific short options which to me don't seem
be handled in the getopt_long() loop in kexec-elf-hppa.c. Please tell us,
if it doesn't break anything.

Kind regards,
ŁS

 kexec/arch/arm/include/arch/options.h  | 6 +++---
 kexec/arch/arm/kexec-zImage-arm.c      | 2 +-
 kexec/arch/hppa/include/arch/options.h | 2 +-
 kexec/arch/hppa/kexec-elf-hppa.c       | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kexec/arch/arm/include/arch/options.h b/kexec/arch/arm/include/arch/options.h
index abbf349..6fabfb7 100644
--- a/kexec/arch/arm/include/arch/options.h
+++ b/kexec/arch/arm/include/arch/options.h
@@ -4,12 +4,12 @@
 #define OPT_DT_NO_OLD_ROOT	(OPT_MAX+0)
 #define OPT_ARCH_MAX		(OPT_MAX+1)
 
-#define OPT_APPEND	'a'
-#define OPT_RAMDISK	'r'
 #define OPT_DTB		(OPT_ARCH_MAX+0)
 #define OPT_ATAGS	(OPT_ARCH_MAX+1)
 #define OPT_IMAGE_SIZE	(OPT_ARCH_MAX+2)
 #define OPT_PAGE_OFFSET	(OPT_ARCH_MAX+3)
+#define OPT_APPEND	(OPT_ARCH_MAX+4)
+#define OPT_RAMDISK	(OPT_ARCH_MAX+5)
 
 /* Options relevant to the architecture (excluding loader-specific ones),
  * in this case none:
@@ -45,7 +45,7 @@
 	{ "image-size",		1, 0, OPT_IMAGE_SIZE }, \
 	{ "page-offset",	1, 0, OPT_PAGE_OFFSET },
 
-#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR "a:r:s:"
+#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ""
 
 extern unsigned int kexec_arm_image_size;
 
diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 9845925..ff609e2 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -409,7 +409,7 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
 		{ "page-offset",	1, 0, OPT_PAGE_OFFSET },
 		{ 0, 			0, 0, 0 },
 	};
-	static const char short_options[] = KEXEC_ARCH_OPT_STR "a:r:";
+	static const char short_options[] = KEXEC_ARCH_OPT_STR "";
 
 	/*
 	 * Parse the command line arguments
diff --git a/kexec/arch/hppa/include/arch/options.h b/kexec/arch/hppa/include/arch/options.h
index a936140..e9deb51 100644
--- a/kexec/arch/hppa/include/arch/options.h
+++ b/kexec/arch/hppa/include/arch/options.h
@@ -17,7 +17,7 @@
 	{ "ramdisk",		1, 0, OPT_RAMDISK },
 
 
-#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR "a:r:s:"
+#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ""
 
 /* See the other architectures for details of these; HPPA has no
  * loader-specific options yet.
diff --git a/kexec/arch/hppa/kexec-elf-hppa.c b/kexec/arch/hppa/kexec-elf-hppa.c
index d3ef0e9..474a919 100644
--- a/kexec/arch/hppa/kexec-elf-hppa.c
+++ b/kexec/arch/hppa/kexec-elf-hppa.c
@@ -76,7 +76,7 @@ int elf_hppa_load(int argc, char **argv, const char *buf, off_t len,
 		{ 0,                    0, NULL, 0 },
 	};
 
-	static const char short_options[] = KEXEC_ALL_OPT_STR "d";
+	static const char short_options[] = KEXEC_ALL_OPT_STR;
 
 	while ((opt = getopt_long(argc, argv, short_options, options, 0)) !=
 		-1) {
-- 
2.25.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] arm: redefine OPT_APPEND and OPT_RAMDISK
  2020-04-22 19:45             ` [PATCH v3] " Łukasz Stelmach
@ 2020-04-24  9:40               ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2020-04-24  9:40 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: kexec, svens

On Wed, Apr 22, 2020 at 09:45:04PM +0200, Łukasz Stelmach wrote:
> Redefine OPT_APPEND to avoid clash with OPT_KEXEC_SYSCALL_AUTO.
> Redefine OPT_RAMDISK to avoid such problems in the future
> 
> Minor cleanup in HPPA too.
> 
> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
> ---
> Sven,
> 
> I removed some arch specific short options which to me don't seem
> be handled in the getopt_long() loop in kexec-elf-hppa.c. Please tell us,
> if it doesn't break anything.

Thanks Łukasz,

I have applied this.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-24  9:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200414085411eucas1p240d872905d55681ab4a3d9bb9f584563@eucas1p2.samsung.com>
2020-04-14  8:52 ` [PATCH] arm: redefine OPT_APPEND and OPT_RAMDISK Łukasz Stelmach
     [not found]   ` <CGME20200415105859eucas1p2db849d89aa9a338077a01784f73dad52@eucas1p2.samsung.com>
2020-04-15 10:58     ` [PATCH v2] " Łukasz Stelmach
2020-04-16  8:44       ` Simon Horman
2020-04-20 14:33       ` Lukasz Stelmach
2020-04-22  8:01         ` Simon Horman
     [not found]           ` <CGME20200422194517eucas1p11d2ab9f4f68b891ea963633045f31ce9@eucas1p1.samsung.com>
2020-04-22 19:45             ` [PATCH v3] " Łukasz Stelmach
2020-04-24  9:40               ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.