Updating rock64 dietpi.txt file inside .img archive before first boot

Hi there,

I have a diet pi install on a rock64 running a music server but I often get corrupted sd cards which force me to reinstall on a fresh card. Is there a way for me to update the dietpi.txt file inside the rock64 dietpi img file so that I can just do a fresh boot directly into the desired setup? If not, can I simply clone the SD card from my properly setup system to create a custom img file?

Lastly, is there an specific dietpi tool to migrate the boot drive to something other than the SD card, like a more reliable USB?

Theoretically using another Linux box should enable you to access the dietpi.txt on the SD card. Or you try to open the img file using an archive tool like 7zip.

Of course you could create your own image from an existing installation. However this would require as well a different Linux box to be able to run our own image tool. This will generate a compressed DietPi image via the dietpi-imager script.

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

Regarding the USB boot, something I’m not able to answer as I don’t have a rock64. I guess you should be able to search the web if and how USB boot could be used on a rock64.

This helped me running Dietpi from USB. Getting started - PINE64

For reference: I followed the info in link above and it worked as expected. It takes a few seconds to begin the boot sequence (i’m guessing it is because the USB boot is the last fallback) but it works perfect in the USB 2 ports. I haven’t gotten it to work in the USB 3 port but it’s already way better with USB 2 than with the SD card.

Thanks. From what I understand, this should creates a bootable clone img file from my working install so I can use balena or dd to image any drive I may need to and get the exact same environment. Correct? If so, this is perfect.

A related question: does dietpi-backup restore the exact file system, with all custom apt installs and modifications? If so, I should just be able to install the base diet pi image, run a restore on a previous backup and get the exact same setup, even the non standard diet pi modifications I may have made. Correct?

yes dietpi-imager will create a 1:1 clone from an existing installation.

yes dietpi-backup will backup your entire system and all components installed. The only thing excluded are USB drives mounted to /mnt/something. There is as well a possibility to restore a backup during first initial boot already. This would require dietpi.txt to be adjusted beforehand

# Restore a DietPi-Backup on first boot: 0 => disable | 1 => interactive restore (show list of found backups) | 2 => non-interactive restore (restore first found backup)
# - Simply attach the drive/disk/stick with contains the backup. All attached drives will be mounted temporarily and searched automatically.
AUTO_SETUP_BACKUP_RESTORE=0

Quick question. What should these variables correspond to?

[FAILED] You must export or pass G_GITOWNER and G_GITBRANCH to the script

available in dietpi.txt

#------------------------------------------------------------------------------------------------------
##### Dev settings #####
#------------------------------------------------------------------------------------------------------
DEV_GITBRANCH=master
DEV_GITOWNER=MichaIng
apt install linux-dtb-current-rockchip64=21.08.2 linux-image-current-rockchip64=21.08.2
apt-mark hold linux-dtb-current-rockchip64 linux-image-current-rockchip64

After the kernel downgrade USB3 works again.