Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't mounting loopdev #2

Open
mrninhvn opened this issue Aug 14, 2023 · 12 comments
Open

Can't mounting loopdev #2

mrninhvn opened this issue Aug 14, 2023 · 12 comments

Comments

@mrninhvn
Copy link

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
Copy link
Owner

frank-w commented Aug 18, 2023

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

@mrninhvn
Copy link
Author

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

My PC runs Debian Bookworm, losetup is installed

@frank-w
Copy link
Owner

frank-w commented Aug 18, 2023

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
Copy link

fggec commented Sep 2, 2024

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
Copy link
Owner

frank-w commented Sep 2, 2024

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
Copy link

fggec commented Sep 2, 2024

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
Copy link
Owner

frank-w commented Sep 2, 2024

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
Copy link
Owner

frank-w commented Sep 2, 2024

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
Copy link

fggec commented Sep 2, 2024

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
Copy link
Owner

frank-w commented Sep 2, 2024

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
Copy link

fggec commented Sep 2, 2024

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

@frank-w
Copy link
Owner

frank-w commented Sep 11, 2024

Any new state here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants