I’m trying to add a package to the iso build for an unsupported network card and I’m getting this error:
N: Download is performed unsandboxed as root as file ‘/root/packages/./realtek-r8126-dkms_10.015.00-1_amd64.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)
I’ve tried changing both the file permissions and ownership of the file, but still getting the same error.
It would pay to provide context around what version you’re building, how you’re building it, what commands you’re using to build it etc. Then someone who understands the build process (not me, sadly) might be able to assist.
This is with the latest rolling release using the standard build docker. I add the .deb to the /packages dir per the build instructions and build per the instructions as well.
The build itself has no other issues and completes successfully, just with the added driver package missing. I’ve tested the resulting iso is working but missing the r8126 driver.
After changing into the checked-out vyos-build directory, you run the docker command?
Where did you get the realtek DEB file from?
And what confuses me a bit is that you put the DEB file in /root/packages? For me the packages folder is a folder in the vyos-build repo. And I’m in the vyos-build repo when I start the docker container.
vyos_bld@f0acfcd8a739:/vyos$ ls -l packages/
total 43984
...
-rw-r--r-- 1 vyos_bld vyos_bld 4146430 Feb 21 15:09 vyos-intel-qat_4.24.0-00005-0_amd64.deb
...
vyos_bld@f0acfcd8a739:/vyos$ id vyos_bld
uid=1000(vyos_bld) gid=1000(vyos_bld) groups=1000(vyos_bld)
I put the .deb in vyos-build/packages, the error message is showing the path as: /root/packages/./realtek-r8126-dkms_10.015.00-1_amd64.deb. It obviously finds it so not sure why the difference, so something to look into.
For the example you sent it’s showing the file owner as vyos_bld, I’ll try set it to that when I get a moment. I’ve tried a few other owners and groups but not that one.
It’s the ID of user I started the docker container with
BUT: I get the same error when download the RealTek DEB into the ./packages directory. Something is not compatible with this kind of installation. Can you manually install the DEB after installation of VyOS itself?
DKMS compiles the module for the kernel and the build environment is not prepared for that I assume.
Edit 2025-04-14: build image process is working again. Editing below instructions
And now the little how-to:
Have a look in vyos-build/scripts/package-build/linux-kernel, there are a few scripts to compile the kernel and additional modules. There is a Python script to compile the Realtek 8152 driver. I added the r8126 driver in similar fashion.
It downloads the driver archive from my site (unmodified archive) since you have to solve a riddle to be able to download it from Realtek. I’m sure that’s not legal (maybe it is) but maybe ok for testing.
## checkout vyos-build, checkout branch current
## skip this step if you already have it checked-out
$ git clone --single-branch --branch current https://github.com/vyos/vyos-build
$ cd vyos-build
## add my r8126 repo and fetch it
$ git remote add boretom https://github.com/boretom/vyos-build
$ git fetch boretom
## git cherry-pick the latest from the `feature/add-realtek-8126` branch
## add `-n` to `cherry-pick` to _not_ commit the changes to your local git repo
## but just have them in the working copy.
$ git cherry-pick -n boretom/feature/add-realtek-8126
## fire up the build docker image however you like
## change into the linux-build package build directory
vyos_bld@...:/vyos$ cd scripts/package-build/linux-kernel
## build the kernel and the Realtek 8126 module
vyos_bld@...:/vyos/scripts/package-build/linux-kernel$ ./build.py --config package.toml --packages linux-kernel realtek-r8126
## copy the resulting `*.deb` file from this directory into /vyos/packages
The resulting kernel and module are signed. If you make changes to the kernel and/or compile it again, the keys may change (not sure) and you would have to rebuild the module.
Edit: Had a brain outage, corrected the above steps. A side-note about building the Realtek module: it should be possible to build the kernel and the driver in one go, like: removed the result of the brain outage… But the code in ./build.py does after all just run build-realtek-r8126.py, running it manually is fine.
Don’t try anything at the moment, building the 1.5-rolling image is broken upstream (2025-04-11 11:00 UTC).
Building the 1.5-rolling image is working again (2025-04-14 08:30 UTC), thanks to everybody involved.
I’ll clean up the post with the how-to once I can confirm that it works, and modify this post to reflect that.
I compiled vyos-1.5-rollling with the Realtek 8126 driver if you want to give a go to see if it works at all. Running the ISO itself should be enough, no installation necessary. I assume the driver is loaded automatically but if not, run:
Wow! You went above and beyond on this one! I was just asking for a few pointers, and you roll me a ISO. And yup… running the ISO the driver is loading.
Just saying… given how things rolls these days I wouldnt trust a compile made by somebody else but Im guessing you can do your own compile shortly in case that would be an issue.
@Apachez I agree, that’s why I wrote no installation is necessary. That way one could check to see if the driver loads and is working from the live ISO. Sure it can already contain a virus or malware.
I have not tried it myself yet: maybe if you place it in /vyos/scripts/package-build/linux-kernel it won’t download it from my site. And if the whole thing works maybe VyOS does include it upstream like for the Realtek 8152.
I’ll create one after getting feedback if the driver is any good/stable.
@Viacheslav maybe a question : if creating a PR for it, can I assume that the driver source archive would be in https://packages.vyos.net/source-mirror/, named the same as the download from the Realtek side, in that case r8126-10.015.00.tar.bz2?