Thank you for the fast reply and for all your works! I have no knowledge of kernel compilation, is there an easy way to do that?
Clone my kernel repo
For r3 change branch to 6.1-main (5.15-main is default and has no support for r3)
Change build.conf by enabling (removing # at beginning of line)
board=bpi-r3
Then import defconfig by running
./build.sh importconfig
Then you can change options with
./build.sh config
And then compile with
./build.sh
At the end of compilation process you can choose pack (creates tar file with all binary parts kernel+modules) or install (to install kernel to sdcard,but you habe to change uEnv.txt to point uboot to new fit)
Greetings,
I have installed the image on a 128 Gb sd, and I wanted to configure it to my liking, starting by installing
local, ntp, vim manpages-en-dev manpages-en apt update && apt update && apt full-upgrade -y && apt update && apt upgrade -y
when I want to do apt update && apt update && apt full-upgrade -y && apt update && apt upgrade -y to upload the version it tells me that it has no room
what can be happening?
Why full-upgrade? And please full erroressage.
If you want bookworm you can use my image creator.
what I want to do is open services, the image starts, starts and seems useful to start a router, for my wishes it starts fine and I try to implement the service more
if i try to add services this is what happens
the SD is 128Gb
Can you make “df -h” and maybe “apt-get clean” before?
Partition should ve large enough…afair i have created a 6g rootfs partition in this image too
then it could be lack of space. Does not resize with the space given to it
could it be this?
more people might have the same space problem.
You can resize partition with gparted on your sdcard…i used a value of 6gb (newer 7gb) because of emmc.
Wonder why 5g already full on your system…you can look for large files with du -h --max-depth=2 /
I have not had time after formatting the sd to do more than this The ntp service when installing the system only sets the time and lets it work, I’m Spanish and the comments in this script are made for my system, but I couldn’t even change the system number
it won’t let me add the frr key either
#!/bin/bahs
# instalacion y configuracion de debian bullseye en banana pi r3
apt install ntp -y
apt update
apt install sudo
# poniendo zona horaria en ntp & reconfigurando la zona y el idioma automáticamente
sudo timedatectl set-timezone Europe/Madrid
# sudo timedatectl set-ntp true
# ver sincronizacion
# ntpq -p
# instalacion editor
apt install vim -y
# instalacion de paginas de ayuda
sudo apt-get install manpages -y
sudo apt-get install manpages-es-dev manpages-es -y
apt install locales -y
# poner el idioma
sudo dpkg-reconfigure locales
Wonder where your space has gone…your / is 775mb…mostly from usr (449) and var (313)…looks like i expected,so where are the remaining 4gb? Or are they cleaned now by the apt-get clean?
Any questions you have I have too.
I already tell him what I have done, and he does not let me do more, I do not understand how it does not use all the sd, I am not saying that it uses hdd anymore
Try using gdisk or parted on your sd…maybe there is something left in the backup gpt. And run fsck,maybe badblocks on the sd (not from running os on r3).
You could also start with bookworm by creating an image with my router images repo
https://github.com/frank-w/BPI-Router-Images
Here you can see all steps i do to create the image.but warning this is very alpha state and at least it does not check yet if all packages are installed on the host. On my system it works,but i had not much time to check every step finished successfully.
apt-get clean doesn’t clean, doesn’t work, and can’t install anything either, doesn’t have space, and doesn’t have them installed, can’t use any tools
if i wanted to use gunzip to follow their manual i couldn’t either
Normally apt-get clean removes cached packages from /var/lib/apt. It is a fast way to possible make free space. You can look into that dir if there are any packages. Or cleanup some other dirs e.g. /var/log (but here not delete files,but only truncate them e.g. with echo -n “”>/var/log/logfile and only with textlogs…not wtmp)
Have not seen this before,i guess something with card/filesystem is wrong…but to do anything you have to make space of course…than ran fsck/badblocks and compare rootfs in “df -h” with “du -hs”…it should show same used space…all other is really strange.
This is what it shows for the moment, where is the swap?
Erase and write again is to return to the initial state
root@bpi-r3:~/Documentos/Bpi# df -h
S.ficheros Tamaño Usados Disp Uso% Montado en
/dev/root 5,9G 5,7G 0 100% /
devtmpfs 993M 0 993M 0% /dev
tmpfs 995M 0 995M 0% /dev/shm
tmpfs 398M 1,6M 397M 1% /run
tmpfs 5,0M 0 5,0M 0% /run/lock
/dev/mmcblk0p5 100M 7,8M 92M 8% /boot
tmpfs 199M 0 199M 0% /run/user/0
df -h
S.ficheros Tamaño Usados Disp Uso% Montado en
/dev/root 5,9G 5,7G 0 100% /
devtmpfs 993M 0 993M 0% /dev
tmpfs 995M 0 995M 0% /dev/shm
tmpfs 398M 1,6M 397M 1% /run
tmpfs 5,0M 0 5,0M 0% /run/lock
/dev/mmcblk0p5 100M 7,8M 92M 8% /boot
tmpfs 199M 0 199M 0% /run/user/0
root@bpi-r3:~/Documentos/Bpi# fdisk -l
Disk /dev/mtdblock0: 20 MiB, 20971520 bytes, 40960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock1: 10,5 MiB, 11010048 bytes, 21504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock2: 512 KiB, 524288 bytes, 1024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock3: 512 KiB, 524288 bytes, 1024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock4: 256 KiB, 262144 bytes, 512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock5: 128 KiB, 131072 bytes, 256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock6: 128 KiB, 131072 bytes, 256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mmcblk0: 119,08 GiB, 127865454592 bytes, 249737216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2BD17853-102B-4500-AA1A-8A21D4D7984D
Device Start End Sectors Size Type
/dev/mmcblk0p1 34 8191 8158 4M Linux filesystem
/dev/mmcblk0p2 8192 9215 1024 512K Linux filesystem
/dev/mmcblk0p3 9216 13311 4096 2M Linux filesystem
/dev/mmcblk0p4 13312 17407 4096 2M Linux filesystem
/dev/mmcblk0p5 17408 222207 204800 100M Linux filesystem
/dev/mmcblk0p6 222208 12805120 12582913 6G Linux filesystem
root@bpi-r3:~/Documentos/Bpi# fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/mmcblk0: 119,08 GiB, 127865454592 bytes, 249737216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2BD17853-102B-4500-AA1A-8A21D4D7984D
Device Start End Sectors Size Type
/dev/mmcblk0p1 34 8191 8158 4M Linux filesystem
/dev/mmcblk0p2 8192 9215 1024 512K Linux filesystem
/dev/mmcblk0p3 9216 13311 4096 2M Linux filesystem
/dev/mmcblk0p4 13312 17407 4096 2M Linux filesystem
/dev/mmcblk0p5 17408 222207 204800 100M Linux filesystem
/dev/mmcblk0p6 222208 12805120 12582913 6G Linux filesystem
Command (m for help):
swap ?
root@bpi-r3:~/Documentos/Bpi# file -s /dev/mmcblk0p1
/dev/mmcblk0p1: data
root@bpi-r3:~/Documentos/Bpi# file -s /dev/mmcblk0p2
/dev/mmcblk0p2: data
root@bpi-r3:~/Documentos/Bpi# file -s /dev/mmcblk0p3
/dev/mmcblk0p3: data
root@bpi-r3:~/Documentos/Bpi# file -s /dev/mmcblk0p4
/dev/mmcblk0p4: data
root@bpi-r3:~/Documentos/Bpi# file -s /dev/mmcblk0p5
/dev/mmcblk0p5: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, reserved sectors 4, root entries 512, Media descriptor 0xf8, sectors/FAT 200, sectors/track 63, heads 255, hidden sectors 17408, sectors 204750 (volumes > 32 MB), reserved 0x1, serial number 0x832cc230, label: "BPI-BOOT ", FAT (16 bit)
root@bpi-r3:~/Documentos/Bpi# file -s /dev/mmcblk0p6
/dev/mmcblk0p6: Linux rev 1.0 ext4 filesystem data, UUID=be301eb8-7cb9-4f3d-abd1-e1ce32973fa6, volume name "BPI-ROOT" (needs journal recovery) (errors) (extents) (large files) (huge files)
I have not defined any swap as this is a very basic image,only necessary changes (fstab,hostname,network config,wifi firmware) and some few preinstalled packages like hostapd
I see df twice (after reformatting with <> button) but not the du summary. If the output differs there is something wrong with the fs…and we are at the fsck step
If I want to make a clean image, only with this system?
I see that you also need to be able to implement security
root@bpi-r3:/var/log# modprobe xt_connlimit
modprobe ip_nat_amanda
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ip_conntrack_irc
modprobe ip_nat_irc
modprobe ip_conntrack_amanda
modprobe iptable_filter
modprobe iptable_nat
modprobe iptable_mangle
modprobe iptable_raw
modprobe iptable_security
modprobe nf_nat_ipv4
modprobe nf_nat_ipv6
modprobe nf_conntrack_ipv4
modprobe nf_conntrack_ipv6
modprobe nf_conntrack
modprobe nf_defrag_ipv4
modprobe nf_defrag_ipv6
modprobe ipt_LOG
modprobe ipt_REJECT
modprobe ip_tables
modprobe nfnetlink
modprobe nf_conntrack_netlink
modprobe nf_conntrack_broadcast
modprobe xt_conntrack
modprobe ipt_MASQUERADE
modprobe iptable_nat
modprobe nf_nat
modprobe nf_log_ipv6
modprobe sch_tbf
modprobe act_police
modprobe xt_OSPF
modprobe: FATAL: Module xt_connlimit not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_nat_amanda not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_conntrack_ftp not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_nat_ftp not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_conntrack_irc not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_nat_irc not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_conntrack_amanda not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module iptable_filter not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module iptable_nat not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module iptable_mangle not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module iptable_raw not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module iptable_security not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_nat_ipv4 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_nat_ipv6 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_conntrack_ipv4 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_conntrack_ipv6 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_conntrack not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_defrag_ipv4 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_defrag_ipv6 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ipt_LOG not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ipt_REJECT not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ip_tables not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nfnetlink not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_conntrack_netlink not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_conntrack_broadcast not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module xt_conntrack not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module ipt_MASQUERADE not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module iptable_nat not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_nat not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module nf_log_ipv6 not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module sch_tbf not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module act_police not found in directory /lib/modules/6.1.0-bpi-r3-main
modprobe: FATAL: Module xt_OSPF not found in directory /lib/modules/6.1.0-bpi-r3-main
Yes,this is kernel topic not image (image only uses my kernel). R3 has very limited kernel config,i need to add firewall modules and some more…but very limited in time atm (i’m no employee of bpi and do this all in spare time).
Thats why i created the image creator script which allows creating image with the latest LTS kernel for the device, so have not to do all manually for each device and distro and update these images after some time. And it is clear how the image was created for security reasons (prove that i have not added some own code).
But creating an image automaticly is also some work and needs a bit more work on user side (not only download,unpack,flash).
Greetings.
Today I had a bit more time trying to create something with https://github.com/frank-w/BPI-Router-Images
I have installed a virtual machine with ubuntu to be able to start working for a possible image in which to include more things.
# Download the necessary files
# Installbootstrap
sudo apt install -y debootstrap
# uboot repository
cd /home/gabriel/Downloads
git clone https://github.com/frank-w/u-boot.git
git clone https://github.com/frank-w/BPI-Router-Images.git
cd BPI-Router-Images/
./buildimg.sh bpi-r3 bookworm
bash: ./buildimg.sh: No such file or directory
root@vmwareubuntu:/home/gabriel/Downloads# cd BPI-Router-Images/
root@vmwareubuntu:/home/gabriel/Downloads/BPI-Router-Images# ./buildimg.sh bpi-r3 bookworm
create image for bpi-r3 (arm64) bookworm 6.1
board: bpi-r3
kernel: 6.1
board:bpi-r3 ubootfile: https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2023-07-bpi-2023.07-2023-07-18_0722/bpi-r3_sdmmc.img .gz
board:bpi-r3 kernelfile: https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-6.1-main-6.1.50-2023-08-31_2023/bpi-r3_6 .1.50-main.tar.gz
ubootfile: https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2023-07-bpi-2023.07-2023-07-18_0722/bpi-r3_sdmmc.img.gz filename: bpi -r3_sdmmc.img.gz
kernelfile: https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-6.1-main-6.1.50-2023-08-31_2023/bpi-r3_6.1.50-main. tar.gz filename: bpi-r3_6.1.50-main.tar.gz
image-file: bpi-r3_sdmmc.img.gz
kernel-file: bpi-r3_6.1.50-main.tar.gz
checking for needed packages...
qemu-arm-static missing
-rw-r--r-- 1 root root 7.2M sep 1 10:13 bpi-r3_sdmmc.img.gz
ls: cannot access 'bookworm_arm64.tar.gz': No such file or directory
rootfs file missing
what am I doing wrong?
we should discuss this in the right thread Debian/Ubuntu image creation
you do not need to clone u-boot-repo, as the script downloads files (uboot,kernel) from github-releases built by github actions CI
yes i have not yet added a check for packages…and some error-checks are missing (to stop script after an error)
for the debootstrap things you will need these:
sudo apt install qemu-user-static debootstrap binfmt-support