From patchwork Fri Jan 12 16:40:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 860042 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:400c:c09::23b; helo=mail-wm0-x23b.google.com; envelope-from=swupdate+bncbcxploxj6ikrb3gj4pjakgqehntptaa@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="osIhyJce"; dkim-atps=neutral Received: from mail-wm0-x23b.google.com (mail-wm0-x23b.google.com [IPv6:2a00:1450:400c:c09::23b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJ7lM6f9Gz9s7M for ; Sat, 13 Jan 2018 03:40:14 +1100 (AEDT) Received: by mail-wm0-x23b.google.com with SMTP id v14sf776297wmd.3 for ; Fri, 12 Jan 2018 08:40:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1515775212; cv=pass; d=google.com; s=arc-20160816; b=F2/+ImSaJ5gPT3sS63DEZMG0XYFru1MIGYBCg60irWyia1uSlH5TfpGcF6DE0pYXF1 i7HSvpN8FIozubee4x/qoxJ6rY8ds8z4Ij+ddoCqGyBRPUj9/jh023W2imyRDS6Bfrzw 5oVHPhwOEgd6GwsHlX/D4FIV6y4L9DLwsbrzetIpeowRvS4PygMPz+J1LPMv6MSuWdIP KGMm0CzAm9JEJkASGruUt+TEhLocufAmAKST8d2KsGIuM7SvxhHJKCpPGeK7vK1V4KQv hidhEM3vI5gpCLMT7lmHm8QySHhfKlQTdKGaoHPaW00hitn2qqCiHfcZCJVpnko1c+sB LZgQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:arc-authentication-results :arc-message-signature:mime-version:sender:dkim-signature :arc-authentication-results; bh=Wix3ZHqXPzipWqfsUaD16X2RLHplRxEptJMRE2NEcMI=; b=sSXhWqbDZnrMPx44U16pfgufaxZGxz0sWDGoCDPiRqp9ZC/8NDUwutWzLMMtuFSp0f lNm2P1VTNgBnlpmORkUqy25vALbeTpY/XrVvPN1LucjFufcxvBZWQMqNw50UVY3pHmWA B9uOarqdh025QEcwrs09P17cp3VE1CCbzQGPIl+sOtRQMybkX/mkN18isQd+Hor4hgke n/SzzCnKvmWntsqlmIWi0pyr4nfMdJOdbTrnxxubJKuVrHKryKUv5bIBGUCjLrTmcTAK RnXKrvi3ne/jz1u9O2FZCYL8pcCsRYmsnfdrZCXjwYrEMMiLCEPctQ6UUoqUYdilq0Tb 0SQw== 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:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Wix3ZHqXPzipWqfsUaD16X2RLHplRxEptJMRE2NEcMI=; b=osIhyJceUumadxja93s8x3j57/OYvvuonTJAT5m/Ht5RxjKNGkvdN5RX1b9P/zCpfj 3OFwbcJYFt0ydQelLeqFNarzxUTxhzXQWfj7F6YPytAIjy5HkGTK5gD1H5WRgedOpUxy IrE4qZOsBMCAiFh2xDlz6D5XD2/NYtgf/QrFp7kgYma3FjIYWmF2s/XESihwx+dVr/0K BVq3VuD4fdZ0lDbZ8O2RdbPDDK4CeiLK42Z1am7O91XFHp2vEcmIbjxQRRxaJ5PUKLkd OBDOWx1hANraMWe9+lpIUUZ5hLqGE85P7FLfeDF9wH11/BJIn+bjR3RWGFSoKQoR3/bY u+zw== 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:in-reply-to:references: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=Wix3ZHqXPzipWqfsUaD16X2RLHplRxEptJMRE2NEcMI=; b=uYxTmhUV8cT9gQADt8G9GNmUl0wLw0wCs/bOE5kAzGLFlokB6QeLBhvJVMGQwgi4Oi XPgrWiq7IEeAkoGN1pRecIE2YC7QKN0uC8QTysUGo6LWtXVOLtS4gaF7OqNobLSMethm 2PxW2I4o13rOYqgyAl9K0hvMkbDvgxaAzgI2C6k82kteB8J1JhuDk+qYboXx5hAhfXtk nBnXbIs5R3JMjGR/NDiEDSAkuSKxExt8bM3q7N+vEfUwVcveSovUVMjBiQnhuqLQ4Ek7 Kc2y1ZSyvQG5CBcK9O8g0Sy4kEU4T3pRQOyeFRG/u7GvkYIOoTCuTXlVr7kGssasrPx7 NFdQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKwxytc6kIYDf7xQQw0xq4wN519ACX0TX2B9misC2+y10Y6Og1udQFVy X7UX2g3hIyhVR5KG/u6mwbA= X-Google-Smtp-Source: ACJfBosY3F+SvHLB+EKREzgDyYiQorffFfOeXfcjF8tlLkcMR8A5pwRXYomw8CYI5QIgTg2qVGwYVw== X-Received: by 10.28.153.72 with SMTP id b69mr55085wme.4.1515775212396; Fri, 12 Jan 2018 08:40:12 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.145.246 with SMTP id h51ls595235eda.8.gmail; Fri, 12 Jan 2018 08:40:11 -0800 (PST) X-Received: by 10.80.146.139 with SMTP id k11mr3159266eda.4.1515775211809; Fri, 12 Jan 2018 08:40:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515775211; cv=none; d=google.com; s=arc-20160816; b=xH/9ITnNnYNB8hiZVge8soY+ZU6mTELQhS2NsRbz7sbb7RRMf4z0eY9odGmV6v0g+U GNSjdUiUBZ2F/XaXXBlfWRGnc+PqPg4am8BvrzYmjQrnNVxPb9wpPgoQc7YWXehsKFF2 S+kfkMKylYnIy0+a5MDt6cxrPGa0/uBNjmbBGK8YG/RD0kX5z+kGnBuuT/3vEk5vZgxW FBI0V1Uf8MH6KCZUbYBQFEKfVnUrQ1C7R924UCqqQ0W35QkUdgO+5Qe+ftHDhuG94xQJ Mc+3VEyAvL7rhzTeEhiAQFPhFof+7X0HpddA+IjeCJNdhKgTS7jE0XgPA+IGodLR3Opr VHzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cTx2CQoHb1T3OBcpxgZi6eGx3YbHMkKZs4PcFfgT2Uo=; b=HQafOKKL2LhfJeGjKrIA/0AJSpUpV2gmDuHekdaq3CphK1R+2snQDJOs/G9b/dG3G+ LlIYmoHGJk9ckXOAVSiTIgAg8PMdUpRin0tTXFGbyUoD3nLkKB68MIk2/C3wnYfBdmiK 7AnuVTjH8yzaEy6P1+DmP54zrXOIj33FQTOUEUwGyDnx4ypD/jR/TwWUjFjooyW00ZbR oJLLRGy7uc5RLUjO9vAiOKzYJSu2YSCm+sVsVpMrfkQdVSzhgZGNwj3Bi3tuo9gR0E6s pUkMdXUD2zTH31LJq9VWwY9douzSGPyEIqC/duFoS5dUv7pVWDe91/mDfw7IA1Lj/kUE 9haw== 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 r58si3237447eda.3.2018.01.12.08.40.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 08:40:11 -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 3zJ7lH3bJNz1qx9H; Fri, 12 Jan 2018 17:40:11 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zJ7lH3RVjz1qqkb; Fri, 12 Jan 2018 17:40:11 +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 zCE0-E4Ifo1p; Fri, 12 Jan 2018 17:40:10 +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; Fri, 12 Jan 2018 17:40:10 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 628C34540397; Fri, 12 Jan 2018 17:40:10 +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 LAOzh-nW4_8R; Fri, 12 Jan 2018 17:40:08 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 2E6EE4540360; Fri, 12 Jan 2018 17:40:08 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 2/2] bootloader handler: fix paths and use TRACE / ERROR macros Date: Fri, 12 Jan 2018 17:40:06 +0100 Message-Id: <1515775206-9174-2-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515775206-9174-1-git-send-email-sbabic@denx.de> References: <1515775206-9174-1-git-send-email-sbabic@denx.de> 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: , Signed-off-by: Stefano Babic --- handlers/boot_handler.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/handlers/boot_handler.c b/handlers/boot_handler.c index 8cda3f6..68c65b4 100644 --- a/handlers/boot_handler.c +++ b/handlers/boot_handler.c @@ -43,30 +43,24 @@ static int install_boot_environment(struct img_type *img, char filename[64]; struct stat statbuf; - const char* TMPDIR = get_tmpdir(); - if (snprintf(filename, sizeof(filename), "%s%s", TMPDIR, + if (snprintf(filename, sizeof(filename), "%s%s", get_tmpdirscripts(), img->fname) >= (int)sizeof(filename)) { - ERROR("Path too long: %s%s", TMPDIR, img->fname); + ERROR("Path too long: %s%s", get_tmpdirscripts(), + img->fname); return -1; } ret = stat(filename, &statbuf); if (ret) { fdout = openfileoutput(filename); - /* - * Bootloader environment is set inside sw-description - * there is no hash but sw-description was already verified - */ ret = copyimage(&fdout, img, NULL); close(fdout); } ret = bootloader_apply_list(filename); - if (ret < 0) { - notify(RUN, RECOVERY_NO_ERROR, ERRORLEVEL, - "Error setting bootloader environment"); + if (ret != 0) { + ERROR("Error setting bootloader environment"); } else { - notify(RUN, RECOVERY_NO_ERROR, INFOLEVEL, - "Bootloader environment updated"); + TRACE("Bootloader environment from %s updated", img->fname); } return ret;