hardware:raspberry_pi:dietpi:dietpi-imager

DietPi での配布イメージの作成 (DietPi-Imager)

$ sudo bash -c "$(curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-imager)"

[  OK  ] DietPi-Imager | cd /home/dietpi
[ INFO ] DietPi-Imager | Checking for required APT packages: parted fdisk zerofree p7zip
[ INFO ] DietPi-Imager | APT update, please wait...
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Hit:2 https://archive.raspberrypi.org/debian bullseye InRelease
Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB]
Get:4 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Contents (deb) [41.1 MB]
Fetched 54.3 MB in 2min 26s (373 kB/s)
Reading package lists...
[  OK  ] DietPi-Imager | APT update
[ INFO ] DietPi-Imager | APT install for: zerofree, please wait...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  zerofree
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
Need to get 8916 B of archives.
After this operation, 25.6 kB of additional disk space will be used.
Get:1 http://ftp.udx.icscoe.jp/Linux/raspbian/raspbian bullseye/main armhf zerofree armhf 1.1.1-1 [8916 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 8916 B in 1s (6362 B/s)
                               Selecting previously unselected package zerofree.
(Reading database ... 71135 files and directories currently installed.)
Preparing to unpack .../zerofree_1.1.1-1_armhf.deb ...
Unpacking zerofree (1.1.1-1) ...
Setting up zerofree (1.1.1-1) ...
[  OK  ] DietPi-Imager | APT install for: zerofree


RPi Zero W (armv6l) | IP: 192.168.1.203












┌──────────────────────────────────────────────────┤ DietPi-Imager ├───────────────────────────────────────────────────┐ │ Please select how the input OS is stored: │ │ │ │ Drive : The OS is stored on an attached drive. │ │ Image : The OS is stored as an image file. │ │ │ │ │ │ <Ok> <Cancel> │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

起動用 SD をセッティングする時残る痕跡を調べる🤤
※機密情報が含まれる可能性があるものを整理してみます🤔

DietPi 公式起動イメージの初期設定(未起動)

/etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/
 
# Drop-in configs
source interfaces.d/*
 
# Ethernet
#allow-hotplug eth0
iface eth0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 9.9.9.9 149.112.112.112
 
# WiFi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 9.9.9.9 149.112.112.112
wireless-power off
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
/etc/wpa_supplicant/wpa_supplicant.conf
# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1

dietpi-firstboot.service を有効化する🤤

$ sudo systemctl enable dietpi-firstboot.service

Created symlink /etc/systemd/system/multi-user.target.wants/dietpi-firstboot.service → /etc/systemd/system/dietpi-firstboot.service.

この時、/boot/dietpi-wifi.txt のパスワードが暗号化処理されて /var/lib/dietpi/dietpi-wifi.db が生成されるので dietpi-wifi.txt を用意しておく😉
※dietpi-wifi.txt は初回起動で処理されたら削除されて消える🤔

/boot/dietpi-wifi.txt
#---------------------------------------------------------------
# Entry 0
# - WiFi SSID: required, case sensitive
aWIFI_SSID[0]=''
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[0]=''
# - Key type: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[0]='WPA-PSK'
# - WPA-EAP options: Only fill if WPA-EAP is set above
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]=''
# - Path to the certificate file, e.g.: /boot/mycert.cer
aWIFI_CERT[0]=''
#---------------------------------------------------------------
# Entry 1
# - WiFi SSID: required, case sensitive
aWIFI_SSID[1]=''
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[1]=''
# - Key type: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[1]='WPA-PSK'
# - WPA-EAP options: Only fill if WPA-EAP is set above
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]=''
# - Path to the certificate file, e.g.: /boot/mycert.cer
aWIFI_CERT[1]=''
#---------------------------------------------------------------
# Entry 2
# - WiFi SSID: required, case sensitive
aWIFI_SSID[2]=''
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[2]=''
# - Key type: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[2]='WPA-PSK'
# - WPA-EAP options: Only fill if WPA-EAP is set above
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]=''
# - Path to the certificate file, e.g.: /boot/mycert.cer
aWIFI_CERT[2]=''
#---------------------------------------------------------------
# Entry 3
# - WiFi SSID: required, case sensitive
aWIFI_SSID[3]=''
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[3]=''
# - Key type: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[3]='WPA-PSK'
# - WPA-EAP options: Only fill if WPA-EAP is set above
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]=''
# - Path to the certificate file, e.g.: /boot/mycert.cer
aWIFI_CERT[3]=''
#---------------------------------------------------------------
# Entry 4
# - WiFi SSID: required, case sensitive
aWIFI_SSID[4]=''
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[4]=''
# - Key type: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[4]='WPA-PSK'
# - WPA-EAP options: Only fill if WPA-EAP is set above
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]=''
# - Path to the certificate file, e.g.: /boot/mycert.cer
aWIFI_CERT[4]=''

初回起動の場合は dietpi-wifi.db は存在しなくて良い🤔

$ sudo rm /var/lib/dietpi/dietpi-wifi.db

  • hardware/raspberry_pi/dietpi/dietpi-imager.txt
  • 最終更新: 2022/08/03 18:04
  • by ともやん