From 32cddd0ba5a1f185fcb2c4d0a3383128dfa9b586 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 8 Mar 2021 20:54:16 +0900 Subject: [PATCH] Fix bootimg.cmdline to use ShellEscapeIncludingSpaces bootimg.cmdline should be passed to mkbootimg's --cmdline flag as a single argument. Because cmdline can have spaces we should escape it with ShellEscapeIncludingSpaces rather than blindly putting double qoutes with ShellEscape, which also puts single quotes when necessary. Bug: 182092664 Test: m nothing && see build.ninja (microdroid's build commands) Test: boot microdroid on VIM3L Change-Id: I5d766bb0a816d829569c9ebfddf97c4f846f78f8 --- filesystem/bootimg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go index 764f0452b..81b3dbbc5 100644 --- a/filesystem/bootimg.go +++ b/filesystem/bootimg.go @@ -153,7 +153,7 @@ func (b *bootimg) buildBootImage(ctx android.ModuleContext, vendor bool) android if vendor { flag = "--vendor_cmdline " } - cmd.FlagWithArg(flag, "\""+proptools.ShellEscape(cmdline)+"\"") + cmd.FlagWithArg(flag, proptools.ShellEscapeIncludingSpaces(cmdline)) } headerVersion := proptools.String(b.properties.Header_version)