All of lore.kernel.org
 help / color / mirror / Atom feed
From: pvorel <pvorel@suse.de>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v7 2/4] Add script to generate arch(s) dependant syscalls
Date: Thu, 31 Oct 2024 16:31:17 +0100	[thread overview]
Message-ID: <522e58298e53ce6cec96d9a10df4f63a@suse.de> (raw)
In-Reply-To: <bf896dde-ba72-4db3-8355-92e600f1dd43@suse.com>

On 2024-10-31 15:52, Andrea Cervesato wrote:
> The kernel doesn't need to be compiled. That's done by the script via
> `make headers` command. I don't know why that is happening honestly.
> 
> On 10/31/24 14:58, Petr Vorel wrote:
>> That fails in generate_table on:
>> if [ $bits == 32 ]; then
> 
> That's because the right syntax should be (for bash):
> 
> if [[ "$bits" == "32" ]]; then

Ah, I should have caught this, I overlooked an obvious bashism. thanks 
for finding the problem.

I actually run checkbashisms before, but only when run with -f finds a 
problems:

$ checkbashisms -f include/lapi/syscalls/generate_arch.sh
possible bashism in include/lapi/syscalls/generate_arch.sh line 73 
(should be 'b = a'):
	if [ $bits == 32 ]; then
possible bashism in include/lapi/syscalls/generate_arch.sh line 83 
(should be >word 2>&1):
	gcc ${TEMP}/list-syscalls.c -U__LP64__ -U__ILP32__ -U__i386__ \
		-D${uppercase_arch} \
		-D__${arch}__ ${extraflags} \
		-I ${LINUX_HEADERS}/usr/include/ \
		-o ${TEMP}/list-syscalls &>/dev/null
possible bashism in include/lapi/syscalls/generate_arch.sh line 116 
(should be >word 2>&1):
	make -s -C ${KERNELSRC} ARCH=${arch} O=${LINUX_HEADERS} \
		headers_install &>/dev/null

"&>" is yet another bashism.

Ideally, not only checking with "checkbashisms -f", but also running 
script with dash (e.g. change shebang to #!/bin/dash) should catch most 
of the problems.


> 
> But in other shells sh compatible, probably I should use:
> 
> if [ "$bits" -eq "32" ]; then

Yes please.

> 
> 
> I'm gonna fix this.

Thanks a lot!

Kind regards,
Petr
> 
> Andrea

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-10-31 15:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31 11:57 [LTP] [PATCH v7 0/4] Automatically generate syscalls.h Andrea Cervesato
2024-10-31 11:57 ` [LTP] [PATCH v7 1/4] Refactor regen.sh script to generate syscalls Andrea Cervesato
2024-10-31 13:01   ` Petr Vorel
2024-10-31 13:18     ` Cyril Hrubis
2024-10-31 13:44       ` Petr Vorel
2024-10-31 13:37     ` Andrea Cervesato via ltp
2024-10-31 14:08       ` Petr Vorel
2024-10-31 11:57 ` [LTP] [PATCH v7 2/4] Add script to generate arch(s) dependant syscalls Andrea Cervesato
2024-10-31 13:58   ` Petr Vorel
2024-10-31 14:52     ` Andrea Cervesato via ltp
2024-10-31 15:31       ` pvorel [this message]
2024-10-31 11:57 ` [LTP] [PATCH v7 3/4] Delete obsolete strip_syscall.awk file Andrea Cervesato
2024-10-31 11:57 ` [LTP] [PATCH v7 4/4] Add documentation about syscalls.h generator Andrea Cervesato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522e58298e53ce6cec96d9a10df4f63a@suse.de \
    --to=pvorel@suse.de \
    --cc=andrea.cervesato@suse.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.