volumio / Build

Buildscripts for Volumio System
GNU General Public License v2.0
113 stars 102 forks source link

Build Issue - chroot: failed to run 'bin/bash' - Nanopi neo air - nikkov / Volumio-NanoPi-Neo #427

Closed tombsix closed 3 years ago

tombsix commented 3 years ago

Hi, I need to build volumio on nano pi neo air to add custom code handling BMS HW i have added.

For now I try first to get the build complete successfully based on nikkkov work. It fails now. Can you please help to overcome this ?

Firstly:

Stumbling on that part of the code in volumio build.sh script

if [ ! "$BUILD" = x86 ]; then chroot "build/$BUILD/root" /bin/bash -x <<'EOF' su - ./volumioconfig.sh EOF else echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\$ chroot "build/$BUILD/root" /volumioconfig.sh fi chroot: failed to run command ‘/bin/bash’: No such file or directory

Secondly:

I've go a series of errors related to the file structure of build/armv7/root with folders missing so copying stuff to there will fail. (like cp /usr/bin/qemu-arm-static "build/$BUILD/root/usr/bin/", and mounting sys and proc) The build folder is created from scratch and then initiated by multistrap -a "$ARCH" -f "$CONF" if i understand correctly. Suspecting this to be the issue.

Resulting in these errors:

apt update failed. Exit value: 100 cp: cannot create regular file 'build/armv7/root/usr/bin/': Not a directory mount: build/armv7/root/proc: mount point does not exist. mount: build/armv7/root/sys: mount point does not exist. Cloning into 'build/armv7/root/volumio'... Cloning into 'build/armv7/root/volumio/http/www'... Cloning into 'build/armv7/root/volumio/http/www3'... chroot: failed to run command ‘/bin/bash’: No such file or directory umount: build/armv7/root/proc: no mount point specified. umount: build/armv7/root/sys: no mount point specified. umount: build/armv7/root/run/cgmanager/fs: no mount point specified. cp: cannot create regular file 'build/armv7/root/etc/dhcp/dhclient.conf': No such file or directory cp: cannot create regular file 'build/armv7/root/etc/dhcp/dhcpd.conf': No such file or directory cp: cannot create regular file 'build/armv7/root/etc/samba/smb.conf': No such file or directory cp: cannot create regular file 'build/armv7/root/etc/polkit-1/localauthority/50-local.d/50-mount-as-pi.pkla': No such file or directory cp: cannot create regular file 'build/armv7/root/etc/ssh/sshd_config': No such file or directory cp: cannot create regular file 'build/armv7/root/etc/systemd/journald.conf': No such file or directory scripts/configure.sh: 69: scripts/configure.sh: cannot create build/armv7/root/etc/wpa_supplicant/wpa_supplicant.conf: Directory nonexistent chmod: cannot access 'build/armv7/root/etc/wpa_supplicant/wpa_supplicant.conf': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/firststart.sh': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/hotspot.sh': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/dynswap.sh': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/volumiologrotate': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/wifistart.sh': No such file or directory chmod: cannot access 'build/armv7/root/bin/wifistart.sh': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/rename_netiface0.sh': No such file or directory chmod: cannot access 'build/armv7/root/bin/rename_netiface0.sh': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/volumiossh.sh': No such file or directory chmod: cannot access 'build/armv7/root/bin/volumiossh.sh': No such file or directory cp: cannot create regular file 'build/armv7/root/bin/volumio_cpu_tweak': No such file or directory chmod: cannot access 'build/armv7/root/bin/volumio_cpu_tweak': No such file or directory cp: cannot create regular file 'build/armv7/root/etc/default/ifplugd': No such file or directory

gkkpch commented 3 years ago

You may need to ask Nikkov, we cannot not support all community builds directly. Make sure you are building on a Debian jessie PC host machine and have all pre-requisites installed. Then when reporting problems, please add the commands you executed and provide a full build log, not just the error message. This avoids that we have to start guessing what you've done.

tombsix commented 3 years ago

Hi Thanks for the feedback.

I have actually found the issue related to multistrap failing to apt update on the repository which is not signed and consequently not create the right file system (lots of stuff missing)

Adding prior to multistrap

apt-key --keyring "build/$BUILD/root/etc/apt/trusted.gpg.d/debian.gpg" adv --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 7638D0442B90D010 apt-key --keyring "build/$BUILD/root/etc/apt/trusted.gpg.d/debian.gpg" adv --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-key CBF8D6FD518E17E1 did solve the problem

This is related to this: https://github.com/volumio/Build/issues/348 May be worth it updating the code in git as to support armhf architecture properly.

gkkpch commented 3 years ago

We only support Debian jessie hosts for our builds, Ubuntu will cause issues, for which a few workarounds have been made. #348 is one of the places where they were documented.

tombsix commented 3 years ago

Okey, good to know thanks. Meanwhile the nanopi neo air is running fine, but still strange things are to be observed like drivers missing although defined in Kconfig properly (LED heartbeat for ex), unlikely but maybe related to not running Debian jessie host..

gkkpch commented 3 years ago

No, that won't be related to debian jessie. Note: when you build the kernel, you need to compile those drivers as built-in or load them early in the boot process.

tombsix commented 3 years ago

Thanks for the info, sure they are built-in in the kernel. It ended up being a pin config conflict in the dtsi file provided by Friendlyarm (error from them) as they tried to allocate uart0 and leds to the same pin. Resolving this conflict has solved the issue (shame the compiler does not notify of these conflicts, would have been easier..)

A last one :-), Datapartition does not resize after boot; the file resize-volumio-datapart was there initially and desappeared after the first boot. Usually i have to resize manually..I initially supposed it was implemented in boot.cmd but it doesn't look like as https://volumio.github.io/docs/Porting_Guide/Boot_Parameters.html specifies anothing about the resize functionality so I am a bit unsure you implement it there..

Any idea what could happen here ? where is the functionality that checks the file and does the job is implemented ? also my datapart is mmcblk0p3 and not mmcblk0p2 that may be implemented in your script internally..

Thanks

gkkpch commented 3 years ago

the resize-data-partition file should be in the boot partition, it is unrelated to the boot.cmd contents. Re-sizing is done during the processing of initramfs when the resize file exists. After resizing, the file will be deleted. So, please check a freshly flashed sd card whether the file is there before you boot from it.

tombsix commented 3 years ago

Hi, yes it is there on a fresh flashed SD and is deleted during first boot, so it does execute the code in initramfs, but for some reason does not resize mmcblk0p3. Will investigate further the code.

gkkpch commented 3 years ago

it would be interesting to know which version of the init script is being copied into the initramfs during the build, the error must be there, combined with the boot oarameters

tombsix commented 3 years ago

This is solved:

Interestingly enough I had to ensure mmcblk0p3 is mounted before resize2fs is run, which was not the case in the original version of initramfs script. This must be working on other platfroms but on for some reason on the nanopi I had to do it so, i am not understanding why it is like that right now.

------------------------------------------------------------- For info on original error below ------------------------------

I've verified and the init script copied in initramfs is correct.

While looking at the console during first startup i have an error though "filesystem superblock" related to resize2fs. Thinking it is due to the fact the mmcblk0p3 partition is not mounted at the time (which would also not work out for you on the raspeberry pi, but let say just to try..) i have sight modified the code to make resizee2fs happen when 0p3 is mounted. No error anymore but still no resizing (df -h indicates 0 octed available on 0p3)

Interestingly, if I execute resize2fs mmcblk0p3 once the command line is available in volumio, resize2fs works and everything is in order.

It looks like resize2fs executed during initramfs does not get the work done whereas resize2fs at command line does. Parted -s did do the job in initramfs as I see p3 resize happened. I am a bit confused here to be honest.

[   75.388989] initramfs: Re-sizing Volumio data partition
Couldn't find valid filesystem superblock.
[   75.643882] initramfs: Volumio data partition succesfully resized
Model: SD SA08G (sd/mmc)
Disk /dev/mmcblk0: 7747MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      21.0MB  83.9MB  62.9MB  primary  fat16        boot, lba
 2      83.9MB  2500MB  2416MB  primary  ext4
 3      2500MB  7747MB  5247MB  primary  ext4

[   75.781139] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)