From owner-svn-src-all@freebsd.org Fri Jul 27 23:58:07 2018 Return-Path: Delivered-To: svn-src-all@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 9DD5A105AD24 for ; Fri, 27 Jul 2018 23:58:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (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 26ED78FBB0 for ; Fri, 27 Jul 2018 23:58:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id v71-v6so9654792itb.3 for ; Fri, 27 Jul 2018 16:58:07 -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=4cqbHGiNAiNzgnE/VKb+fdqcW/V4/ZnuxeePSIIr/K8=; b=WFgxwOWIsqsbH/K2R3NaHEHztqzbVptRBOneWXLSqzHokHE3htP1rhV2KnUtY+Njkw 7lyTne3uzcdroYqwoTvY7xte5RhZ/cUVFyWeaP9QDsqceAQqqFdHTwyrUnEEMRYKX2oF gZl5PmsRy0vtK5X6n/NhwJ5upBwLJa4PjnCxI0ASWOmM4kNQ4joH1MFka24TDHcjizfk +vBfAxt6krs3Ey9z2ycthlmfLsTNNCkxwH2oh+JrNK6DQBgLAjVc85i4PszScn0STcGv ECpB5w7fyepLTeY6/GzEDjpj5q1CGwIM5NHBEscx2AkqOZNZvXiiiqo1YzXw26geOgmf d7Kg== 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=4cqbHGiNAiNzgnE/VKb+fdqcW/V4/ZnuxeePSIIr/K8=; b=pfkGi8xDCC6ma/FWgQ4EQKu3MZWfu7o4uv1GMFl2NMx61aOdjNz4erjKjoLpkBRcHk JccgE6K3Vr3j1+FpP3g7IyvgJ19NKxC47uxhr2XZ5fnJh6TY0tUDAzL3gXgrHfEsoLxs YDlQKp9Ayfq5LXcF+HxAp4SNSht/E0bTKBN8yboYDiLEp33fwxp+smqyKlnMCASqiddV P7XjuBc50QacBr7gfdOnot5z+4yStRvZVHuVf+ZIh5lJR4ytVnyeS8PO3eZKKvmP6Bce 3jPz81CQIJGgwADD4ik6UK9AkFJiT2PoRBVtqwwakGSqwb9KUJW9CK3V3tf9rY5LOFbU BHXw== X-Gm-Message-State: AOUpUlGc63kZkzgXM4EiVshU7o0hf8HNXDO9EDBKtjFTlswi8fU6NOma jZabwkT4smw0Cqo1OBEMtM5e9FeZgV5sfzjGX7l67WP3s/4= X-Google-Smtp-Source: AAOMgpfr266WNxknLgwhahW6YeCMX6Z4wRs+D6e4FKk6JvF/OgmYoN31HAPvbac3HT9XuoAmvlY5dvXL0F7Gd+nOyiE= X-Received: by 2002:a02:3344:: with SMTP id k4-v6mr8365860jak.45.1532735886259; Fri, 27 Jul 2018 16:58:06 -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 16:58:05 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <201807272354.w6RNsHox053294@pdx.rh.CN85.dnsmgr.net> References: <201807272200.w6RM00n3024246@repo.freebsd.org> <201807272354.w6RNsHox053294@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 27 Jul 2018 17:58:05 -0600 X-Google-Sender-Auth: E4u7FzYoTaE4G6u_7Y8yQD-_pYA Message-ID: Subject: Re: svn commit: r336789 - head/stand/efi/loader To: "Rodney W. Grimes" 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-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 23:58:07 -0000 Yea, that was a misfire.... It's been a long week and I didn't check before I tried to commit and hit ^C too late when I realized my mistake. Warner On Fri, Jul 27, 2018 at 5:54 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Fri Jul 27 22:00:00 2018 > > New Revision: 336789 > > URL: https://svnweb.freebsd.org/changeset/base/336789 > > > > Log: > > stand debug > > Thats a bit brief for a commit message... > > > 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. > > > > > > -- > Rod Grimes > rgrimes@freebsd.org >