On 09/03/2019 23:29, Bruce Dubbs via lfs-dev wrote: > On 3/9/19 3:47 PM, Pierre Labastie via lfs-dev wrote: >> On 09/03/2019 21:24, Bruce Dubbs via lfs-dev wrote: >>> On 3/9/19 12:57 PM, DJ Lucas via lfs-dev wrote: >>>> On 3/9/2019 10:38 AM, Pierre Labastie via lfs-dev wrote: >>>>> On 09/03/2019 17:09, DJ Lucas via lfs-dev wrote: >>>>>> This reminds me, I'm getting /etc/sysconfig/ifconfig.eth0 with >>>>>> IFACE=enp3s0. >>>>> >>>>> Yes, completely forgot about that... Problem is, I want to take my >>>>> information >>>>> from the book, and the book hardcodes ifconfig.eth0. Maybe make "eth0" >>>>> replaceable, so that lfs.xsl can catch it more easily... Would it be >>>>> acceptable (would render eth0 in italics)? Note that lfs.xsl detects eth0 >>>>> in >>>>> "IFACE=eth0", because it is in a <literal> tag. That's less easy outside >>>>> any >>>>> specific tag (I don't consider <userinput> as specific in this book ;) >>>> >>>> Yep, that should probably be done anyway, you can still use the value and >>>> just do a quick append, something to the effect of: >>>> >>>> (source /etc/sysconfig/ifconfig.eth0 && >>>> mv /etc/sysconfig/ifconfig.{eth0,${IFACE}}) >>> >>> There are a couple of issues here. There three places in sysV that use the >>> network interface name: >>> >>> 1. /etc/udev/rules.d/70-persistent-net.rules >>> >>> This is created by the /lib/udev/init-net-rules.sh script. By default it >>> will >>> pick up the host system device name. If the host is a distro like Debian >>> or >>> other systemd based system, the name will probably be something like >>> enp3s0. >>> On a LFS host that uses eth0, then it will remain eth0. That said, it can >>> easily be changed to anything you want with an editor. It sets the >>> interface >>> name in /sys/class/net/ at boot time. >>> >>> 2. /etc/sysconfig/ifconfig.eth0 >>> >>> This is hard coded into 7.5.1. Creating Network Interface Configuration >>> Files, >>> but is an example. There is no 'here' document to copy/paste. >>> The file name extention is not 100% required. The startup scripts only look >>> for the ifconfig stem of the filename. For instance, on my laptop I have >>> multiple ifconfig files like ifconfig.eth0.home and ifconfig.eth0.school >>> and I >>> have ONBOOT=no in both. For this system, I bring up the network manually >>> with, for example, ifup eth0.school. >>> >>> 3. The line IFACE=eth0 in the /etc/sysconfig/ifconfig >>> >>> This needs to match the device in /sys/class/net/. Typically it would match >>> the device in the 70-persistent-net.rules file, but the the rules file is >>> not >>> strictly required. >>> >> >> I think the main point here is that jhalfs can modify the IFACE= line (for >> example to IFACE=enp0s3 if you use qemu), but does not modify the >> ifconfig.eth0 extension... This is not a problem if ONBOOT is yes, although >> the information message is "bringing up eth0", while the interface may be >> something else. This is a problem if ONBOOT is no, because if you run ifup >> enp0s3 manually, it won't work: you have to run ifup eth0, which is somewhat >> confusing. So jhalfs needs to be consistent and have the same extension for >> the file as what is in the IFACE variable... >> >> Of course, more complicated setups are beyond the scope of jhalfs, and should >> be done manually... >> >> What is proposed by DJ would be a workaround, but I'd rather do that more >> cleanly: put a tag around the eth0 extension in the book, then use the >> stylesheet to change eth0 to whatever is in IFACE... >> >> My proposition for the ifconfig example would be: >> >> cat > ifconfig.<replaceable>eth0</replaceable> << "EOF" >> ... >> >> Would it be acceptable? >> >> Then I would take care of lfs.xsl... > > Sure. That's fine.
Done at revision 11556 + made all variable values in the file <replaceable>, and reworded some comments accordingly. Jhalfs revision is 4081 Pierre -- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page