From patchwork Mon Feb 19 08:59:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 875033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4010:c07::239; helo=mail-lf0-x239.google.com; envelope-from=swupdate+bncbcxploxj6ikrb3fdvlkakgqehm5ggsy@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="sQQAYhQm"; dkim-atps=neutral Received: from mail-lf0-x239.google.com (mail-lf0-x239.google.com [IPv6:2a00:1450:4010:c07::239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zlHk86nMZz9rxj for ; Mon, 19 Feb 2018 19:59:27 +1100 (AEDT) Received: by mail-lf0-x239.google.com with SMTP id a76sf2689908lfb.3 for ; Mon, 19 Feb 2018 00:59:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1519030765; cv=pass; d=google.com; s=arc-20160816; b=z+B697oljA9iaPrq5FfsmVX1TKucVShFCsv1zZhNwkk7mRarhunmwG4DRfV0pdDUE2 ijNAb1k32QAjxjGTApdscv35spuBY5IltPE6ZFdMbVyLEm42OeIZFWdwdNFzmf9LHMG2 IQ3povUWPuqKsbNvlBdY5WXwGY8IcyEXCeeskihzFt7ULYA3Fq1U14w4gHGW0MvdWC71 5AX2gf6twtCICuq+4rNVf7o6G2NLl5zXRtCco4ytLZCXUdAAyicceXP4ef6Jf+YvQCAP vP//CYLnQLWJdRz3zgMUIWLZvZchLJ/IgxRRteKRnePIbeTOlgzmJwjDYwoaRYrJ/7uh 30dA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=6t/zR+jPrMMO6C4K7/Q5BFVVoPzdSYghJBsE05hsZ4Q=; b=F6iU8thHuAwZA8FhcRQUFHRAg7WF1MXOCnz8vGV4khzCm1c/Wsee+ZLTciNQ9Xwb0D nkfCu3Vw3o3uAlQz3w06Y61plMwTogIbA5lYhazQR+47OeLrLJEONcSf1JKNln88UP/E 5OYFpzKKEg8Y3kQp+NZHMPP0M5igkOsCTyzgsvD0/R5LrSYOBKS3c9+EU0/Y25zZN+8R 1kuV8xpbjgER4bh4PMszFbV6JDdQpinH4ItbN4cqFJd3PG4YgZWBLSVFmxvfR3sxijN7 0mkhETIPiuTy2+2djzQvKJ7il1Zn9YQXjGfsqSAOKKi8XaQ6SGJ4TS36BMq6zuG7jRXz tRLg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=6t/zR+jPrMMO6C4K7/Q5BFVVoPzdSYghJBsE05hsZ4Q=; b=sQQAYhQmjda5jbyYJtX88LJtFQixqCaccZRkdDTCElHuItUY0PggWifE4e5vat2g97 fJ+8T7KDC4ff/I8+MXZDgUXBcfaNC1e1GFSZ/6onO1X9rPsagZBEiZVpBLino+QVCkJR cJoS+AMSSD39RbyvZGHy6fetWHY+Q5X2ktCTv1NHGsykMRKRoc/5BtiBV2lk2r1/MasU ro+66E+FJzrbe+V3WouzMzrgZf4KNh5G57ewPiWCF8XSQgjwYobphnI5PuLMtNdfLIZI EeNJY8fOL+vwIT0o3scUDufzFT4au2LAn6nMy0wkdDWUgoz6LhZXP6PkaKlyDdOaZotb Wc5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=6t/zR+jPrMMO6C4K7/Q5BFVVoPzdSYghJBsE05hsZ4Q=; b=hy/jJ4M/qC5w9h4LgWIclGgERsoq2FymVl3t53t2c7VYo814t7uUxH8wLqtNRplS+3 yyPufNZD0RJsiVpg/xs8Jerbiv05ArKv1F4OgXvwxMQQe9nDPDL4S7NqankZGWRy+ZgL g3Jc3vsnya6e/3jCTGaqY9w2O1YPWbT2p14cfJpxzsUunfhSzepGLn54mEEWfdeKEBJN xd3qfhK9iljj23NiKxMhcKcrM4ZtRphWUkoeyyxzwfKnw1uNxS6K3r18MWhlMss1VqPP qlNBU9bZuI8/0QfRNv1UfVSSm7FCv9tvFOrH3M79Pf67YS5lLChAjjzik9Hoxj5PW9FL m15w== Sender: swupdate@googlegroups.com X-Gm-Message-State: APf1xPCafNp+UvH2LE1FAshxoYVU/lJcolp9KqhHvKgbVFrbzM6usrkQ Q3nnsZxkCtMauRAkoFPesy0= X-Google-Smtp-Source: AH8x227uO+xxEj2shWEXA4HWPC0/IURoNflH6cwrEuWhpcPEDnZW+ivLB7Se4GkIy5bqpggawN3sKQ== X-Received: by 10.25.163.141 with SMTP id m135mr55149lfe.0.1519030764969; Mon, 19 Feb 2018 00:59:24 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.46.23.194 with SMTP id 63ls72342ljx.8.gmail; Mon, 19 Feb 2018 00:59:24 -0800 (PST) X-Received: by 10.46.89.91 with SMTP id n88mr812755ljb.35.1519030764363; Mon, 19 Feb 2018 00:59:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519030764; cv=none; d=google.com; s=arc-20160816; b=PY9kJg2BW2SSgRvdqCoG9rgoaJhXrck7+VfP+7LuQ5EL9VqkK/lTmL/TFMSnX0gydV 2PVSTQU+yu1+y9haQNkTWcuts2dAhWWqIiQJwOD5Irelii6/Y8KM+jp34YyG8qbDS0VO ZyrMSCLVJenFp0wY6wzITIkeemmCGVOBUN4snwp4C8pkYuGKBd3VK7r8V6tbkxXnGqwB fw+tGZ5B8jTmr2p7vQtvOaVVn0wmB4A60xyJ/gzXS+ZypXS49LZz3wOC1f1ZyYRIM2Cq 8V1WPhi9WgJzAABqZcSy1pcDeYHt69zOwsMi8j1O7gFmJjwJ+sFTNY/PSNQCu/YP2UG8 OhUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=jVPdcFA5hxtcvXKUAoGefz5pY/mpUkgt2uD2bMF9ZRE=; b=jBxiXeW4QLRPY2d7AL8wtbVSUiHVnsOxTOzfVwYRD/6mdzyA4LdOTR+24yNq1bcHv9 lPpK63ZPfO/kpfgTT09+wtts9gyofZVE5lyeU0D0Gae0G6dCLY5kEjFd3PtwkfNxaIPN /K+uyNo0RZCASJLe1a5sHCXCo0c5fqrPLTsxTkocHkAeEcdz2fF4hUCU2gAMx+XpBjJU qHu07zsUtAgqYbMSCkVDl1yF2ruw/SPGkPKso2qPVZRqc0iNnoR9XVUmsPBaZG+viriW KN4m5v9W8PLxACqnX/NhqDdvobBKTwyAsgRRkfgvkdEdqTnFTbU2ojN99qACb8xXaUTb Hmag== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id b10si108098lfe.4.2018.02.19.00.59.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 00:59:24 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zlHk35LrRz1qvTW; Mon, 19 Feb 2018 09:59:23 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zlHk357WFz1qt3W; Mon, 19 Feb 2018 09:59:23 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 3r3eqhaI3GyK; Mon, 19 Feb 2018 09:59:21 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Mon, 19 Feb 2018 09:59:21 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 41CA245404E4; Mon, 19 Feb 2018 09:59:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ydoc764gVC2w; Mon, 19 Feb 2018 09:59:19 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 135114540439; Mon, 19 Feb 2018 09:59:19 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] bootloader: fix setting GRUB variable Date: Mon, 19 Feb 2018 09:59:16 +0100 Message-Id: <1519030756-17333-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Due to a bug while variables are parsed, a long string for the value of a variable is truncated. The following works: { name = "var1"; value = "val1"; } but it does not work in this case: { name = "var1"; value = "val1 val2 val3 val4"; } and the result is just var1=val1 Signed-off-by: Stefano Babic Acked-by: Christian Storm --- bootloader/grub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootloader/grub.c b/bootloader/grub.c index dc35718..4c9b0b8 100644 --- a/bootloader/grub.c +++ b/bootloader/grub.c @@ -123,7 +123,7 @@ static int grubenv_parse_script(struct grubenv_t *grubenv, const char *script) */ while ((getline(&line, &len, fp)) != -1) { key = strtok(line, " \t\n"); - value = strtok(NULL, " \t\n"); + value = strtok(NULL, "\t\n"); if (value != NULL && key != NULL) { ret = dict_set_value(&grubenv->vars, key, value); if (ret) {