Skip to content

Commit

Permalink
v8.23
Browse files Browse the repository at this point in the history
- RISC-V | Migrate from Debian ports to regular Debian Sid repository, which now supports RISC-V
  • Loading branch information
MichaIng committed Sep 26, 2023
1 parent 925d4ba commit a5796c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
6 changes: 2 additions & 4 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ case $HW_ARCH in
2) iarch='ARMv7' parch='armhf';;
3) iarch='ARMv8' parch='arm64';;
10) iarch='x86_64' parch='amd64';;
11) iarch='RISC-V' parch='riscv64' DISTRO=8 repo='https://deb.debian.org/debian-ports/' keyring='/usr/share/keyrings/debian-ports-archive-keyring.gpg';; # RISC-V architecture is available on Debian ports only
11) iarch='RISC-V' parch='riscv64' DISTRO=8;; # RISC-V architecture is available on Sid only, but internally DietPi handles it as Trixie
*) G_DIETPI-NOTIFY 1 "Invalid architecture \"$HW_ARCH\" passed, aborting..."; exit 1;;
esac

Expand All @@ -157,7 +157,7 @@ case $DISTRO in
7|8)
exclude=',gcc-8-base,gcc-9-base,gcc-10-base,gcc-11-base'
[[ $DISTRO == 7 ]] && distro='bookworm' || distro='trixie' exclude+=',gcc-12-base'
[[ $HW_ARCH == 11 ]] && distro='sid' # RISC-V architecture is available on Debian Sid/unstable only
[[ $HW_ARCH == 11 ]] && distro='sid' # RISC-V architecture is available on Sid only
# Raise root size where required
case $HW_MODEL in
1[256]|54|61|7[4569]) ((root_size+=128));;
Expand Down Expand Up @@ -220,7 +220,6 @@ if [[ ! -f $keyring ]]
then
case $keyring in
*'raspbian'*) url='https://archive.raspbian.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb';;
*'debian-ports'*) url='https://deb.debian.org/debian/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2023.02.01~deb11u1_all.deb';;
*) url='https://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.4_all.deb';;
esac
G_EXEC curl -sSf "$url" -o /tmp/keyring.deb
Expand Down Expand Up @@ -401,7 +400,6 @@ G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/lib/apt/lists
G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/log
packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gnupg,htop,iputils-ping,locales,nano,p7zip,parted,procps,psmisc,sudo,systemd-sysv,tzdata,udev,unzip,wget,whiptail,'
[[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils'
[[ $HW_ARCH == 11 ]] && packages+=',debian-ports-archive-keyring'
G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat /dev/shm/rootfs/debootstrap/debootstrap.log; }
G_EXEC_OUTPUT=1 G_EXEC debootstrap --variant=minbase --exclude="gcc-7-base$exclude" --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo"
G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log
Expand Down
3 changes: 0 additions & 3 deletions .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -1342,9 +1342,6 @@ _EOF_
unset -v apackages
fi

# RISC-V: Install Debian ports repository key
(( $G_HW_ARCH == 11 )) && aPACKAGES_REQUIRED_INSTALL+=('debian-ports-archive-keyring')

# WiFi and firmware packages: Usually no firmware should be necessary for VMs. If user manually passes though some USB device, user might need to install the firmware then.
if (( $G_HW_MODEL != 20 && $G_HW_MODEL != 75 ))
then
Expand Down
9 changes: 9 additions & 0 deletions .update/pre-patches
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,14 @@ _EOF_
fi
fi

# v8.23
if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 22 ) ))
then
# RISC-V: Migrate from Debian ports to regular Debian Sid
G_DIETPI-NOTIFY 2 'Migrating from Debian ports to regular Debian Sid repository, which now supports RISC-V'
G_EXEC eval 'echo '\''deb https://deb.debian.org/debian/ sid main contrib non-free non-free-firmware'\'' > /etc/apt/sources.list'
dpkg-query -s 'debian-ports-archive-keyring' &> /dev/null && G_EXEC apt-mark auto debian-ports-archive-keyring
fi

exit 0
}
5 changes: 2 additions & 3 deletions dietpi/func/dietpi-set_software
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root|<empty> Whether to disable SSH
local rpi_distro=${G_DISTRO_NAME/trixie/bookworm}
(( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) && G_EXEC eval "echo 'deb https://archive.raspberrypi.org/debian/ ${rpi_distro/bookworm/bullseye} main' > /etc/apt/sources.list.d/raspi.list"

# RISC-V: Provided via Debian ports and Sid only
# RISC-V: Provided via Sid only
if (( $G_HW_ARCH == 11 ))
then
G_EXEC eval 'echo '\''deb https://deb.debian.org/debian-ports/ sid main contrib non-free non-free-firmware
deb https://deb.debian.org/debian-ports/ unreleased main contrib non-free non-free-firmware'\'' > /etc/apt/sources.list'
G_EXEC eval 'echo '\''deb https://deb.debian.org/debian/ sid main contrib non-free non-free-firmware'\'' > /etc/apt/sources.list'

# Raspbian
elif (( $G_RASPBIAN ))
Expand Down

0 comments on commit a5796c5

Please sign in to comment.