BPI-R4:Beginner questions for kernel building

@frank-w What is the procedure for upgrading the kernel?

I built a deb package from your repo, but doing dpkg -i bananapi-r4-image-6.13-main_6.13.0-1_arm64.deb and rebooting, is not using that new kernel.

I also did these commands:

cp /boot/bananapi/bpi-r4/linux/dtb/bpi-r4-6.13.0-main.dtb     /boot/bpi-r4.dtb
cp /boot/bananapi/bpi-r4/linux/uEnv.txt   /boot/uEnv.txt
cp /boot/bananapi/bpi-r4/linux/uImage_6.13.0-main_nodt   /boot/uImage_nodt

Right now, there are these files on /boot:

/boot/
/boot/uEnv.txt
/boot/bpi-r4.dtb
/boot/uImage_nodt
/boot/bpi-r4.itb
/boot/bananapi
/boot/bananapi/bpi-r4
/boot/bananapi/bpi-r4/linux
/boot/bananapi/bpi-r4/linux/uEnv.txt
/boot/bananapi/bpi-r4/linux/dtb
/boot/bananapi/bpi-r4/linux/dtb/bpi-r4-6.13.0-main.dtb
/boot/bananapi/bpi-r4/linux/dtb/bpi-r4-6.12.7-main.dtb
/boot/bananapi/bpi-r4/linux/uImage_6.13.0-main_nodt
/boot/bananapi/bpi-r4/linux/uImage_6.12.7-main_nodt

I see there are references to the old kernel, 6.12.7 on the bpi-r4.itb file, but i don’t see a .itb file for the new kernel 6.13.

EDIT: Not sure if this matters, but i’m using Openwrt’s boot loader, as i used it to install Debian 12 in the EMMC.

SOLUTION: copy the new .itb file from compilation machine. `

scp ./build/bpi-r4.itb BANANA-R4:/boot

The itb is the important part,maybe it is missing in 6.13 somehow…needed to patch deb creation script to include the files,maybe something has changed recently. If the deb contains no itb there is the problem. If the itb has version in name (as i guess) you have to change fit var in uEnv.txt to boot it (of course it need to exist). The dtb/no_dt is not needed here,but created for compatibility reasons with r64 and for manual try to apply dtb

Ok, i just copied the .itb file from compilation machine and now 6.13 kernel boots.

scp ./build/bpi-r4.itb BANANA-R4:/boot

Yes,this is the way i use it too,but with install option to sdcard which installs modules too (which are installed through deb i guess) :slight_smile: but you should make backup of your last itb before overwriting it

For missing itb,i wonder why dtb and uimage_nodt are packed for r4 as this should be done only for r64 based on my patch

Maybe there are better ways.

1 Like

@frank-w I’m not very proficient with github. Is there a way to know when you update the kernel repo for a specific branch?

Basicly github has an api where you can get the last commits and push timestamp.

Idk if there is a out-of-box notification mechanism…i did some tests years ago to get updates for forks of my repos,but cannot tell how exactly i did this without looking in the (really dirty) code.

1 Like

@frank-w i tried your 6.16-mt7988upstream branch and now the sfp ports don’t work. Did i forget to enable some module on compilation?

Sfps need pcs and the usxgmii patches which are not for upstream yet. The mt7988upstream branches are only for the upstream process not for direct usage,so missing functionality :slight_smile: and these branches are often rebased.

It is still discussion how pcs should be upstreamed. Afaik last steps are done by sean anderson.

https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

I guess he will send v6 when rc1 is out. When pcs is clear then the usxgmii patches can follow. I only added sfp in upstream to allow access via i2c.

For testing better use main or the rc branches…as there is no 6.16-rc1 yet i have not created the 6.16-rc yet…only upstream to send dts patches as soon as possible

Ok Frank, thanks for the explanation. So, your 6.12 branch is still on 6.12.30, how to update to 6.12.32? Will this work? [BPI-R2] mt7925 - #10 by SDXC

Tried add a remote, but says already exists:

git remote add origin https://github.com/torvalds/linux.git
error: remote origin already exists.

EDIT2: Ok i did git remote add torvalds https://github.com/torvalds/linux.git , but how to use the 6.12.32 sources?

You have to add stable tree…but you can do this automaticly with “./build.sh updatesrc”

But have to make your working dir clean (e.g. git stash)

Would it be an option to use 1 fixed branch name, that always has the latest patches? Me too I’m always searching which branch.

That’s why I stick with dangowrt’s mt7988-for-next branch for R4, which holds most latest patches and is always rebased. Then I don’t need to search and just build this one, even using a script.

No it’s no option as i need to look when a problem starts or till which it works…and there are lts kernels for productive use.

Ok, i did this:

git clone --depth 1  -b  6.12-main https://github.com/frank-w/BPI-Router-Linux.git
git stash
cd BPI-Router-Linux/
git config --global --add safe.directory $PWD
git stash


./build.sh  updatesrc
# error:
Update kernel source
fatal: 'stable' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


# So i ran it again:
./build.sh  updatesrc
Update kernel source
remote: Enumerating objects: 13545655, done.
# ***  SNIP ***

 * [new tag]                   v6.9.7               -> v6.9.7
 * [new tag]                   v6.9.8               -> v6.9.8
 * [new tag]                   v6.9.9               -> v6.9.9
newkernver:6.12.31 (max:6.12.32)
fatal: refusing to merge unrelated histories


./build.sh importconfig

grep 6.12 ../build/.config
# Linux/arm64 6.12.30 Kernel Configuration

So, no 6.12.32, any other alternative Frank?

So actually running 6.15.0, which came from your branch 6.16-mt7988 branch, the problems with the mt7922 seem to be been fixed, but again, the fiber ports don’t work. So, hopefully 6.12.32 has the fixes for this card.

build.sh should add it on this error (seems it did in your case because error-message changed)…

but the new error (refusing to merge unrelated histories) is strange…are you on 6.12-main (i see you cloned only this branch which should be ok - calculation of newkernver is right so far)?

i had done the last merges with another laptop, so my current sync also contains already merged tags, but basicly works

$ ./build.sh updatesrc
Update kernel source
remote: Enumerating objects: 862356, done.
remote: Counting objects: 100% (109197/109197), done.
remote: Compressing objects: 100% (3222/3222), done.
remote: Total 862356 (delta 106563), reused 106960 (delta 105975), pack-reused 753159
Receiving objects: 100% (862356/862356), 633.08 MiB | 3.02 MiB/s, done.
Resolving deltas: 100% (633397/633397), completed with 41345 local objects.
From https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable
...
 * [new tag]                   v6.12.24             -> v6.12.24
 * [new tag]                   v6.12.25             -> v6.12.25
 * [new tag]                   v6.12.26             -> v6.12.26
 * [new tag]                   v6.12.27             -> v6.12.27
 * [new tag]                   v6.12.28             -> v6.12.28
 * [new tag]                   v6.12.29             -> v6.12.29
 * [new tag]                   v6.12.30             -> v6.12.30
 * [new tag]                   v6.12.32             -> v6.12.32
....
newkernver:6.12.31 (max:6.12.32)
...

and similar for 6.12.32 without errors, maybe issue with shallow clone…maybe you need the --single-branch too, but manpage says that depth implies single-branch?

pushed the updated tree

I don’t i know Frank, but i cloned the tree again and yes, 6.12.32 came. Running it now. Fiber working again, thanks for the update Frank. Nex time, i try without --depth 1.

@frank-w I’m writing a complete tutorial for installing your debian in emmc. However i’m having this error:

compilador@debian /home/compilador $ git clone --depth 1 https://github.com/frank-w/BPI-Router-Images
cd BPI-Router-Images/
Cloning into 'BPI-Router-Images'...
remote: Enumerating objects: 88, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 88 (delta 13), reused 65 (delta 4), pack-reused 0 (from 0)
Receiving objects: 100% (88/88), 21.06 KiB | 7.02 MiB/s, done.
Resolving deltas: 100% (13/13), done.

compilador@debian /home/compilador/BPI-Router-Images $ ./buildimg.sh bpi-r4 bookworm 6.12 emmc
needed: python3 python3-requests parted qemu-user-static debootstrap binfmt-support
create image for bpi-r4 (arm64) bookworm 6.12 emmc
board  : bpi-r4
kernel : 6.12
device : emmc
bpi-r3mini_emmc_bl2.img
bpi-r3mini_spim-nand_bl2.img
bpi-r3mini_spim-nand_ubi_bl2.img
bpi-r3_emmc_bl2.img
bpi-r3_nor_bl2.img
bpi-r3_nor_ubi_bl2.img
bpi-r3_sdmmc_bl2.img
bpi-r3_spim-nand_bl2.img
bpi-r3_spim-nand_ubi_bl2.img
bpi-r4_emmc_8GB_bl2.img
bpi-r4_emmc_bl2.img
bpi-r4_sdmmc_8GB_bl2.img
bpi-r4_sdmmc_bl2.img
bpi-r4_spim-nand_8GB_bl2.img
bpi-r4_spim-nand_bl2.img
bpi-r4_spim-nand_ubi_8GB_bl2.img
bpi-r4_spim-nand_ubi_bl2.img
bpi-r64_emmc_bl2.img
bpi-r64_sdmmc_bl2.img
files: {
  "bpi-r2pro": {
    "sdmmc": {
      "name": "bpi-r2pro_sdmmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r2pro_sdmmc.img.gz"
    }
  },
  "bpi-r2": {
    "sdmmc": {
      "name": "bpi-r2_sdmmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r2_sdmmc.img.gz"
    }
  },
  "bpi-r3mini": {
    "emmc": {
      "name": "bpi-r3mini_emmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_emmc.img.gz",
      "bl2": {
        "name": "bpi-r3mini_emmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_emmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r3mini_emmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_emmc_fip.bin"
      }
    },
    "ram": {
      "bl2": {
        "name": "bpi-r3mini_ram_bl2.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_ram_bl2.bin"
      },
      "fip": {
        "name": "bpi-r3mini_ram_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_ram_fip.bin"
      }
    },
    "spim-nand": {
      "bl2": {
        "name": "bpi-r3mini_spim-nand_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_spim-nand_bl2.img",
        "UBI": {
          "name": "bpi-r3mini_spim-nand_ubi_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_spim-nand_ubi_bl2.img"
        }
      },
      "fip": {
        "name": "bpi-r3mini_spim-nand_ubi_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3mini_spim-nand_ubi_fip.bin"
      }
    }
  },
  "bpi-r3": {
    "emmc": {
      "name": "bpi-r3_emmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_emmc.img.gz",
      "bl2": {
        "name": "bpi-r3_emmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_emmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r3_emmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_emmc_fip.bin"
      }
    },
    "nor": {
      "bl2": {
        "name": "bpi-r3_nor_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_nor_bl2.img",
        "UBI": {
          "name": "bpi-r3_nor_ubi_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_nor_ubi_bl2.img"
        }
      },
      "fip": {
        "name": "bpi-r3_nor_ubi_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_nor_ubi_fip.bin"
      }
    },
    "ram": {
      "bl2": {
        "name": "bpi-r3_ram_bl2.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_ram_bl2.bin"
      },
      "fip": {
        "name": "bpi-r3_ram_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_ram_fip.bin"
      }
    },
    "sdmmc": {
      "name": "bpi-r3_sdmmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_sdmmc.img.gz",
      "bl2": {
        "name": "bpi-r3_sdmmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_sdmmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r3_sdmmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_sdmmc_fip.bin"
      }
    },
    "spim-nand": {
      "bl2": {
        "name": "bpi-r3_spim-nand_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_spim-nand_bl2.img",
        "UBI": {
          "name": "bpi-r3_spim-nand_ubi_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_spim-nand_ubi_bl2.img"
        }
      },
      "fip": {
        "name": "bpi-r3_spim-nand_ubi_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r3_spim-nand_ubi_fip.bin"
      }
    }
  },
  "bpi-r4": {
    "emmc": {
      "name": "bpi-r4_emmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc.img.gz",
      "bl2": {
        "8G": {
          "name": "bpi-r4_emmc_8GB_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_8GB_bl2.img"
        },
        "name": "bpi-r4_emmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r4_emmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_fip.bin"
      }
    },
    "ram": {
      "bl2": {
        "name": "bpi-r4_ram_bl2.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_ram_bl2.bin"
      },
      "fip": {
        "name": "bpi-r4_ram_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_ram_fip.bin"
      }
    },
    "sdmmc": {
      "name": "bpi-r4_sdmmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_sdmmc.img.gz",
      "bl2": {
        "8G": {
          "name": "bpi-r4_sdmmc_8GB_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_sdmmc_8GB_bl2.img"
        },
        "name": "bpi-r4_sdmmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_sdmmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r4_sdmmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_sdmmc_fip.bin"
      }
    },
    "spim-nand": {
      "bl2": {
        "8G": {
          "name": "bpi-r4_spim-nand_8GB_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_spim-nand_8GB_bl2.img",
          "UBI": {
            "name": "bpi-r4_spim-nand_ubi_8GB_bl2.img",
            "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_spim-nand_ubi_8GB_bl2.img"
          }
        },
        "name": "bpi-r4_spim-nand_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_spim-nand_bl2.img",
        "UBI": {
          "name": "bpi-r4_spim-nand_ubi_bl2.img",
          "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_spim-nand_ubi_bl2.img"
        }
      },
      "fip": {
        "name": "bpi-r4_spim-nand_ubi_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_spim-nand_ubi_fip.bin"
      }
    }
  },
  "bpi-r64": {
    "emmc": {
      "name": "bpi-r64_emmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r64_emmc.img.gz",
      "bl2": {
        "name": "bpi-r64_emmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r64_emmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r64_emmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r64_emmc_fip.bin"
      }
    },
    "sdmmc": {
      "name": "bpi-r64_sdmmc.img.gz",
      "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r64_sdmmc.img.gz",
      "bl2": {
        "name": "bpi-r64_sdmmc_bl2.img",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r64_sdmmc_bl2.img"
      },
      "fip": {
        "name": "bpi-r64_sdmmc_fip.bin",
        "url": "https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r64_sdmmc_fip.bin"
      }
    }
  }
}
initfiles: {'rootfs_armhf.cpio.zst': 'https://github.com/frank-w/buildroot/releases/download/CI-BUILD-2025.05-bpi-armhf-2025-07-16_1747/rootfs_armhf.cpio.zst', 'rootfs_arm64.cpio.zst': 'https://github.com/frank-w/buildroot/releases/download/CI-BUILD-2025.05-bpi-arm64-2025-07-16_1747/rootfs_arm64.cpio.zst'}
board:bpi-r4 ubootfile: {'name': 'bpi-r4_emmc.img.gz', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc.img.gz', 'bl2': {'8G': {'name': 'bpi-r4_emmc_8GB_bl2.img', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_8GB_bl2.img'}, 'name': 'bpi-r4_emmc_bl2.img', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_bl2.img'}, 'fip': {'name': 'bpi-r4_emmc_fip.bin', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_fip.bin'}}
board:bpi-r4 kernelfile: https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-6.12-main-6.12.39-2025-07-19_1110/bpi-r4_6.12.39-main.tar.gz
ubootfile: {'name': 'bpi-r4_emmc.img.gz', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc.img.gz', 'bl2': {'8G': {'name': 'bpi-r4_emmc_8GB_bl2.img', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_8GB_bl2.img'}, 'name': 'bpi-r4_emmc_bl2.img', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_bl2.img'}, 'fip': {'name': 'bpi-r4_emmc_fip.bin', 'url': 'https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_emmc_fip.bin'}} filename: bpi-r4_emmc.img.gz
kernelfile: https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-6.12-main-6.12.39-2025-07-19_1110/bpi-r4_6.12.39-main.tar.gz filename: bpi-r4_6.12.39-main.tar.gz
-rw-r--r-- 1 compilador compilador 65 Aug  9 14:27 sourcefiles_bpi-r4.conf
image-file: bpi-r4_emmc.img.gz
kernel-file: bpi-r4_6.12.39-main.tar.gz
checking for needed packages...
debootstrap missing
-rw-r--r-- 1 compilador compilador 7.6M Aug  9 14:27 bpi-r4_emmc.img.gz
ls: cannot access 'bookworm_arm64.tar.gz': No such file or directory
rootfs file missing

I also tried manually downloading the u-boot file, build with skipubootdownload=1 and skipkerneldownload=1 with just ./buildimg.sh bpi-r4 bookworm, same error. But yesterday it ran fine. Am i missing something or something changed in the repo?

EDIT: Alright, here’s the thing, yesterday i compiled as root, today as a normal user. Error is debootstrap missing, because /usr/sbin/debootstrap is not the $PATH for normal user. @frank-w am i screwing something up on my bashrc file or some sudo missing on the build scripts? This is why i always do stuff as root :slight_smile:

This script makes sudo where needed. Please do not run as root…but you have to install some packages like debootstrap and qemu-static. /usr/sbin should be in path for root after run with sudo

But it is possible that files are created as root which cannot be overwritten with normal user.

Frank, the necessary packages are installed. That error still happens if run as a normal user. So what is the solution?

  • A normal user should have /usr/sbin in $PATH.
  • Run sudo ./buildimg.sh
  • Adding some missing sudo somewhere

Here on debian 12, a normal user does not have /usr/sbin in $PATH. And that makes sense. sbin is for super users.

That is clear that normal user does not have it in path,but debootstrap is called with sudo and should find debootstrap. But i have tested it only on ubuntu where script works.

Maybe you can disable the check as this is not called with sudo

Possibly in ubuntu this command is in /usr/bin

edit in ubuntu $PATH contains the /usr/sbin and /usr/local/sbin where debootstrap is located…so i need a different way for checking if command is there

Frank, here it works fine with sudo ./buildimg.sh. No permissions issues that i can see. Not during building, nor later in the emmc system. So, i guess it’s better to keep simple.