Jump to content

CANNOT START USB IP ON ORANGE WITH ARMBIAN


marol94
 Share

Recommended Posts

Hi,

i can't get usbip work, there's a tutorial or something else that i can follow to make usbip working over that soc board?

 

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"

 

 

#/usr/bin/usbip

WARNING: usbip not found for kernel 4.14.84

  You may need to install the following packages for this specific kernel:
    linux-tools-4.14.84-sunxi
    linux-cloud-tools-4.14.84-sunxi

  You may also want to install one of the following packages to keep up to date:
    linux-tools-sunxi
    linux-cloud-tools-sunxi

 

 

The board is a orange pi r1

how i can make that working?

 

 

Edited by marol94
Link to comment
Share on other sites

Armbian Linux community supported weekly builds download

Run apt update and upgrade and it will work since it's enabled in most recent kernel https://github.com/armbian/build/blob/master/config/kernel/linux-sunxi-next.config#L4608-L4613

 

But if this functionality doesn't work for some reason, we can't help anything. There is alternative solution: https://www.incentivespro.com/usb-redirector.html

Link to comment
Share on other sites

Hi,

iv'e done what you told me, but i've got that now

 

 

root@orangepi:~# usbip
WARNING: usbip not found for kernel 4.19.13

  You may need to install the following packages for this specific kernel:
    linux-tools-4.19.13-sunxi
    linux-cloud-tools-4.19.13-sunxi

  You may also want to install one of the following packages to keep up to date:
    linux-tools-sunxi
    linux-cloud-tools-sunxi

 

 

how can i do?

Link to comment
Share on other sites

9 minutes ago, marol94 said:

how can i do?


No idea. USBIP service is not related to Armbian whatsoever - check kernel configuration if modules are enabled. I never used it and can't help here.  Check manual.

 

Moving to general community section.

Link to comment
Share on other sites

Hi,

 

I just got usbip working on an odroid-n2 with kernel 5.10.

 

$ apt-get install linux-headers-current-meson64

$ apt-get install linux-source-5.10.34-current-meson64

$ apt-get install libtool

$ apt-get install libudev-dev

 

Unpack the kernel sources (/usr/src), go into the tools/usb/usbip directory and follow instructions in README:

$ ./autogen.sh

$ ./configure --with-tcp-wrappers=no

$ make install

 

Then:

 

$ export LD_LIBRARY_PATH=/usr/local/lib

$ cd /usr/local/sbin

 

$ modprobe usbip_host

$ ./usbipd

$ ./usbip list -l

$ ./usbip bind -b 2-1.3

...

 

Good luck. Cheers.

 

Link to comment
Share on other sites

13.08.2022 в 19:47, Igor сказал:

Is there a simple way to package all those tools within a kernel compilation:
https://armbian.atlassian.net/browse/AR-1283

 

This is a very beautiful example - usbip.
If I understood correctly after reading this description:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/usb/usbip/README?h=v5.19

we need to build a kernel module, a user-space utility, and write udev rules for loading the module and starting the server.

We need to pack all this into one or two packages and prescribe dependencies on a specific kernel. In this case, the utility

will have dependencies on system libraries. That is, it must be collected in the environment in which it will be used.

 

In order for this to become an easy way, we need to do the following:
1) Build packages from kernel sources without using the built-in mechanism (mkdebian, builddeb).
Instead, we have to generate files in the debian directory ourselves from our own templates.

During this process, handle some differences from the kernel version and writing all the necessary variables to files.
2) Collect packages for focal in this OS, packages for jammy in the jammy environment.

 

Link to comment
Share on other sites

13 minutes ago, going said:

we need to build a kernel module

 

I was also looking into usbip as I want to implement it to be able to attach devices under test to USB server containing a bunch of wireless cards.

This seems covered well.

Spoiler
linux-bcm2711-current.config:CONFIG_USBIP_CORE=m
linux-bcm2711-edge.config:CONFIG_USBIP_CORE=m
linux-imx6-current.config:CONFIG_USBIP_CORE=m
linux-imx6-edge.config:CONFIG_USBIP_CORE=m
linux-imx7d-current.config:# CONFIG_USBIP_CORE is not set
linux-imx7d-legacy.config:CONFIG_USBIP_CORE=m
linux-jetson-nano-legacy.config:# CONFIG_USBIP_CORE is not set
linux-media-current.config:CONFIG_USBIP_CORE=m
linux-media-edge.config:CONFIG_USBIP_CORE=m
linux-meson64-current.config:CONFIG_USBIP_CORE=m
linux-meson64-edge.config:CONFIG_USBIP_CORE=m
linux-meson64-legacy.config:CONFIG_USBIP_CORE=m
linux-meson-current.config:CONFIG_USBIP_CORE=m
linux-meson-edge.config:CONFIG_USBIP_CORE=m
linux-meson-legacy.config:CONFIG_USBIP_CORE=m
linux-mt7623-edge.config:CONFIG_USBIP_CORE=m
linux-mt7623-legacy.config:CONFIG_USBIP_CORE=m
linux-mvebu64-current.config:CONFIG_USBIP_CORE=m
linux-mvebu64-edge.config:CONFIG_USBIP_CORE=m
linux-mvebu64-legacy.config:CONFIG_USBIP_CORE=m
linux-mvebu-current.config:CONFIG_USBIP_CORE=m
linux-mvebu-edge.config:CONFIG_USBIP_CORE=m
linux-mvebu-legacy.config:CONFIG_USBIP_CORE=m
linux-odroidxu4-current.config:CONFIG_USBIP_CORE=m
linux-odroidxu4-edge.config:CONFIG_USBIP_CORE=m
linux-odroidxu4-legacy.config:CONFIG_USBIP_CORE=m
linux-rk322x-current.config:CONFIG_USBIP_CORE=m
linux-rk322x-edge.config:CONFIG_USBIP_CORE=m
linux-rk322x-legacy.config:CONFIG_USBIP_CORE=m
linux-rk3399-legacy.config:CONFIG_USBIP_CORE=m
linux-rk35xx-legacy.config:CONFIG_USBIP_CORE=m
linux-rockchip64-current.config:CONFIG_USBIP_CORE=m
linux-rockchip64-edge.config:CONFIG_USBIP_CORE=m
linux-rockchip64-legacy.config:CONFIG_USBIP_CORE=m
linux-rockchip-current.config:CONFIG_USBIP_CORE=m
linux-rockchip-edge.config:CONFIG_USBIP_CORE=m
linux-rockchip-legacy.config:CONFIG_USBIP_CORE=m
linux-rockchip-rk3588-legacy.config:CONFIG_USBIP_CORE=m
linux-rockpis-legacy.config:CONFIG_USBIP_CORE=m
linux-s5p6818-legacy.config:CONFIG_USBIP_CORE=m
linux-station-p2-legacy.config:# CONFIG_USBIP_CORE is not set
linux-sun50iw9-legacy.config:CONFIG_USBIP_CORE=m
linux-sunxi64-current.config:CONFIG_USBIP_CORE=m
linux-sunxi64-edge.config:CONFIG_USBIP_CORE=m
linux-sunxi64-legacy.config:CONFIG_USBIP_CORE=m
linux-sunxi-current.config:CONFIG_USBIP_CORE=m
linux-sunxi-edge.config:CONFIG_USBIP_CORE=m
linux-sunxi-legacy.config:CONFIG_USBIP_CORE=m
linux-uefi-arm64-current.config:CONFIG_USBIP_CORE=m
linux-uefi-arm64-edge.config:CONFIG_USBIP_CORE=m
linux-uefi-x86-current.config:CONFIG_USBIP_CORE=m
linux-uefi-x86-edge.config:CONFIG_USBIP_CORE=m
linux-virtual-current.config:CONFIG_USBIP_CORE=m
linux-zynq-legacy.config:# CONFIG_USBIP_CORE is not set

 

 

14 minutes ago, going said:

That is, it must be collected in the environment in which it will be used.

 

12 minutes ago, going said:

Collect packages for focal in this OS, packages for jammy in the jammy environment.


Under this?
https://github.com/armbian/build/tree/master/packages/extras-buildpkgs

Link to comment
Share on other sites

4 часа назад, Igor сказал:

Under this?

In a sense, it is a build server for the target architecture in the target operating system environment.
I have not come up with a simpler and more correct way at the moment.
I am building a library and an application using kernel sources in a chroot environment by mounting them in the following way.

From 29990c7edb920a7c5be3b898716f48d8bbc29dec Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Fri, 13 May 2022 21:31:51 +0300
Subject: [PATCH] Mount bind linux source if necessary

---
 lib/chroot-buildpackages.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/chroot-buildpackages.sh b/lib/chroot-buildpackages.sh
index 9471ee3a3..b4b52fc18 100644
--- a/lib/chroot-buildpackages.sh
+++ b/lib/chroot-buildpackages.sh
@@ -258,7 +258,7 @@ chroot_build_packages()
 
 			for plugin in $config_for_packages; do
 				unset package_name package_repo package_ref package_builddeps package_install_chroot package_install_target \
-					package_upstream_version needs_building plugin_target_dir package_component "package_builddeps_${release}"
+					package_upstream_version needs_building plugin_target_dir package_component "package_builddeps_${release}" mount_linux_src
 				source "${plugin}"
 
 				# check build condition
@@ -312,11 +312,19 @@ chroot_build_packages()
 
 				fetch_from_repo "$package_repo" "extra/$package_name" "$package_ref"
 
+				if [ "$mount_linux_src" == "yes" ];then
+					mkdir -p $target_dir/root/linux
+					linuxsrc=$(realpath "${SRC}"/cache/sources/${LINUXSOURCEDIR})
+					# redefine mount_linux_src
+					mount_linux_src="--bind-ro ${linuxsrc}/:/root/linux"
+				fi
+
 				eval systemd-nspawn -a -q \
 					--capability=CAP_MKNOD -D "${target_dir}" \
 					--tmpfs=/root/build \
 					--tmpfs=/tmp:mode=777 \
 					--bind-ro "$(dirname $plugin)"/:/root/overlay \
+					$mount_linux_src \
 					--bind-ro "${SRC}"/cache/sources/extra/:/root/sources /bin/bash -c "/root/build.sh" 2>&1 \
 					${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/${LOG_SUBPATH}/buildpkg.log'}
 
-- 
2.35.3

 

Link to comment
Share on other sites

16.08.2022 в 17:46, Igor сказал:

I have looked carefully at the build scripts of the original ubuntu kernel package.
The scripts are configured for both cross compilation and native assembly.
If there is a very big desire, then it will be possible to implement this for the armbian build system.
It is assumed that this will be a significantly reduced version.

Link to comment
Share on other sites

On 8/17/2022 at 9:36 PM, going said:

If there is a very big desire, then it will be possible to implement this for the armbian build system.


Desire is getting bigger :) but if there is no time ... Can you at least give me some directions so I don't start from scratch?

Link to comment
Share on other sites

I see two ways.
1) You can turn the user's @hoov manual into a debian/rule file.

Mount the already patched kernel into the build environment and assemble the kernel module.
Take my branch. https://github.com/The-going/armbian-build/tree/chroot_build_pkg

Use the parameter mount_linux_src=yes

https://github.com/The-going/armbian-build/blob/1e9a7a1b24e5d5aead730f58ad910124782b5576/lib/chroot-buildpackages.sh#L313

 

Here I help the user to build a debian package in a chroot environment, bypassing many unnecessary steps.

 

2) I wanted to try to rework the debian rules directly from the original ubuntu repository:

/gituser/ubuntu-kernel> mkdir jammy
/gituser/ubuntu-kernel> cd jammy/
/gituser/ubuntu-kernel/jammy> git init
/gituser/ubuntu-kernel/jammy> git remote add origin git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
/gituser/ubuntu-kernel/jammy> git fetch
/gituser/ubuntu-kernel/jammy> git checkout -b hwe-5.19-next origin/hwe-5.19-next

I'll take that as a basis. Everything is available here. We only need to choose what we will take.

Link to comment
Share on other sites

I have similar issue. I'm trying to install usb IP on:
 

uname -a
Linux pineh64-b 5.15.80-sunxi64 #22.11.1 SMP Wed Nov 30 11:23:00 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Armbian 22.11.1 Jammy

 

Using @hoov tutorial I went with:

apt-get install linux-source-5.15.80-current-sunxi64
apt-get install linux-headers-current-sunxi64
apt-get install libudev-dev
apt-get install libtool

And I went to /usr/src/linux-headers-5.15.80-sunxi64/tools/usb/usbip

But there is no README and there is no ./autogen.sh:

 

root@pineh64-b:/usr/src/linux-headers-5.15.80-sunxi64/tools/usb/usbip# ls -la
total 20
drwxr-xr-x 4 root root 4096 Dec  1 00:48 .
drwxr-xr-x 4 root root 4096 Dec  1 00:48 ..
drwxr-xr-x 2 root root 4096 Dec  1 00:48 libsrc
-rw-r--r-- 1 root root  292 Dec  1 00:48 Makefile.am
drwxr-xr-x 2 root root 4096 Dec  1 00:48 src

 

What have I done wrong? what am I missing?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...