frank-w / BPI-Router-Images

8 stars 6 forks source link

Can't mounting loopdev #2

Open mrninhvn opened 1 year ago

mrninhvn commented 1 year ago

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

frank-w commented 1 year ago

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

mrninhvn commented 1 year ago

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

My PC runs Debian Bookworm, losetup is installed

frank-w commented 1 year ago

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?

fggec commented 2 weeks ago

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

frank-w commented 2 weeks ago

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

fggec commented 2 weeks ago

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)
frank-w commented 2 weeks ago

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 commented 2 weeks ago

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

fggec commented 2 weeks ago

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

frank-w commented 2 weeks ago

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

fggec commented 2 weeks ago

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

frank-w commented 1 week ago

Any new state here?