Skip to content

How to create a DietPi image for x86_64 PCs (UEFI)

Bastian Pätzold edited this page Jun 5, 2022 · 5 revisions

Download base image

Flash and boot

  • Flash the image onto a USB flash drive, using e.g. Rufus or Etcher.
  • Plug the USB flash drive into the target system and boot from it.

Debian installer

  • Advanced options > Expert install
  • When the installer menu shows up, unplug the USB flash drive and in case any other external drive. This is required to allow the installer detecting the main internal drive as SCSI1/sda.
  • Choose language
    • Language: English - English
    • Country, territory or area: United Kingdom
    • Country to base default locale settings on: United Kingdom - en_GB.UTF-8
    • Additional locales: select NO additional locales > Continue
  • Configure the keyboard
    • British English
  • Detect network hardware
    • In case: Deselect any Modules to load as we don't require them.
  • Configure the network
    • In case select correct network adapter and enter WiFi credentials
    • Auto-configure networking: Yes
    • Waiting time for link detection: 3 (default)
    • Hostname: DietPi
    • Domain name: <leave empty>
  • Choose a mirror of the Debian archive
    • Protocol for file downloads: http
    • Debian archive mirror country: just use your country or use United Kingdom. It will be overwritten anyway by DietPi-PREP, as actually most other settings as well 😉.
    • Debian archive mirror: just use one near to your location or deb.debian.org. It will be overwritten anyway by DietPi-PREP, as actually most other settings as well 😉.
    • HTTP proxy information: in case select your proxy server or leave it empty if there is no proxy server.
    • Debian version to install: bullseye - stable
  • Download installer components
    • deselect everything > Continue
  • Set up users and passwords
    • Enable shadow passwords? Yes
    • Allow login as root? Yes
    • Root password: dietpi > Continue
    • Create a normal user account now? No
  • Configure the clock
    • Set the clock using NTP? Yes
    • NTP server to use: leave default mirror 0.debian.pool.ntp.org > Continue
    • Select your time zone: UTC
  • Detect disks
    • In case: Deselect any Modules to load > Continue
  • Partition disks
    • Partition method: Manual
    • Select the main drive (SCSI1/sda)
      • Create new empty partition table on this device?: Yes
      • Partition table type: gpt
    • Select FREE SPACE below the drive
      • Create a new partition
      • New partition size: 100 MB > Continue
      • Location for the new partition: Beginning
      • Partition settings:
        • Use as: EFI System Partition
        • Done setting up the partition
    • Select FREE SPACE below the EFI partition
      • Create a new partition
      • New partition size: 1.5 GB (should be sufficient for Debian + DietPi installs) > Continue
      • Location for the new partition: Beginning
      • Partition settings:
        • Use as: Ext4 journaling file system
        • Mount point: /
        • Done setting up the partition
    • Finish partitioning and write changes to disk
      • Do you want to return to the partitioning menu?: No
      • Write the changes to disks?: Yes
  • Install the base system
    • Kernel to install: linux-image-amd64
    • Drivers to include in the initrd: generic to be most compatible.
  • Configure the package manager
    • Use non-free software?: No
    • Use contrib software?: No
    • Enable source repositories in APT? No
    • Services to use: select security updates and release updates and backported software, however it will be added by DietPi-PREP anyway. > Continue.
  • Select and install software
    • Updates management on this system: No automatic updates
    • Participate in the package usage survey?: No (user should decide this oneself later)
    • Deselect all additional software > Continue
  • Install the GRUB boot loader on a hard disk
    • Force GRUB installation to the EFI removable media path?: Yes
      • This is the default location for EFI boot files /efi/boot/bootx64.efi. Most systems don't require the bootloader there, as they are able to scan other directories for EFI boot files as well, but some do, e.g. VirtualBox VM. Since we create a full disk image here, including a fresh ESP (EFI System Partition), it makes sense to create a copy of the bootloader on this default path to assure best compatibility. This is not done by default, to avoid overwriting the default boot loader of other operating systems, installed on the same drive, which is not the case here.
  • Finish the installation
    • Is the system clock set to UTC? Yes
    • Installation complete: Continue

DietPi-PREP

Image file creation and packaging

  • Either plug the drive into another DietPi system or boot DietPi from another USB drive.
  • Run DietPi-Imager
    bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-imager')"

Packing Image with CloneZilla installer

... ToDo