From 7bc1e97f1652f62f80cb944c1dc9961e76034964 Mon Sep 17 00:00:00 2001 From: Suhaas Joshi Date: Tue, 26 Nov 2024 13:55:37 +0530 Subject: [PATCH] feat: How_to_Guides: Add section on Y2K38 Y2K38 issue has been fixed in Scarthgap, but is still present in Kirkstone, and hence also in Kirkstone images of AM335x and AM437x. Since 9.3 release is going to be a Kirkstone one, add a How_to_Guide section of the presence of this issue, and some solutions on how to deal with it. Signed-off-by: Suhaas Joshi --- configs/AM335X/AM335X_linux_toc.txt | 1 + configs/AM437X/AM437X_linux_toc.txt | 1 + .../How_to_Guides/Target/How_to_fix_y2k38.rst | 44 +++++++++++++++++++ source/linux/How_to_Guides_Target.rst | 1 + 4 files changed, 47 insertions(+) create mode 100644 source/linux/How_to_Guides/Target/How_to_fix_y2k38.rst diff --git a/configs/AM335X/AM335X_linux_toc.txt b/configs/AM335X/AM335X_linux_toc.txt index 13e81b2bc..da64ba04d 100644 --- a/configs/AM335X/AM335X_linux_toc.txt +++ b/configs/AM335X/AM335X_linux_toc.txt @@ -143,6 +143,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_add_a_JVM linux/How_to_Guides/Target/How_to_use_a_Mouse_instead_of_the_Touchscreen_with_Matrix linux/How_to_Guides/Target/Update_U-Boot_Environment_Variables_stored_in_SPI_Flash_from_Linux +linux/How_to_Guides/Target/How_to_fix_y2k38 linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_Boot_Beagle_Bone_Black_with_Processor_SDK_Linux linux/How_to_Guides/Target/How_to_Program_Beaglebone_Black_eMMC_via_SD_Card diff --git a/configs/AM437X/AM437X_linux_toc.txt b/configs/AM437X/AM437X_linux_toc.txt index 46c78f1c2..9caef2d2a 100644 --- a/configs/AM437X/AM437X_linux_toc.txt +++ b/configs/AM437X/AM437X_linux_toc.txt @@ -142,6 +142,7 @@ linux/How_to_Guides/Target/How_to_add_a_JVM linux/How_to_Guides/Target/How_to_use_a_Mouse_instead_of_the_Touchscreen_with_Matrix linux/How_to_Guides/Target/Update_U-Boot_Environment_Variables_stored_in_SPI_Flash_from_Linux linux/How_to_Guides/Target/How_to_Change_dtb_File +linux/How_to_Guides/Target/How_to_fix_y2k38 linux/How_to_Guides_Hardware_Setup_with_CCS linux/How_to_Guides/Hardware_Setup_with_CCS/EVMK2H_Hardware_Setup linux/How_to_Guides_Board_Port diff --git a/source/linux/How_to_Guides/Target/How_to_fix_y2k38.rst b/source/linux/How_to_Guides/Target/How_to_fix_y2k38.rst new file mode 100644 index 000000000..7b447af67 --- /dev/null +++ b/source/linux/How_to_Guides/Target/How_to_fix_y2k38.rst @@ -0,0 +1,44 @@ +.. include:: /_replacevars.rst + +How to Fix Y2K38 Issue +====================== + +What is the Y2K38 Issue? +------------------------ + +The Y2K38 issue is a bug which disallows a date from exceeding 03:14:07 UTC on January 19, 2038, on 32-bit systems. This +is because the structures used to store the date experience an integer overflow when the date is set beyond the mentioned +one. This causes the system to crash. +For more information, see: https://en.wikipedia.org/wiki/Year_2038_problem + +There are new data structures that are used on 32-bit systems to store date/time in longer fields, thereby avoiding the +overflow and the crash. However, since setting and displaying date/time uses multiple software components (such as the +kernel, glibc etc), **all** code on a filesystem must be Y2K38-compliant (i.e. all code must be using the new data +structures and functions) for the filesystem to be Y2K38-friendly. If any piece of software uses the older structures +and functions, it makes the whole filesystem vulnerable. + +To understand how the problem was fixed in Scarthgap filesystem, refer: +https://static.sched.com/hosted_files/osseu2024/8b/EOSS%20Vienna%202024%20-%20Surviving%20Y2038.pdf + +Building a Y2K38-friendly Image +------------------------------- + +In SDK 9.3, TI's 32-bit platforms are still based on Kirkstone filesystem, which is NOT Y2K38-friendly. The Y2K38 issue +is fixed in OE-core Scarthgap, on which the next release will be based. + +Until then, if a Y2K38-friendly filesystem is required, obtain a :file:`tisdk-thinlinux-image` from the latest +:file:`cicd.scarthgap.x` link from latest `cicd.scarthgap.x`: + +.. ifconfig:: CONFIG_part_variant in ('AM335X') + + https://software-dl.ti.com/cicd-report/linux/index.html?section=platform&platform=am335x + +.. ifconfig:: CONFIG_part_variant in ('AM437X') + + https://software-dl.ti.com/cicd-report/linux/index.html?section=platform&platform=am437x + +Unlike the :file:`tisdk-default-image`, this image is based on the 6.6 Kernel and Scarthgap filesystem, and +thus has the Y2K38 issue fixed. + +To build a Y2K38-friendly image on the 6.6 Kernel and Scarthgap filesystem baseline, follow the "Build Instructions" +section present in the above link. diff --git a/source/linux/How_to_Guides_Target.rst b/source/linux/How_to_Guides_Target.rst index 5e00c35e9..ebf2687c2 100644 --- a/source/linux/How_to_Guides_Target.rst +++ b/source/linux/How_to_Guides_Target.rst @@ -19,3 +19,4 @@ Target How_to_Guides/Target/How_to_Use_K3Conf_Tool How_to_Guides/Target/How_to_Tune_Real_Time_Linux How_to_Guides/Target/How_to_Program_Beaglebone_Black_eMMC_via_SD_Card + How_to_Guides/Target/How_to_fix_y2k38