Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4465C4321E for ; Sat, 26 Nov 2022 17:20:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E025E852B7; Sat, 26 Nov 2022 18:18:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="ZJGcSzRE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C97BC8502C; Sat, 26 Nov 2022 17:59:56 +0100 (CET) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 79A0D85098 for ; Sat, 26 Nov 2022 17:59:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=souajih@baylibre.com Received: by mail-wr1-x42f.google.com with SMTP id o5so1811695wrm.1 for ; Sat, 26 Nov 2022 08:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=snU6SkIPrXz5Qe5ZN3CiS9sUd7izw7iOlWtyjVw0oHQ=; b=ZJGcSzREGKTIkDhkWYflb8yCokwGoD9uymSTdB1jmTmFVgOusosMsPJBPtIyz+nS0Y 9UQ813h7I8VilfOHpRilHfDC2e6FqAxmudaxjB6tJ4mJKCDS+3fuD0vPoLVLkz/4wGGj FWIJ0m+qvZn4ktzZt3+QWfgygoBQfWk5phPOEjhW4wAl0BTbY9kju9CBFaOOpU3P0XQ8 yiy1oBt1yBp1AOof8Ko27TIcsuCNgcm7xCwbcg/WylZ5UqHT0JERXw5c40VTVIz9VXaQ nN1kInL1Exvg0rz50Ind5asRrqwR7IWCD2i1yRkZVziZFb307CvFI8e8/zZVTKcCg8/i 22rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=snU6SkIPrXz5Qe5ZN3CiS9sUd7izw7iOlWtyjVw0oHQ=; b=e05kRHlC+zOba/WnP+hEG4WEmblrFI7t8I7TUeAs67RLhjddzaxf809mIMzDHBR9Gs O4AfL71Y//RFXqQvwoVOxK9RrxnKlHwXjxGVXfFEiVmG6LUGgL2jHmz2zX5qPRoo+XoS qcbo+nOngQMakdLP1DG0p/9qyCRYlPdNKUxXV6lyH+ZeS6G2LYlClBe/stJ5JUQZN3A7 m2VxGBhO+SY194IN0lGEOF0NAFSz46Le7338JeBKW4kaAwdi7LlymTveZHPsGJbz4Ate CIbTALWucB6MIbqZD37TvgkLf5KAXb5fZmv8xV4sMACCgMWImdEm+w4i5xxXtlIAWHGB v9sg== X-Gm-Message-State: ANoB5plwAgzFBdG+IzYUOBartoXjwEHDFjqzWWJuf7iM1geVCPAioi98 00ETWD8/zYM8lwGUgvL8IjESUg== X-Google-Smtp-Source: AA0mqf4fSAQYFZGd/X5GZMQkYUHErYZGO/ffztQG54+cIu74+Uc4nyMaNmrprUuh83p2VKHD7lXbfg== X-Received: by 2002:a05:6000:1f05:b0:238:3fcb:36d with SMTP id bv5-20020a0560001f0500b002383fcb036dmr17814548wrb.0.1669481993968; Sat, 26 Nov 2022 08:59:53 -0800 (PST) Received: from safae.baylibre.local ([2a04:cec0:11b5:4031:7588:eb2c:a5c2:aa6d]) by smtp.gmail.com with ESMTPSA id c15-20020adfe70f000000b00241e8d00b79sm7462408wrm.54.2022.11.26.08.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 08:59:53 -0800 (PST) From: Safae Ouajih To: sjg@chromium.org Cc: u-boot@lists.denx.de, sean.anderson@seco.com, r.stratiienko@gmail.com, mkorpershoek@baylibre.com, glaroque@baylibre.com, khilman@baylibre.com Subject: [PATCH 13/17] android: boot: support extra command line Date: Sat, 26 Nov 2022 17:59:27 +0100 Message-Id: <20221126165931.197607-14-souajih@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221126165931.197607-1-souajih@baylibre.com> References: <20221126165931.197607-1-souajih@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sat, 26 Nov 2022 18:18:14 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean In version 3 and 4 of boot image header, the vendor specific command line are located in vendor boot image. Thus, using extra command line to add those cmd to bootargs. Signed-off-by: Safae Ouajih --- boot/image-android.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/boot/image-android.c b/boot/image-android.c index 78bf708fed9f..291911ea1852 100644 --- a/boot/image-android.c +++ b/boot/image-android.c @@ -55,6 +55,7 @@ static void android_vendor_boot_image_v3_v4_parse_hdr(const struct andr_vendor_b * The header takes a full page, the remaining components are aligned * on page boundary. */ + data->kcmdline_extra = hdr->cmdline; data->tags_addr = hdr->tags_addr; data->image_name = hdr->name; data->kernel_addr = hdr->kernel_addr; @@ -231,6 +232,11 @@ int android_image_get_kernel(const struct andr_boot_img_hdr_v0_v1_v2 *hdr, len += strlen(img_data.kcmdline); } + if (img_data.kcmdline_extra) { + printf("Kernel extra command line: %s\n", img_data.kcmdline_extra); + len += strlen(img_data.kcmdline_extra); + } + char *bootargs = env_get("bootargs"); if (bootargs) len += strlen(bootargs); @@ -250,6 +256,11 @@ int android_image_get_kernel(const struct andr_boot_img_hdr_v0_v1_v2 *hdr, if (*img_data.kcmdline) strcat(newbootargs, img_data.kcmdline); + if (img_data.kcmdline_extra) { + strcat(newbootargs, " "); + strcat(newbootargs, img_data.kcmdline_extra); + } + env_set("bootargs", newbootargs); if (os_data) { -- 2.25.1