[BPI-R64] Imagebuilder R64 ArchlinuxArm, linux-rolling-stable

Did you connect wan port to internet?

Try

ping 8.8.8.8

ping www.google.com

Oh! So there is no wireless by default. I will try that in the morning.

There is a wireless AP to connect clients. Internet connect to wan. This is how the standard router setup is.

With the script you can change from router setup to access point setup. Then all ports will become lan ports. Anyway, from this point you can setup as you likeā€¦

Is it possible to include a sd card resize script or code such as that included on the Raspberry Pi Operating System to resize the sd card to use the total amount of space on the sd card. That is if there is not an option to do this already?

CanĀ“t connect to access point the router wonĀ“t acknowledge the password. Tried both with and without the . on the end but the authorization dialog kept popping up. Is it possible to have it wireless connect to the main router? I need it to connect to my desktop via Ethernet which is in another room to the main router.

When you use the script to build the SD card, the total amount of space will be used. It is the idea to use the script. There are some settings to tweak, also to optimize the alignment of the partitions on the SD card. I cannot make an image for every combination of tweaks. The image is really only for try out to see if one likes the result. I would still like to check with you why the script failed before. There could be a bug in the script needing unbugging, but I think it could also be the case that you used sudo together with git clone. That would also explain there was no write permission. What does the script output after:

cd buildR64arch
git pull
./build.sh -a

Then check output

BASH_SOURCE:
Current dir:

This info will help me check where possibly it goes wrong.

How do you plan to use the BPI-R64? As an access point or as the main router? Do you plan to use Fast BSS Transition 802.11r (often abbreviated to Fast Transition or FT ) AKA wifi roaming? Does your router support it?

BASH_SOURCE: ./build.sh
Current dir: /home/aaron/buildR64arch
Target device=sdmmc
Not running on Bananapi BPI-R64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-3build1).
bison is already the newest version (2:3.8.2+dfsg-1build1).
build-essential is already the newest version (12.9ubuntu3).
flex is already the newest version (2.6.4-8build2).
libncurses-dev is already the newest version (6.3-2).
parted is already the newest version (3.4-2build1).
udisks2 is already the newest version (2.9.4-1ubuntu2).
wget is already the newest version (1.21.2-2ubuntu1).
f2fs-tools is already the newest version (1.14.0-2build1).
ca-certificates is already the newest version (20211016ubuntu0.22.04.1).
gzip is already the newest version (1.10-4ubuntu4.1).
libssl-dev is already the newest version (3.0.2-0ubuntu1.7).
u-boot-tools is already the newest version (2022.01+dfsg-2ubuntu2.3).
The following packages were automatically installed and are no longer required:
  linux-headers-5.15.0-52 linux-headers-5.15.0-52-generic
  linux-image-5.15.0-52-generic linux-modules-5.15.0-52-generic
  linux-modules-extra-5.15.0-52-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 87 not upgraded.
2023-01-25 20:19:28 URL:https://objects.githubusercontent.com/github-production-release-asset-2e65be/47342812/c87faf25-ae4d-4e05-ae66-6852d89dce4d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230125%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230125T094927Z&X-Amz-Expires=300&X-Amz-Signature=7ed67943201ec8c43e3e4583ec876c79a0668701589e67cb316a35dd7d9f018d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=47342812&response-content-disposition=attachment%3B%20filename%3Dx86_64_qemu-aarch64-static.tar.gz&response-content-type=application%2Foctet-stream [2476289/2476289] -> "./x86_64_qemu-aarch64-static.tar.gz" [1]
:qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-aarch64-static:CF

All the text from the terminal on the host computer at the moment.

I am trying to the pi up as a repeater because my desktop machine does not have a wifi card as well as I can plug other Ethernet stuff into the pi too.

Edit:

If you are referring to the contents of the file itself

#!/bin/bash

# xz -e -k -9 -C crc32 $$< --stdout > $$@

ALARM_MIRROR="http://de.mirror.archlinuxarm.org"

QEMU="https://github.com/multiarch/qemu-user-static/releases/download/v5.2.0-11/x86_64_qemu-aarch64-static.tar.gz"

ARCHBOOTSTRAP="https://raw.githubusercontent.com/tokland/arch-bootstrap/master/arch-bootstrap.sh"

REPOKEY="DD73724DCA27796790D33E98798137154FE1474C"
REPOURL='ftp://ftp.woudstra.mywire.org/repo/$arch'
BACKUPREPOURL="https://github.com/ericwoud/buildR64arch/releases/download/packages"

KERNELDTB="mt7622-bananapi-bpi-r64"

ATFDEVICE="sdmmc"
#ATFDEVICE="emmc"

KERNELBOOTARGS="console=ttyS0,115200 rw rootwait audit=0"

# https://github.com/bradfa/flashbench.git, running multiple times:
# sudo ./flashbench -a --count=64 --blocksize=1024 /dev/sda
# Shows me that times increase at alignment of 8k
# On f2fs it is used for wanted-sector-size, but sector size is stuck at 512
SD_BLOCK_SIZE_KB=8                   # in kilo bytes
# When the SD card was brand new, formatted by the manufacturer, parted shows partition start at 4MiB
# 1      4,00MiB  29872MiB  29868MiB  primary  fat32        lba
# Also, once runnig on BPIR64 execute:
# bc -l <<<"$(cat /sys/block/mmcblk1/device/preferred_erase_size) /1024 /1024"
# bc -l <<<"$(cat /sys/block/mmcblk1/queue/discard_granularity) /1024 /1024"
SD_ERASE_SIZE_MB=4                   # in Mega bytes

ATF_END_KB=1024                   # End of atf partition
MINIMAL_SIZE_FIP_MB=62             # Minimal size of fip partition

ROOTFS_LABEL="BPI-ROOT"

NEEDED_PACKAGES="base hostapd openssh wireless-regdb iproute2 nftables f2fs-tools dtc mkinitcpio patch sudo"
EXTRA_PACKAGES="vim nano screen"
PREBUILT_PACKAGES="bpir64-atf-git linux-bpir64-git linux-bpir64-git-headers bpir64-mkimage yay mmc-utils-git"
SCRIPT_PACKAGES="wget ca-certificates udisks2 parted gzip bc f2fs-tools"
SCRIPT_PACKAGES_ARCHLX="base-devel      uboot-tools  ncurses        openssl"
SCRIPT_PACKAGES_DEBIAN="build-essential u-boot-tools libncurses-dev libssl-dev flex bison "

SETUP="RT"   # Setup as RouTer
#SETUP="AP"  # Setup as Access Point

TIMEZONE="Europe/Paris"              # Timezone
USERNAME="user"
USERPWD="admin"
ROOTPWD="admin"                      # Root password

[ -f "./override.sh" ] && source ./override.sh

export LC_ALL=C
export LANG=C
export LANGUAGE=C

function finish {
  if [ -v rootfsdir ] && [ ! -z $rootfsdir ]; then
    $sudo sync
    echo Running exit function to clean up...
    $sudo sync
    echo $(mountpoint $rootfsdir)
    while [[ $(mountpoint $rootfsdir) =~  (is a mountpoint) ]]; do
      echo "Unmounting...DO NOT REMOVE!"
      $sudo umount -R $rootfsdir
      sleep 0.1
    done
    $sudo rm -rf $rootfsdir
    $sudo sync
    echo -e "Done. You can remove the card now.\n"
  fi
  unset rootfsdir
  [ -v sudoPID ] && kill -TERM $sudoPID
}

function waitdevlink {
  while [ ! -L "$1" ]; do
    echo "WAIT!"
    sleep 0.1
  done
}

function formatsd {
  echo ROOTDEV: $rootdev
  realrootdev=$(lsblk -prno pkname $rootdev)
  [ -z $realrootdev ] && exit
  [ "$l" = true ] && skip="" || skip='\|^loop'
  readarray -t options < <(lsblk --nodeps -no name,serial,size \
                    | grep -v "^"${realrootdev/"/dev/"/}$skip \
                    | grep -v 'boot0 \|boot1 \|boot2 ')
  PS3="Choose device to format: "
  select dev in "${options[@]}" "Quit" ; do
    if (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
      break
    else exit
    fi
  done
  device="/dev/"${dev%% *}
  for PART in `df -k | awk '{ print $1 }' | grep "${device}"` ; do $sudo umount $PART; done
  $sudo parted -s "${device}" unit MiB print
  echo -e "\nAre you sure you want to format "$device"???"
  read -p "Type <format> to format: " prompt
  [[ $prompt != "format" ]] && exit
  minimalrootstart=$(( $ATF_END_KB + ($MINIMAL_SIZE_FIP_MB * 1024) ))
  rootstart=0
  while [[ $rootstart -lt $minimalrootstart ]]; do
    rootstart=$(( $rootstart + ($SD_ERASE_SIZE_MB * 1024) ))
  done
  $sudo dd of="${device}" if=/dev/zero bs=1024 count=$rootstart status=progress
  $sudo sync
  $sudo partprobe "${device}"
  $sudo parted -s -- "${device}" unit kiB \
    mklabel gpt \
    mkpart primary $rootstart 100% \
    mkpart primary $ATF_END_KB $rootstart \
    mkpart primary 0% $ATF_END_KB \
    name 1 bpir64-${ATFDEVICE}-root \
    name 2 bpir64-${ATFDEVICE}-fip \
    name 3 bpir64-${ATFDEVICE}-atf \
    print
  $sudo partprobe "${device}"
  waitdevlink "/dev/disk/by-partlabel/bpir64-${ATFDEVICE}-root"
  $sudo blkdiscard -fv "/dev/disk/by-partlabel/bpir64-${ATFDEVICE}-root"
  waitdevlink "/dev/disk/by-partlabel/bpir64-${ATFDEVICE}-root"
  nrseg=$(( $SD_ERASE_SIZE_MB / 2 )); [[ $nrseg -lt 1 ]] && nrseg=1
  $sudo mkfs.f2fs -w $(( $SD_BLOCK_SIZE_KB * 1024 )) -s $nrseg \
                  -f -l $ROOTFS_LABEL "/dev/disk/by-partlabel/bpir64-${ATFDEVICE}-root"
  $sudo sync
  if [ -b ${device}"boot0" ] && [ $bpir64 == "true" ]; then
    $sudo mmc bootpart enable 7 1 ${device}
  fi
  $sudo lsblk -o name,mountpoint,label,partlabel,size,uuid "${device}"
}

function bootstrap {
  if [ ! -d "$rootfsdir/etc" ]; then
    rm -f /tmp/downloads/$(basename $ARCHBOOTSTRAP)
    wget --no-verbose $ARCHBOOTSTRAP --no-clobber -P /tmp/downloads/
    $sudo bash /tmp/downloads/$(basename $ARCHBOOTSTRAP) -q -a aarch64 \
          -r $ALARM_MIRROR $rootfsdir #####  2>&0
    ls -al $rootfsdir
  fi
}

function rootfs {
  $sudo mkdir -p $rootfsdir/boot/bootcfg/
  $sudo cp -rf --dereference -v ./rootfs/boot $rootfsdir
  echo /boot/Image |                                  $sudo tee $rootfsdir/boot/bootcfg/linux
  echo /boot/initramfs-linux-bpir64-git.img |         $sudo tee $rootfsdir/boot/bootcfg/initrd
  echo ${KERNELDTB} |                                 $sudo tee $rootfsdir/boot/bootcfg/dtb
  echo $KERNELBOOTARGS |                              $sudo tee $rootfsdir/boot/bootcfg/cmdline
  echo ${ATFDEVICE} |                                 $sudo tee $rootfsdir/boot/bootcfg/device
  echo "--- Following packages are installed:"
  $schroot pacman -Qe
  echo "--- End of package list"
  $schroot pacman-key --init
  $schroot pacman-key --populate archlinuxarm
  $schroot pacman-key --recv-keys $REPOKEY
  $schroot pacman-key --finger     $REPOKEY
  $schroot pacman-key --lsign-key $REPOKEY
  if [ -z "$(cat $rootfsdir/etc/pacman.conf | grep -oP '^\[ericwoud\]')" ]; then
    echo -e "\n[ericwoud]\nServer = $REPOURL\nServer = $BACKUPREPOURL" | \
               $sudo tee -a $rootfsdir/etc/pacman.conf
  fi
  $schroot pacman -Syu --needed --noconfirm $NEEDED_PACKAGES $EXTRA_PACKAGES $PREBUILT_PACKAGES
  $schroot useradd --create-home --user-group \
               --groups audio,games,log,lp,optical,power,scanner,storage,video,wheel \
               -s /bin/bash $USERNAME
  echo $USERNAME:$USERPWD | $schroot chpasswd
  echo      root:$ROOTPWD | $schroot chpasswd
  echo "%wheel ALL=(ALL) ALL" | $sudo tee $rootfsdir/etc/sudoers.d/wheel
  $schroot ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
  $sudo sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/' $rootfsdir/etc/ssh/sshd_config
  $sudo sed -i 's/.*UsePAM.*/UsePAM no/' $rootfsdir/etc/ssh/sshd_config
  $sudo sed -i 's/.*#IgnorePkg.*/IgnorePkg = bpir64-atf-git/' $rootfsdir/etc/pacman.conf
  $sudo cp -rfv --dereference rootfs/. $rootfsdir
  $sudo rm -rf $rootfsdir/etc/systemd/network
  $sudo mv -vf $rootfsdir/etc/systemd/network-$SETUP $rootfsdir/etc/systemd/network
  $sudo rm -rf $rootfsdir/etc/systemd/network-*
  $schroot systemctl reenable systemd-timesyncd.service
  $schroot systemctl reenable sshd.service
  $schroot systemctl reenable systemd-resolved.service
  $schroot systemctl reenable hostapd.service
  if [ $SETUP == "RT" ]; then $schroot systemctl reenable nftables.service
  else                        $schroot systemctl disable nftables.service
  fi
  $schroot systemctl reenable systemd-networkd.service
  find -L "rootfs/etc/systemd/system" -name "*.service"| while read service ; do
    $schroot systemctl reenable $(basename $service)
  done
  if [ ! -f "$rootfsdir/etc/mac.eth0.txt" ] || [ ! -f "$rootfsdir/etc/mac.eth1.txt" ]; then
    nr=16 # Make sure there are 16 available mac addresses: nr=16/32/64
    first=AA:BB:CC
    mac5=$first:$(printf %02X $(($RANDOM%256))):$(  printf %02X $(($RANDOM%256)))
    mac=$mac5:$(printf %02X $(($(($RANDOM%256))&-$nr)))
    echo $mac $nr | $sudo tee $rootfsdir/etc/mac.eth0.txt
    mac=$mac5
    while [ "$mac" == "$mac5" ]; do # make sure second mac is different
      mac=$first:$(printf %02X $(($RANDOM%256))):$(printf %02X $(($RANDOM%256)))
    done
    mac=$mac:$(printf %02X $(($RANDOM%256)) )
    echo $mac | $sudo tee $rootfsdir/etc/mac.eth1.txt
  else echo "Macs on eth0 and eth1 already configured."
  fi
}

function chrootfs {
  echo "Entering chroot on image. Enter commands as if running on the target:"
  echo "Type <exit> to exit from the chroot environment."
  $schroot
}

function installscript {
  if [ ! -f "/etc/arch-release" ]; then ### Ubuntu / Debian
    $sudo apt-get install --yes         $SCRIPT_PACKAGES $SCRIPT_PACKAGES_DEBIAN
  else
    $sudo pacman -Syu --needed --noconfirm $SCRIPT_PACKAGES $SCRIPT_PACKAGES_ARCHLX
  fi
  # On all linux's
  if [ $bpir64 != "true" ]; then # Not running on BPI-R64
    wget --no-verbose $QEMU          --no-clobber -P ./
    $sudo tar -xf $(basename $QEMU) -C /usr/local/bin
    S1=':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7'
    S2=':\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-aarch64-static:CF'
    echo -n $S1$S2| $sudo tee /lib/binfmt.d/05-local-qemu-aarch64-static.conf
    echo
    $sudo systemctl restart systemd-binfmt.service
  fi
  if [ -z "$(cat /etc/resolv.conf | grep -oP '^nameserver')" ]; then
    echo "nameserver 8.8.8.8" | $sudo tee -a /etc/resolv.conf
  fi
  exit
}
function removescript {
  # On all linux's
  if [ $bpir64 != "true" ]; then # Not running on BPI-R64
    $sudo rm -f /usr/local/bin/qemu-aarch64-static
    $sudo rm -f /lib/binfmt.d/05-local-qemu-aarch64-static.conf
    $sudo systemctl restart systemd-binfmt.service
  fi
  exit
}

[ $USER = "root" ] && sudo="" || sudo="sudo"
[[ $# == 0 ]] && args="-c"|| args=$@
echo "BASH_SOURCE: ${BASH_SOURCE[0]}"
cd "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")"
while getopts ":ralcRASD" opt $args; do declare "${opt}=true" ; done
trap finish EXIT
shopt -s extglob

if [ -n "$sudo" ]; then
  sudo -v
  ( while true; do sudo -v; sleep 40; done ) &
  sudoPID=$!
fi

echo "Current dir:" $(realpath .)
echo "Target device="$ATFDEVICE
if [ "$(tr -d '\0' 2>/dev/null </proc/device-tree/model)" != "Bananapi BPI-R64" ]; then
  echo "Not running on Bananapi BPI-R64"
  bpir64="false"
else
  echo "Running on Bananapi BPI-R64"
  bpir64="true"
fi

[ "$a" = true ] && installscript
[ "$A" = true ] && removescript

rootdev=$(lsblk -pilno name,type,mountpoint | grep -G 'part /$')
rootdev=${rootdev%% *}
if [ "$S" = true ] && [ "$D" = true ]; then formatsd; exit; fi
if [ -L "/dev/disk/by-partlabel/bpir64-${ATFDEVICE}-root" ]; then
  mountdev=$(realpath "/dev/disk/by-partlabel/bpir64-${ATFDEVICE}-root")
else
  echo "Not inserted! (Maybe not matching the target device on the card)"
  exit
fi
if [ "$rootdev" == "$mountdev" ];then
  rootfsdir="" ; r="" ; R=""     # Protect root when running from it!
  schroot=""
else
  rootfsdir=/mnt/bpirootfs
  schroot="$sudo unshare --mount --fork --kill-child --pid --root=$rootfsdir"
fi

echo OPTIONS: rootfs=$r apt=$a
if [ "$R" = true ] ; then
  echo Removing rootfs...
  $sudo rm -rf $rootfsdir/*
  exit
fi
echo "SETUP="$SETUP
echo "Rootfsdir="$rootfsdir
echo "Mountdev="$mountdev

if [ ! -z $rootfsdir ]; then
  $sudo umount $mountdev
  [ -d $rootfsdir ] || $sudo mkdir $rootfsdir
  $sudo mount --source $mountdev --target $rootfsdir \
              -o exec,dev,noatime,nodiratime
  [[ $? != 0 ]] && exit
  [ "$r" = true ] && bootstrap
  $sudo mount -t proc               /proc $rootfsdir/proc
  [[ $? != 0 ]] && exit
  $sudo mount --rbind --make-rslave /sys  $rootfsdir/sys
  [[ $? != 0 ]] && exit
  $sudo mount --rbind --make-rslave /dev  $rootfsdir/dev
  [[ $? != 0 ]] && exit
  $sudo mount --rbind --make-rslave /run  $rootfsdir/run
  [[ $? != 0 ]] && exit
  [ "$r" = true ] && rootfs
  [ "$c" = true ] && chrootfs
fi

exit

# kernelcmdline: block2mtd.block2mtd=/dev/mmcblk0p2,128KiB,MyMtd cmdlinepart.mtdparts=MyMtd:1M(mtddata)ro

# sudo dd if=/dev/zero of=~/bpir64-sdmmc.img bs=1M count=3360 status=progress
# sync
# sudo udisksctl loop-setup -f ~/bpir64-sdmmc.img
# ./build.sh -lSD
# ./build.sh -r
# ./build.sh
# rm -vrf /tmp/*
# pacman -Scc
# exit
# sudo udisksctl loop-delete --block-device /dev/loop0
# xz --keep --force --verbose ~/bpir64-sdmmc.img

What do you need to know about the cuurent directory?

Seems that part of the script was successful. Continue following the readme I would sayā€¦ You can skip the part of tweaking SD card settings for nowā€¦ The basic settings will do fine for most SD cards.

Easiest to setup is a wired Access Point, connecting your router and Access Point LAN-LAN, with the corresponding network setupā€¦

How would I achieve that setup?

Change this part to:

#SETUP="RT"   # Setup as RouTer
SETUP="AP"  # Setup as Access Point

Edit rootfs/etc/systemd/network-AP/10-brlan.network

So that Gateway is the local (lan) IP number of your router, On the Address line the first 3 numbers need to match your routerā€™s first three numbers. Choose any unused last number and keep the /24. It will become the IP number of the BPI-R64.

Then build the image and connect Router LAN port to Bpir64 LAN port (actually all bpir64 ports are now a lan port). Then keep fingers crossedā€¦

If this is all successful then you could try to setup wifi roaming FT, for a practically seamless wifi roaming transition. This would involve matching your routerā€™s settings with your bpir64, so you need to figure this out yourself, unless your router is also a bpir64. This is what I have here at home, so then I could help with that as well.

For the Network file you mean like in the attached picture?Screenshot%20from%202023-01-25%2023-36-05

[NetDev]
Name=brlan
Kind=bridge
Gateway=10.1.1.1
Address=10.1.1.4
[Bridge]
DefaultPVID=0
VLANFiltering=1

"/etc/systemd/network/10-brlan.netdev"

Which file was this in?

#SETUP="RT"   # Setup as RouTer
SETUP="AP"  # Setup as Access Point

No the picture is wrong. Please follow instructions to the letter, as the SETUP="AP" setting will change many things on the image that need to be adjusted correctly. (disabling nftables, copying the multiple correct network files).

SETUP=ā€œAPā€ you will find in the build.sh script itself. In the same directory you will find the rootfs folder, where you will find the other file you need to edit.

Using the script to build the image, you donā€™t need to resize the root partition anymoreā€¦

Note: it is the .network file, not the .netdev file you need to edit.

Be careful with vlan_filteringā€¦my tests on 6.2 show that it is not working and breaks vlan on ports at same gmac not part of bridge

@frank-w Thanks for the info, I am following linux rolling-stable, so I still am on 6.1

I thought the bug was only concerning mixing vlan unaware ports with vlan aware ports on the same dsa switch (and then sending vlan tagged traffic over the vlan unaware port)? I have all ports on the bridge and all ports vlan aware.

I have software vlan on wan-port and vlan_aware flag on lan-bridgeā€¦and also the vlans on the bridge are not working in my test-setup (without patching out vlan-aware mode on gmac)ā€¦have added interface to the bridge to extract vlan from the bridge. Iā€™m not sure my setup is right.

https://lkml.org/lkml/2023/1/21/120

I had the same issue on 5.18.80,but not retested if vlan_filtering is broken there too

@Nightwalker83 imho ip-setting needs to be done in separate network file and network section and not in netdev which only creates the bridge,edit i see eric has pointed it already

I think adding vlan device to the bridges self port (brlan interface in my setup) and setting the bridge as vlan aware, it can become quite confusing and unnecessarily complicated.

On the lan side I would only setup vlan tagging using the bridge ingress/egress.

I remember, year ago you were using vlan traffic on the wan side and added vlan devices on wan. How do you need to have your setup now?

Edit: If you want to add vlan devices on the bridges self port, you need to setup this bridge port the same as a trunk port. But please bear in mind that hostapd also uses the bridgeā€™s self port, if the wlan interface is added to the bridge. You may run in to trouble authenticating. I have had trouble with this, years before, when I wanted the bridgeā€™s self port to traffic multiple vlan idā€™s.

Edit 2: I remember it was a Port Access Entity packet send on the bridgeā€™s self port which gave me that trouble.

My ISP requires 2 vlan with 1 pppoe session each (one for internet traffic,one for voice). These are still software vlans and also on lan-side i have a vlan_unaware bridge and put the software vlans on top of it.

And wan should not be bridged to lan for security reasons netherless on using vlans to archive wan/lan separation. Basicly my internet traffic comes through vlan tagged pppoe packets and these do no reach untagged part of lan, but this is very bad design when bridging lan with wan. Thought about separate vlan_aware bridge for wan but this makes setup more complicated. Maybe a good way when using multiple wan-ports like on r3.

But we are going off-topicā€¦only wanted to mention the known bug :grin:

You could add veth devices to the bridge as ports with ingress/egress, instead of attaching vlan devices to the bridgeā€™s self port.

You can accomplish the same, and leave the bridgeā€™s self port as a normal port (1 vlan id).

Yeah, I realised that after I looked at the listed of files. I looked in the network file and realised I was wrong.

Edit:

In the build.sh but I posted receiving error when I ran it last time. Wouldnā€™t the error still occur?

In build.sh

at this function

function finish { < -- Line 60
  if [ -v rootfsdir ] && [ ! -z $rootfsdir ]; then
    $sudo sync
    echo Running exit function to clean up...
    $sudo sync
    echo $(mountpoint $rootfsdir)
    while [[ $(mountpoint $rootfsdir) =~  (is a mountpoint) ]]; do < -- Line 66
      echo "Unmounting...DO NOT REMOVE!"
      $sudo umount -R $rootfsdir
      sleep 0.1
    done
    $sudo rm -rf $rootfsdir
    $sudo sync
    echo -e "Done. You can remove the card now.\n"
  fi
  unset rootfsdir
  [ -v sudoPID ] && kill -TERM $sudoPID
}

build.sh: 60: function: not found build.sh: 66: Syntax error: ā€œ(ā€ unexpected (expecting ā€œdoā€)

Edit:

Is this correct for the wifi

[WiFi] Address 10.1.1.4 Gateway 10.1.1.1

I canā€™t think of anything else I need to add?