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 DE529C636CD for ; Fri, 10 Feb 2023 12:30:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 67F5985FA0; Fri, 10 Feb 2023 13:30:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="bGcDsyeG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12A3685C6F; Fri, 10 Feb 2023 10:05:54 +0100 (CET) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (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 1694685764 for ; Fri, 10 Feb 2023 10:05:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=timlee660101@gmail.com Received: by mail-pl1-x631.google.com with SMTP id v23so5833254plo.1 for ; Fri, 10 Feb 2023 01:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mOF4BYpyJynRg3JaoaLgj11StH39dne/EKQKs/jIT6U=; b=bGcDsyeGsczbFX4Oi/Dz6HaJXOjpeYyd1HedR2+GZia5sU4Kn2e1vuCUUfqnyWjegs Ms7YDE9yB5SVfaUOTTrzSfvCbxRpPqzQKVIqVDU6wHPqxqRC+Vbd1Wf3PgitPvuZwFnU wWG+1uW7J1OBhms9LnW5oJAMWDSpsT2qoRVRYQcST8Bg23Lj2jYm65ZRB4ihFXLeGmCX J3yU6x6AIqT7GqDSsQfsgNzCJd2HbcKLBr8Wkg9btFvc8RR3WJXSWNP+JzzbNfgt5YXJ ewzzeQyoItTraEJiiMjmF1f0+sfd6+h1IhYv00nkNGbfcznFzt9L7gT2rVCLkgbtATEP Ol9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mOF4BYpyJynRg3JaoaLgj11StH39dne/EKQKs/jIT6U=; b=NYP69/cHqDT8HiwpYz9pSKy/TxdqJIrpNeGW5k31M3GwiNJWzzYTCEDFnmPwspbXz2 xvKT692s+ycKNl50o7qQXN7i1gUbmG++LXLOkxbnRh9/oCnkh1PpIPxFln1+fcrV/AiW 8MOscr49KIMVQK8fZdtLzQu3UEmfh+quW7LTOCaZqvqjp5L1ZE/dgXooOIJIYI3+tUEf aMoF9GsG85pXDDYbMHpKIRDxTgzzkPKdIx+hhMgrAN5c9hbLp+iSDRZritVQXntP4N/n mMnnzVRymVjlagEOFyqFZzBBGfrVyXOjRhV4UZYXP/wRUHomKLA1EVmmZP7Uk/Ac/MvE loCg== X-Gm-Message-State: AO0yUKW70A7RIxfjU2ew8XTC57OcNlHOx58H+YyZ3QGuwaN/1CP4O5fm 8nMTxyQIKsD0pDbgWdihCLw= X-Google-Smtp-Source: AK7set9M7cC/c/6Y1LLCgZ3PGfCi9I3uA6gMdesdsWfe3ojHWKchGAlWiXvaHkrpniHMWx9HHS2dnw== X-Received: by 2002:a17:902:e808:b0:194:476b:1af0 with SMTP id u8-20020a170902e80800b00194476b1af0mr18035309plg.65.1676019949372; Fri, 10 Feb 2023 01:05:49 -0800 (PST) Received: from localhost.localdomain (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id q24-20020a170902b11800b0019a723a831dsm866228plr.158.2023.02.10.01.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 01:05:48 -0800 (PST) From: Tim Lee To: trini@konsulko.com, sjg@chromium.org, timlee660101@gmail.com, chli30@nuvoton.com Cc: u-boot@lists.denx.de Subject: [PATCH v1 1/1] tools: env: use /run to store lockfile Date: Fri, 10 Feb 2023 17:05:39 +0800 Message-Id: <20230210090539.1631-1-timlee660101@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Fri, 10 Feb 2023 13:30:34 +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 According this issue https://github.com/ppp-project/ppp/issues/339. Eventually, the dt-utils changed lock directory to fix missing /var/lock directory error then make dt-utils can run normally. We also have a similar issue with these two utilities fw_printenv and fw_setenv will failed when the directory /var/lock is non-existent. We have a custom linux distribution built with yocto (OpenBMC) that use systemd and it deprecated the /var/lock directory. More discussion in systemd/systemd#15668. Thus, we sync with community's solution for uboot/tools/env utilities: The current location /var/lock is considered legacy (at least by systemd). Just use /run to store the lockfile and append the usual .lock suffix. Tested: Verified /run/lock is now present and fw_printenv can work in OpenBMC. Signed-off-by: Tim Lee --- tools/env/fw_env_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index 1d193bd437..0b201b9e62 100644 --- a/tools/env/fw_env_main.c +++ b/tools/env/fw_env_main.c @@ -73,7 +73,7 @@ void usage_printenv(void) " -c, --config configuration file, default:" CONFIG_FILE "\n" #endif " -n, --noheader do not repeat variable name in output\n" - " -l, --lock lock node, default:/var/lock\n" + " -l, --lock lock node, default:/run\n" "\n"); } @@ -88,7 +88,7 @@ void usage_env_set(void) #ifdef CONFIG_FILE " -c, --config configuration file, default:" CONFIG_FILE "\n" #endif - " -l, --lock lock node, default:/var/lock\n" + " -l, --lock lock node, default:/run\n" " -s, --script batch mode to minimize writes\n" "\n" "Examples:\n" @@ -206,7 +206,7 @@ int parse_setenv_args(int argc, char *argv[]) int main(int argc, char *argv[]) { - char *lockname = "/var/lock/" CMD_PRINTENV ".lock"; + char *lockname = "/run/" CMD_PRINTENV ".lock"; int lockfd = -1; int retval = EXIT_SUCCESS; char *_cmdname; -- 2.17.1