Re: svn commit: r326458 - head/lib/libefivar

2017-12-02 Thread Alexey Dokuchaev
On Sat, Dec 02, 2017 at 08:38:17AM -0700, Warner Losh wrote:
> On Sat, Dec 2, 2017 at 4:22 AM, O. Hartmann  wrote:
> > Am Sat, 2 Dec 2017 07:29:19 + (UTC)
> > Warner Losh  schrieb:
> > > Author: imp
> > > Date: Sat Dec  2 07:29:19 2017
> > > New Revision: 326458
> > > URL: https://svnweb.freebsd.org/changeset/base/326458
> > > ...
> >
> > It seems this broke buildworld, as my attempt to build fails with this
> > error on r326459: [...]
> >
> > make[4]: stopped in /usr/src/usr.sbin/efivar
> > .ERROR_TARGET='efivar'
> 
> Yea, I added a libgeom dependency for libefivar and simply forgot about
> this program.

Now, guys, please remember that the Internet is still delivered via punched
cards for some of us, and trim your replies down to actual relevant context.
Thank you,

./danfe
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r326458 - head/lib/libefivar

2017-12-02 Thread Warner Losh
On Sat, Dec 2, 2017 at 4:22 AM, O. Hartmann  wrote:

> Am Sat, 2 Dec 2017 07:29:19 + (UTC)
> Warner Losh  schrieb:
>
> > Author: imp
> > Date: Sat Dec  2 07:29:19 2017
> > New Revision: 326458
> > URL: https://svnweb.freebsd.org/changeset/base/326458
> >
> > Log:
> >   Create a function to translate UEFI paths to unix paths
> >
> >   efivar_device_path_to_unix_path translates from UEFI to Unix
> >   efivar_unix_path_to_device_path translates from Unix to UEFI
> >
> >   At present, only HD() device types are supported (both GPT and
> >   MBR). CdRom and floppy devices aren't supported. ZFS isn't supported
> >   because there's no way in the UEFI standard to specify a ZFS datastore.
> >   Network devices aren't supported either.
> >
> >   Three forms of Unix path are accepted: /path/to/file (for a mounted
> >   filesystem), //path/to/file (uses the EFI partition on the same disk
> >   as /), and dev:/path/to/file (for unmounted filesystem). Two forms are
> >   produced (the first and last).
> >
> >   Sponsored by: Netflix
> >
> > Added:
> >   head/lib/libefivar/efivar-dp-xlate.c   (contents, props changed)
> > Modified:
> >   head/lib/libefivar/Makefile
> >   head/lib/libefivar/efivar-dp-format.c
> >   head/lib/libefivar/efivar-dp.h
> >
> > Modified: head/lib/libefivar/Makefile
> > 
> ==
> > --- head/lib/libefivar/Makefile   Sat Dec  2 07:29:07 2017
> (r326457)
> > +++ head/lib/libefivar/Makefile   Sat Dec  2 07:29:19 2017
> (r326458)
> > @@ -35,6 +35,7 @@ PACKAGE=lib${LIB}
> >  LIB= efivar
> >  SRCS=efivar.c efichar.c efivar-dp-format.c \
> >   efivar-dp-parse.c \
> > + efivar-dp-xlate.c \
> >   uefi-guid.c uefi-dputil.c
> >  INCS=efivar.h efivar-dp.h
> >  SHLIB_MAJOR= 1
> >
> > Modified: head/lib/libefivar/efivar-dp-format.c
> > 
> ==
> > --- head/lib/libefivar/efivar-dp-format.c Sat Dec  2 07:29:07 2017
> > (r326457) +++ head/lib/libefivar/efivar-dp-format.c   Sat Dec  2
> 07:29:19
> > 2017  (r326458) @@ -2432,7 +2432,7 @@ efidp_format_device_path(char
> *buf, size_t
> > len, const_ }
> >
> >  ssize_t
> > -efidp_format_device_path_node(char *buf, size_t len, const_efidp dp,
> ssize_t max)
> > +efidp_format_device_path_node(char *buf, size_t len, const_efidp dp)
> >  {
> >   char *str;
> >   ssize_t retval;
> > @@ -2453,4 +2453,15 @@ efidp_size(const_efidp dp)
> >  {
> >
> >   return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *,
> dp));
> > +}
> > +
> > +char *
> > +efidp_extract_file_path(const_efidp dp)
> > +{
> > + const FILEPATH_DEVICE_PATH  *fp;
> > + char *name = NULL;
> > +
> > + fp = (const void *)dp;
> > + ucs2_to_utf8(fp->PathName, );
> > + return name;
> >  }
> >
> > Added: head/lib/libefivar/efivar-dp-xlate.c
> > 
> ==
> > --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> > +++ head/lib/libefivar/efivar-dp-xlate.c  Sat Dec  2 07:29:19 2017
> > (r326458) @@ -0,0 +1,715 @@
> > +/*-
> > + * Copyright (c) 2017 Netflix, Inc.
> > + * All rights reserved.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions
> > + * are met:
> > + * 1. Redistributions of source code must retain the above copyright
> > + *notice, this list of conditions and the following disclaimer
> > + *in this position and unchanged.
> > + * 2. Redistributions in binary form must reproduce the above copyright
> > + *notice, this list of conditions and the following disclaimer in
> the
> > + *documentation and/or other materials provided with the
> distribution.
> > + *
> > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES
> > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> DISCLAIMED.
> > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
> BUT
> > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> USE,
> > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
> USE OF
> > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > + */
> > +
> > +#include 
> > +__FBSDID("$FreeBSD$");
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#undef MAX
> > +#undef MIN
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > 

Re: svn commit: r326458 - head/lib/libefivar

2017-12-02 Thread O. Hartmann
Am Sat, 2 Dec 2017 07:29:19 + (UTC)
Warner Losh  schrieb:

> Author: imp
> Date: Sat Dec  2 07:29:19 2017
> New Revision: 326458
> URL: https://svnweb.freebsd.org/changeset/base/326458
> 
> Log:
>   Create a function to translate UEFI paths to unix paths
>   
>   efivar_device_path_to_unix_path translates from UEFI to Unix
>   efivar_unix_path_to_device_path translates from Unix to UEFI
>   
>   At present, only HD() device types are supported (both GPT and
>   MBR). CdRom and floppy devices aren't supported. ZFS isn't supported
>   because there's no way in the UEFI standard to specify a ZFS datastore.
>   Network devices aren't supported either.
>   
>   Three forms of Unix path are accepted: /path/to/file (for a mounted
>   filesystem), //path/to/file (uses the EFI partition on the same disk
>   as /), and dev:/path/to/file (for unmounted filesystem). Two forms are
>   produced (the first and last).
>   
>   Sponsored by: Netflix
> 
> Added:
>   head/lib/libefivar/efivar-dp-xlate.c   (contents, props changed)
> Modified:
>   head/lib/libefivar/Makefile
>   head/lib/libefivar/efivar-dp-format.c
>   head/lib/libefivar/efivar-dp.h
> 
> Modified: head/lib/libefivar/Makefile
> ==
> --- head/lib/libefivar/Makefile   Sat Dec  2 07:29:07 2017
> (r326457)
> +++ head/lib/libefivar/Makefile   Sat Dec  2 07:29:19 2017
> (r326458)
> @@ -35,6 +35,7 @@ PACKAGE=lib${LIB}
>  LIB= efivar
>  SRCS=efivar.c efichar.c efivar-dp-format.c \
>   efivar-dp-parse.c \
> + efivar-dp-xlate.c \
>   uefi-guid.c uefi-dputil.c
>  INCS=efivar.h efivar-dp.h
>  SHLIB_MAJOR= 1
> 
> Modified: head/lib/libefivar/efivar-dp-format.c
> ==
> --- head/lib/libefivar/efivar-dp-format.c Sat Dec  2 07:29:07 2017
> (r326457) +++ head/lib/libefivar/efivar-dp-format.c   Sat Dec  2 07:29:19
> 2017  (r326458) @@ -2432,7 +2432,7 @@ efidp_format_device_path(char *buf, 
> size_t
> len, const_ }
>  
>  ssize_t
> -efidp_format_device_path_node(char *buf, size_t len, const_efidp dp, ssize_t 
> max)
> +efidp_format_device_path_node(char *buf, size_t len, const_efidp dp)
>  {
>   char *str;
>   ssize_t retval;
> @@ -2453,4 +2453,15 @@ efidp_size(const_efidp dp)
>  {
>  
>   return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp));
> +}
> +
> +char *
> +efidp_extract_file_path(const_efidp dp)
> +{
> + const FILEPATH_DEVICE_PATH  *fp;
> + char *name = NULL;
> +
> + fp = (const void *)dp;
> + ucs2_to_utf8(fp->PathName, );
> + return name;
>  }
> 
> Added: head/lib/libefivar/efivar-dp-xlate.c
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/lib/libefivar/efivar-dp-xlate.c  Sat Dec  2 07:29:19 2017
> (r326458) @@ -0,0 +1,715 @@
> +/*-
> + * Copyright (c) 2017 Netflix, Inc.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer
> + *in this position and unchanged.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include 
> +__FBSDID("$FreeBSD$");
> +
> +#include 
> +#include 
> +#include 
> +
> +#undef MAX
> +#undef MIN
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "efichar.h"
> +
> +#include "efi-osdep.h"
> +#include "efivar-dp.h"
> +
> +#include "uefi-dplib.h"
> +
> +#define MAX_DP_SANITY4096/* Biggest device path in bytes 
> */
> +#define MAX_DP_TEXT_LEN  4096/* Longest string rep of dp */
> +
> +#define  

svn commit: r326458 - head/lib/libefivar

2017-12-01 Thread Warner Losh
Author: imp
Date: Sat Dec  2 07:29:19 2017
New Revision: 326458
URL: https://svnweb.freebsd.org/changeset/base/326458

Log:
  Create a function to translate UEFI paths to unix paths
  
  efivar_device_path_to_unix_path translates from UEFI to Unix
  efivar_unix_path_to_device_path translates from Unix to UEFI
  
  At present, only HD() device types are supported (both GPT and
  MBR). CdRom and floppy devices aren't supported. ZFS isn't supported
  because there's no way in the UEFI standard to specify a ZFS datastore.
  Network devices aren't supported either.
  
  Three forms of Unix path are accepted: /path/to/file (for a mounted
  filesystem), //path/to/file (uses the EFI partition on the same disk
  as /), and dev:/path/to/file (for unmounted filesystem). Two forms are
  produced (the first and last).
  
  Sponsored by: Netflix

Added:
  head/lib/libefivar/efivar-dp-xlate.c   (contents, props changed)
Modified:
  head/lib/libefivar/Makefile
  head/lib/libefivar/efivar-dp-format.c
  head/lib/libefivar/efivar-dp.h

Modified: head/lib/libefivar/Makefile
==
--- head/lib/libefivar/Makefile Sat Dec  2 07:29:07 2017(r326457)
+++ head/lib/libefivar/Makefile Sat Dec  2 07:29:19 2017(r326458)
@@ -35,6 +35,7 @@ PACKAGE=lib${LIB}
 LIB=   efivar
 SRCS=  efivar.c efichar.c efivar-dp-format.c \
efivar-dp-parse.c \
+   efivar-dp-xlate.c \
uefi-guid.c uefi-dputil.c
 INCS=  efivar.h efivar-dp.h
 SHLIB_MAJOR=   1

Modified: head/lib/libefivar/efivar-dp-format.c
==
--- head/lib/libefivar/efivar-dp-format.c   Sat Dec  2 07:29:07 2017
(r326457)
+++ head/lib/libefivar/efivar-dp-format.c   Sat Dec  2 07:29:19 2017
(r326458)
@@ -2432,7 +2432,7 @@ efidp_format_device_path(char *buf, size_t len, const_
 }
 
 ssize_t
-efidp_format_device_path_node(char *buf, size_t len, const_efidp dp, ssize_t 
max)
+efidp_format_device_path_node(char *buf, size_t len, const_efidp dp)
 {
char *str;
ssize_t retval;
@@ -2453,4 +2453,15 @@ efidp_size(const_efidp dp)
 {
 
return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp));
+}
+
+char *
+efidp_extract_file_path(const_efidp dp)
+{
+   const FILEPATH_DEVICE_PATH  *fp;
+   char *name = NULL;
+
+   fp = (const void *)dp;
+   ucs2_to_utf8(fp->PathName, );
+   return name;
 }

Added: head/lib/libefivar/efivar-dp-xlate.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libefivar/efivar-dp-xlate.cSat Dec  2 07:29:19 2017
(r326458)
@@ -0,0 +1,715 @@
+/*-
+ * Copyright (c) 2017 Netflix, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer
+ *in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+#undef MAX
+#undef MIN
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "efichar.h"
+
+#include "efi-osdep.h"
+#include "efivar-dp.h"
+
+#include "uefi-dplib.h"
+
+#define MAX_DP_SANITY  4096/* Biggest device path in bytes */
+#define MAX_DP_TEXT_LEN4096/* Longest string rep of dp */
+
+#defineG_PART  "PART"
+#defineG_LABEL "LABEL"
+#define G_DISK "DISK"
+
+static const char *
+geom_pp_attr(struct gmesh *mesh, struct gprovider *pp, const char *attr)
+{
+   struct gconfig *conf;
+
+   LIST_FOREACH(conf, >lg_config, lg_config) {
+   if (strcmp(conf->lg_name, attr) != 0)
+