From mboxrd@z Thu Jan 1 00:00:00 1970 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 CD113C77B7A for ; Tue, 16 May 2023 05:57:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D805863C0; Tue, 16 May 2023 07:57:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="RbXJW6X/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B062D8661E; Tue, 16 May 2023 07:57:24 +0200 (CEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 555E085031 for ; Tue, 16 May 2023 07:57:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-306281edf15so12909320f8f.1 for ; Mon, 15 May 2023 22:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684216642; x=1686808642; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NtwNVrQUjygzsRRpHtLW7ZCpRJRN5N/slbgYfnwW+w0=; b=RbXJW6X/cNf0o6p6mQBvLk13/hgjIFu4GyosMGvduWgvDe0pP7pOaMBqYU9gcQXPJv gdRfMQukztN9xVzgYB9dE6oo5XhrNAc+rdWzEIdObPWjYigTmCxzjsNwerpmkSoj+gCN XMEfVavOJ7mO8GaLDOWMZsevTsSBdg1IcagDjdTyoC8oYw17h3zYPFCZYiPsAyDeSLLE JaTR0jySxTCl/JOSfZRvYF4A2FW1jfKXS3l7O7FnyZNj8UK4k6NNbqEU8mt1ObTNNnhI 1nrqQKd3aRnPRBS5Q9PyPpjyDlCpG3WghV68otyZ+0pm/iWVUpuoSNtKSLwXwnNmS7FF iXhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684216642; x=1686808642; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NtwNVrQUjygzsRRpHtLW7ZCpRJRN5N/slbgYfnwW+w0=; b=emtanYSTl2HlsynRIFuzLiaxrs84/Du1LIu7do5s7jiZ0GQfgUot/bZoSOkO2J9r4Y FrmFZzI4k5dEigSbGz0loK0W9xDunbj0GGUgttiXxz5BV3SQXaN+vF5dgM9wOZ+3POu8 cJs40HBRWQ4VyV0r0lmq5W6xH2QlD3pnghVaBMIFaf3wEsl9+WpOEkKOQc6lbVdT7Maq JO0V9ZT6Y/DvbtKQRR18NJp42p8P2UkNP8Sq7oAEzmpGWoZo2U78n0Sr9dKr7g/7uQgZ sKoAblAZcfmovmiS3omjgxfAqZjQZlVczVdm1xJpZPSFx+kg9N5L8tDkIz2EcIbWHAuy +wDQ== X-Gm-Message-State: AC+VfDyGiKoP+q2wCglmV6ZjqE8900yfad7nhbVExZe7Gpi0XSoQuFm5 N7eYJ395tFBwHzVpJVTZN8ANIQ== X-Google-Smtp-Source: ACHHUZ47Vt/1AMUAazEAMv7UF95/wFPAvCxGKQI/PZcXImxrcGHOmt7Cv9OiDuyqLFHZ5VnKoGhThQ== X-Received: by 2002:adf:f08b:0:b0:307:aec0:4296 with SMTP id n11-20020adff08b000000b00307aec04296mr15662568wro.12.1684216641733; Mon, 15 May 2023 22:57:21 -0700 (PDT) Received: from hera (ppp176092130041.access.hol.gr. [176.92.130.41]) by smtp.gmail.com with ESMTPSA id m2-20020adfe942000000b002cea9d931e6sm1273924wrn.78.2023.05.15.22.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 22:57:21 -0700 (PDT) Date: Tue, 16 May 2023 08:57:19 +0300 From: Ilias Apalodimas To: Raymond Mao Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Masahisa Kojima , Simon Glass Subject: Re: [PATCH v3 3/3] Load option with short device path for boot vars Message-ID: References: <20230502191218.47109-1-raymond.mao@linaro.org> <20230502191218.47109-3-raymond.mao@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230502191218.47109-3-raymond.mao@linaro.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Hi Raymond, On Tue, May 02, 2023 at 12:12:21PM -0700, Raymond Mao wrote: > The boot variables automatically generated for removable medias > should be with short form of device path without device nodes. > This is a requirement for the case that a removable media is > plugged into a different port but is still able to work with the > existing boot variables. > > Signed-off-by: Raymond Mao > --- > Changes in v2 > - Ignore EFI_NOT_FOUND returned from > efi_bootmgr_update_media_device_boot_option which means no boot > options scanned. > Changes in v3 > - Split the patch into moving and renaming functions and > individual patches for each changed functionality > > cmd/bootmenu.c | 2 +- > cmd/eficonfig.c | 2 +- > include/efi_loader.h | 2 +- > lib/efi_loader/efi_bootmgr.c | 16 +++++++++++++--- > lib/efi_loader/efi_disk.c | 2 +- > lib/efi_loader/efi_variable.c | 2 +- > lib/efi_loader/efi_variable_tee.c | 2 +- > 7 files changed, 19 insertions(+), 9 deletions(-) [...] > * @count: number of efi handle > + * @short_path: use short form device path for matching > * Return: status code > */ > static efi_status_t efi_bootmgr_enumerate_boot_option(struct eficonfig_media_boot_option *opt, > efi_handle_t *volume_handles, > - efi_status_t count) > + efi_status_t count, > + bool short_path) Are there cases where the normal device path is used? If not we can get rid of the bool option entirely > { > u32 i; > struct efi_handler *handler; > @@ -387,6 +389,13 @@ static efi_status_t efi_bootmgr_enumerate_boot_option(struct eficonfig_media_boo > p = dev_name; > utf8_utf16_strncpy(&p, buf, strlen(buf)); > > + /* use short form device path */ > + if (short_path) { > + device_path = efi_dp_shorten(device_path); > + if (!device_path) > + continue; > + } > + > lo.label = dev_name; > lo.attributes = LOAD_OPTION_ACTIVE; > lo.file_path = device_path; [...] Thanks /Ilias