BPI-Router-Images icon indicating copy to clipboard operation
BPI-Router-Images copied to clipboard

Can't mounting loopdev

Open mrninhvn opened this issue 2 years ago • 12 comments

Hi, Thanks for greate work. I have some problem with mmcbootpart when mounting loopdev setting up imgfile to loopdev... losetup: bpi-r3_bookworm_6.1.img: failed to use device: No such device mounting loopdev... mount: /home/ninh/apps/BPI-Router-Images/mnt/BPI-BOOT: special device p5 does not exist. dmesg(1) may have more information after failed mount system call. mounting BPI-BOOT failed

mrninhvn avatar Aug 14 '23 04:08 mrninhvn

Which host system do you have? Have you installed losetup?

frank-w avatar Aug 18 '23 07:08 frank-w

Which host system do you have? Have you installed losetup?

My PC runs Debian Bookworm, losetup is installed

mrninhvn avatar Aug 18 '23 08:08 mrninhvn

You can try printing out the variable returned from losetup -f and add Debug with "set -x" or bash -x in the first line of the buildimg.sh

https://github.com/frank-w/BPI-Router-Images/blob/main/buildimg.sh#L43C3-L43C3

It looks like this fails (and $LDEV is empty)...maybe you see an error?

frank-w avatar Aug 18 '23 08:08 frank-w

Same here. When i use the deault uboot image from upstream everything is working fine. But when i pack uboot myself with ./build.sh createimg i see the following on imagebuild

+ echo 'setting up imgfile to loopdev...'
setting up imgfile to loopdev...
+ sudo losetup /dev/loop21 bpi-r4_jammy_6.9.0-main.img
+ [[ 0 -ne 0 ]]
+ echo 'mounting loopdev...'
mounting loopdev...
+ sudo partprobe /dev/loop21
+ [[ 0 -ne 0 ]]
+ mkdir -p mnt/BPI-BOOT mnt/BPI-ROOT
+ sudo mount /dev/loop21p5 mnt/BPI-BOOT
mount: /home/fgarbe/BPI/BPI-Router-Images-main/mnt/BPI-BOOT: special device /dev/loop21p5 does not exist.
+ [[ 32 -ne 0 ]]
+ echo 'mounting BPI-BOOT failed'
mounting BPI-BOOT failed
+ exit 1

Running on Ubuntu 22.04.4 LTS

fggec avatar Sep 02 '24 08:09 fggec

Looks like Partprobe does not find any partitions..

You could try using fdisk or parted on the loopdev to show gpt.

Gpt itself is created with parted in build.sh in mtk-atf branch in my uboot repo

frank-w avatar Sep 02 '24 11:09 frank-w

got following output from parted

GNU Parted 3.4
Using /dev/loop19
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/loop19: unrecognised disk label
Model: Loopback device (loopback)
Disk /dev/loop19: 7340MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
(parted)

fggec avatar Sep 02 '24 15:09 fggec

The img file is downloaded from my uboot releases? Which exactly (you see downloadlink when running the buildimg script)? Maybe there is a build issue.

frank-w avatar Sep 02 '24 15:09 frank-w

Last build of 2024.07 for r4 looks good so far

https://github.com/frank-w/u-boot/actions/runs/10661486395/job/29547044343#step:16:829

frank-w avatar Sep 02 '24 18:09 frank-w

The img file is downloaded from my uboot releases? Which exactly (you see downloadlink when running the buildimg script)? Maybe there is a build issue.

I'm build uboot with ~/BPI/u-boot-2024-04-bpi > ./build.sh importconfig ~/BPI/u-boot-2024-04-bpi > ./build.sh ~/BPI/u-boot-2024-04-bpi > ./build.sh createimg locally. After that i want to use it like in the readme with skipubootdownload=1 and imagepath. i tried relative path to uboot file and also abolut path with no change

If i use auto-dowload uboot from upstream everything works as expected

fggec avatar Sep 02 '24 19:09 fggec

Have you changed build.conf to the right board? Per default it is bpi-r2 which image can be created from uboot branch due to binary preloader...and this image contains only 2 partitions...so will cause your error.

for bpi-r3 and r4 uboot needs to be packed in atf (mtk-atf branch) and createimg is in this build.sh,not in uboot branch.

See ci pipeline (.github/workflows/build.yaml) for more

frank-w avatar Sep 02 '24 19:09 frank-w

Thanks for your fast reply and clarification. I will try it tomorrow.

fggec avatar Sep 02 '24 19:09 fggec

Any new state here?

frank-w avatar Sep 11 '24 18:09 frank-w