From owner-freebsd-hackers@freebsd.org Fri May 18 06:47:05 2018 Return-Path: Delivered-To: freebsd-hackers@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 5B015EEC4EB for ; Fri, 18 May 2018 06:47:05 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc12.plala.or.jp (msc12.plala.or.jp [60.36.166.22]) by mx1.freebsd.org (Postfix) with ESMTP id 705D769916 for ; Fri, 18 May 2018 06:47:04 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([126.74.209.183]) by msc12.plala.or.jp with ESMTP id <20180518064656.CAWL27377.msc12.plala.or.jp@localhost> for ; Fri, 18 May 2018 15:46:56 +0900 Date: Fri, 18 May 2018 15:46:51 +0900 (JST) Message-Id: <20180518.154651.1245356276560904866.ish@amail.plala.or.jp> To: freebsd-hackers@freebsd.org Subject: Re: How can I wait for a USB Ethernet adapter to appear to configure lagg on startup? From: Masachika ISHIZUKA In-Reply-To: <5AFE43FF.8020800@grosbein.net> References: <20180518.113009.439302765921485452.ish@amail.plala.or.jp> <5AFE439D.4000801@grosbein.net> <5AFE43FF.8020800@grosbein.net> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac12; Fri, 18 May 2018 15:46:56 +0900 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2018 06:47:05 -0000 >>> I use a nootbook machine. >>> As this machine has no internal nic, I use a USB ethernet adapter(ue0). >>> I want to configure lagg0 of ue0 and iwm0, but I must wait to start >>> /etc/rc.d/netif until appearing the ue0. >>> I'm using patched netif as follows, but I must keep it whenever >>> 'mergemaster -Ui' is run. >>> Is there a more elegant way? >> >> Yes. In fact, you do not need to wait but "hook" on the event of ue0 creation. >> We have several ways to do that and simpliest one for network interface is >> using /etc/start_if.ue0 script like this: >> >> #!/bin/sh >> >> ifconfig ue0 up >> ifconfig lagg0 addm ue0 > > Sorry, this should be "ifconfig lagg0 laggport ue0" Thank you, Eugene. I wrote /etc/start_if.ue0 on 12-current r333704 as follows % cat /etc/start_if.ue0 #!/bin/sh ifconfig ue0 ether xx:xx:xx:xx:xx:xx up # set iwm0's mac address ifconfig lagg0 -laggport wlan0 laggport ue0 laggport wlan0 /etc/rc.d/wpa_supplicant start wlan0 Now, it works well. Thank you very much. -- Masachika ISHIZUKA