Dietpi: dietpi.txt software install setting

Created on 24 Aug 2018  ยท  7Comments  ยท  Source: MichaIng/DietPi

Creating a bug report/issue:

Required Information:

  • DietPi version | 6.14
  • Distro version | stretch
  • Kernel version | Linux zerow 4.14.62+ #1134 Tue Aug 14 16:58:07 BST 2018 armv6l GNU/Linux
  • SBC device | RPi Zero W (armv6l)
  • Power supply used PC
  • SDcard used | SanDisk 64GB

Steps to reproduce:

  1. edit dietpi.txt
  2. AUTO_SETUP_INSTALL_SOFTWARE_ID=59 #rpicam
    AUTO_SETUP_INSTALL_SOFTWARE_ID=132 #aria2
    AUTO_SETUP_INSTALL_SOFTWARE_ID=122 #nodered

Expected behaviour:

aria2 will be installed

Actual behaviour:

rpicam and nodered installed
but aria2 not installed.

Extra details:

i am sure i do a clean install dietpi for many times, and only aria2 will not install via the dietpi.txt

Question

Most helpful comment

Found the issue I think. The "2" from "# Aria2" is taken as well. We need to scrape the values differently to ignore trailing comments.

awk '{print $1}' | sed ...
or value=${value##[[:blank:]]*}
or unallow comments within the same line.

โ‚ฌ: Jep, currently it is:
"$(grep '^[[:blank:]]*AUTO_SETUP_INSTALL_SOFTWARE_ID=' /DietPi/dietpi.txt | sed 's/[^0-9]*//g')"

All 7 comments

@msongz

Thanks for the report ๐Ÿ‘

I'll open for investigations.

Please can you paste the 1st run install logs:

cat /var/tmp/dietpi/logs/dietpi-firstrun-setup.log

first-run-log.txt

sorry for the delay.

also, the timezone I set on dietpi.txt: AUTO_SETUP_TIMEZONE=Asia/Hong Kong

would not take effect.

@msongz

Thanks ๐Ÿ‘

Appears invalid index was used in dietpi.txt

Invalid value 1322. No changes applied.

Please verify the index is 132 in dietpi.txt

Asia/Hong_Kong is the correct entry (_ for space). Please use that in dietpi.txt:

Current default time zone: 'Asia/Hong_Kong'
Local time is now:      Tue Aug 28 03:39:52 HKT 2018.
Universal Time is now:  Mon Aug 27 19:39:52 UTC 2018.

@Fourdee
thanks for the correct timezone entry~
but it is weird that the index I set in dietpi.txt is 132, not 1322.
https://github.com/msongz/dietpi-script/blob/7f8f637a7e5ec32d76a94cae14f850d7d0eec456/songz-dietpi.txt#L86

Found the issue I think. The "2" from "# Aria2" is taken as well. We need to scrape the values differently to ignore trailing comments.

awk '{print $1}' | sed ...
or value=${value##[[:blank:]]*}
or unallow comments within the same line.

โ‚ฌ: Jep, currently it is:
"$(grep '^[[:blank:]]*AUTO_SETUP_INSTALL_SOFTWARE_ID=' /DietPi/dietpi.txt | sed 's/[^0-9]*//g')"

@MichaIng

Legend ๐Ÿ‘ ๐Ÿฅ‡

I'll go with awk for today ๐Ÿ˜ƒ

root@DietPi:~# grep '^[[:blank:]]*AUTO_SETUP_INSTALL_SOFTWARE_ID=' /DietPi/dietpi.txt | sed 's/[^0-9]*//g'
232123
74111
44341

root@DietPi:~# grep '^[[:blank:]]*AUTO_SETUP_INSTALL_SOFTWARE_ID=' /DietPi/dietpi.txt | awk '{print $1}' | sed 's/[^0-9]*//g'
23
74
44

@MichaIng

Great find on fix ๐Ÿ‘

@msongz

Thanks for reporting, fixed in v6.15 update ๐Ÿ‘ eta this weekend (ish)

Was this page helpful?
0 / 5 - 0 ratings