WSL2 still does not support USB devices, but with a little effort we can make possible to flash and monitor ESP device from WSL2.
| # Decompile | |
| dtc -I dtb -O dts -o devicetree.dts /boot/dtb/<your_devicetree_file_name>.dtb | |
| # Compile | |
| dtc -I dts -O dtb devicetree.dts -o <your_devicetree_file_name>.dtb | |
| # Merge with DTBO | |
| fdtoverlay -i modified-base.dtb -o modified-full.dtb /boot/tegra194-p3668-all-p3509-0000-user-custom.dtbo | |
| # DTS from fs |
| // Device tree overlay for Goodix GT9110 touch controller | |
| // connected to Raspberry Pi via I2C on GPIO pins. | |
| /dts-v1/; | |
| /plugin/; | |
| / { | |
| compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709"; | |
| fragment@0 { | |
| target = <&gpio>; // Overlay for GPIO pins, using standard 'gpio' node |
A collection of Markdown code and tricks that were tested to work in Gist.
This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.
- Reformat this whole document and assimilate these:
I had imaged a full 8GB SD card, but I only wanted to distribute a smaller image. These are a few notes:
Image the SD card
dd if=/dev/sdb of=./backup.img
Now I wanted to use gparted to resize the partition, you can run sudo gparted ./backup.img and it will show the partitions, but it will think that the partitions are located at /dev/./backup.img1 and /dev/./backup.img2 which is not correct. The trick here is to use the loopback interface.
losetup /dev/loop0 backup.img this will make the backup.img file show up as a block device. You can then run gparted on /dev/loop0 and once again see the partition table. There still is an issue though, it will look for the partitions to be located at /dev/loop0p1 and /dev/loop0p2, these block devices do not exist. It turns out that losetup has a flag that I have not noticed anywhere before -P this causes the kernel to read the partition table of the device and create the additional block device. This lets us avoid having to manually look at the partit
