XPS 9300

Info

Remove BitLocker

Shrink the Windows partition

Remove RAID

BIOS settings

Create bootable USB stick

Setup partitions

Setup full-disk encryption

Formatting

mkfs.vfat -F 32 -n BOOT /dev/nvme0n1p7
mkswap -L SWAP /dev/nvme0n1p8
cryptsetup luksFormat /dev/nvme0n1p9
cryptsetup luksOpen /dev/nvme0n1p9 root
mkfs.ext4 -L ROOT /dev/mapper/root

Mounting existing installation from rescue USB

cryptsetup luksOpen /dev/nvme0n1p9 root
mkdir /mnt/gentoo
mount /dev/mapper/root /mnt/gentoo
cp --dereference /etc/resolv.conf /mnt/gentoo/etc/
mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) ${PS1}"
mount /dev/nvme0n1p7 /boot
 

Copy existing installation

rsync is a very nice tool to copy a filesystem from one system to another.

On destination system

cryptsetup luksOpen /dev/nvme0n1p9 root
mkdir /mnt/gentoo
mount /dev/mapper/root /mnt/gentoo

mkdir /mnt/gentoo/boot
mount /dev/nvme0n1p7 /mnt/gentoo/boot 

On source system

export REMOTE_IP=<ip of remote system>
mkdir /mnt/ROOT

mkdir /mnt/BOOT
mount --bind / /mnt/ROOT
mount --bind /boot /mnt/BOOT
rsync --rsh=ssh --archive --hard-links --sparse --xattrs --acls --numeric-ids --info=progress2 /mnt/BOOT/ root@$REMOTE_IP:/mnt/gentoo/boot
rsync --rsh=ssh --archive --hard-links --sparse --xattrs --acls --numeric-ids --info=progress2 /mnt/ROOT/ root@$REMOTE_IP:/mnt/gentoo

Configure boot partition

Find uuid of partition: ls -la /dev/disk/by-uuid/ | grep nvme0n1p9

Edit the rEFInd setup: vi /mnt/boot/EFI/BOOT/refind.conf

Devices

WD19TB Dock

Workaround for blank screens problem (thanks to Mark Blakeney): Add this as a kernel parameter i915.enable_dp_mst=0

It is not really a nice workaround because the effect is that the multi-display support of the dock is disabled. If you still want to use three displays you can use the daisy-chain port on the dock and the other TB port on the laptop. Both can be connected to TB-to-DP adapters and so adding the two extra displays besides the port in the dock.

Audio

There are two audio outputs on the dock and somehow the rear one is not detected automatically. In my case I could see the devices with 'aplay -l' but I could not select it in the mixer. Adding "load-module module-alsa-sink device=hw:0,1" to "/etc/pulse/default.pa" fixed that for me.

Some commands for debugging (run as normal user):

lsusb -d 0bda:402e -v
aplay -l
cat /dev/urandom | aplay -Dhw:<card>,<device> -f S24_3LE -c 2
pacmd list-sinks
speaker-test
pactl list
killall pulseaudio