All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] Problem of cant find a serial device in the Functional.serial_rx
@ 2018-07-12  2:12 Li, Xiaoming
  2018-07-13 20:53 ` Tim.Bird
  0 siblings, 1 reply; 3+ messages in thread
From: Li, Xiaoming @ 2018-07-12  2:12 UTC (permalink / raw)
  To: fuego; +Cc: Oki Kyohhei/�_ 恭平

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

Hi all:

I am working on the Functional.serial_rx test suite,and found  a  problem.

As u know,  Functional.serial_rx tests  the seria port,  receive and send capacity between  host and board.

But,   the  fuego install script  do not create a  virtual serial device in the docker.   So it just cant work.

Below  is my  method to solve this problem,    anyone knows a better one ?


diff --git a/fuego-host-scripts/docker-create-container.sh b/fuego-host-scripts/docker-create-container.sh
index 59cce3d..c8f1231 100755
--- a/fuego-host-scripts/docker-create-container.sh
+++ b/fuego-host-scripts/docker-create-container.sh
@@ -23,5 +23,10 @@ sudo docker create -it --name ${DOCKERCONTAINER} \
     -v $DIR/../fuego-rw:/fuego-rw \
     -v $DIR/../fuego-ro:/fuego-ro:ro \
     -v $DIR/../../fuego-core:/fuego-core:ro \
+    --device /dev/ttyUSB0:/dev/ttyS0 \
+    --device /dev/ttyUSB1:/dev/ttyS1 \
+    --device /dev/ttyUSB2:/dev/ttyS2 \
+    --device /dev/ttyUSB3:/dev/ttyS3 \
+    --device /dev/ttyUSB4:/dev/ttyS4 \
     --net="host" ${DOCKERIMAGE} || \
     echo "Could not create fuego-container. See error messages."


Best regards
Li

--------------------------------------------------
Li, Xiaoming
Development Dept.III
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST) No. 6 Wenzhu Road, Nanjing, 210012, China
TEL: +86+25-86630566-8451
FAX: +86+25-83317685
MAIL: lixm.fnst@cn.fujitsu.com<mailto:lixm.fnst@cn.fujitsu.com>
--------------------------------------------------




[-- Attachment #2: Type: text/html, Size: 6732 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Fuego] Problem of cant find a serial device in the Functional.serial_rx
  2018-07-12  2:12 [Fuego] Problem of cant find a serial device in the Functional.serial_rx Li, Xiaoming
@ 2018-07-13 20:53 ` Tim.Bird
  2018-07-17  9:48   ` Li, Xiaoming
  0 siblings, 1 reply; 3+ messages in thread
From: Tim.Bird @ 2018-07-13 20:53 UTC (permalink / raw)
  To: lixm.fnst, fuego; +Cc: kyohhei.oki



> -----Original Message-----
> From: Li, Xiaoming
> 
> I am working on the Functional.serial_rx test suite,and found  a  problem.
> 
> As u know,  Functional.serial_rx tests  the seria port,  receive and send
> capacity between  host and board.
>  
> But,   the  fuego install script  do not create a  virtual serial device in the
> docker.   So it just cant work.
> 
> Below  is my  method to solve this problem,    anyone knows a better one ? 
> 
> diff --git a/fuego-host-scripts/docker-create-container.sh b/fuego-host-
> scripts/docker-create-container.sh
> 
> index 59cce3d..c8f1231 100755
> 
> --- a/fuego-host-scripts/docker-create-container.sh
> 
> +++ b/fuego-host-scripts/docker-create-container.sh
> 
> @@ -23,5 +23,10 @@ sudo docker create -it --name ${DOCKERCONTAINER} \
> 
>      -v $DIR/../fuego-rw:/fuego-rw \
> 
>      -v $DIR/../fuego-ro:/fuego-ro:ro \
> 
>      -v $DIR/../../fuego-core:/fuego-core:ro \
> 
> +    --device /dev/ttyUSB0:/dev/ttyS0 \
> 
> +    --device /dev/ttyUSB1:/dev/ttyS1 \
> 
> +    --device /dev/ttyUSB2:/dev/ttyS2 \
> 
> +    --device /dev/ttyUSB3:/dev/ttyS3 \
> 
> +    --device /dev/ttyUSB4:/dev/ttyS4 \
> 
>      --net="host" ${DOCKERIMAGE} || \
> 
>      echo "Could not create fuego-container. See error messages."

Using --device in docker-create-container will only work if the
devices are static (that is, they don't appear and disapper), and
if the devices are present when the container is started.

See docker-create-usb-privileged-container.sh instead, which worked
for me when I was testing the serial port test in my lab.  That script creates
volume mounts for /dev/bus/usb and /dev/serial, along with volume
mounts for a number of specific devices (ttyACM[01], and ttyUSB0).
You can expand this to include the serial devices that will show up
in your lab.

In my lab, as boards are rebooted their USB and ACM connections
appear and disappear, which makes using --device problematic.

If needed, you can even do '-v /dev:/dev'.  This is a rather drastic
measure to take, but it should get the job done.

Please try this out and let me know if it works for your situation.
 -- Tim


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Fuego] Problem of cant find a serial device in the Functional.serial_rx
  2018-07-13 20:53 ` Tim.Bird
@ 2018-07-17  9:48   ` Li, Xiaoming
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Xiaoming @ 2018-07-17  9:48 UTC (permalink / raw)
  To: Tim.Bird, fuego; +Cc: kyohhei.oki

Hi Tim

docker-create-usb-privileged-container.sh works well for me

thx


-----Original Message-----
From: Tim.Bird@sony.com [mailto:Tim.Bird@sony.com] 
Sent: Saturday, July 14, 2018 4:54 AM
To: Li, Xiaoming/李 霄鸣; fuego@lists.linuxfoundation.org
Cc: kyohhei.oki@denso-ten.com
Subject: RE: [Fuego] Problem of cant find a serial device in the Functional.serial_rx



> -----Original Message-----
> From: Li, Xiaoming
> 
> I am working on the Functional.serial_rx test suite,and found  a  problem.
> 
> As u know,  Functional.serial_rx tests  the seria port,  receive and 
> send capacity between  host and board.
>  
> But,   the  fuego install script  do not create a  virtual serial device in the
> docker.   So it just cant work.
> 
> Below  is my  method to solve this problem,    anyone knows a better one ? 
> 
> diff --git a/fuego-host-scripts/docker-create-container.sh 
> b/fuego-host- scripts/docker-create-container.sh
> 
> index 59cce3d..c8f1231 100755
> 
> --- a/fuego-host-scripts/docker-create-container.sh
> 
> +++ b/fuego-host-scripts/docker-create-container.sh
> 
> @@ -23,5 +23,10 @@ sudo docker create -it --name ${DOCKERCONTAINER} \
> 
>      -v $DIR/../fuego-rw:/fuego-rw \
> 
>      -v $DIR/../fuego-ro:/fuego-ro:ro \
> 
>      -v $DIR/../../fuego-core:/fuego-core:ro \
> 
> +    --device /dev/ttyUSB0:/dev/ttyS0 \
> 
> +    --device /dev/ttyUSB1:/dev/ttyS1 \
> 
> +    --device /dev/ttyUSB2:/dev/ttyS2 \
> 
> +    --device /dev/ttyUSB3:/dev/ttyS3 \
> 
> +    --device /dev/ttyUSB4:/dev/ttyS4 \
> 
>      --net="host" ${DOCKERIMAGE} || \
> 
>      echo "Could not create fuego-container. See error messages."

Using --device in docker-create-container will only work if the devices are static (that is, they don't appear and disapper), and if the devices are present when the container is started.

See docker-create-usb-privileged-container.sh instead, which worked for me when I was testing the serial port test in my lab.  That script creates volume mounts for /dev/bus/usb and /dev/serial, along with volume mounts for a number of specific devices (ttyACM[01], and ttyUSB0).
You can expand this to include the serial devices that will show up in your lab.

In my lab, as boards are rebooted their USB and ACM connections appear and disappear, which makes using --device problematic.

If needed, you can even do '-v /dev:/dev'.  This is a rather drastic measure to take, but it should get the job done.

Please try this out and let me know if it works for your situation.
 -- Tim






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-17  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-12  2:12 [Fuego] Problem of cant find a serial device in the Functional.serial_rx Li, Xiaoming
2018-07-13 20:53 ` Tim.Bird
2018-07-17  9:48   ` Li, Xiaoming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.