From owner-svn-src-head@freebsd.org Fri Jul 27 22:30:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 721751059023 for ; Fri, 27 Jul 2018 22:30:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F30148C91A for ; Fri, 27 Jul 2018 22:30:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id q20-v6so9485523ith.0 for ; Fri, 27 Jul 2018 15:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OomFQGoeiVJTkRJko2NWmmiIPjUCpuW1My8aFiCv+4s=; b=O4UgsTU/LG6aAgBrNYQRFs1StlAb3/FLvP1+e0/Q7BnNkm27qwfqJOIPgPoYX+EZhi IXlQoMo8mezsm8Tf/GSD7p3UTupfQnnFanvU682OIfYRgga0Y8iv4u3i71xsewMSi32c shFwOBzsC5Lv70WCBecqpw2uyJQgV7Odfe65RPvD/n7N+8in8wA+HKWtkORPtcHLe/9P CAznH3hF7sMnn/oCkCwg087di8tVkr0BqZL71xtaM91qGPpHBN3kwaQy/UdzHSmYWJK0 Lh2LdGPQVpZhm2ZqdiVMyWER31N4S0zNmXtgNom9glRnz+oaum1w5OAweXtazlMBKBT3 fJfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OomFQGoeiVJTkRJko2NWmmiIPjUCpuW1My8aFiCv+4s=; b=O61T8C9c4Hl+ZxugFtw9Fs35OlbDToW4VZAswn263qAGBAF/dLFpjUZ9qDHy4yho00 l+hCwssCcKH0mnnS05Cp2BxmWB2a62a4Dac2sNcCbiU7BOSTZYzHh32Q566HAeF6PynC okAId3NUx/Kyr+2gguRVbdS09JVcvffxDZmFqT0aqTHUQKSIirr+VNdBsjPDUMaBAVYI eY1o3YWI5V+HqIzd8M8lulFOY6jAlEqPzXlpsfEIDy4eMBdqZ2qmoYHIGFM4HJHJZ5D2 tSUUw26WuBoTRSCMQ2dPeF35RrXAuoTxAEua9ovaI4UIy4PdMfmZxBihWpHypwd2B1Vx US8A== X-Gm-Message-State: AOUpUlEDoqZ3JrZXid7PqHkrAHeP33/UhvyvtZIMGfz27AgfKx7Doul/ dEpBwOhmqheAtKVcfHpb4RKI7mNdOZb0z70iMLTCsw== X-Google-Smtp-Source: AAOMgpdjCxQ5SLmHuBJg1x7Aw1qQLJ91nVFo6rmeFYRLaHx/mLvWcaXx9SHnv4XVD0Kf04lvVsPggBviUl22TBkcwOk= X-Received: by 2002:a02:3344:: with SMTP id k4-v6mr8167958jak.45.1532730635238; Fri, 27 Jul 2018 15:30:35 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:4485:0:0:0:0:0 with HTTP; Fri, 27 Jul 2018 15:30:34 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180728002255.01f3e19f@thor.intern.walstatt.dynvpn.de> References: <201807272200.w6RM00n3024246@repo.freebsd.org> <20180728002255.01f3e19f@thor.intern.walstatt.dynvpn.de> From: Warner Losh Date: Fri, 27 Jul 2018 16:30:34 -0600 X-Google-Sender-Auth: wyiKtBI-5dFVdGzJ5gBUVnvn5e4 Message-ID: Subject: Re: svn commit: r336789 - head/stand/efi/loader To: "O. Hartmann" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 22:30:36 -0000 On Fri, Jul 27, 2018 at 4:22 PM, O. Hartmann wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Am Fri, 27 Jul 2018 22:00:00 +0000 (UTC) > Warner Losh schrieb: > > > Author: imp > > Date: Fri Jul 27 22:00:00 2018 > > New Revision: 336789 > > URL: https://svnweb.freebsd.org/changeset/base/336789 > > > > Log: > > stand debug > > > > Modified: > > head/stand/efi/loader/main.c > > > > Modified: head/stand/efi/loader/main.c > > ============================================================ > ================== > > --- head/stand/efi/loader/main.c Fri Jul 27 21:50:10 2018 > (r336788) > > +++ head/stand/efi/loader/main.c Fri Jul 27 22:00:00 2018 > (r336789) > > @@ -312,6 +312,7 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, > char * > > char *kernel = NULL; > > FILEPATH_DEVICE_PATH *fp; > > struct stat st; > > + CHAR16 *text; > > > > /* > > * FreeBSD encodes it's boot loading path into the boot loader > > @@ -349,6 +350,11 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, > char * > > if ((char *)edp > ep) > > return NOT_SPECIFIC; > > while (dp < edp) { > > + text = efi_devpath_name(dp); > > + if (text != NULL) { > > + printf(" BootInfo Path: %S\n", text); > > + efi_free_devpath_name(text); > > + } > > last_dp = dp; > > dp = (EFI_DEVICE_PATH *)((char *)dp + > efi_devpath_length(dp)); > > } > > @@ -359,22 +365,31 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, > char * > > * path in it. Those show up as various VenHw() nodes > > * which are basically opaque to us. Don't count those > > * as something specifc. > > + * path in it... > > */ > > - if (last_dp == first_dp) > > + if (last_dp == first_dp) { > > + printf("Ignoring BootXXX: Only one DP found\n"); > > return NOT_SPECIFIC; > > - if (efi_devpath_to_media_path(last_dp) == NULL) > > + } > > + if (efi_devpath_to_media_path(path) == NULL) { > > + printf("Ignoring BootXXXX: No Media Path\n"); > > return NOT_SPECIFIC; > > + } > > > > /* > > * OK. At this point we either have a good path or a bad one. > > * Let's check. > > */ > > pp = efiblk_get_pdinfo_by_device_path(last_dp); > > - if (pp == NULL) > > + if (pp == NULL) { > > + printf("Ignoring BootXXXX: Device Path not found\n"); > > return BAD_CHOICE; > > + } > > set_currdev_pdinfo(pp); > > - if (!sanity_check_currdev()) > > + if (!sanity_check_currdev()){ > > + printf("Ignoring BootXXX: sanity check failed\n"); > > return BAD_CHOICE; > > + } > > > > /* > > * OK. We've found a device that matches, next we need to check > the last > > @@ -386,20 +401,30 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, > char * > > */ > > dp = efi_devpath_last_node(last_dp); > > if (DevicePathType(dp) != MEDIA_DEVICE_PATH || > > - DevicePathSubType(dp) != MEDIA_FILEPATH_DP) > > + DevicePathSubType(dp) != MEDIA_FILEPATH_DP) { > > + printf("Using BootXXXX for root partition\n"); > > return (BOOT_INFO_OK); /* use currdir, default > kernel */ > > + } > > fp = (FILEPATH_DEVICE_PATH *)dp; > > ucs2_to_utf8(fp->PathName, &kernel); > > - if (kernel == NULL) > > + if (kernel == NULL) { > > + printf("Not using BootXXX: can't decode kernel\n"); > > return (BAD_CHOICE); > > + } > > if (*kernel == '\\' || isupper(*kernel)) > > fix_dosisms(kernel); > > if (stat(kernel, &st) != 0) { > > free(kernel); > > + printf("Not using BootXXX: can't find %s\n", kernel); > > return (BAD_CHOICE); > > } > > setenv("kernel", kernel, 1); > > free(kernel); > > + text = efi_devpath_name(last_dp); > > + if (text) { > > + printf("Using BootXXX %S + %s\n", text, kernel); > > + efi_free_devpath_name(text); > > + } > > > > return (BOOT_INFO_OK); > > } > > @@ -499,13 +524,22 @@ find_currdev(EFI_LOADED_IMAGE *img, bool > do_bootmgr, b > > if (sanity_check_currdev()) > > return (0); > > if (dp->pd_parent != NULL) { > > + pdinfo_t *espdp = dp; > > dp = dp->pd_parent; > > STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { > > + /* Already tried the ESP */ > > + if (espdp == pp) > > + continue; > > /* > > * Roll up the ZFS special case > > * for those partitions that have > > * zpools on them. > > */ > > + text = efi_devpath_name(pp->pd_devpath); > > + if (text != NULL) { > > + printf("Trying: %S\n", text); > > + efi_free_devpath_name(text); > > + } > > if (try_as_currdev(dp, pp)) > > return (0); > > } > > @@ -798,6 +832,8 @@ main(int argc, CHAR16 *argv[]) > > } > > } > > } > > + printf("howto %#x console set to %s\n", howto, getenv("console")); > > + > > /* > > * howto is set now how we want to export the flags to the kernel, > so > > * set the env based on it. > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > I see inconsistent usage of BootXXXX and BootXXX in the printf messages. I > guess this is > meant to be BootXXXX? > I fixed it by substituting the right XXXX since we may need that in some booting scenarios. r336791 has that fix. Warner