Bug#881771: release-notes: No mention of "predictable network interface names" in Debian 10
Hi Justin,
Very briefly: the issues.dbk file contains
lots-o-stuff that seemed like it might be
relevant to include in the final text.  A lot
of it is a hodge-podge and not ready to be reviewed.
Of course you're welcome to come up with something
yourself. :-)
On Sun, 7 Apr 2019 02:43:21 +0100
Justin B Rye <justin.byam.rye@gmail.com> wrote:
> > +<screen>
> > +printf '0A:30' \
> > +  | perl -e 'while (<>)
> > +               {printf("enp%ss%s\n",
> > +                       oct("0x".substr($_,0,2)),
> > +                       oct("0x".substr($_,3,2)));};'
> > +</screen>  
> 
> This seems an overcomplicated way of converting a number from hex to
> dec, though I may be biassed due to the fact that for my own hardware
> I've never seen a slot or bus number higher than 7.  Couldn't you just
> use a bash function like:
> 
>  $ ethname() { echo "enp$((16#$1))s$((16#$2))"; }
>  $ ethname 0a 30
>  enp10s48
Technically, bash is not a required package.  So it
won't necessarily be on every Debian system.  The
perl-base package is required, so I used perl.
(printf is Posix and in dash, which is also required.)
This may be over-thinking, but I thought it a factor.
Regards,
Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein
Reply to: