User Tools

Site Tools


hardwarerelated:nintendo_switch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hardwarerelated:nintendo_switch [2019/08/31 10:50]
chris [Generic hints]
hardwarerelated:nintendo_switch [2020/06/24 14:17] (current)
chris [Fedora/switch FAQ]
Line 1: Line 1:
 ===== What is here? ===== ===== What is here? =====
-Some notes regarding running Linux on the Nintendo Switch. First things first, thanks [[https://github.com/fail0verflow/shofel2|fail0verflow]]. I did just play a bit on the software side, but fail0verflow was one of the 2 groups who found the way to run Linux, and established all the chain to make this possible, including providing the patched Linux kernel. You guys rock!+Some notes regarding running Linux on the Nintendo Switch. First things first, thanks [[https://github.com/fail0verflow/shofel2|fail0verflow]]. I did just play a bit on the software side, but fail0verflow was one of the 2 groups who found the way to run Linux, and established all the chain to make this possible, including providing the patched Linux kernel. After the initial release, most contributions/enhancements come from the [[https://twitter.com/switchroot_org|switchroot project]]. You guys rock!
  
 {{https://fluxcoil.net/files/tmp/20190707_124709_nintendo_switchc.jpg?600x400 }} {{https://fluxcoil.net/files/tmp/20190707_124709_nintendo_switchc.jpg?600x400 }}
  
 ===== Links ===== ===== Links =====
 +  * https://ismyswitchpatched.com/ -- find out if your switch is patched, or if you can install Linux!
   * https://www.reddit.com/r/SwitchHaxing/ -- reddit switch news   * https://www.reddit.com/r/SwitchHaxing/ -- reddit switch news
-  * [[https://media.ccc.de/v/c4.openchaos.2018.06.glitching-the-switch|"glitching the switch" from Andreas Galauner]]+  * [[https://media.ccc.de/v/c4.openchaos.2018.06.glitching-the-switch|Presentation "glitching the switch" from Andreas Galauner]]
   * [[https://fluxcoil.net/software/switch/fedora|My older linux@switch notes]]   * [[https://fluxcoil.net/software/switch/fedora|My older linux@switch notes]]
-  * [[https://fluxcoil.net/software/switch/debian|notes on Debian@switch]] +  * [[https://fluxcoil.net/software/switch/debian|Notes on Debian@switch]] 
-  * [[https://www.youtube.com/watch?v=tmGImw8cs0o|cuda on switch?]] +  * [[https://www.youtube.com/watch?v=tmGImw8cs0o|Cuda on switch?]] 
-  * [[https://www.youtube.com/watch?v=_kXtIWThE2A|L4T installation video (uses Windows as base, not Linux)]] +  * Darkglider/bell07 [[https://gitlab.com/bell07/gentoo-switch_overlay|Gentoo switch overlays]]
-  * [[https://forum.xda-developers.com/nintendo-switch/nintendo-switch-news-guides-discussion--development/rom-switchroot-lineageos-15-1-t3951389|Android@switch is now also available]], thanks to https://twitter.com/switchroot_org +
-  * Gentoo/switch links [[https://github.com/bell07/gentoo-switch_overlay|bell07 overlay]] [[https://github.com/GavinDarkglider/gentoo-switch_overlay|Darkglider overlay]]+
   * [[/hardwarerelated/raspberry_pi_4#benchmark_results|CPU/memory performance of Raspberry pi 4, Nintendo switch and a Thinkpad L480]]   * [[/hardwarerelated/raspberry_pi_4#benchmark_results|CPU/memory performance of Raspberry pi 4, Nintendo switch and a Thinkpad L480]]
-===== hardware =====+ 
 +===== Nintendo Switch Hardware Specs =====
   * cpu:   * cpu:
     * Nvidia Tegra X1, model T210: 4x Cortex-A57, 4x Cortex-A53 (big.LITTLE approach, but Linux kernel 4.16 is just presenting the 4 A57 cores)     * Nvidia Tegra X1, model T210: 4x Cortex-A57, 4x Cortex-A53 (big.LITTLE approach, but Linux kernel 4.16 is just presenting the 4 A57 cores)
-    * **note:** several variants of the switch are around, newer ones do not allow to run unsigned code from the RCM. The serial number can be used to check this. [[https://www.eurogamer.net/articles/digitalfoundry-2019-switch-new-tegra-x1-silicon-comes-into-focus|Cpu variant details]]+    * **note:** several variants of the switch are around, newer ones do not allow to run unsigned code from the RCM. The serial number can be used to check this. [[https://www.eurogamer.net/articles/digitalfoundry-2019-switch-new-tegra-x1-silicon-comes-into-focus|CPU variant details]]
     * Nvidia Maxwell GPU     * Nvidia Maxwell GPU
     * 4GB LPDDR4 RAM     * 4GB LPDDR4 RAM
Line 29: Line 29:
     * charging from linux works     * charging from linux works
  
-===== Todo ===== +===== Graphical Demos/Games =====
-The Fedora30/switch build does most of what I need now. Just these things might be interesting to look into: +
-  * 3D is not running properly in all details: supertuxkart do not run, and firefox plays no webgl. [[/software/switch/fedora#fedora_30_mesa_rebuild_attempts_xorg_3d_support|Investigation details.]] +
-  * Research CUDA support. Would be awesome to utilize the tegra cores for image manipulation. Is CUDA here pure graphic, or AI style computing? The switch might be a nice platform for playing with AI code then! The switch Tegra has double the power of the Nvidia Jetson nano board. [[https://elinux.org/Jetson/Installing_CUDA|link1]] [[https://developer.nvidia.com/embedded/develop/software|link2]] [[https://developer.nvidia.com/embedded/jetpack|link3]] +
- +
-===== Graphical demos/games =====+
 What are people actually using the Nintendo switch/Linux setups for? Some use it like a workstation on HDMI output, with the option of undocking and using it on the road. Of course, databases, libreoffice and so on work. Some more graphical ideas to try out: What are people actually using the Nintendo switch/Linux setups for? Some use it like a workstation on HDMI output, with the option of undocking and using it on the road. Of course, databases, libreoffice and so on work. Some more graphical ideas to try out:
  
Line 57: Line 52:
   * Karaoke applications like [[https://usdx.eu/|UltraStar Deluxe]]   * Karaoke applications like [[https://usdx.eu/|UltraStar Deluxe]]
  
-===== What works (not)? ===== +===== What Linux flavour works (not)? =====
-  * For a start, setting up Lakka/switch (a distro intended to run emulators) or the L4T Ubuntu is best for most people. These provide most features, for example audio support via the switch speakers. They can also run sshd, you can connect to wlan and look around. +
-  * With more work you can also bootstrap Fedora30, details are here in the wiki. I have not published complete images for Fedora30.+
  
-^distro           ^wlan ^xorg plain^xorg accelerated^audio^ +^distro                                                             ^wlan ^xorg plain^xorg accelerated^audio^cuda
-|[[https://lakka-switch.github.io/documentation/|Lakka/switch]]     |yes  | yes  | yes | yes | +|[[https://lakka-switch.github.io/documentation/|Lakka/switch]]     |yes  | yes  | yes | yes | no 
-|[[https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/|L4T ubuntu]] |yes  | yes  | yes | yes| +|[[https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/|L4T Ubuntu]] |yes  | yes  | yes | yes| yes| 
-|[[/hardwarerelated/nintendo_switch#installing_fedora|Fedora28/29/30]]|yes  | yes  | yes| yes | +|[[/hardwarerelated/nintendo_switch#installing_fedora_32|Fedora 28/29/30/31/32]]|yes  | yes  | yes| yes | no 
-|[[https://gbatemp.net/threads/quick-tuto-how-to-boot-linux-on-your-switch.501918/|Arch Linux image]]|yes|yes|yes|no| +|[[https://forum.xda-developers.com/nintendo-switch/nintendo-switch-news-guides-discussion--development/rom-switchroot-lineageos-15-1-t3951389|Android 8.1/LineageOS 15.1]] |yes | n/ n/| yes | no |
-|[[https://github.com/cmsj/nintendo-switch-ubuntu-builder|Ubuntu 18.04]]|yes  yes  | yes|no | +
-|[[/software/switch/debian|Debian sid]]       |yes  yes  | no |no | +
-|[[/software/switch/opensuse|openSUSE Tumbleweed]]|yes| yes  | no |no | +
- +
- +
-**Note:** There have been reports of hardware being sold after July 2018, where unsigned payloads via USB can no longer be supplied, this prevents running own code like Linux on these models.+
  
 +  * For a start, setting up Lakka/switch (a distro intended to run emulators) or the L4T Ubuntu is best for most people. These provide most features, for example audio support via the switch speakers. They can also run sshd, you can connect to wlan and look around.
 +  * With more work you can also bootstrap Fedora32, details are here in the wiki.
 +  * Other distros/projects: [[/software/switch/debian|Debian sid (2019)]], [[/software/switch/opensuse|openSUSE Tumbleweed (2019)]], [[https://github.com/cmsj/nintendo-switch-ubuntu-builder|Ubuntu 18.04 (2018)]], [[https://gbatemp.net/threads/quick-tuto-how-to-boot-linux-on-your-switch.501918/|Arch Linux (2018)]]
 +  * **Note:** Newer Nintendo switch can not be brought into RCM, so unsigned payloads via USB can no longer be supplied, this prevents running own code like Linux on these models.
  
 ===== Boot order for Linux@switch ===== ===== Boot order for Linux@switch =====
-  - As first step, the switch needs to be booted into RCM, an early debug mode. For doing this for the first time, pins on the switch need to be crossed, for example using this [[https://github.com/fail0verflow/shofel2/tree/master/rcm-jig|RCM jig device]].  When this succeeded one time, you can use Hekate to set 'autorcm', the switch will then after resets always enter RCM instead of booting Nintendos Horizon. +  - As first step, the switch needs to be booted into RCM, an early debug mode. For doing this for the first time, pins on the switch need to be crossed, for example using this [[https://github.com/fail0verflow/shofel2/tree/master/rcm-jig|RCM jig device]].  You can create a Jig yourself, or buy them online. When booting to RCM succeeded, you can use Hekate to set 'autorcm', the switch will then after resets automatically enter RCM instead of booting Nintendos Horizon. 
-  - With the switch being in RCM, it will do nothing, the screen will be black. At this state, payload code to be run needs to be supplied via USB. The code can be supplied from Android (via [[https://github.com/DavidBuchanan314/NXLoader|NXLoader]]) or a Linux box via [[https://github.com/Qyriad/fusee-launcher|Fusee launcher]]. +  - With the switch being in RCM, it will do nothing, the screen will be black. At this state, payload code to be run needs to be supplied via USB. The code can be supplied from a Linux box via [[https://github.com/Qyriad/fusee-launcher|Fusee launcher]].
   - What to run as first level payload?   - What to run as first level payload?
     * [[https://github.com/CTCaer/hekate/releases|Hekate]] could be used, offered via Fusee launcher. Hekate can then     * [[https://github.com/CTCaer/hekate/releases|Hekate]] could be used, offered via Fusee launcher. Hekate can then
Line 91: Line 82:
   - Which userland to run? L4T and Lakka come with kernel/userland together. The kernels with switch patches can be used on other userlands though, like Fedora30, SuSE, Debian.   - Which userland to run? L4T and Lakka come with kernel/userland together. The kernels with switch patches can be used on other userlands though, like Fedora30, SuSE, Debian.
  
-===== Fedora boot order ===== +===== L4T Ubuntu 3.0 installation ===== 
-2 variants can be used: +This is also the first step for installing Fedora, L4T will be used to bootstrap. The L4T instructions, for reference, are [[https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/|here]].
  
-  - loading kernel/initrd from sdcard +  * **Requirements:** 
-  - or via USB +    * A Nintendo switch which is old enough, switch lite and newer normal switches do not boot into RCM. 
 +    * A microsd-card, 16+ GB 
 +    * A Linux system with usb3 (Fedora31/x86_64 here) 
 +    * A USB-C cable, to connect the switch to the Linux system 
 +  * **Software preparations:** 
 +    * Download switchroot-l4t-ubuntu-3.0.0-full-2020-03-01.img.gz from [[https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/|here]] 
 +    * Download hekate_ctcaer_5.1.4_Nyx_0.8.7.zip from [[https://github.com/CTCaer/hekate/releases|here]] 
 +    * Get fusee-launcher: git clone https://github.com/Qyriad/fusee-launcher 
 +<code> 
 +# Insert your microsd-card, 32+ GB 
 +# Find the microsd-card device, write the image, it's 13GB decompressed. 
 +# Took here for me 133min (Samsung EVO 64GB) or 17min (Toshiba 32GB) 
 +cat /proc/partitions 
 +zcat switchroot-l4t-ubuntu-3.0.0-full-2020-03-01.img.gz |pv >/dev/mmcblk0
  
-I use USB so farit's easier to exchange kernelsSingle steps (nicely summed up [[https://wiki.postmarketos.org/wiki/Nintendo_Switch_(nintendo-nx)|here]]): +# mount the cardunzip hekate, copy hekate. 
-  * Switch booting into to Tegra RCM flashing mode over USB +# Warnings about permissions not being copied are normal, as this is FAT32. 
-  ShofEL2 boots Coreboot +mount /dev/mmcblk0p1 /mnt/tmp 
-  Coreboot initializes hardware and launches U-Boot as its payload +unzip hekate_ctcaer_5.1.4_Nyx_0.8.7.zip 
-  U-Boot starts SDP flashing mode over USB +tar cf - bootloader/|(cd /mnt/tmp && tar xfv -) 
-  imx-usb-loader loads Linux kerneldevice tree, and U-Boot script via SDP +umount /mnt/tmp 
-  U-Boot script decompresses (if comressed kernel) and boots Linux+</code> 
 +  * **First boot:** 
 +    * Ensure the switch is turned off 
 +    * Insert your Jig on the right side 
 +    * Press the 'volume up' button, keep it pressed 
 +    * turn on the switch, either in pressing the power button or connecting the USB cable to the Linux system 
 +    * The switch should turn on, but the screen stay black: RCM mode 
 +    Supply the payload from the Linux system: sudo ./fusee-launcher.py hekate_ctcaer_5.1.4.bin 
 +    When hekate is booted, remove the Jig, and activate "auto RCM" in the menu. As long as this is activated, the switch will boot into RCM without the Jig. 
 +    Select "Ubuntu" from "More Configs", wait some minutes, work through the setup steps. Select "auto login". 
 +    Directly after the initial steps are doneyou end up at the Ubuntu screen: reboot then 
 +    * Select "Ubuntu" from "More Configs" 
 +    * Open the "Disks" app 
 +    * Choose the L4T partition on the sdcard (the second parition), click the gears icon 
 +    * Click "resize", and resize to 16GB 
 +    If you setup WLAN in the first installation steps, you can login via WLAN. Alternatively, you can login via usb-net: "ssh <user>@192.168.55.1". Use "sudo su -" to become root, and update the installation: "apt-get update; apt-get dist-upgrade"
  
-===== Installing Fedora 30 ===== +===== Installing Fedora 32 ===== 
-I am installing Fedora for the switch on the microsd card, using a Fedora30 x86_64 as host. I created DOS style partitions on a 32GB card, and switch between the partitions in modifying the kernel command line. First, I installed L4T on the card, this  did setup partitions 1 (vfat) and 2 (ext4, L4T). After increasing the second partition to 16GB, I created a third partition and installed Fedora 30 there.+These steps need an already installed L4T on the microsd cardpartitions 1 (vfat) and 2 (ext4, L4T) have been set up. After increasing the second partition to 16GB, I create a third partition and install Fedora 32 there. I use a Fedora31/x86_64 system here as helper.
  
-L4T is booting the linux kernel from the cardbut am booting Fedora with kernel/initrd supplied via USB. For this, I have compiled shovel2/coreboot from [[https://gbatemp.net/threads/quick-tuto-how-to-boot-linux-on-your-switch.501918/|this guide]]. I also compiled the kernel as per these instructionsbut it has many downsides over the L4T kernelI am booting Fedora with the L4T kernelDetails on how I boot kernels are [[/software/switch/l4t-kernel-compile|here]]+For installing the Fedora32 aarch64 userland for the switch, I use Fedora-Server-32_Beta-1.2.aarch64.raw.xz. The images for Fedora31/32 do not come with wpa_supplicantwe need to install it manuallyNetworkmanager-wifi is part of the images.
  
-For installing the Fedora30 aarch64 userland for the switch, I used Fedora-Server-30-1.2.aarch64.raw.xz. Despite being the server spin, it comes with packages wpa_supplicant and Networkmanager-wifi. 
-  
 <code> <code>
-### preparing the new partition+### The following steps are done on the Fedora31/x86_64 system, 
 +### with the microsd card with L4T installed. 
 +fdisk /dev/mmcblk0 
 +# n / p / 3 / <return> / <return>
 mkfs.ext4 /dev/mmcblk0p3 mkfs.ext4 /dev/mmcblk0p3
 mount /dev/mmcblk0p3 /mnt/tmp3 mount /dev/mmcblk0p3 /mnt/tmp3
 +cd /mnt/tmp3
  
-### deploying the image +xz -d Fedora-Server-32_Beta-1.2.aarch64.raw.xz 
-xz -d Fedora-Server-30-1.2.aarch64.raw.xz +kpartx -av Fedora-Server-32_Beta-1.2.aarch64.raw
-kpartx -av Fedora-Server-30-1.2.aarch64.raw+
 vgscan  vgscan 
 vgchange -ay vgchange -ay
 mount /dev/fedora/root /mnt/tmp mount /dev/fedora/root /mnt/tmp
 cd /mnt/tmp cd /mnt/tmp
-tar cfp - *|pv|(cd /mnt/tmp3 && tar xfp -)+tar cfp - *|pv|(cd /mnt/tmp3 && tar xf -)
  
-### preparations+Now, as the copy finished, preparations
 cd /mnt/tmp3 cd /mnt/tmp3
-vi etc/fstab +echo '/dev/mmcblk0p2 / ext4 defaults 0 0' >etc/fstab
-# only need this: /dev/mmcblk0p3 / ext4 defaults 0 0+
  
 # set a root password, for example one from your /etc/shadow # set a root password, for example one from your /etc/shadow
 vi etc/shadow vi etc/shadow
 +# Now either add your ssh-pubkey to root/.ssh/authorized_keys,
 +# or modify etc/ssh/sshd_config to accept password root logins.
  
 echo switch.local >etc/hostname echo switch.local >etc/hostname
Line 147: Line 168:
    /etc/sysconfig/network-scripts/ifcfg-mynetwork \    /etc/sysconfig/network-scripts/ifcfg-mynetwork \
     etc/sysconfig/network-scripts/     etc/sysconfig/network-scripts/
 +    
 +# Our Fedora-server image lacks package wpa_supplicant.
 +# The package has to be fetched, and installed.
 +# Either
 +# - chroot into the Fedora partition, and "rpm -i <file>"
 +#   (needs to be done from an aarch64, for example the L4T)
 +# - or use
 +#     cd /mnt/tmp2
 +# rpm2cpio <rpmfile> | cpio --extract --verbose --make-directories --preserve
 +
 +# We have 2 options:
 +# a) create an own inifile for Fedora on the boot partition,
 +#    then we have full control over kernel parameters, but
 +#    we need to write a new boot.scr file
 +# b) Or, we just exchange partitions 2 and 3 in the
 +#    partition table.  Doing that for now.
 +
 +# twist partitions 2 and 3 with sfdisk
 +sfdisk /dev/mmcblk0 -l >/root/ptable_normal
 +cp /root/ptable_normal /root/ptable_twisted
 +vi /root/ptable_twisted
 +# change mmcblk0p2 -> mmcblk0p3, and 
 +# the original mmcblk0p3 -> mmcblk0p2
 +sfdisk /dev/mmcblk0 --force </root/ptable_twisted
 +
 +# mount the L4T partition
 +mount /dev/mmcblk0p2 /mnt/tmp2
 +
 +echo brcmfmac >etc/modules-load.d/brcmfmac.conf
 +cp /mnt/tmp2/lib/firmware/brcm/brcmfmac4356-pcie.txt lib/firmware/brcm/
 +cp -r /mnt/tmp2/lib/modules/4.9.140+/ lib/modules
  
 # Now we can boot the system.  After the reboot, wlan should # Now we can boot the system.  After the reboot, wlan should
Line 177: Line 229:
   https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm   https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
 </code> </code>
- 
  
 ===== Fedora Xorg/LXDM autologin ===== ===== Fedora Xorg/LXDM autologin =====
Line 190: Line 241:
 # - synergy, so I can use mouse/keyboard of my linux box # - synergy, so I can use mouse/keyboard of my linux box
 # - f29-backgrounds, because they are awesome :) # - f29-backgrounds, because they are awesome :)
-dnf install -y xvkbd synergy f29-backgrounds-base mplayer+# - mplayer: media player, blueman: connect bt headsets etc. 
 +dnf install -y xvkbd synergy f29-backgrounds-base mplayer blueman
  
 # Now copying drivers from an L4T installation on partition2: # Now copying drivers from an L4T installation on partition2:
-mount /dev/mmcblk0p2 /mnt/tmp2+mount /dev/mmcblk0p3 /mnt/tmp3
-cd /mnt/tmp2+cd /mnt/tmp3
  
 cp usr/lib/xorg/modules/drivers/nvidia_drv.so \ cp usr/lib/xorg/modules/drivers/nvidia_drv.so \
Line 200: Line 252:
 cp usr/lib/xorg/modules/extensions/libglxserver_nvidia.so \ cp usr/lib/xorg/modules/extensions/libglxserver_nvidia.so \
   /usr/lib64/xorg/modules/extensions/   /usr/lib64/xorg/modules/extensions/
-cp /mnt/tmp2/usr/bin/dock-hotplug /usr/bin+cp usr/bin/dock-hotplug /usr/bin
  
 mkdir -p /usr/lib/aarch64-linux-gnu mkdir -p /usr/lib/aarch64-linux-gnu
Line 255: Line 307:
 useradd -m $MYUSER useradd -m $MYUSER
  
 +# We create a default autostart, including running synergy
 +# client, trying to connect to a synergy-server on 192.168.0.2
 mkdir -p /home/$MYUSER/.config/lxsession/LXDE mkdir -p /home/$MYUSER/.config/lxsession/LXDE
 cat >/home/$MYUSER/.config/lxsession/LXDE/autostart<<EOT cat >/home/$MYUSER/.config/lxsession/LXDE/autostart<<EOT
 @lxpanel --profile LXDE @lxpanel --profile LXDE
 @pcmanfm --desktop --profile LXDE @pcmanfm --desktop --profile LXDE
-@synergy-core --client 192.168.0.3+@synergyc 192.168.0.2
 EOT EOT
 chown -R $MYUSER /home/$MYUSER/.config chown -R $MYUSER /home/$MYUSER/.config
Line 330: Line 384:
 ===== Fedora/switch FAQ ===== ===== Fedora/switch FAQ =====
   * **Q:** Can I use XFS?    * **Q:** Can I use XFS? 
-  * **A:** Not if you use the kernel as compiled by the L4T project. It has no support for XFS +  * **A:** Not if you use the kernel as compiled by the L4T project. It has no support for XFS.
-  * **Q:** Has Fedora30/switch all features of L4T and Lakka? +
-  * **A:** It uses the same kernel, the biggest things like xorg & sound are working. I have not looked into bluetooth, hdmi/sound output, automatic screen switching when docking/undocking.+
   * **Q:** Can I use multiple partitions on one sdcard?   * **Q:** Can I use multiple partitions on one sdcard?
-  * **A:** Yes. You could setup L4T as per instructions, and enlarge the second partition to 16GB. You can create further partitions after that area, and later 'select' which partition to boot from the kernel options handed over when booting the kernelI am not booting kernels via hekate/vfat partitionbut via shovel2/coreboot/usb. With this, I can conveniently on the Linux system running shovel2 select the kernel options+  * **A:** Yes. You can setup L4T as per instructions, and enlarge the L4T partition, for example to 16GB. You can create further partitions after that area, and later twist the partitions to select what to boot. Alternativelyyou could create own boot-inis to easily select which Linux to start from hekate
-  * **Q:** Can I compile kernels on Fedora30?+  * **Q:** Can I compile kernels on Fedora?
   * **A:** I did not succeed to recompile the L4T kernel on Fedora30/switch with the native GCC9.  Seems like it does not go well with the tegra-specific patches from nvidia. Maybe with GCC8. Or compile custom kernels on L4T/switch, or crosscompile on Linux/AMD64. As for debugging why a self compiled kernel is not booting: when docked, debug messages can be seen via HDMI output.   * **A:** I did not succeed to recompile the L4T kernel on Fedora30/switch with the native GCC9.  Seems like it does not go well with the tegra-specific patches from nvidia. Maybe with GCC8. Or compile custom kernels on L4T/switch, or crosscompile on Linux/AMD64. As for debugging why a self compiled kernel is not booting: when docked, debug messages can be seen via HDMI output.
   * **Q:** Why can I not run glxgears?   * **Q:** Why can I not run glxgears?
   * **A:** Run 'strace -f -o logg glxgears' to see details, might just be a permission issue. Accessing /dev/nvhost-ctrl or /dev/nvmap ?   * **A:** Run 'strace -f -o logg glxgears' to see details, might just be a permission issue. Accessing /dev/nvhost-ctrl or /dev/nvmap ?
-===== EL8/aarch64 ===== +  * **Q:** Something is not working.. 
-  * EL8 userland runs ok with the L4T kernel.+  * **A:** You might want to have a look at the [[https://github.com/gamingnation1/l4t-fedora|L4T-Fedora]] repo, verify the configfiles and deployment with the one from here. 
 + 
 +===== RHEL8/aarch64 ===== 
 +  * RHEL8 userland runs ok with the L4T kernel.
   * Do not use XFS, the L4T kernel does not include the xfs driver.   * Do not use XFS, the L4T kernel does not include the xfs driver.
-  * **Note:** EL8 comes with basic xorg, I was able to run an X and xterm, but no gnome. Also EPEL8 is [[https://admin.fedoraproject.org/mirrormanager/|not yet available]] and once released it's not clear if it will contain further window managers. See [[https://fedoraproject.org/wiki/Infrastructure_2020/EPEL-8|EPEL8 planning page]]+  * **Note:** EL8 comes with basic xorg, I was able to run an X and xterm, but no gnome. EPEL8 might have further window managers.
 <code> <code>
 # I used the cloud image as base, mounted and copied # I used the cloud image as base, mounted and copied
Line 367: Line 422:
  
 ===== Generic hints ===== ===== Generic hints =====
-=== touchscreen detection not in sync ===+=== Touchscreen detection not in sync ===
 The touchscreen driver will work in horizontal mode by default, but the xorg screen might come up in vertical mode. Above xorgs monitor definition should rotate the monitor for all Xorg windowmanagers, but the rotation could instead also be done at the windowmanager level.  Rotating the screen in LXDE: The touchscreen driver will work in horizontal mode by default, but the xorg screen might come up in vertical mode. Above xorgs monitor definition should rotate the monitor for all Xorg windowmanagers, but the rotation could instead also be done at the windowmanager level.  Rotating the screen in LXDE:
 <code> <code>
Line 378: Line 433:
 </code> </code>
  
-=== booting is slow ===+=== Booting is slow ===
 Use systemd to illustrate what takes time at boot, and consider to disable services. Also comparing the graph from Fedora30 with the one from L4T helps. This helped me tremendously getting boottime down, after turning the switch on, it takes now 29sec until the usable LXDE screen of Fedora30. I supply the kernel via usb instead of reading from disk, that is further potential for optimization, takes 5.2sec until kernel/initrd etc. are transferred and the kernel is booted. Use systemd to illustrate what takes time at boot, and consider to disable services. Also comparing the graph from Fedora30 with the one from L4T helps. This helped me tremendously getting boottime down, after turning the switch on, it takes now 29sec until the usable LXDE screen of Fedora30. I supply the kernel via usb instead of reading from disk, that is further potential for optimization, takes 5.2sec until kernel/initrd etc. are transferred and the kernel is booted.
-  * Generate graph: `systemd-analyze plot >systemd_plot_fed30.svg` +  * Generate graph: `systemd-analyze plot >systemd_plot_fed.svg` 
-  * Open in firefox: `firefox systemd_plot_fed30.svg` +  * Open in firefox: `firefox systemd_plot_fed.svg`
- +
-=== synergy L4T === +
-<code> +
-# install synergy +
-apt-get install quicksynergy +
-# run this as client +
-/usr/bin/synergyc -f --name switch.local 192.168.0.3 +
-# run this if the mouse is not visible +
-gsettings set org.gnome.settings-daemon.plugins.cursor active fa +
-lse +
-</code>+
  
 === console debugging === === console debugging ===
Line 403: Line 447:
 You are running the synergy client for mouse/keyboard sharing, in the LXDE autostart. But what to run to get the server part? I use this: You are running the synergy client for mouse/keyboard sharing, in the LXDE autostart. But what to run to get the server part? I use this:
 <code> <code>
-[chris@電脳 ~]$ cat ./synergy-server.sh  +[chris@電脳 ~]$ cat .synergy.conf 
-#!/usr/bin/bash +
-synergy-core --server --name ThinkPadL480 --config /home/chris/synergy.conf +
-[chris@電脳 ~]$  +
-[chris@電脳 ~]$ cat synergy.conf +
 section: screens section: screens
-        ThinkPadL480:+        dennou.local:
         switch.local:         switch.local:
 end end
- 
 section: links section: links
-        ThinkPadL480:+        dennou.local:
                 up = switch.local                 up = switch.local
         switch.local:         switch.local:
-                down = ThinkPadL480+                down = dennou.local 
 end end
 +[chris@電脳 ~]$ synergys
 [chris@電脳 ~]$  [chris@電脳 ~]$ 
-</code> 
- 
-=== L4T cleanup === 
-Steps/reminders after setting up L4T.. 
-<code> 
-ssh-copy-add chris@switch 
-echo "alias su='sudo su -'">>~/.bashrc 
-# as root 
-apt-get update 
-apt-get remove --purge kde-window-manager kinit kio kpackagetool5 kwayland-data kwin-common kwin-x11 
-apt-get dist-upgrade 
-apt-get install pv 
 </code> </code>
  
Line 443: Line 472:
  
 === dealing with filesystem corruptions === === dealing with filesystem corruptions ===
-use 2 micro-sd cards, 16GB and 32GB. I run L4T and Fedora30/L4T-kernel on the 32GB card, and see ext4 corruptions there, on both partitions. Using the RPM checksums to verify:+saw ext4 corruptions on 32GB card, on both partitions. Using the RPM checksums to verify:
 <code> <code>
 for i in $(rpm -qa|sort); do echo "### $i"; rpm -V $i; done  >>logg for i in $(rpm -qa|sort); do echo "### $i"; rpm -V $i; done  >>logg
Line 461: Line 490:
 echo performance >/sys/devices/system/cpu/cpufreq/policy0/scaling_governor echo performance >/sys/devices/system/cpu/cpufreq/policy0/scaling_governor
 </code> </code>
- 
-=== microsd card not found === 
-After having the switch not used for some weeks, microsd cards were no longer recognized. Kernels supplied via USB did not find the card/partitions. Also hekate, when booted as payload via usb, did not find any cards - even ones which worked perfectly fine before. Plugging cards in multiple times/taking out/plugging in did apparently clean contacts, and the cards were recognized again. 
-===== Noteworthy games ===== 
-The switch is a nice platform for portable gaming, and has many indie game titles. Unfortunately, many are not available in all regions. (-J) means: not available when Japan is set as region in the nintendo store. 
-  * Thimbleweed park https://thimbleweedpark.com/ (-J) 
-  * Into the breach (-J) 
-  * steamworld dig 2 / スチームワールドディグ2 (+J) 
-  * The messenger / jump'n'run (+J) 
-  * Celeste / jump'n'run (+J) 
-  * Baba is you (-J) 
-  * Vectronom (-J) 
-  * Axiom Verge / jump'n'run (+J) 
-  * Dead cells / jump'n'run (+J) 
-  * Enter the Gungeon (+J) 
-  * Cadence of Hyrule Crypt of the NecroDancer 
-  * Hollow knight 
hardwarerelated/nintendo_switch.1567241411.txt · Last modified: 2019/08/31 10:50 by chris