RE: Official Debian support! - foresto - 10-29-2022
Here's where you should report the problem:
https://www.debian.org/releases/stable/i386/ch05s04#submit-bug
It's probably worth testing and reporting whether using a microsd card vs. emmc makes any difference. Some people have found that one works where the other fails on this device.
RE: Official Debian support! - varac - 08-16-2023
I was finally able to install (current) Debian bookworm on my RockPro64 !
The big missing part for me was that (a recent) uboot needed to be installed in SPI memory,
which makes subsequent Debian installations much easier since the Debian Installer doesn't install uboot by itself.
I documented the installation procedure here: https://0xacab.org/varac-projects/doc/-/blob/main/hardware/single-board-computers/pine64-nascase.md#official-debian
Hope it works for everyone else here !
RE: Official Debian support! - foresto - 08-16-2023
(08-16-2023, 01:32 AM)varac Wrote: The big missing part for me was that (a recent) uboot needed to be installed in SPI memory,
Debian's u-boot-rockchip package now supports the RockPro64 v2, too.
With that, I was able to create a fresh bootable microsd card by populating a GPT partition with the kernel, initrd, dtbs, and extlinux files, and running u-boot-install-rockchip /dev/devicename .
Note that the partition must not start before the 16MiB mark, because the space before that is where the bootloader files are written. I think it requires the bootable flag to be set, too.
https://opensource.rock-chips.com/wiki_Partitions
It's also helpful to put a script in /etc/kernel/postinst.d and /etc/kernel/postrm.d to automate copying the new .dtb file to the boot partition whenever a new kernel is installed.
debian kernel postinst/postrm script - foresto - 12-16-2023
Code: #!/bin/sh
# This script installs RockPro64 devicetree files into /boot when new kernels
# are installed, removes them when kernels are removed, and updates the
# "dtbs" and "dtbs.old" symlinks accordingly.
# It should be copied into /etc/kernel/postinst.d/ and /etc/kernel/postrm.d/
# and given execute permission.
# https://www.debian.org/doc/manuals/debian-kernel-handbook/ch-update-hooks.html
set -e
exec </dev/null >&2 # Don't use stdin or stdout
version="$1"
pkgname=${DPKG_MAINTSCRIPT_PACKAGE:-kernel package}
if [ -z "$version" ]; then
echo "W: $pkgname did not pass a version number; exiting."
exit 0
fi
eval set -- "$DEB_MAINT_PARAMS"
action="$1"
# return 0 if $1 matches any of the remaining args
among() {
val="$1"
shift
for a in "$@"; do
if [ "$val" = "$a" ]; then return 0; fi
done
return 1;
}
# update /boot/dtbs and /boot/dtbs.old
# expects $1 to be "configure" or "remove"
# expects $version to be set
# see also: linux-update-symlinks
update_symlinks() {
# build a list of dtbs-<ver> symlink targets, highest priority first...
# ...first priority is a newly installed kernel
if [ "$action" = configure ]; then
set -- "dtbs-$version"
else
set --
fi
if [ "$action" = remove ]; then
rmtarget=dtbs-$version
fi
# ...next priority is the existing primary symlink (if not being removed)
link1=/boot/dtbs
target1="$(readlink "$link1" || true)"
if [ -e "$link1" ] && ! among "$target1" "$@"; then
if [ "$target1" != "$rmtarget" ]; then
set -- "$@" "$target1"
fi
fi
# ...next priority is the existing secondary symlink (if not being removed)
link2=/boot/dtbs.old
target2="$(readlink "$link2" || true)"
if [ -e "$link2" ] && ! among "$target2" "$@"; then
if [ "$target2" != "$rmtarget" ]; then
set -- "$@" "$target2"
fi
fi
# ...finally, any other installed kernels, newest first
for v in $(linux-version list | linux-version sort --reverse); do
if [ "$action" = remove ] && [ "$v" = "$version" ]; then
continue;
fi
if ! among "dtbs-$v" "$@"; then
set -- "$@" "dtbs-$v"
fi
done
# create/replace/remove the primary and secondary symlinks
if [ $# -ge 1 ]; then
echo "I: creating symlink $link1 -> $1"
ln -sfn "$1" "$link1"
elif [ -L "$link1" ]; then
echo "I: removing $link1"
rm -f "$link1"
fi
if [ $# -ge 2 ]; then shift; fi
if [ $# -ge 1 ]; then
echo "I: creating symlink $link2 -> $1"
ln -sfn "$1" "$link2"
elif [ -L "$link2" ]; then
echo "I: removing $link2"
rm -f "$link2"
fi
if [ ! -e "$link1" ]; then
echo "W: $link1 symlink is missing; unable to find a target for it"
fi
}
srcdir=/usr/lib/linux-image-${version}/rockchip
destbase=dtbs-${version}
destdir=/boot/$destbase/rockchip
fname=rk3399-rockpro64-v2.dtb
if [ "$action" = configure ]; then
if [ -f "$srcdir/$fname" ]; then
echo "I: installing $destdir/$fname"
mkdir -p "$destdir"
cp "$srcdir/$fname" "$destdir/$fname"
else
echo "W: $pkgname doesn't contain $srcdir/$fname; making symlink anyway"
fi
update_symlinks "$action"
fi
if [ "$action" = remove ]; then
update_symlinks "$action"
if [ -f "$destdir/$fname" ]; then
echo "I: removing $destdir/$fname"
rm "$destdir/$fname"
rmdir "$destdir" || true
rmdir "/boot/$destbase" || true
fi
fi
RE: Official Debian support! - grobbs - 03-15-2024
I was trying this out today and it seems to work well.
One question: how can I change the resolution? I am guessing that has to be done at boot but I can't find anything in /boot to configure.
RE: debian kernel postinst/postrm script - foresto - 05-13-2024
(12-16-2023, 03:00 PM)foresto Wrote: [code]#!/bin/sh
# This script installs RockPro64 devicetree files into /boot when new kernels
# are installed, removes them when kernels are removed, and updates the
# "dtbs" and "dtbs.old" symlinks accordingly.
# It should be copied into /etc/kernel/postinst.d/ and /etc/kernel/postrm.d/
# and given execute permission.
I have edited that post to contain the latest version of the script. It is now smart enough to create a new /boot/dtbs.old symlink when a kernel is removed and the existing dtbs.old becomes dtbs. (It uses the same logic as used for the other symlinks in /boot.)
|