Skip to content

Commit

Permalink
v9.1
Browse files Browse the repository at this point in the history
- DietPi-Installer | When installing a package via "dpkg -i", add it to the aPACKAGES_REQUIRED_INSTALL array as well, to assure it is marked as manually installed. Otherwise, if the package was installed previously and marked as "auto", it will remain marked as "auto" and hence autoremoved later: MichaIng#6594 (comment)
  • Loading branch information
MichaIng committed Jan 22, 2024
1 parent c46ebc9 commit ee76776
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,8 @@ setenv rootuuid "true"' /boot/boot.cmd
# (Re)create DietPi runtime and logs dir, used by G_AGx
G_EXEC mkdir -p /run/dietpi /var/tmp/dietpi/logs

aPACKAGES_REQUIRED_INSTALL=()

# RPi/ARMv6 container
if [[ -f '/etc/apt/sources.list.d/raspi.list' ]]
then
Expand All @@ -784,6 +786,7 @@ setenv rootuuid "true"' /boot/boot.cmd
G_EXEC curl -sSf 'https://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb
G_EXEC dpkg -i keyring.deb
G_EXEC rm keyring.deb
aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-archive-keyring')
fi

if (( $DISTRO_TARGET > 7 ))
Expand All @@ -810,7 +813,7 @@ _EOF_
unset -v apackages

# DietPi list of minimal required packages, which must be installed:
aPACKAGES_REQUIRED_INSTALL=(
aPACKAGES_REQUIRED_INSTALL+=(

'apt' # Debian package manager
'bash-completion' # Auto completes a wide list of bash commands and options via <tab>
Expand Down Expand Up @@ -1063,6 +1066,7 @@ _EOF_
G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb"
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
aPACKAGES_REQUIRED_INSTALL+=("linux-u-boot-$model-$branch")
fi

# Odroid C1: https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818
Expand Down Expand Up @@ -1203,27 +1207,31 @@ _EOF_
G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/firmware-$variant.deb"
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
aPACKAGES_REQUIRED_INSTALL+=("firmware-$variant")

# NanoPi R5S/R5C
elif (( $G_HW_MODEL == 76 )) && { [[ ! $(find /lib/modules -mindepth 1 -maxdepth 1 -type d) ]] || dpkg-query -s 'firmware-nanopi5' &> /dev/null; }
then
G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-nanopi5.deb'
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
aPACKAGES_REQUIRED_INSTALL+=('firmware-nanopi5')

# NanoPi 6
elif (( $G_HW_MODEL == 79 )) && { [[ ! $(find /lib/modules -mindepth 1 -maxdepth 1 -type d) ]] || dpkg-query -s 'firmware-nanopi6' &> /dev/null; }
then
G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-nanopi6.deb'
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
aPACKAGES_REQUIRED_INSTALL+=('firmware-nanopi6')

# NanoPi M2/T2/Fire2 Linux 4.4: Requires dedicated boot partition, starting at 4 MiB for U-Boot, with ext4 filesystem
elif [[ $G_HW_MODEL == 61 && $(findmnt -Ufnro FSTYPE -M /boot) == 'ext4' ]] && (( $(sfdisk -qlo Start "$BOOT_DEVICE" | mawk 'NR==2') >= 8192 ))
then
G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-nanopi2.deb'
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
aPACKAGES_REQUIRED_INSTALL+=('firmware-nanopi2')

# VisionFive 2
elif (( $G_HW_MODEL == 81 ))
Expand All @@ -1237,7 +1245,7 @@ _EOF_
G_EXEC rm package.deb
G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf
aPACKAGES_REQUIRED_INSTALL+=('libubootenv-tool')
aPACKAGES_REQUIRED_INSTALL+=('linux-image-visionfive2' 'libubootenv-tool')

# Star64
elif (( $G_HW_MODEL == 84 ))
Expand All @@ -1251,7 +1259,7 @@ _EOF_
G_EXEC rm package.deb
G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf
aPACKAGES_REQUIRED_INSTALL+=('libubootenv-tool')
aPACKAGES_REQUIRED_INSTALL+=('linux-image-star64' 'libubootenv-tool')

# Orange Pi Zero 3
elif (( $G_HW_MODEL == 83 ))
Expand All @@ -1269,6 +1277,7 @@ _EOF_
G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb "https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next$variant.deb"
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb package3.deb
G_EXEC rm package1.deb package2.deb package3.deb
aPACKAGES_REQUIRED_INSTALL+=('linux-image-next-sun50iw9' 'linux-dtb-next-sun50iw9' 'linux-u-boot-orangepizero3-next')

# Flash U-Boot
# shellcheck disable=SC1091
Expand Down Expand Up @@ -1311,6 +1320,7 @@ fi\
[[ -f '/boot/uenv.txt' ]] && G_EXEC rm /boot/uenv.txt
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
aPACKAGES_REQUIRED_INSTALL+=('firmware-sparkysbc')

G_EXEC curl -sSfo u-boot.gz 'https://dietpi.com/downloads/binaries/u-boot-sparkysbc.img.gz'
G_EXEC gzip -d u-boot.gz
Expand Down

0 comments on commit ee76776

Please sign in to comment.