Installation

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
estebaneban
Posts: 5
Joined: Thu May 17, 2018 1:38 am

Installation

Post by estebaneban »

Hi!
I've run the installation process up to the point where this happens:

DietPi-Software
─────────────────────────────────────────────────────
Mode: Configuring Samba: feature-rich file server

[ SUB1 ] DietPi-Services > dietpi_controlled
[ OK ] DietPi-Services | dietpi_controlled : nmbd
[ OK ] DietPi-Services | dietpi_controlled : smbd
[ OK ] DietPi-Services | dietpi_controlled : cron
[ INFO ] DietPi-Software | Setting Locale es_AR.UTF-8. Please wait
[ SUB1 ] DietPi-Set_software > locale (es_AR.UTF-8)
[ OK ] DietPi-Set_software | dpkg-reconfigure -f noninteractive locales
[ OK ] locale es_AR.UTF-8 | Completed
[FAILED] DietPi-Software | Connection test: 1
[ INFO ] DietPi-Software | If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues).
[FAILED] DietPi-Software | Connection test: 1
[ INFO ] DietPi-Software | If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues).

And in the blue screen, on the logging part, it says:

Log file contents:
Spider mode enabled. Check if remote file exists.
--2018-05-16 20:32:40-- http://1/
Resolving 1 (1)... 0.0.0.1
Connecting to 1 (1)|0.0.0.1|:80... failed: Invalid argument.
```
It's trying to get something from "1", as if "1" is a url
Any ideas?
Thanks!





EDIT:

I've found that this looks to be the culprit:

local run_custom_script=0
if [ -f /boot/Automation_Custom_Script.sh ]; then

cp /boot/Automation_Custom_Script.sh /root/AUTO_CustomScript.sh
run_custom_script=1

#Custom 1st run Script (Online file)
elif [ "$AUTOINSTALL_CUSTOMSCRIPTURL" != "0" ]; then

INSTALL_URL_ADDRESS="$AUTOINSTALL_CUSTOMSCRIPTURL"
G_CHECK_URL "$INSTALL_URL_ADDRESS"

#Get script and execute
wget "$INSTALL_URL_ADDRESS" -O /root/AUTO_CustomScript.sh
run_custom_script=1

fi

This is line 14544 from /dietpi/dietpi-software

Is there something wrong in that logic? Or is it me that didn't understand it. I've copied to the .img file, the /boot/Automation_Custom_Script.sh file, as it reads on line 127 of /dietpi.txt. The file seems to be lost through the installation process, because there is no file on /boot/ at the time the installation stops because of this error I'm writing about.
Then, as the first if doesn't find the file, and the elif ask for != "0", then it takes the value of AUTO_SETUP_CUSTOM_SCRIPT_EXEC as a url and crashes.

Can somebody help me on this one?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Installation

Post by MichaIng »

@estebaneban
Just checked the code, as far as I know, you have two options:
- Placing your script to /boot/Automation_Custom_Script.sh, leaving AUTO_SETUP_CUSTOM_SCRIPT_EXEC untouched (0) OR
- changing AUTO_SETUP_CUSTOM_SCRIPT_EXEC value to a valid URL, where the script is available.

I agree the wording is easily missunderstandable, as it says "Option 1" which does not mean value "1" ;).

BUT: The value of AUTO_SETUP_CUSTOM_SCRIPT_EXEC should be ignored, if /boot/Automation_Custom_Script.sh is found. Are you sure you placed the file correctly? /boot should at least contain kernel and bootloader. Usually it is a separate partition, so that if it's not mounted, /boot just appears to be empty.
Which device are you using?
estebaneban
Posts: 5
Joined: Thu May 17, 2018 1:38 am

Re: Installation

Post by estebaneban »

Many, many thanks for answering. I'm really struggling with this. I've even tried to alter the code of dietpi-software, with no success. The reasoning behind that was that maybe the /boot directory got overwritten through the installation process. I'll do everything again from scratch and let you know.

Can you, please, confirm that if i do what I describe below, it should do as intended?

1 - Mount the .img file on my PC.
2 - Edit dietpi.txt , and set AUTO_SETUP_CUSTOM_SCRIPT_EXEC = 0
3 - Copy the auto setup file as /boot/Automation_Custom_Script.sh
4 - Unmount the .img
5 - Burn the .img to the flash with etcher
6 - Start the PI

Thanks a lot!

EDIT:
The .img file shows two partitions only. I've mounted both of them and /boot still seems to be empty.

What do you mean by "device"? The flash drive I'm using? It's an 32Gb sd card, by the way, but I don't think you asked me that.

EDIT 2:
It worked with the Automation_Custom_Script.sh on the cloud and setting AUTO_SETUP_CUSTOM_SCRIPT_EXEC=[url]
But couldn't get it to work with that file on the .img
It servers my purposes so far, so I can let it be like that, but if we could answer the issue of getting it to work with a local Automation_Custom_Script.sh, may be useful for someone else.
Thanks again for your reply.
Last edited by estebaneban on Sat May 19, 2018 9:02 pm, edited 1 time in total.
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Installation

Post by MichaIng »

@estebaneban
  • You can skip step 2, as this is set already by default and the entry is ignored anyway, if /boot/Automation_Custom_Script.sh is present.
  • Yes two partitions is default for most devices. One is the larger ext4 root partition, the other one the boot partition, usually a just small FAT file system, containing dietpi.txt, config.txt, kernel and bootloader files. This boot partition is on the final system mounted to /boot. So even that the folder /boot might be already present on ext4 root fs, is is intended to be empty, as it is just the mountpoint for the boot partition.
  • By "device" I mean the SBC model you use, or if it is native x86 PC or VM. If the issue persists, we can further investigate with this info, but I think the above should do it 8).
estebaneban
Posts: 5
Joined: Thu May 17, 2018 1:38 am

Re: Installation

Post by estebaneban »

Oh! Device! Jajaj! Right. I'm on a Raspberry PI 3B
I'll re test this afternoon, to figure this out. As I've said, I got it running with the Automation_Custom_Script.sh script hosted on the cloud.
What happened when I tried it whith the script on /boot, was that, in my PC, I've copied the script on the root fs mounted from .img. (say home/user_me/work/mnt1/boot/Automation_Custom_Script.sh), being mnt the mounting point of the root fs. In my pc I have an ubuntu 16.04 so that was easy.
Then, unmount (suspect is not necessary), and burn the .img to the memory card, plug the card on the PI, and let the installation process run.
After that, back to the PC, exploring the card, there was no Automation_Custom_Script.sh script on the /boot directory, for which the dietpi-software was trying to download it from "1". The script Automation_Custom_Script.sh was not there anymore, which makes sense since the /boot folder, you've just told me, was the mounting point of a filesystem. Right?
I get confused, sorry.
I'll do the procedure again to re-check how things are happening.
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Installation

Post by MichaIng »

@estebaneban
I've copied the script on the root fs mounted from .img. (say home/user_me/work/mnt1/boot/Automation_Custom_Script.sh), being mnt the mounting point of the root fs.
You need to mount the other (1st, kernel+bootloader) partition, not the root fs ;).
estebaneban
Posts: 5
Joined: Thu May 17, 2018 1:38 am

Re: Installation

Post by estebaneban »

Ok, I've mounted both, but I can't find on the firtst one the folder named /boot where you are supposed to copy Automation_Custom_Script.sh. Sorry for the dumb question. To clarify: where, in the first partition, do you copy Automation_Custom_Script.sh so it ends up in /boot/Automation_Custom_Script.sh after installation ends?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Installation

Post by MichaIng »

@estebaneban
Copy the file into this partitions root, beside dietpi.txt and config.txt.

The whole partition will be mounted/available at /boot after first run setup.
estebaneban
Posts: 5
Joined: Thu May 17, 2018 1:38 am

Re: Installation

Post by estebaneban »

Beautiful! Totally working. Now I'll fight for an auto samba share. Any thoughts?
Many, many thanks for your help.
Post Reply