[bootlin/training-materials updates] master: labs/sysdev-u-boot-qemu: qemu-ifup doesn't need to be in /etc (58b50283)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Nov 13 11:05:58 CET 2020


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/58b50283c7f5ef77de2e67df1028dcb70f9315fd

>---------------------------------------------------------------

commit 58b50283c7f5ef77de2e67df1028dcb70f9315fd
Author: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date:   Fri Nov 13 11:05:58 2020 +0100

    labs/sysdev-u-boot-qemu: qemu-ifup doesn't need to be in /etc
    
    Putting it in /etc doesn't make much sense, just put it in the user
    directory somewhere.
    
    Also, using /bin/sh is enough, /bin/bash is not needed.
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>


>---------------------------------------------------------------

58b50283c7f5ef77de2e67df1028dcb70f9315fd
 labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex b/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex
index c9e6c82d..f115ed9b 100644
--- a/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex
+++ b/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex
@@ -202,19 +202,18 @@ printenv foo
 To load a kernel in the next lab, we will setup networking between the QEMU emulated
 machine and the host.
 
-To do so, create a \code{/etc/qemu-myifup} (for example)
-script that will bring up a network interface between QEMU and the host.
-Here are its contents:
+To do so, create a \code{qemu-myifup} script that will bring up a
+network interface between QEMU and the host.  Here are its contents:
 
 \begin{verbatim}
-#!/bin/bash
+#!/bin/sh
 /sbin/ip a add 192.168.0.1/24 dev $1
 /sbin/ip link set $1 up
 \end{verbatim}
 
 Of course, make this script executable:
 \begin{verbatim}
-sudo chmod +x /etc/qemu-myifup
+chmod +x qemu-myifup
 \end{verbatim}
 
 As you can see, the host side will have the \code{192.168.0.1} IP
@@ -229,7 +228,7 @@ because of the need to bring up the network interface:
 sudo qemu-system-arm -M vexpress-a9 -m 128M -nographic \
 -kernel u-boot-2020.04/u-boot \
 -sd sd.img \
--net tap,script=/etc/qemu-myifup -net nic
+-net tap,script=./qemu-myifup -net nic
 \end{verbatim}
 
 Note the new net options:




More information about the training-materials-updates mailing list