Closed djkaosun closed 1 year ago
I posted this on the VyOS forum, as it is probably a problem with the VyOS build system.
I am not sure if this is the correct solution, but I changed build-image.sh of vyos-pi-builder as follows, and the build was completed tentatively. I have not yet confirmed that the VyOS image built with this script works properly.
build-image.sh is:
- # Clean out the build-repo and copy all custom packages
- rm -rf vyos-build
- git clone http://github.com/vyos/vyos-build vyos-build
for a in $(find build -type f -name "*.deb" | grep -v -e "-dbgsym_" -e "libnetfilter-conntrack3-dbg"); do
echo "Copying package: $a"
cp $a vyos-build/packages/
done
cd vyos-build
echo "Copy new default configuration to the vyos image"
cp ${ROOTDIR}/config.boot.default data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default
# Build the image
- VYOS_BUILD_FLAVOR=data/generic-arm64.json
- ./configure
- make iso
+ /vyos/vyos-build/build-vyos-image iso --architecture arm64
cd $ROOTDIR
# Build u-boot
bash build-u-boot.sh
Makefile is:
container:
- sudo rm -rf vyos-build
- git clone -b current --single-branch https://github.com/vyos/vyos-build
sudo docker build --arch arm64 vyos-build/docker -v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static -t vyos/vyos-build:current-arm64
- iso-local:
- sudo docker run --rm -it --arch arm64 --privileged -v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static -v "$(shell pwd)":/vyos -v /dev:/dev --sysctl net.ipv6.conf.lo.disable_ipv6=0 localhost/vyos/vyos-build:current-arm64 /bin/bash -c 'cd /vyos; /bin/bash -x build-image.sh'
iso-registry:
- sudo docker run --rm -it --arch arm64 --privileged -v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static -v "$(shell pwd)":/vyos -v /dev:/dev --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos/vyos-build:current-arm64 /bin/bash -c 'cd /vyos; /bin/bash -x build-image.sh'
+ sudo docker run --rm -it --platform arm64 --privileged -v "$(shell pwd)":/vyos -v /dev:/dev --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos/vyos-build:current-arm64 /bin/bash -c 'cd /vyos; /bin/bash -x build-image.sh'
In addition, the following preparations were required.
$ git clone https://github.com/runborg/vyos-pi-builder
$ cd vyos-pi-builder
$ git clone -b current --single-branch https://github.com/vyos/vyos-build
$ wget -qO- https://repos.influxdata.com/influxdb.key > sudo tee vyos-build/data/live-build-config/archives/influxdb.key.chroot
$ vi vyos-build/data/architectures/arm64.toml
+ additional_repositories = [
+ "deb [arch=arm64] https://repos.influxdata.com/debian bullseye stable"
+ ]
+ kernel_flavor = "arm64-vyos"
# Packages added to images for x86 by default
packages = [
- "grub-efi-arm"
+ "grub-efi-arm64",
+ "telegraf"
]
bootloaders = "grub-efi"
$ vi build-pi-kernel.sh
set -x
set -e
ROOTDIR=$(pwd)
cd vyos-build/packages/linux-kernel/
git clone https://github.com/raspberrypi/linux
./build-kernel.sh
git clone https://github.com/accel-ppp/accel-ppp.git
./build-accel-ppp.sh
$sudo docker run --rm -it --platform arm64 --privileged -v "$(pwd)":/vyos -v /dev:/dev --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos/vyos-build:current-arm64 /bin/bash -c 'cd /vyos; /bin/bash -x build-pi-kernel.sh'
I wanted to use wi-fi but it is not recognizing the device and I am trying to work it out.
I forgot to build the firmware, so I did the following additionally.
build-pi-kernel.sh:
set -x
set -e
ROOTDIR=$(pwd)
cd vyos-build/packages/linux-kernel/
git clone https://github.com/raspberrypi/linux
./build-kernel.sh
+ ln -s linux/drivers/firmware linux-firmware
+ ./build-linux-firmware.sh
git clone https://github.com/accel-ppp/accel-ppp.git
./build-accel-ppp.sh
vyos-build/data/architectures/arm64.toml:
additional_repositories = [
"deb [arch=arm64] https://repos.influxdata.com/debian bullseye stable"
]
kernel_flavor = "arm64-vyos"
# Packages added to images for x86 by default
packages = [
"grub-efi-arm64",
+ "vyos-linux-firmware",
"telegraf"
]
bootloaders = "grub-efi"
The wi-fi device did not work even after running build-linux-firmware.sh. However, I did the following on VyOS and it is now recognized.
$ sudo -i
# wget -qO- https://github.com/openwrt/cypress-nvram/blob/master/brcmfmac43456-sdio.txt > /lib/firmware/brcm/brcmfmac43455-sdio.txt
In addition, because the kernel version included the unfamiliar "v8", the following workaround was implemented.
vyos-build/build-vyos-image:
- --linux-packages linux-image-{{kernel_version}} \
+ --linux-packages linux-image-{{kernel_version}}-v8 \
vyos-build/packages/linux-kernel/build-linux-firmware.sh:
- FW_FILES=$(find ${LINUX_SRC}/debian/linux-image/lib/modules/${KERNEL_VERSION}${KERNEL_SUFFIX}/kernel/drivers/net -name *.ko | xargs modinfo | grep "^firmware:" | awk '{print $2}')
+ FW_FILES=$(find ${LINUX_SRC}/debian/linux-image/lib/modules/${KERNEL_VERSION}-v8${KERNEL_SUFFIX}/kernel/drivers/net -name *.ko | xargs modinfo | grep "^firmware:" | awk '{print $2}')
It appears to be working at least for the moment, so I will use this image for a while.
As for now all fixes should be merged, i’ve verified that it builds fine, but do not have any means to verify it.. could you do a verification?
Hi,
apparently building live-image-arm64.hybrid.iso seem to fail.
I ran the following command:
The result is as follows:
What am I doing wrong?