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

nand-sata-install - possibility to run from chroot #2533

Open
piknew opened this issue Jan 5, 2021 · 2 comments
Open

nand-sata-install - possibility to run from chroot #2533

piknew opened this issue Jan 5, 2021 · 2 comments
Labels
Bugfix Pull request is fixing a bug Help needed We need your involvement

Comments

@piknew
Copy link

piknew commented Jan 5, 2021

When using nand-sata-install script the issue is with line which recognizes root device:

image

This code ignores the fact, that root device may be eg. chrooted from image (loopback). It is always returning UUID of root of host system.

The fix would be to replace (line 43) it with:

image

Then it is correctly recognizing root device and later partitions etc.:

non-chrooted:
image

chrooted (image is mounted as looppack device):
image

@igorpecovnik igorpecovnik added Help needed We need your involvement Bugfix Pull request is fixing a bug and removed 4.need PR labels May 2, 2022
@qiurui144
Copy link
Collaborator

how can i repeat this error

@piknew
Copy link
Author

piknew commented Sep 30, 2022

Please create an image of any existing armbian installation. Then (assuming it is in armbian.img file) do as following (attention: if test is done please make sure that UUIDs of source system are different that the system on which test is done):

losetup -P /dev/loop0 armbian.img

then:

mkdir /tmp/armbian
mount /dev/loop0p1 /tmp/armbian

... now it is good idea to mount some of other directories (by bind mount):

mount --bind /proc /tmp/armbian/proc
mount --bind /dev /tmp/armbian/dev
mount --bind /sys /tmp/armbian/sys
mount --bind /run /tmp/armbian/run
mount --bind /tmp /tmp/armbian/tmp

and run "chrooted" environment:

chroot /tmp/armbian

next steps will be to use scripts etc. They should be applied to /dev/loop0 (if we are talking about devices) or /dev/loop0p1 (if partition is in the scope). NOT to the block devices of host (test) system (which is actually the problem when reading /proc/cmdline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Pull request is fixing a bug Help needed We need your involvement
Development

No branches or pull requests

3 participants