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

Armbian-config hardware -> empty "Toggle hardware configuration" list #33

Open
troyane opened this issue Oct 3, 2018 · 32 comments
Open

Comments

@troyane
Copy link

troyane commented Oct 3, 2018

I'm using Armbian_5.59_Nanopiair_Debian_stretch_next_4.14.65.img on NanoPi Neo Air.

System -> Hardware option looks like this:

toggle_hardware

Before showing this window with empty checkboxes it outputs this:
grep

Same situation after switch to nightly automated builds.

@igorpecovnik
Copy link
Member

Could not recreate, closing. It must be related to bad SD card media or corrupted install.

@Yadro
Copy link

Yadro commented Oct 27, 2018

Armbian_5.65_Orangepizero_Debian_stretch_next_4.14.78.img on Orange Pi Zero

The same issue with same log above.
I just installed OS, ran apt update/upgrate and set timezone and locals - en-US UTF-8 + ru-RU UTF-8

Same situation after switch to nightly automated builds.

Don't help too..

@igorpecovnik
Copy link
Member

Changing locales could have some impact on this. Have to check ...

@igorpecovnik igorpecovnik reopened this Oct 27, 2018
@Yadro
Copy link

Yadro commented Oct 27, 2018

Yep, I've reinstalled distr and with no changes of locals it's work.
Seems due to changes of locals we'll see empty list.

@Yadro
Copy link

Yadro commented Oct 27, 2018

For Orange Pi Zero I see this list:

[ ] analog-codec        
[ ] cir                 
[ ] i2c0                
[ ] i2c1                
[ ] i2c2                
[ ] pps-gpio            
[ ] pwm                 
[ ] spdif-out           
[ ] spi-add-cs1         
[ ] spi-jedec-nor       
[ ] spi-spidev          
[ ] uart1               
[ ] uart2               
[ ] uart3               
[ ] usbhost0            
[ ] usbhost1            
[ ] usbhost1 
[*] usbhost2 
[*] usbhost3 
[ ] w1-gpio  

It can somebody help :)

@igorpecovnik
Copy link
Member

Good, we find the cause. Solution is that critical commands are called with LANG=C prefix and it should survive locales change. Like this one: https://github.com/armbian/config/blob/master/debian-config-functions#L201

@pwuertz
Copy link

pwuertz commented Feb 6, 2019

I'm still seeing this exact error on a freshly downloaded / installed Armbian on a NanoPi Neo Air. Also tried armbian-config from github master, same error.

What is the current workaround? I tried setting export LANG=C before calling armbian-config, but it has no effect.

@pwuertz
Copy link

pwuertz commented Feb 6, 2019

I didn't change any locale settings by the way, this error is showing up on a vanilla armbian setup.

@igorpecovnik
Copy link
Member

I can reproduce this on a random occasion. Sometimes https://github.com/armbian/config/blob/master/debian-config-jobs#L1045 is executed properly, sometimes not. Don't know what is wrong :(

@pwuertz
Copy link

pwuertz commented Feb 7, 2019

Ok, I think I found something. On my affected system the /boot/armbianEnv.txt has beed corrupted, its contents got replaced by some PGP Private Key. After restoring armbianEnv.txt to something useful armbian-config works as expected.

I'm absolutely positive that I haven't touched that file. All I did was apt installing and apt update/upgrade once.

@igorpecovnik If you happen to experience this random occasion again, maybe you could have a look at armbianEnv.txt to check if this is indeed the same reason for this error. If so, there might be a rogue script somewhere in the first bootup or upgrade channel.

@Gasman2014
Copy link

Exactly the same issue as @troyane here. The only thing that could have touched /boot/armbianEnv.txt that I can think of is that I was investigating the other options in armbian-config and looked at the boot environment but did not write this back - apart from the usbstoragequirks entry it seemed to have acquired a ^A character but was otherwise empty. Copying a vanilla from another machine and retaining the usbstoragequirks entry now reboots and the system options selection now works.

verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3
usbstoragequirks .....

@troyane
Copy link
Author

troyane commented Feb 12, 2019

@igorpecovnik @Gasman2014 I haven't seen this issue for a long time already. I've treated Igor's words Could not recreate, closing. It must be related to bad SD card media or corrupted install as solution, so I've:

  • got new microSD (SanDisk Ultra),
  • download newer available version of Armbian,
  • burn Armbian using Etcher.

And all works well.

@Gasman2014
Copy link

Gasman2014 commented Feb 12, 2019 via email

@doublehp
Copy link

Consider this disucssion:

https://forum.armbian.com/topic/8819-where-to-report-a-bug-etcinitdarmhwinfo-corrupts-bootarmbianenvtxt-when-followed-by-powerfailure/?_fromLogin=1

It's not just ext4 or the SD that is broken; the issue occurs only when some init script alters armbianEnv.txt ; and the issue is 95% reproductible when you know how to: remove the line about USBquircks ... rerun the script that introduces it blindly, power cycle before sync.

One part of the problem is that this script may readd the line even if it's already in there.

I have fixed this by backing up the file regularly, and automatically restaure the last backup if it looks broken. For me this is now a fully automated service; backup files appear from time to time; but since I developped this service, I never had any failure.

An other part of the problem is how temp files are managed.

An other part of the problem is the lack of sync after some critical steps. Even if I know very well why sync should not be more frequent than 5mn on normal use, during the first 5mn after boot, there should be a sync every 10s. Especially after altering /boot ...

@igorpecovnik
Copy link
Member

igorpecovnik commented Mar 26, 2019

power cycle before sync.

A sync can be added here and there, to make sure those configs are written properly.

there should be a sync every 10s

This will lead to another problem - extreme SD card lifespan shortening which will sooner or later produce similar problems - fs corruption. Bottom up. If you want to have file system that survive power cut it has to be read/only ... you can also alter few things to improve this but sacrifice performance/SD card endurance. Check / mount option in /etc/fstab

@bonjour81
Copy link

Hi there,
I just switched from kernell 3.4.xxx to 4.11.xx via armbiam and my I2C seems not working anymore.
Anyway, I tried to check "toggle" hw options in armbian and I do have exact same display as in the 1st port from @troyane

I'm not sure to have followed correctly the discussion here, but my armbianEnv.txt looks like this:

verbosity=7
console=both
machid=1029
bootm_boot_mode=sec
rootdev=UUID=f794393d-6f2d-48a6-a5a4-ba4f957a76c9
rootfstype=ext4
overlays=""
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

Is there anything that I can do ?

I run an orange pi PC+ (with internal emmc, no sdcard)

@doublehp
Copy link

doublehp commented Apr 6, 2019

bonjour81, I have seen many changes in the way I2C is handled between kernels 3 and 4. I have discussed about this at many places. From memory, you need to play with overlays in /boot/armbianEnv.txt . I had a lot of issues with SPI and 1W. I had a project which got stuck because one feature required a kernel 4 , and an other feature required kernel 3 for a driver which is not ported yet; project is stuck. Be carefull when playing with I2C, because a mistake can mess your eMMC; then you need to boot from SD to fix the eMMC. Also, armbian-config may not be up to date for the feature you need. And whatever you find in Google or a forum, assume it was written for kernel 3 and expect it to not work with kernel 4.

@bonjour81
Copy link

Hi!
Thanks for informations !
I solved my I2C issue by replacing overlays="" by overlays=sun8i-h3-i2c0 to in armbianEnv.txt
My sensor is back :-) (even if I must say I'm not sure what I'm doing here...)

But the issue mentionned here is still present in armbian-config (no display in toggle HW section).
So far it's not blocking anymore for me, but if I can help, let me know how

@doublehp
Copy link

"This will lead to another problem - extreme SD card lifespan shortening which will sooner or later produce similar problems - fs corruption."

Ony if you drop parts of the phrase you quoted: during the first 5mn after boot

@ntfs1984
Copy link

I have the same issue with my cubietruck.
And it's definitely not SD issue, FS corruption or something like that.

Screenshot from 2019-04-29 20-11-01
Screenshot from 2019-04-29 20-11-12

@dh1tw
Copy link

dh1tw commented Jun 1, 2019

I had the same issue on several Orange Pi Zero H3 and H5. Thanks to @pwuertz comment, I can confirm that in all cases the file /boot/armbianEnv.txt was either overwritten by a PGP key or partially overwritten with some gibberish..
Replacing the file with an intact version for the particular platform fixed the issue. Now armbian-config works again properly.

@ZupoLlask
Copy link

In my case, the culprit of the empty hardware section with grep errors was overlay_prefix= empty (in comparison with overlay_prefix=sun50i-a64) or totally missing at /boot/armbianEnv.txt.

I think armbian-config should check if that key is not missing or empty before running grep, and if needed it must try to recover that key and correct it at /boot/armbianEnv.txt.

As it is, it's not sufficiently robust.

@igorpecovnik
Copy link
Member

igorpecovnik commented Dec 28, 2019

it's not sufficiently robust.

I am aware of that, but since there is very little time and lots of issues/wishes it will remain this way. This is amateur development.

Few help here and there changes a lot https://www.armbian.com/get-involved

@ZupoLlask
Copy link

ZupoLlask commented Dec 28, 2019

I'll see if I can contribute with a decent PR for this... 😊

@1ubuntuuser
Copy link

@ZupoLlask That would be great! This issue causes me all sorts of headaches.

@1ubuntuuser
Copy link

1ubuntuuser commented Dec 30, 2019

I deploy armbian in the field where power cutoffs happen all to often. Would setting /boot/armbianEnv.txt to readonly resolve the issue for now?

Edit: I should say, prevent the issue from happening in future.

@GitTweaker
Copy link

My NanoPi NEO2 Black had the same issue.
Just added the line in /boot/armbianEnv.tx and the nit worked fine:
overlay_prefix=sun50i-h5

@chmondkind
Copy link

chmondkind commented Jan 24, 2020

Had issues with my NanoPi Air (H3). There was a OpenSSH private key in it (a fact I don't understand). After it the following entries where in it:
rootdev=UUID=fc6d1d22-a58c-4f4b-89fd-b91068648fa3 rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

Resolved thanks to the information here - I removed the SSH key, left the three lines above, added two lines to it:
sudo su
cd /boot/
cp armbianEnv.txt armbian.Env.txt.old
nano armbianEnv.txt
overlay_prefix=sun8i-h3 overlays=usbhost2 usbhost3 rootdev=UUID=fc6d1d22-a58c-4f4b-89fd-b91068648fa3 rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
save, reboot.

@iav
Copy link
Contributor

iav commented May 13, 2020

I found similar with nightly on ODroid-N2.
my /boot/armbianEnv.txt file was:

verbosity=1
logo=disabled
console=both
ethaddr=xx:xx:removed
rootdev=UUID=366ca76b-c168-4bea-97ef-b8d7efadcdb8
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

debug trace I add at theend of this message.
Error occures if /boot/armbianEnv.txt not contains overlay_prefix string at all or it have empty value.

It start to work when I add string overlay_prefix=meson-.

Seems there should be check for string presence with error diag — or kind of workaround for line 1220 of file /usr/lib/armbian-config/jobs.sh

maybe I can try to fix this — if owner points me what behavior is correct for this case.

+ case $1 in
+ CHANGES=false
+ true
++ cat /boot/armbianEnv.txt
++ grep overlay_prefix
++ sed s/overlay_prefix=//g
+ overlay_prefix=
+ TARGET_BRANCH=dev
+ exceptions dev
+ TARGET_FAMILY=meson64
+ UBOOT_BRANCH=dev
+ [[ dev == \d\e\f\a\u\l\t ]]
+ TARGET_BRANCH=-dev
+ [[ meson64 == pine64 ]]
+ [[ meson64 == sun*i ]]
+ MOTD=()
+ LINES=()
+ LIST_CONST=-3
+ j=0
+ DIALOG_CANCEL=1
+ DIALOG_ESC=255
+ read line
++ sed 's/^.*\(.*\)/\1/g'
++ ls -1 /boot/dtb/amlogic/overlay/meson-i2cA.dtbo /boot/dtb/amlogic/overlay/meson-i2cB.dtbo /boot/dtb/amlogic/overlay/meson-uartA.dtbo /boot/dtb/amlogic/overlay/meson-uartC.dtbo /boot/dtb/amlogic/overlay/meson-w1-gpio.dtbo /boot/dtb/amlogic/overlay/meson-w1AB-gpio.dtbo
++ sed s/.dtbo//g
++ sed s/-//g
+++ cat /boot/armbianEnv.txt
+++ grep overlays
+++ grep -w
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
++ [[ -n '' ]]
+ STATUS=
++ description ''
++ case $1 in
++ echo ''
+ DESC=
+ MOTD+=("$line" "$DESC" "$STATUS")
+ LINES[ $j ]=
+ ((  j++  ))
+ read line
+++ cat /boot/armbianEnv.txt
+++ grep overlays
+++ grep -w
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
++ [[ -n '' ]]
+ STATUS=
++ description ''
++ case $1 in
++ echo ''
+ DESC=
+ MOTD+=("$line" "$DESC" "$STATUS")
+ LINES[ $j ]=
+ ((  j++  ))
+ read line
+++ cat /boot/armbianEnv.txt
+++ grep overlays
+++ grep -w
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
++ [[ -n '' ]]
+ STATUS=
++ description ''
++ case $1 in
++ echo ''
+ DESC=
+ MOTD+=("$line" "$DESC" "$STATUS")
+ LINES[ $j ]=
+ ((  j++  ))
+ read line
+++ cat /boot/armbianEnv.txt
+++ grep overlays
+++ grep -w
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
++ [[ -n '' ]]
+ STATUS=
++ description ''
++ case $1 in
++ echo ''
+ DESC=
+ MOTD+=("$line" "$DESC" "$STATUS")
+ LINES[ $j ]=
+ ((  j++  ))
+ read line
+++ cat /boot/armbianEnv.txt
+++ grep overlays
+++ grep -w
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
++ [[ -n '' ]]
+ STATUS=
++ description ''
++ case $1 in
++ echo ''
+ DESC=
+ MOTD+=("$line" "$DESC" "$STATUS")
+ LINES[ $j ]=
+ ((  j++  ))
+ read line
+++ cat /boot/armbianEnv.txt
+++ grep overlays
+++ grep -w
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
++ [[ -n '' ]]
+ STATUS=
++ description ''
++ case $1 in
++ echo ''
+ DESC=
+ MOTD+=("$line" "$DESC" "$STATUS")
+ LINES[ $j ]=
+ ((  j++  ))
+ read line
+ exec
++ dialog --backtitle 'Configuration utility, Armbian 20.05.0-trunk.132 nightly, 192.168.1.220' --colors --title 'Toggle hardware configuration' --clear --cancel-label Back --ok-label Save --checklist '\nUse \Z1<space>\Z0 to toggle functions and save them. Exit when you are done.\n ' 0 0 0 '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ''

@gigobait
Copy link

Has anyone fixed this? Every single image for the Renegade i burned to SD has the issue.

@EvilOlaf
Copy link
Member

Probably not and probably won't anymore since all efforts going into the overhaul of that tool as announced in forums.

@gigobait
Copy link

fix for Renegade

create
/boot/armbianEnv.txt

verbosity=1
bootlogo=true
overlay_prefix=rockchip
rootdev=UUID=e39e2e68-b810-41f9-8fd3-75e1ba55eb3c (get this by using blkid)
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

save, reboot, the menu will start working.
probably same concept for different boards, use the same family of chip

viraniac pushed a commit to viraniac/fenix-config that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests