MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.89k stars 498 forks source link

PREP_SYSTEM_FOR_DIETPI.sh | Automate #1285

Closed Fourdee closed 6 years ago

Fourdee commented 6 years ago

Status: Beta

What is this?

What this script does NOT do:


Step 1: Ensure a Debian/Raspbian OS is running on the system

Step 2: Pre-req packages

Step 3: Run DietPi installer

Ensure you have elevated privileges (eg: login as root, or use sudo su).

Copy and paste all into term.

wget https://raw.githubusercontent.com/MichaIng/DietPi/master/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
#wget https://raw.githubusercontent.com/MichaIng/DietPi/jessie-support/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
#wget https://raw.githubusercontent.com/MichaIng/DietPi/beta/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
#wget https://raw.githubusercontent.com/MichaIng/DietPi/dev/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
chmod +x PREP_SYSTEM_FOR_DIETPI.sh
./PREP_SYSTEM_FOR_DIETPI.sh

Follow the onscreen prompts.

Fourdee commented 6 years ago

Minor, EFI PC:

[ INFO ] Configuring Dropbear:
sed: can't read /etc/default/dropbear: No such file or directory
Fourdee commented 6 years ago

@MichaIng

Closed for now 👍

kuzinnv commented 6 years ago

I try to install DietPi on my Beaglebone Black by running sudo GIT_BRANCH=$GIT_BRANCH ./PREP_SYSTEM_FOR_DIETPI.sh but on the Removing connman step BBB has disappeared from my network. SSH closed the connection. The DHCP server on my router does not show it. What I doing wrong?

MichaIng commented 6 years ago

@kuzinnv Thanks for reporting.

Yey I can imagine the issue, when starting preparation script via OpenSSH connection, as we do install/prevent Dropbear from removal, but remove OpenSSH by default: https://github.com/Fourdee/DietPi/blob/testing/PREP_SYSTEM_FOR_DIETPI.sh#L540-L548

This was already on my list somewhere before v6.0 release, forgot it 😅. We could check, if script is started via active OpenSSH session (need to find reliable method, alternative just check if it's installed) and in that case choose it for preserving instead of Dropbear. Further ideas about this:

About the DHCP issue, I have no idea, needs to be investigated by someone with BBB maybe. We install the default DHCP client: https://github.com/Fourdee/DietPi/blob/testing/PREP_SYSTEM_FOR_DIETPI.sh#L517 Maybe some important firmware got removed in your case. Could you please copy&paste the whole script output, better in a separate new topic?

BBB has no HDMI or something right? So connecting via SSH (including successful network) is the only way to interact?

kuzinnv commented 6 years ago

BBB has no HDMI or something right? So connecting via SSH (including successful network) is the only way to interact?

Yes, BBB has HDMI. I will try to use it. Thank you!

MichaIng commented 6 years ago

@kuzinnv Ah okay, then I found the wrong one 😆. Yes would be great, if you had some access to logs/service/network states then for investigation.

kuzinnv commented 6 years ago

@MichaIng I tried to use the HDMI output on BBB to install the DietPi. The script stopped again with an error. eth0 interface was not configured. After configuring on /etc/network/interfaces I will run the script again. This time the script finished correctly. I was reboot BBB and he was never boot again. I'm confused.

MichaIng commented 6 years ago

@Fourdee Maybe you can help? Do you remember issues with preparation script and BBB?

@kuzinnv as well: Which image did you start from? http://debian.beagleboard.org/images/bone-debian-9.3-iot-armhf-2018-01-28-4gb.img.xz looks reasonable for me and seems like Debian is anyway default on BBB? But I don't know if on different images there might be essential kernel/bootloader/firmware APT packages necessary/installed? We just keep device-tree-compiler right now within script, which means there is non-packaged kernel+bootloader expected: https://github.com/Fourdee/DietPi/blob/master/PREP_SYSTEM_FOR_DIETPI.sh#L635

kuzinnv commented 6 years ago

@MichaIng

Which image did you start from? http://debian.beagleboard.org/images/bone-debian-9.3-iot-armhf-2018-01-28-4gb.img.xz looks reasonable for me and seems like Debian is anyway default on BBB?

Yes, exactly this image I use and his work fine. I will make a screenshots.

k-plan commented 6 years ago

Sorry, no spare time at the moment to play with my BBB.

@kuzinnv Have you read, what Fourdee did while he build first testing image? https://github.com/Fourdee/DietPi/issues/931#issuecomment-345451529

Yes, old version of testing image DietPi_v158_BBB-armv7-(Stretch).7z is discontinue and gone. But I have it somewhere laying around.

Because there is not much attentions for BBB so far, we have it not on ToDo list at the moment. https://github.com/Fourdee/DietPi/issues/1385

Sorry

kuzinnv commented 6 years ago

@k-plan

Have you read, what Fourdee did while he build first testing image?

Okay... And how will help me this?

1st run of DietPi results in failed boot (middle 2 blue LED's lit), due to FS expansion. Not compatible with BBB's unique boot system. Fixed image size (4GB) for EMMC.

I have exactly so problem!

Fourdee commented 6 years ago

@kuzinnv

Apologies, this is an issue our end. We forgot to remove the FS expansion script for BBB.

Please do the following after you have completed a fresh DietPi PREP (once its finished, before reboot):

rm /etc/systemd/system/dietpi-fs_expand.service
rm /var/lib/dietpi/fs_partition_resize.sh
rm /etc/systemd/system/dietpi-fs_partition_resize.service
systemctl daemon-reload

You can now reboot the system.

I'll apply this fix into testing branch.

kuzinnv commented 6 years ago

Ah yeah! It's work! Thank you, @Fourdee!

tomillr commented 6 years ago

I'd like to use this script to install DietPi on an Intel Apollo Lake-based x64 system with build in eMMC storage (Beelink AP34). Unfortunately, I can't seem the system to boot the Debian netinstall linked to above. Is there a way to get Debian to run on this system?

Fourdee commented 6 years ago

@tomillr

Using Method 2: UEFI beta x86_64 image: should work fine on the AP34: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021

I use this on the Z83-II.

tomillr commented 6 years ago

Already tried Method 2 as well. It just crashed the system to a non-blinking cursor.

lateboomer commented 6 years ago

When I ran the scripts for Beaglebone Black, half way through it lost networking services and etho was not configured. May I know how do I configure network services to continue the run? may be it purges the network packages.

Fourdee commented 6 years ago

@lateboomer

Thanks for the report 👍

Which Pre-image did you use, official BBB image?

lateboomer commented 6 years ago

I am using this pre-image as suggested above:

http://debian.beagleboard.org/images/bone-debian-9.3-iot-armhf-2018-01-28-4gb.img.xz

The BBB image I downloaded the latest one from the download page.

Note: It is not BBB image, what I meant is it is PREP_SYSTEM_FOR_DIETPI.sh scripts I downloaded from the download page. When I run the scripts half way eth0 and dns name derivation all lost.

valerivp commented 6 years ago

Orange Pi i96 on Debian after instalation DietPi (with out errors), and reboot wrote:

Please login to continue

But not show command promt 2018-05-28_1642

alexz-kh commented 6 years ago

Folks , is it possible to pass predefined

export PREIMAGE_INFO="http://example.com"
export G_HW_MODEL='35'
export WIFI_REQUIRED=1

variables ? to be able build w\o manual input ?

MichaIng commented 6 years ago

@kuzinnv Not yet, but the idea is great to allow predefining all user input 👍. I will add PR for this later.

johbar commented 6 years ago

As far as I see pure 32 bit architectures (i686) are not supported. Why? Is there a workaround available? (I hope that's the right place for this kind of question.)

MichaIng commented 6 years ago

@johbar Please read: https://github.com/Fourdee/DietPi/issues/1854#issuecomment-401457209

We would need to find install options for x32 for all our offered software titles, implement and test them. It's just a too huge rework for our limited man power, although I understand that especially for very old x32 machines in particular a very lightweight OS is interesting.

Fourdee commented 6 years ago

Note: Dev/Testing branch currently has issues (globals?):

Seems fine here:

[  OK  ] DietPi-PREP | Step 2 (inputs): Image info / Hardware / WiFi / Distro:
[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[ INFO ] DietPi-PREP | Setting G_HW_MODEL index of: 42
[ INFO ] DietPi-PREP | CPU ARCH = 3 : aarch64
[ INFO ] DietPi-PREP | WiFi selection
[ INFO ] DietPi-PREP | Marking WiFi as needed
[ INFO ] DietPi-PREP | Disabled Distro downgrade: index 3

Not here:

root@rockpro64:/home/rock64# G_HW_MODEL=42 /DietPi/dietpi/func/dietpi-set_software apt-mirror 'default'
[  OK  ] Root access verified.
[  OK  ] DietPi-Drive_Manager | RootFS R/W access verified.

 DietPi-Set_software
─────────────────────────────────────────────────────
 Mode: apt-mirror (default)

[  OK  ] DietPi-Set_software | Desired setting in /DietPi/dietpi.txt was already set: CONFIG_APT_RASPBIAN_MIRROR=http://raspbian.raspberrypi.org/raspbian
[  OK  ] apt-mirror http://raspbian.raspberrypi.org/raspbian | Completed

DietPi-Set_software always reporting G_HW_MODEL=0 during debug.

Due to these changes:

    #Device details
    # - Declare
    G_HW_MODEL=0
    G_HW_MODEL_DESCRIPTION='NULL'
    G_HW_ARCH=0
    G_HW_ARCH_DESCRIPTION='NULL'
    G_HW_CPUID=0
    G_HW_CPU_CORES=$(nproc --all)

They need to be static init.

MichaIng commented 6 years ago

@Fourdee I guess this is related: https://github.com/Fourdee/DietPi/issues/1960

Wait... Raspbian on Rock64?

Fourdee commented 6 years ago

@MichaIng

Wait... Raspbian on Rock64?

😉 🤣 👍

Yep, issues with globals script changes: Fixed with https://github.com/Fourdee/DietPi/commit/36111dcc1d3ee3bb189ac4527b370a937405c6eb

Fourdee commented 6 years ago

@MichaIng

You were right, systemd-sysv deps on systemd, i've updated the pre-req in 1st post 👍

k-plan commented 6 years ago

Hi,

have playing around a little bit with PREP_SYSTEM_FOR_DIETPI.sh. Read in Changelog, dietpi.txt and Getting started guide we now need /boot/dietpi-wifi.txt since v6.16.

After doing PREP_SYSTEM_FOR_DIETPI.sh , where will no /boot/dietpi-wifi.txt generated/copied. Yes, I have see this dietpi-wifi.txt in your prebuild DietPi_v6.16_RPi-ARMv6-Stretch.img:

#---------------------------------------------------------------
# - Entry 0
#   WiFi SSID (Case Sensitive)
aWIFI_SSID[0]=""
#   Key options: If no key (open), leave this blank
aWIFI_KEY[0]=""
#   Available options: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[0]="WPA-PSK"
# - WPA-EAP Options
aWIFI_PROTO[0]=""
aWIFI_PAIRWISE[0]=""
aWIFI_AUTH_ALG[0]=""
aWIFI_EAP[0]=""
aWIFI_IDENTITY[0]=""
aWIFI_PASSWORD[0]=""
aWIFI_PHASE1[0]=""
aWIFI_PHASE2[0]=""
#   Location of the certificate file (eg: /boot/mycert.cer)
aWIFI_CERT[0]=""
#---------------------------------------------------------------
# - Entry 1
#   WiFi SSID (Case Sensitive)
aWIFI_SSID[1]=""
#   Key options: If no key (open), leave this blank
aWIFI_KEY[1]=""
#   Available options: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[1]="WPA-PSK"
# - WPA-EAP Options
aWIFI_PROTO[1]=""
aWIFI_PAIRWISE[1]=""
aWIFI_AUTH_ALG[1]=""
aWIFI_EAP[1]=""
aWIFI_IDENTITY[1]=""
aWIFI_PASSWORD[1]=""
aWIFI_PHASE1[1]=""
aWIFI_PHASE2[1]=""
#   Location of the certificate file (eg: /boot/mycert.cer)
aWIFI_CERT[1]=""
#---------------------------------------------------------------
# - Entry 2
#   WiFi SSID (Case Sensitive)
aWIFI_SSID[2]=""
#   Key options: If no key (open), leave this blank
aWIFI_KEY[2]=""
#   Available options: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[2]="WPA-PSK"
# - WPA-EAP Options
aWIFI_PROTO[2]=""
aWIFI_PAIRWISE[2]=""
aWIFI_AUTH_ALG[2]=""
aWIFI_EAP[2]=""
aWIFI_IDENTITY[2]=""
aWIFI_PASSWORD[2]=""
aWIFI_PHASE1[2]=""
aWIFI_PHASE2[2]=""
#   Location of the certificate file (eg: /boot/mycert.cer)
aWIFI_CERT[2]=""
#---------------------------------------------------------------
# - Entry 3
#   WiFi SSID (Case Sensitive)
aWIFI_SSID[3]=""
#   Key options: If no key (open), leave this blank
aWIFI_KEY[3]=""
#   Available options: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[3]="WPA-PSK"
# - WPA-EAP Options
aWIFI_PROTO[3]=""
aWIFI_PAIRWISE[3]=""
aWIFI_AUTH_ALG[3]=""
aWIFI_EAP[3]=""
aWIFI_IDENTITY[3]=""
aWIFI_PASSWORD[3]=""
aWIFI_PHASE1[3]=""
aWIFI_PHASE2[3]=""
#   Location of the certificate file (eg: /boot/mycert.cer)
aWIFI_CERT[3]=""
#---------------------------------------------------------------
# - Entry 4
#   WiFi SSID (Case Sensitive)
aWIFI_SSID[4]=""
#   Key options: If no key (open), leave this blank
aWIFI_KEY[4]=""
#   Available options: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[4]="WPA-PSK"
# - WPA-EAP Options
aWIFI_PROTO[4]=""
aWIFI_PAIRWISE[4]=""
aWIFI_AUTH_ALG[4]=""
aWIFI_EAP[4]=""
aWIFI_IDENTITY[4]=""
aWIFI_PASSWORD[4]=""
aWIFI_PHASE1[4]=""
aWIFI_PHASE2[4]=""
#   Location of the certificate file (eg: /boot/mycert.cer)
aWIFI_CERT[4]=""

Or do I miss something?

Thanks and see you.

k-plan

MichaIng commented 6 years ago

@k-plan Hi, nice too see you here again 😃.

Actually https://github.com/Fourdee/DietPi/blob/master/PREP_SYSTEM_FOR_DIETPI.sh#L1407-L1409 should lead to dietpi-wifi.txt being created. Did this not happen during your test?

An issue I could think is that private WiFi SSID/key could be stored inside. Either users should be informed about that, their current WiFi credentials from image creation system being stored on the image, or we should anonymize it, or simply put a raw default in place?

k-plan commented 6 years ago

Hi @MichaIng ,

should lead to dietpi-wifi.txt being created. Did this not happen during your test?

Sadly no.

The device has no Wifi buildin, connected or Wifi connection configured. So Wifi was disabled in dietpi-config But i have choose I require WiFi functionality, keep/install related packages. Is this a problem?

An issue I could think is that private WiFi SSID/key could be stored inside

Puuh... think that's not the best idea ... 😞

... or simply put a raw default in place?

Yes, I will vote for this please. 😃

Fourdee commented 6 years ago

@k-plan

Hello you, long time no see, hope all is well? 😃

I believe there was a bug in the v6.16 PREP (and master branch), where it would not generate the dietpi-wifi.db file automatically, if it did not exist (whoopsie!)

This is now resolved in the v6.17 update (via testing branch currently). If you run PREP with testing branch, should be fine :)

k-plan commented 6 years ago

@Fourdee

Hi Dan, I'm fine, thanks.

Sounds good, will try this, if I find some spare time.

Thanks.

Congratulations to @Fourdee and @MichaIng for coding progress on your DietPi. Pretty nice work! ❤️

Fourdee commented 6 years ago

Changes to PREP run script, for v6.17 release:

wget https://raw.githubusercontent.com/Fourdee/DietPi/master/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
#wget https://raw.githubusercontent.com/Fourdee/DietPi/beta/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
#wget https://raw.githubusercontent.com/Fourdee/DietPi/dev/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
chmod +x PREP_SYSTEM_FOR_DIETPI.sh
sudo ./PREP_SYSTEM_FOR_DIETPI.sh
theAkito commented 6 years ago

Greetings,

I want to run this script on my Orange Pi i96, but this device has neither an HDMI nor a LAN interface, so I really rely completely on being able to SSH into this thing over Wi-Fi. How do I make sure that I can connect to the system, after all the existing software (APT) and user data will be deleted? I really like the aforementioned idea of predefining user input.

MichaIng commented 6 years ago

@Akito13 Currently DietPi-PREP does not run reliably on WIFI-only devices without HDMI. Note: https://github.com/Fourdee/DietPi/blob/master/PREP_SYSTEM_FOR_DIETPI.sh#L5-L9

E.g. if NetworkManager is installed, it will be uninstalled, which drops the connection, thus SSH will be lost and script cancelled.

So either a local terminal is needed (thus HDMI) or an Ethernet connection that assures ongoing SSH connection without relying on a certain connection manager/method.

Theoretically it should be possible to start the script via SSH within a screen session. This would resume, even if SSH is lost. All the interactive part is done, before any connection related changes are done, so theoretically it works. No ordinary shutdown can be done then, but waiting better longer then shorter until every activity stopped, then plug off from power, should do it.

But we had some WiFi/interface init issues with v6.16, mostly on Jessie systems. But since we cleaned up all the interface/connection stuff at (first) boot, I would wait for v6.17 before doing much effort for the above attempts.

Somnius commented 5 years ago

I'm having this, running beta script on Clean Debian 9 latest x64 on Vultr, choose VM on the device list.

image

any ideas?

edit: i'm gonna reinstall Debian from 9 to 8 just to check things out and report back here..

lvnsk commented 5 years ago

Sorry, can't help you with this. I'm run it on armbian image for banana pi

сб, 2 февр. 2019 г., 5:45 Lefteris @SomniusX notifications@github.com:

I'm having this, running beta script on Clean Debian 9 latest x64 on Vultr, choose VM on the device list.

[image: image] https://user-images.githubusercontent.com/144157/52153724-c8073e80-2683-11e9-810a-94ad47e4b933.png

any ideas?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Fourdee/DietPi/issues/1285#issuecomment-459893889, or mute the thread https://github.com/notifications/unsubscribe-auth/ArtFrT0giTIzDhyiEdYqUKo4JpcFzcLYks5vJMOegaJpZM4Q8Uyf .

Somnius commented 5 years ago

I've reached out to the twitter account and the person that manages it said that he uses the dev brach, which to be frank was the only one i haven't truly tried yesterday. So.. ;) it started "doing" stuff, ripping off the already empty netinstall of debian 9

screenshot 2019-02-02 at 09 37 55

kuerious commented 5 years ago

So what is the fix, then? I'm trying (dying to) use DietPi on a full-blown x86_64 PC environment. Did a Debian Netinstall, minimum (only an SSH). The script (using the master build) keeps crapping out. Can't someone just figure out where in the script something's not working?

I'm definitely going to be submitting a trouble ticket, but this seems like it should be easy to fix.

mzramna commented 5 years ago

btrfs does not support swapfile like archives , it should be checked into the instalation script before starting the conversion,if the file system is btrfs it should not start even the downloads of the others scripts related to this,it should check too if the time is right,sometimes the system could not get the right time from ntp,it make it impossible to download from any ssl ,like github,so this presents many problems that could be solved just ajusting to right date/time

MichaIng commented 5 years ago

See: https://github.com/MichaIng/DietPi/issues/719#issuecomment-484298070

About the time sync:

tomillr commented 5 years ago

I'm trying to run the script on the latest Debian Buster rc1 release (which is finally able to run on UEFI machines right out of the box). I've selected the MASTER branch, but the script always times out at the "Removing ifupdown (0.8.35) ..." part.

root@PlexMediaServer:~# apt-get update
OK:1 http://deb.debian.org/debian buster InRelease                             
OK:2 http://security.debian.org/debian-security buster/updates InRelease       
Paketlisten werden gelesen... Fertig                                           
root@PlexMediaServer:~# apt-get install -y systemd-sysv ca-certificates sudo wget locales --reinstall
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden zusätzlichen Pakete werden installiert:
  libpcre2-8-0 libpsl5 openssl publicsuffix
Die folgenden NEUEN Pakete werden installiert:
  ca-certificates libpcre2-8-0 libpsl5 openssl publicsuffix sudo wget
0 aktualisiert, 7 neu installiert, 2 erneut installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 7.685 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 10,1 MB Plattenplatz zusätzlich benutzt.
Holen:1 http://deb.debian.org/debian buster/main amd64 systemd-sysv amd64 241-5 [98,2 kB]
Holen:2 http://deb.debian.org/debian buster/main amd64 locales all 2.28-10 [4.060 kB]
Holen:3 http://deb.debian.org/debian buster/main amd64 libpcre2-8-0 amd64 10.32-5 [213 kB]
Holen:4 http://deb.debian.org/debian buster/main amd64 libpsl5 amd64 0.20.2-2 [53,7 kB]
Holen:5 http://deb.debian.org/debian buster/main amd64 wget amd64 1.20.1-1.1 [902 kB]
Holen:6 http://deb.debian.org/debian buster/main amd64 openssl amd64 1.1.1b-2 [840 kB]
Holen:7 http://deb.debian.org/debian buster/main amd64 ca-certificates all 20190110 [157 kB]
Holen:8 http://deb.debian.org/debian buster/main amd64 publicsuffix all 20190415.1030-1 [116 kB]
Holen:9 http://deb.debian.org/debian buster/main amd64 sudo amd64 1.8.27-1 [1.245 kB]
Es wurden 7.685 kB in 1 s geholt (5.856 kB/s).
Vorkonfiguration der Pakete ...
(Lese Datenbank ... 24906 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../0-systemd-sysv_241-5_amd64.deb ...
Entpacken von systemd-sysv (241-5) über (241-5) ...
Vorbereitung zum Entpacken von .../1-locales_2.28-10_all.deb ...
Entpacken von locales (2.28-10) über (2.28-10) ...
Vormals nicht ausgewähltes Paket libpcre2-8-0:amd64 wird gewählt.
Vorbereitung zum Entpacken von .../2-libpcre2-8-0_10.32-5_amd64.deb ...
Entpacken von libpcre2-8-0:amd64 (10.32-5) ...
Vormals nicht ausgewähltes Paket libpsl5:amd64 wird gewählt.
Vorbereitung zum Entpacken von .../3-libpsl5_0.20.2-2_amd64.deb ...
Entpacken von libpsl5:amd64 (0.20.2-2) ...
Vormals nicht ausgewähltes Paket wget wird gewählt.
Vorbereitung zum Entpacken von .../4-wget_1.20.1-1.1_amd64.deb ...
Entpacken von wget (1.20.1-1.1) ...
Vormals nicht ausgewähltes Paket openssl wird gewählt.
Vorbereitung zum Entpacken von .../5-openssl_1.1.1b-2_amd64.deb ...
Entpacken von openssl (1.1.1b-2) ...
Vormals nicht ausgewähltes Paket ca-certificates wird gewählt.
Vorbereitung zum Entpacken von .../6-ca-certificates_20190110_all.deb ...
Entpacken von ca-certificates (20190110) ...
Vormals nicht ausgewähltes Paket publicsuffix wird gewählt.
Vorbereitung zum Entpacken von .../7-publicsuffix_20190415.1030-1_all.deb ...
Entpacken von publicsuffix (20190415.1030-1) ...
Vormals nicht ausgewähltes Paket sudo wird gewählt.
Vorbereitung zum Entpacken von .../8-sudo_1.8.27-1_amd64.deb ...
Entpacken von sudo (1.8.27-1) ...
systemd-sysv (241-5) wird eingerichtet ...
libpsl5:amd64 (0.20.2-2) wird eingerichtet ...
locales (2.28-10) wird eingerichtet ...
Generating locales (this might take a while)...
  de_DE.UTF-8... done
Generation complete.
sudo (1.8.27-1) wird eingerichtet ...
libpcre2-8-0:amd64 (10.32-5) wird eingerichtet ...
openssl (1.1.1b-2) wird eingerichtet ...
publicsuffix (20190415.1030-1) wird eingerichtet ...
wget (1.20.1-1.1) wird eingerichtet ...
ca-certificates (20190110) wird eingerichtet ...
Updating certificates in /etc/ssl/certs...
128 added, 0 removed; done.
Trigger für systemd (241-5) werden verarbeitet ...
Trigger für libc-bin (2.28-10) werden verarbeitet ...
Trigger für ca-certificates (20190110) werden verarbeitet ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
root@PlexMediaServer:~# wget https://raw.githubusercontent.com/Fourdee/DietPi/master/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
--2019-06-09 21:55:00--  https://raw.githubusercontent.com/Fourdee/DietPi/master/PREP_SYSTEM_FOR_DIETPI.sh
Auflösen des Hostnamens raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.12.133
Verbindungsaufbau zu raw.githubusercontent.com (raw.githubusercontent.com)|151.101.12.133|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 59715 (58K) [text/plain]
Wird in »PREP_SYSTEM_FOR_DIETPI.sh« gespeichert.

PREP_SYSTEM_FOR_DIE 100%[===================>]  58,32K  --.-KB/s    in 0,07s   

2019-06-09 21:55:01 (786 KB/s) - »PREP_SYSTEM_FOR_DIETPI.sh« gespeichert [59715/59715]

root@PlexMediaServer:~# #wget https://raw.githubusercontent.com/Fourdee/DietPi/beta/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
root@PlexMediaServer:~# #wget https://raw.githubusercontent.com/Fourdee/DietPi/dev/PREP_SYSTEM_FOR_DIETPI.sh -O PREP_SYSTEM_FOR_DIETPI.sh
root@PlexMediaServer:~# chmod +x PREP_SYSTEM_FOR_DIETPI.sh
root@PlexMediaServer:~# sudo ./PREP_SYSTEM_FOR_DIETPI.sh
OK:1 http://deb.debian.org/debian buster InRelease
OK:2 http://security.debian.org/debian-security buster/updates InRelease
Paketlisten werden gelesen... Fertig
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden NEUEN Pakete werden installiert:
  apt-transport-https
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 149 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 156 kB Plattenplatz zusätzlich benutzt.
Holen:1 http://deb.debian.org/debian buster/main amd64 apt-transport-https all 1.8.2 [149 kB]
Es wurden 149 kB in 0 s geholt (2.071 kB/s).
Vormals nicht ausgewähltes Paket apt-transport-https wird gewählt.
(Lese Datenbank ... 25409 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../apt-transport-https_1.8.2_all.deb ...
Entpacken von apt-transport-https (1.8.2) ...
apt-transport-https (1.8.2) wird eingerichtet ...
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Vorgeschlagene Pakete:
  zip
Die folgenden NEUEN Pakete werden installiert:
  unzip
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 169 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 567 kB Plattenplatz zusätzlich benutzt.
Holen:1 http://deb.debian.org/debian buster/main amd64 unzip amd64 6.0-23 [169 kB]
Es wurden 169 kB in 0 s geholt (392 kB/s).
Vormals nicht ausgewähltes Paket unzip wird gewählt.
(Lese Datenbank ... 25413 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../unzip_6.0-23_amd64.deb ...
Entpacken von unzip (6.0-23) ...
unzip (6.0-23) wird eingerichtet ...
Generating locales (this might take a while)...
  en_GB.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "de_DE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "de_DE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "de_DE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "de_DE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
./PREP_SYSTEM_FOR_DIETPI.sh: Zeile 144: Warnung: setlocale: LC_ALL: Kann die Locale nicht ändern (en_GB.UTF8).
[ INFO ] Selected Git branch: MichaIng/master
--2019-06-09 21:55:33--  https://raw.githubusercontent.com/MichaIng/DietPi/master/dietpi/func/dietpi-globals
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.112.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.112.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 70107 (68K) [text/plain]
Saving to: ‘dietpi-globals’

dietpi-globals      100%[===================>]  68.46K  --.-KB/s    in 0.03s   

2019-06-09 21:55:33 (2.35 MB/s) - ‘dietpi-globals’ saved [70107/70107]

./dietpi-globals: Zeile 174: Warnung: setlocale: LC_ALL: Kann die Locale nicht ändern (en_GB.UTF-8): Datei oder Verzeichnis nicht gefunden

[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[  OK  ] DietPi-PREP | Step 0: Detecting existing DietPi system:
[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[ INFO ] DietPi-PREP | Non-DietPi system found, skipping pre-prep

[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[  OK  ] DietPi-PREP | Step 1 Ask user about: Image info / Hardware / WiFi / Distro:
[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[ INFO ] DietPi-PREP | Entered image creator: Tom
[ INFO ] DietPi-PREP | Entered pre-image info: Debian Buster rc1
[ INFO ] DietPi-PREP | Selected hardware model ID: 21
[ INFO ] DietPi-PREP | Detected CPU architecture: x86_64 (ID: 10)
[ INFO ] DietPi-PREP | Marking WiFi as NOT required
[ INFO ] DietPi-PREP | Disabled distro downgrade to: : jessie-support
[ INFO ] DietPi-PREP | Disabled distro downgrade to: : Stretch (current stable release, recommended)
[ INFO ] DietPi-PREP | Selected Debian version: buster (ID: 5)

[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[  OK  ] DietPi-PREP | Step 2: Downloading and installing DietPi sourcecode:
[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[  OK  ] DietPi-PREP | Connection test: https://github.com/MichaIng/DietPi/archive/master.zip
[  OK  ] DietPi-PREP | Root access verified.
[  OK  ] DietPi-PREP | wget https://github.com/MichaIng/DietPi/archive/master.zip -O package.zip
[  OK  ] DietPi-PREP | Extracting DietPi sourcecode
[ INFO ] DietPi-PREP | Moving kernel and boot configuration to /boot
[  OK  ] DietPi-PREP | mv DietPi-master/dietpi.txt /boot/
[  OK  ] DietPi-PREP | mv DietPi-master/README.md /boot/dietpi-README.md
[  OK  ] DietPi-PREP | mv DietPi-master/CHANGELOG.txt /boot/dietpi-CHANGELOG.txt
[  OK  ] DietPi-PREP | Copy DietPi core files to /boot/dietpi
[  OK  ] DietPi-PREP | Copy DietPi rootfs files in place
[  OK  ] DietPi-PREP | Clean download location
[  OK  ] DietPi-PREP | Set execute permissions for DietPi scripts
[  OK  ] DietPi-PREP | systemctl daemon-reload
[  OK  ] DietPi-PREP | systemctl enable dietpi-ramdisk
[  OK  ] DietPi-PREP | mkdir -p /DietPi
[  OK  ] DietPi-PREP | mount -t tmpfs -o size=10m tmpfs /DietPi
[  OK  ] DietPi-PREP | Starting DietPi-RAMdisk

[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[  OK  ] DietPi-PREP | Step 3: APT configuration:
[ INFO ] DietPi-PREP | -----------------------------------------------------------------------------------
[ INFO ] DietPi-PREP | Setting APT sources.list: buster 5
[ .... ] DietPi-PREP | /DietPi/dietpi/func/dietpi-set_software apt-mirror defaul[  OK  ] DietPi-PREP | /DietPi/dietpi/func/dietpi-set_software apt-mirror default
[  OK  ] DietPi-PREP | mkdir -p /var/tmp/dietpi/logs
[ INFO ] DietPi-PREP | APT update, please wait...
Hit:1 https://cdn-aws.deb.debian.org/debian buster InRelease
Get:2 https://cdn-aws.deb.debian.org/debian buster-updates InRelease [46.8 kB]
Get:3 https://cdn-aws.deb.debian.org/debian-security buster/updates InRelease [39.1 kB]
Get:4 https://cdn-aws.deb.debian.org/debian buster/contrib amd64 Packages [51.1 kB]
Get:5 https://cdn-aws.deb.debian.org/debian buster/contrib Translation-en [45.0 kB]
Get:6 https://cdn-aws.deb.debian.org/debian buster/non-free amd64 Packages [88.0 kB]
Get:7 https://cdn-aws.deb.debian.org/debian buster/non-free Translation-en [88.3 kB]
Get:8 https://cdn-aws.deb.debian.org/debian-security buster/updates/main amd64 Packages [1,132 B]
Get:9 https://cdn-aws.deb.debian.org/debian-security buster/updates/main Translation-en [678 B]
Fetched 360 kB in 2s (161 kB/s)
Reading package lists...
[  OK  ] DietPi-PREP | G_AGUP
[ INFO ] DietPi-PREP | Marking all packages as auto-installed first, to allow effective autoremove afterwards
[ .... ] DietPi-PREP | apt-mark auto adduser apt apt-transport-https apt-utils b[  OK  ] DietPi-PREP | apt-mark auto adduser apt apt-transport-https apt-utils base-files base-passwd bash bsdmainutils bsdutils busybox ca-certificates console-setup coreutils cpio cron dash debconf debconf-i18n debian-archive-keyring debianutils diffutils discover dmidecode dmsetup dpkg e2fsprogs fdisk findutils gcc-8-base gdbm-l10n gpgv grep grub-common grub-efi-amd64 gzip hostname ifupdown init init-system-helpers initramfs-tools installation-report iproute2 iptables iputils-ping isc-dhcp-client isc-dhcp-common keyboard-configuration kmod laptop-detect less libacl1 libapparmor1 libapt-inst2.0 libapt-pkg5.0 libargon2-1 libattr1 libaudit-common libaudit1 libblkid1 libbsd0 libbz2-1.0 libc-bin libc6 libcap-ng0 libcap2 libcap2-bin libcom-err2 libcryptsetup12 libdb5.3 libdebconfclient0 libdevmapper1.02.1 libdns-export1104 libelf1 libestr0 libext2fs2 libfastjson4 libfdisk1 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libhogweed4 libidn11 libidn2-0 libip4tc0 libip6tc0 libiptc0 libisc-export1100 libjson-c3 libkmod2 liblocale-gettext-perl liblognorm5 liblz4-1 liblzma5 libmnl0 libmount1 libncurses6 libncursesw6 libnetfilter-conntrack3 libnettle6 libnewt0.52 libnfnetlink0 libnftnl11 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre3 libpopt0 libprocps7 libseccomp2 libselinux1 libsemanage-common libsemanage1 libsepol1 libslang2 libsmartcols1 libss2 libssl1.1 libstdc++6 libsystemd0 libtasn1-6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libtinfo6 libudev1 libunistring2 libuuid1 libxtables12 libzstd1 linux-image-amd64 locales login logrotate lsb-base mawk mount nano ncurses-base ncurses-bin netbase passwd pciutils perl-base procps readline-common rsyslog sed sensible-utils shim-signed sudo systemd systemd-sysv sysvinit-utils tar task-german task-ssh-server tasksel tasksel-data tzdata udev unzip usbutils util-linux vim-common vim-tiny wget whiptail xxd zlib1g
[ INFO ] DietPi-PREP | Disable automatic recommends/suggests install and allow them to be autoremoved:
[  OK  ] DietPi-PREP | /etc/apt/apt.conf.d/99-dietpi-norecommends
[ INFO ] DietPi-PREP | Preserve modified config files on APT update:
[  OK  ] DietPi-PREP | /etc/apt/apt.conf.d/99-dietpi-forceconf
[ INFO ] DietPi-PREP | APT installation for: debian-archive-keyring, please wait...
[  OK  ] DietPi-PREP | G_AGI debian-archive-keyring
[ INFO ] DietPi-PREP | APT installation for: linux-image-amd64 os-prober, please wait...
[  OK  ] DietPi-PREP | G_AGI linux-image-amd64 os-prober
[ INFO ] DietPi-PREP | APT installation for: grub-efi-amd64, please wait...
[  OK  ] DietPi-PREP | G_AGI grub-efi-amd64
[ INFO ] DietPi-PREP | Generating list of minimal packages, required for DietPi installation
[  OK  ] DietPi-PREP | Marking required packages as manually installed
[ INFO ] DietPi-PREP | Install verified: dbus
[ INFO ] DietPi-PREP | Not installed, ignoring: dhcpcd5
[ INFO ] DietPi-PREP | Not installed, ignoring: mountall
[ INFO ] DietPi-PREP | APT removal for: dbus , please wait...
(Reading database ... 25431 files and directories currently installed.)
Removing libpam-systemd:amd64 (241-5) ...
Removing dbus (1.12.14-1) ...
(Reading database ... 25387 files and directories currently installed.)
Purging configuration files for dbus (1.12.14-1) ...
rmdir: failed to remove '/var/run/dbus': Directory not empty
Processing triggers for systemd (241-5) ...
[  OK  ] DietPi-PREP | G_AGP dbus dhcpcd5 mountall
[ INFO ] DietPi-PREP | APT autoremove + purge, please wait...
(Reading database ... 25384 files and directories currently installed.)
Removing aspell-de (20161207-7) ...
Removing aspell (0.60.7~20110707-6) ...
Removing bsdmainutils (11.1.2+b1) ...
Removing busybox (1:1.30.1-4) ...
Removing debconf-i18n (1.5.71) ...
Removing wngerman (20161207-7) ...
Removing iswiss (20161207-7) ...
Removing discover (2.1.2-8) ...
Removing libdiscover2 (2.1.2-8) ...
Removing discover-data (2.2013.01.11) ...
Removing dmidecode (3.2-1) ...
Removing efibootmgr (15-1) ...
Removing gdbm-l10n (1.18.1-4) ...
Removing grub-efi-amd64-signed (1+2.02+dfsg1+18) ...
Removing ifupdown (0.8.35) ...
MichaIng commented 5 years ago

@tomillr Jep, known issue. It does not time out but the SSH connection simply breaks in some cases when this package is removed. Strangely that never happens on my VM installs.

However clearly requires enhancement, this will solve it: https://github.com/MichaIng/DietPi/issues/2739

What you should do to prevent the ifupdown uninstall (which is not intended): apt install resolvconf before running the script.

tomillr commented 5 years ago

What you should do to prevent the ifupdown uninstall (which is not intended): apt install resolvconf before running the script.

Quick feedback: This worked on my minimal Buster rc1 install. Thanks.

scottwilliamsinaus commented 5 years ago

Over the past few years I have tried unsuccessfully a few times to use PREP_SYSTEM to get DietPi onto a BeagleBone Black. I have tried again today using the current official Debian 9.5 2018-10-07 4GB SD IoT image from the BeagleBoard site. As it has on every other occasion, it hangs at the "Removing connman" step as below. ssh breaks then also. Any chance of finding a way forward here?

[ INFO ] DietPi-PREP | Disable automatic recommends/suggests install and allow them to be autoremoved:
[  OK  ] DietPi-PREP | /etc/apt/apt.conf.d/99-dietpi-norecommends
[ INFO ] DietPi-PREP | Preserve modified config files on APT update:
[  OK  ] DietPi-PREP | /etc/apt/apt.conf.d/99-dietpi-forceconf
[ INFO ] DietPi-PREP | APT installation for: debian-archive-keyring, please wait...
[  OK  ] DietPi-PREP | G_AGI debian-archive-keyring
[ INFO ] DietPi-PREP | APT installation for: device-tree-compiler, please wait...
[  OK  ] DietPi-PREP | G_AGI device-tree-compiler
[ INFO ] DietPi-PREP | Generating list of minimal packages, required for DietPi installation
[  OK  ] DietPi-PREP | Marking required packages as manually installed
[ INFO ] DietPi-PREP | APT installation for: resolvconf, please wait...
Preconfiguring packages ...
Selecting previously unselected package resolvconf.
(Reading database ... 38198 files and directories currently installed.)
Preparing to unpack .../resolvconf_1.79_all.deb ...
Unpacking resolvconf (1.79) ...
Processing triggers for systemd (232-25+deb9u4) ...
Setting up resolvconf (1.79) ...
Created symlink /etc/systemd/system/sysinit.target.wants/resolvconf.service → /lib/systemd/system/resolvconf.service.
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for resolvconf (1.79) ...
[  OK  ] DietPi-PREP | G_AGI resolvconf
[ INFO ] DietPi-PREP | APT removal for: dbus, please wait...
(Reading database ... 38226 files and directories currently installed.)
Removing libnss-mdns:armhf (0.10-8) ...
Removing avahi-utils (0.6.32-2) ...
Removing avahi-daemon (0.6.32-2) ...
Created symlink /run/systemd/system/avahi-daemon.service → /dev/null.
Removed /run/systemd/system/avahi-daemon.service.
Removing bluetooth (5.43-2+deb9u1) ...
Removing bluez (5.43-2+deb9u1) ...
Removing connman (1.35-1rcnee2~stretch+20170829) ...
MichaIng commented 5 years ago

@scottwilliamsinaus Hmm yeah this is a known issue if you're connected via WiFi at least and network is configured via netman or in your case connman.

As DietPi installs ifupdown for network setup, the above packages are purged. But doing so, their controlled network connections (WiFi at least) break, which breaks the installer when connected via SSH. For this reason currently DietPi-PREP only works reliable on Ethernet connections or local console.

Are you connected via WiFi indeed?


Regardless, save way currently is to install resolvconf+ifupdown manually first and configure the network (and in case WiFi via wpasupplicant) first via these: /etc/network/interfaces

auto eth0 iface eth0 inet dhcp EOF systemctl enable networking ifup -a

- Not sure if, after the above steps, purging `connman` still breaks the active network connection, in case a reboot should lead to ifupdown/networking service configuring them:

apt purge connman reboot


________
Related issue: https://github.com/MichaIng/DietPi/issues/2054
scottwilliamsinaus commented 5 years ago

I always connect via ethernet, never wifi. Will try the above.

scottwilliamsinaus commented 5 years ago

Success with the resolvconf+ifupdown process above. Purged connman, rebooted and DietPi-PREP proceeded uneventfully to completion: [ OK ] DietPi-PREP | Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi.

Now after reboot though, I have no networking to the device - it doesn't show on my router client list and no ssh. Not sure where to go now...

MichaIng commented 5 years ago

@scottwilliamsinaus Did you give it some time to finish first boot setup? Strange since it configures Ethernet+DHCP by default, which cannot really fail 🤔. In case perhaps plugoff + plugin (when no disk activity is shown via LED lights) helps.