public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 1/2] start_vm: Fix quotes usage
Date: Fri, 27 Apr 2018 14:14:23 +0300	[thread overview]
Message-ID: <f0c42266-3aec-d89f-00a1-ddad9f32463a@ilbers.de> (raw)
In-Reply-To: <20180427130649.5ce34aa1@md1pvb1c.ad001.siemens.net>


On 04/27/2018 02:06 PM, Henning Schild wrote:
> Am Fri, 27 Apr 2018 13:28:52 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> 
>> According to the following chapter:
>>
>> http://wiki.bash-hackers.org/syntax/quoting#quotes_and_escaping
>>
>>    MYARG="\"my multiword argument\""
>>    somecommand $MYARG
>>
>> is NOT the same as:
>>
>>    command "my multiword argument"
>>
>> So this patch splits kernel params to separate variable for correct
>> interpretation.
>>
>> Tested with bash and dash in Debian jessie.
>>
>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>> ---
>>   scripts/start_vm | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/start_vm b/scripts/start_vm
>> index cfb2bea..7eb633e 100755
>> --- a/scripts/start_vm
>> +++ b/scripts/start_vm
>> @@ -28,6 +28,7 @@ start_qemu() {
>>   	$QCPU \
>>   	-nographic \
>>   	$EXTRA_ARGS \
>> +        "$KARGS" \
> 
> How about?
>   -append "$KARGS"

If I understand this correctly, $KARGS could be empty for some cases. 
Does it work with empty $KARGS? Let me check this. But in general I like 
your suggestion.

> 
>>   	$root
>>       [ $had_x -eq 0 ] && set +x
>>   }
>> @@ -123,7 +124,8 @@ case "$IMAGE_TYPE" in
>>       EXTRA_ARGS="$EXTRA_ARGS \

                     ^
Here is opening one.

>>   	-kernel $QKERNEL \
>>   	-initrd $QINITRD \
>> -	-append \"console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw\""
>> +	-append "
                 ^
This one is closing.

> 
> Where are the closing quotes?

Alex

> 
> Henning
> 
>> +    KARGS="console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw"
>>       ;;
>>       wic-img)
>>       readonly
>> ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.wic.img
> 

-- 
With best regards,
Alexander Smirnov

ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov

  reply	other threads:[~2018-04-27 11:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 10:28 [PATCH 0/2] Fix start_vm script Alexander Smirnov
2018-04-27 10:28 ` [PATCH 1/2] start_vm: Fix quotes usage Alexander Smirnov
2018-04-27 11:06   ` Henning Schild
2018-04-27 11:14     ` Alexander Smirnov [this message]
2018-04-27 14:37   ` [PATCH v2 " Alexander Smirnov
2018-04-27 10:28 ` [PATCH 2/2] start_vm: Fix script header Alexander Smirnov
2018-05-01 19:23 ` [PATCH 0/2] Fix start_vm script Alexander Smirnov

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=f0c42266-3aec-d89f-00a1-ddad9f32463a@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox