MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.86k stars 496 forks source link

XU4 | Prep for 4.9 kernel | Offer test image #899

Closed Fourdee closed 7 years ago

Fourdee commented 7 years ago

4.9 kernel image for TESTING purposes only:

- http://dietpi.com/downloads/images/no_release/(NR_4.x)_DietPi_OdroidXU4-armv7-(Jessie).7z


Meveric's repo/packages is changing to 4.9 kernel. Test and update images/patch existing systems. Many thanks to meveric for the heads up and additional info

joaofl commented 7 years ago

Hi Fourdee. Can I help on something with this task?

I may have some free time soon, maybe to test this and improve that config dir thing we discussed about syncthing.

Fourdee commented 7 years ago

@joaofl

Hi Fourdee. Can I help on something with this task?

By all means, thanks for offering 👍 Once i figure out how will we patch uuid in boot.ini and fstab to replace /dev/mmcxxxx, should be good to test. I'll also create a new image with the kernel installed, for testing.

Fourdee commented 7 years ago

Patch Notes / Prep for 4.9 kernel install:

MMC0p2

UUID_CURRENT=$(blkid /dev/mmcblk0p2 -s UUID -o value) sed -i "s#^/dev/mmcblk0p2#UUID=$UUID_CURRENT#g" /etc/fstab systemctl daemon-reload

sed -i "s#root=/dev/mmcblk0p2#root=UUID=$UUID_CURRENT#g" /DietPi/boot.ini

XU4 DTB (If XU4 board):

sed -i "s#exynos5422-odroidxu3.dtb#exynos5422-odroidxu4.dtb#g" /DietPi/boot.ini


> since with Kernel 4.9 the boot device is no longer always mmcblk0 but can also be mmcblk1 if you start from SD card

---
#### GPU driver changes:
> You'll also find the new xf86-video-armsoc driver which is needed for Desktop and G2D acceleration.
Make sure you set option "NoFlip" "true" in /etc/X11/xorg.conf to make sure vsync is working where it's required.

wget http://oph.mdrjr.net/meveric/kernel/XU3/4.9.x/xf86-video-armsoc-odroid_20170419-1.4.1-1+deb8_armhf.deb -O package.deb dpkg -i package.deb


---

#### Install 4.9 kernel:

wget http://oph.mdrjr.net/meveric/kernel/XU3/4.9.x/linux-image-4.9.24+_4.9.24-20170428-XU3_armhf.deb -O package.deb dpkg -i package.deb


- SD: SystemD fails boot waiting on mmc0p1, try UUID in fstab.
- 🈹 Yep, kernel 4.9 requires both mmc0p* entries in fstab to be UUID
- 🈴 System boots, no ethernet. ```dmesg | grep eth``` = ```usbcore: registered new interface driver cdc_ether```
Thanks to Meveric for heads up, ```dtb```'s for XU3/4 4.9 kernel are now unique.

- 🈯️ If XU4 board:

sed -i "s#exynos5422-odroidxu3.dtb#exynos5422-odroidxu4.dtb#g" /DietPi/boot.ini

Fourdee commented 7 years ago

Weird, if serial UART is connected to SBC pins and USB UART pins (GND/TX/RX), but not connected to a USB socket, system fails to boot.

Fourdee commented 7 years ago

@joaofl

Any chance you could test this (and ethernet status) on your XU4?

To install 4.9 kernel, as per https://github.com/Fourdee/DietPi/issues/899#issuecomment-298170796:

joaofl commented 7 years ago

@Fourdee

My first test was with my current setup, in which I already had the UUID set on both files (fstab and boot.ini) since I was booting from an USB pendrive. However it failed to boot. It halts at: Apr 30 02:08:37 DietPi systemd[427]: Failed at step EXEC spawning /bin/plymouth: No such file or directory (journal file attached). journal.txt

My second test was on a new install: It halts at that same plymouth issue. But there are other errors concerning the mmcmblk1 (timed out). See the journal attached. journal-freshinstall.txt .

Is there an easy way to rollback to the previous kernel and fix this issue?

Fourdee commented 7 years ago

@joaofl

Thanks for testing.

Is there an easy way to rollback to the previous kernel and fix this issue?

Yep, if you copy the contents of /boot on the image file, to SD card/EMMC, excluding:

And modules from image in 2nd partition, to rootfs:

Should boot back up


since I was booting from an USB pendrive.

Ah, you may need to manually pull in the UUID of this rootfs drive, and replace:

Fourdee commented 7 years ago

Possible solutions regarding Failed at step EXEC spawning /bin/plymouth: No such file or directory https://unix.stackexchange.com/a/178640

If you test again, before rebooting after kernel update, we should probably check patched /etc/fstab and blkid match:

blkid
cat /etc/fstab
cat /DietPi/boot.ini | grep 'root='
Fourdee commented 7 years ago

🈯️ Network bandwidth much improved over 3.x (was around 400Mbit):

Client connecting to 192.168.0.112, TCP port 5001
TCP window size: 87.5 KByte (default)
------------------------------------------------------------
[  5] local 192.168.0.111 port 51702 connected with 192.168.0.112 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-30.0 sec  3.28 GBytes   938 Mbits/sec
[  4] local 192.168.0.111 port 5001 connected with 192.168.0.112 port 38925
[  4]  0.0-30.0 sec  2.68 GBytes   766 Mbits/sec
joaofl commented 7 years ago

@Fourdee Indeed, by commenting two custom mounts I had on my fstab, it booted. Buuuut, without ethernet.

On dmesg, it shows that it failed to boot some modules for example the s5p which was not found. also fuse, IPV6... I guess the first is from the GPU that in fact I did not install since I dont use it currently.

How did you get your ethernet working? I remember someone mentioned this issue in some other forum, I'll try to figure it out.

I also noticed that Dietpi fails to fetch CPU governor settings...

Fourdee commented 7 years ago

@joaofl

Buuuut, without ethernet.

For XU3/4, dtb's are now unique. So if your running a XU4:

sed -i "s#exynos5422-odroidxu3.dtb#exynos5422-odroidxu4.dtb#g" /DietPi/boot.ini
reboot
Fourdee commented 7 years ago

@joaofl

I also noticed that Dietpi fails to fetch CPU governor settings...

Interactive is not available in 4.9, ondemand and performance govs only: freqs are for cpu 0 image

DietPi should cycle through govs and re-apply, if current one does not exist.

joaofl commented 7 years ago

@Fourdee Thanks! It works now. Buuut, :) Cloudshell stopped working... Is the SPI module loaded? I could help on testing that as well.

joaofl commented 7 years ago

@Fourdee

Is the CPU limited to 1.3 GHz? 2.0 doesn't show in the list of frequencies available, however It still throttle up to 2.0. When I test the ethernet speed using iperf, I get almost 0.8 Gbps, but when transferring a file through sftp, I get at most 220 Mbps (28 MB/s). I believe the bottleneck in this case is the CPU. What do you think?

Minor issue:

Fourdee commented 7 years ago

@joaofl

Is the CPU limited to 1.3 GHz?

Yep, for cores 0-3, other cores are still 2GHz. They must of tweaked max frequencies a little to try to reduce known heat issues with XU4.

but when transferring a file through sftp, I get at most 220 Mbps (28 MB/s). I believe the bottleneck in this case is the CPU. What do you think?

Not sure, disk/IO bottleneck maybe?

when I chose to change the "On demand sampling rate" I get the error:

Good find, new location is:

/sys/devices/system/cpu/cpufreq/ondemand/min_sampling_rate

dietpi-cpu_set

/DietPi/dietpi/dietpi-cpu_set: line 117: /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold: No such file or directory
/DietPi/dietpi/dietpi-cpu_set: line 118: /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate: No such file or directory
/DietPi/dietpi/dietpi-cpu_set: line 119: /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor: No such file or directory

New locations are:

/sys/devices/system/cpu/cpufreq/ondemand
Fourdee commented 7 years ago

ToDo:

rncwnd79 commented 7 years ago

Hi @Fourdee, maybe this is already resolved in your testing image, but I encountered the following problem when building and running my own 4.9 kernel from official hardkernel repo on XU4: the script /boot/diepi/dietpi-obtain_hw_model was not able to detect XU4 anymore because /proc/cpuinfo doesn't contain the odroid-string anymore:

cat /proc/cpuinfo ... Hardware : SAMSUNG EXYNOS (Flattened Device Tree) Revision : 0100 Serial : 0000000000000000

This leads to dietpi-update not pulling the right files and trying to install rPi files on odroid (fortunately I cancelled update fast enough).

Fourdee commented 7 years ago

@rncwnd79

because /proc/cpuinfo doesn't contain the odroid-string anymore:

Thanks for the report. 👍 Although this appears fine on the current 4.9 kernel from Meveric. Maybe we'll see this in the next update.

You can avoid the string check and force the HW_MODEL index, for XU4:

echo 11 > /etc/.dietpi_hw_model_identifier

I'll add that by default to our next XU4 image, to avoid this.

Fourdee commented 7 years ago
Fourdee commented 7 years ago

Ok, Meverics right, 4.9 is still in active dev, so lets wait for it to become stable:

Fourdee commented 7 years ago

Prep completed.

Will mark this ticket as completed. Open up a new one for further 4.9 testing: https://github.com/Fourdee/DietPi/issues/926