D1s:修订间差异

来自资料库(何亚红)
跳转到导航 跳转到搜索
 
(未显示同一用户的13个中间版本)
第2行: 第2行:
D1s是全志出品的RISC-V处理器,集成64MB DRAM。
D1s是全志出品的RISC-V处理器,集成64MB DRAM。


=== 个人说明 ===
=== 软件开发工具/方法 ===
D1s相对于F1C200s、V3s与RV1103 等廉价Linux芯片,具有2个USB口,可同时作为主机与从机,可实现在不影响OTG功能的同时,使用USB扩展各种外设。
 
* Tina
* [[Rt-thread|RT-Thread]]
 
== Tina ==
Tina Linux是全志科技基于Linux内核开发的针对智能硬件类产品的嵌入式软件系统。Tina Linux基于openwrt-14.07 版本的软件开发包,包含了 Linux 系统开发用到的内核源码、驱动、工具、系统中间件与应用程序包。
 
具体教程见:https://d1s.docs.aw-ol.com/
 
=== 下载 ===
Tina采用repo工具下载,其下载步骤如下:
 
* 准备repo工具。如在中国境内需要配置REPO_URL:本人一般使用<code>export REPO_URL=https://gerrit-googlesource.proxy.ustclug.org/git-repo</code>配置。
 
* 准备git工具。配置身份认证:<code>git config --global credential.helper store</code>。
 
* 初始化repo,准备一个空目录,执行 <code>repo init -u https://sdk.aw-ol.com/git_repo/D1_Tina_Open/manifest.git -b master -m tina-d1-h.xml</code> ,期间需要[https://bbs.aw-ol.com bbs.aw-ol.com]的Lv2及以上等级的账号与对应密码。
 
* 同步repo,执行<code>repo sync</code>,如执行失败建议删除文件夹并重新建目录初始化repo。
 
* 安装补丁,从[https://www.aw-ol.com/downloads?cat=19 社区]下载补丁并重命名为.tar.gz文件并使用tar命令解压。
 
=== tools补丁 ===
由于Tina依赖的[[openwrt]]版本较为老旧,其tools可能不能在较新的操作系统上运行。<syntaxhighlight lang="diff" line="1">
From d659908f80853cc39786de226b50305d8fee0caf Mon Sep 17 00:00:00 2001
From: HEYAHONG <2229388563@qq.com>
Date: Wed, 6 Mar 2024 13:18:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81ubuntu22.04?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
 
Change-Id: I3b00e3e875950f8e3cef25ecf02c783ae63c49c5
---
fakeroot/Makefile                            |  13 +-
m4/Makefile                                  |  4 +-
m4/patches/001-fix-macos-vasnprintf.patch    |  25 ----
m4/patches/010-glibc-change-work-around.patch | 118 ------------------
mklibs/Makefile                              |  1 +
.../patches/0003-mksquashfs-h-extern.patch    |  11 ++
6 files changed, 23 insertions(+), 149 deletions(-)
delete mode 100644 m4/patches/001-fix-macos-vasnprintf.patch
delete mode 100644 m4/patches/010-glibc-change-work-around.patch
create mode 100644 squashfskit4/patches/0003-mksquashfs-h-extern.patch
 
diff --git a/fakeroot/Makefile b/fakeroot/Makefile
index 0b8dcfd..495a745 100644
--- a/fakeroot/Makefile
+++ b/fakeroot/Makefile
@@ -5,11 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fakeroot
-PKG_VERSION:=1.20.2
+PKG_VERSION:=1.30.1
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
-PKG_SOURCE_URL:=http://snapshot.debian.org/archive/debian/20141005T221953Z/pool/main/f/fakeroot
-PKG_HASH:=7c0a164d19db3efa9e802e0fc7cdfeff70ec6d26cdbdc4338c9c2823c5ea230c
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://sources.buildroot.net/fakeroot/fakeroot_1.30.1.orig.tar.gz
+PKG_HASH:=32ebb1f421aca0db7141c32a8c104eb95d2b45c393058b9435fbf903dd2b6a75
+PKG_FIXUP:=autoreconf
include $(BUILD_DIR)/host-build.mk
@@ -17,4 +19,7 @@ HOST_CONFIGURE_VARS += \
ac_cv_header_sys_capability_h=no \
ac_cv_func_capset=no
+HOST_CONFIGURE_ARGS += \
+    --with-ipc=tcp
+
$(eval $(call HostBuild))
diff --git a/m4/Makefile b/m4/Makefile
index 241b60f..1a61410 100644
--- a/m4/Makefile
+++ b/m4/Makefile
@@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=m4
PKG_CPE_ID:=cpe:/a:gnu:m4
-PKG_VERSION:=1.4.18
+PKG_VERSION:=1.4.19
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_HASH:=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+PKG_HASH:=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
PKG_CAT:=xzcat
HOST_BUILD_PARALLEL:=1
diff --git a/m4/patches/001-fix-macos-vasnprintf.patch b/m4/patches/001-fix-macos-vasnprintf.patch
deleted file mode 100644
index e41315d..0000000
--- a/m4/patches/001-fix-macos-vasnprintf.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/lib/vasnprintf.c
-+++ b/lib/vasnprintf.c
-@@ -4858,7 +4858,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
- #endif
-                  *fbp = dp->conversion;
- #if USE_SNPRINTF
--# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-+# if ! (((__GLIBC__ > 2                                                \
-+          || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))                  \
-+        && !defined __UCLIBC__)                                        \
-+        || (defined __APPLE__ && defined __MACH__)                      \
-+        || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-                fbp[1] = '%';
-                fbp[2] = 'n';
-                fbp[3] = '\0';
-@@ -4872,6 +4876,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
-                    in format strings in writable memory may crash the program
-                    (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
-                    in this situation.  */
-+                /* macOS 10.13 High Sierra behaves like glibc with
-+                  _FORTIFY_SOURCE=2, and older macOS releases
-+                  presumably do not need %n.  */
-                /* On native Windows systems (such as mingw), we can avoid using
-                    %n because:
-                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
diff --git a/m4/patches/010-glibc-change-work-around.patch b/m4/patches/010-glibc-change-work-around.patch
deleted file mode 100644
index 0ef6216..0000000
--- a/m4/patches/010-glibc-change-work-around.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-Subject: Workaround change in glibc
-
-Temporary workaround to compile with glibc 2.28, which
-deprecated some constants
-
-Taken from the rpms/m4 Fedora repository, commit 814d5921
-(Work around change in glibc)
-
-Original filename: m4-1.4.18-glibc-change-work-around.patch
-
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
-
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+  problem by defining it ourselves.  FIXME: Do not rely on glibc
-+  internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
-
- /* BSD stdio derived implementations.  */
-
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
-
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
-
- #endif
-
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-  if (stream == NULL || ! freading (stream))
-    return fflush (stream);
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
-  clear_ungetc_buffer_preserving_position (stream);
-
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-  /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-  return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-  /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-  fp->_IO_read_end = fp->_IO_read_ptr;
-  fp->_IO_write_ptr = fp->_IO_write_base;
-  /* Avoid memory leak when there is an active ungetc buffer.  */
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -25,7 +25,7 @@
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-  if (fp->_IO_write_ptr > fp->_IO_write_base)
-    return 0;
-  return (fp->_IO_read_end - fp->_IO_read_ptr)
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-  /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-  return ((fp->_flags & _IO_NO_WRITES) != 0
-          || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-              && fp->_IO_read_base != NULL));
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
- #endif
-
-  /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-  if (fp->_IO_read_end == fp->_IO_read_ptr
-      && fp->_IO_write_ptr == fp->_IO_write_base
-      && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
-          return -1;
-        }
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-      fp->_flags &= ~_IO_EOF_SEEN;
-      fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
diff --git a/mklibs/Makefile b/mklibs/Makefile
index 906e994..3d091ef 100644
--- a/mklibs/Makefile
+++ b/mklibs/Makefile
@@ -18,6 +18,7 @@ HOST_FIXUP:=autoreconf
include $(BUILD_DIR)/host-build.mk
HOST_CFLAGS += -I$(CURDIR)/include
+HOST_CPPFLAGS += -std=gnu++98
define Host/Install
        $(INSTALL_BIN) \
diff --git a/squashfskit4/patches/0003-mksquashfs-h-extern.patch b/squashfskit4/patches/0003-mksquashfs-h-extern.patch
new file mode 100644
index 0000000..a4ef70e
--- /dev/null
+++ b/squashfskit4/patches/0003-mksquashfs-h-extern.patch
@@ -0,0 +1,11 @@
+--- a/squashfs-tools/mksquashfs.h 2024-03-06 11:26:41.039679211 +0800
++++ b/squashfs-tools/mksquashfs.h 2024-03-06 11:27:23.774172147 +0800
+@@ -133,7 +133,7 @@
+ #define BLOCK_OFFSET 2
+
+ extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
+-struct cache *bwriter_buffer, *fwriter_buffer;
++extern struct cache *bwriter_buffer, *fwriter_buffer;
+ extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
+       *locked_fragment, *to_process_frag;
+ extern struct append_file **file_mapping;
--
2.34.1
 
 
</syntaxhighlight>上述补丁将tools目录下的工具进行了修补,使用方法如下:
 
* 将上述补丁保存为文件,文件后缀名为.diff。
* 在tools目录下执行<code>git apply diff文件名</code>  应用补丁。
 
如不能使用git应用补丁,则可参照补丁修改Tina目录下的tools目录。
 
上述补丁在以下环境测试通过,其它环境仅供参考:
 
* ubuntu 22.04
 
== 笔记 ==
D1s相对于[[F1C100s F1C200s|F1C200s]]、[[V3s]]与[[RV1103]] 等廉价Linux芯片,具有2个USB口,可同时作为主机与从机,可实现在不影响OTG功能的同时,使用USB扩展各种外设。
 
=== 硬件 ===
* D1s可采用三路DC-DC直接供电,可以不使用电源管理芯片。
 
* 需采用负载电容大(如20pF)的晶振。
* 可采用类似单片机SOC的结构,即挂一个SPI Nor Flash/SPI Nand Flash,直接跑裸机程序。
 
=== Tina ===
 
==== 编译过程中遇到[[Linux]]内核[[Kconfig]]配置选项配置询问。 ====
直接按Enter键使用默认选项即可。
 
如不使用默认选项,可能导致编译不过。一般情况下,各种厂商移植的Linux内核通常只支持少量定制(厂商通常只会测试自己移植的部分,不会考虑某些兼容性),随意更改配置极有可能导致编译不过。
 
这主要是由于预置的[[Linux]]内核[[Kconfig]]配置文件不全(一般是手动更改了选项但没使用[[Kconfig]]工具(如menuconfig)同步所致)所致,通常情况下使用默认选项即可。


== 官方资料 ==
== 官方资料 ==
第19行: 第327行:


* D1s:https://linux-sunxi.org/D1s
* D1s:https://linux-sunxi.org/D1s
* https://d1s.docs.aw-ol.com/

2024年3月23日 (六) 11:12的最新版本

说明

D1s是全志出品的RISC-V处理器,集成64MB DRAM。

软件开发工具/方法

Tina

Tina Linux是全志科技基于Linux内核开发的针对智能硬件类产品的嵌入式软件系统。Tina Linux基于openwrt-14.07 版本的软件开发包,包含了 Linux 系统开发用到的内核源码、驱动、工具、系统中间件与应用程序包。

具体教程见:https://d1s.docs.aw-ol.com/

下载

Tina采用repo工具下载,其下载步骤如下:

  • 准备git工具。配置身份认证:git config --global credential.helper store
  • 同步repo,执行repo sync,如执行失败建议删除文件夹并重新建目录初始化repo。
  • 安装补丁,从社区下载补丁并重命名为.tar.gz文件并使用tar命令解压。

tools补丁

由于Tina依赖的openwrt版本较为老旧,其tools可能不能在较新的操作系统上运行。

From d659908f80853cc39786de226b50305d8fee0caf Mon Sep 17 00:00:00 2001
From: HEYAHONG <2229388563@qq.com>
Date: Wed, 6 Mar 2024 13:18:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81ubuntu22.04?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I3b00e3e875950f8e3cef25ecf02c783ae63c49c5
---
 fakeroot/Makefile                             |  13 +-
 m4/Makefile                                   |   4 +-
 m4/patches/001-fix-macos-vasnprintf.patch     |  25 ----
 m4/patches/010-glibc-change-work-around.patch | 118 ------------------
 mklibs/Makefile                               |   1 +
 .../patches/0003-mksquashfs-h-extern.patch    |  11 ++
 6 files changed, 23 insertions(+), 149 deletions(-)
 delete mode 100644 m4/patches/001-fix-macos-vasnprintf.patch
 delete mode 100644 m4/patches/010-glibc-change-work-around.patch
 create mode 100644 squashfskit4/patches/0003-mksquashfs-h-extern.patch

diff --git a/fakeroot/Makefile b/fakeroot/Makefile
index 0b8dcfd..495a745 100644
--- a/fakeroot/Makefile
+++ b/fakeroot/Makefile
@@ -5,11 +5,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fakeroot
-PKG_VERSION:=1.20.2
+PKG_VERSION:=1.30.1
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
-PKG_SOURCE_URL:=http://snapshot.debian.org/archive/debian/20141005T221953Z/pool/main/f/fakeroot
-PKG_HASH:=7c0a164d19db3efa9e802e0fc7cdfeff70ec6d26cdbdc4338c9c2823c5ea230c
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://sources.buildroot.net/fakeroot/fakeroot_1.30.1.orig.tar.gz
+PKG_HASH:=32ebb1f421aca0db7141c32a8c104eb95d2b45c393058b9435fbf903dd2b6a75
+PKG_FIXUP:=autoreconf
 
 include $(BUILD_DIR)/host-build.mk
 
@@ -17,4 +19,7 @@ HOST_CONFIGURE_VARS += \
 	ac_cv_header_sys_capability_h=no \
 	ac_cv_func_capset=no
 
+HOST_CONFIGURE_ARGS += \
+    --with-ipc=tcp
+
 $(eval $(call HostBuild))
diff --git a/m4/Makefile b/m4/Makefile
index 241b60f..1a61410 100644
--- a/m4/Makefile
+++ b/m4/Makefile
@@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=m4
 PKG_CPE_ID:=cpe:/a:gnu:m4
-PKG_VERSION:=1.4.18
+PKG_VERSION:=1.4.19
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_HASH:=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+PKG_HASH:=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96
 PKG_CAT:=xzcat
 
 HOST_BUILD_PARALLEL:=1
diff --git a/m4/patches/001-fix-macos-vasnprintf.patch b/m4/patches/001-fix-macos-vasnprintf.patch
deleted file mode 100644
index e41315d..0000000
--- a/m4/patches/001-fix-macos-vasnprintf.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/lib/vasnprintf.c
-+++ b/lib/vasnprintf.c
-@@ -4858,7 +4858,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
- #endif
-                   *fbp = dp->conversion;
- #if USE_SNPRINTF
--# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-+# if ! (((__GLIBC__ > 2                                                 \
-+          || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))                  \
-+         && !defined __UCLIBC__)                                        \
-+        || (defined __APPLE__ && defined __MACH__)                      \
-+        || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-                 fbp[1] = '%';
-                 fbp[2] = 'n';
-                 fbp[3] = '\0';
-@@ -4872,6 +4876,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
-                    in format strings in writable memory may crash the program
-                    (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
-                    in this situation.  */
-+                /* macOS 10.13 High Sierra behaves like glibc with
-+                   _FORTIFY_SOURCE=2, and older macOS releases
-+                   presumably do not need %n.  */
-                 /* On native Windows systems (such as mingw), we can avoid using
-                    %n because:
-                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
diff --git a/m4/patches/010-glibc-change-work-around.patch b/m4/patches/010-glibc-change-work-around.patch
deleted file mode 100644
index 0ef6216..0000000
--- a/m4/patches/010-glibc-change-work-around.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-Subject: Workaround change in glibc
-
-Temporary workaround to compile with glibc 2.28, which
-deprecated some constants
-
-Taken from the rpms/m4 Fedora repository, commit 814d5921
-(Work around change in glibc)
-
-Original filename: m4-1.4.18-glibc-change-work-around.patch
-
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
-    the same implementation of stdio extension API, except that some fields
-    have different naming conventions, or their access requires some casts.  */
- 
-+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-+   problem by defining it ourselves.  FIXME: Do not rely on glibc
-+   internals.  */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
- 
- /* BSD stdio derived implementations.  */
- 
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
- 
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
- 
- #endif
- 
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
- 
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
-   if (stream == NULL || ! freading (stream))
-     return fflush (stream);
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- 
-   clear_ungetc_buffer_preserving_position (stream);
- 
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   fp->_IO_read_end = fp->_IO_read_ptr;
-   fp->_IO_write_ptr = fp->_IO_write_base;
-   /* Avoid memory leak when there is an active ungetc buffer.  */
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -25,7 +25,7 @@
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_write_ptr > fp->_IO_write_base)
-     return 0;
-   return (fp->_IO_read_end - fp->_IO_read_ptr)
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
-   /* Most systems provide FILE as a struct and the necessary bitmask in
-      <stdio.h>, because they need it for implementing getc() and putc() as
-      fast macros.  */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   return ((fp->_flags & _IO_NO_WRITES) != 0
-           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
-               && fp->_IO_read_base != NULL));
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
- #endif
- 
-   /* These tests are based on fpurge.c.  */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-   if (fp->_IO_read_end == fp->_IO_read_ptr
-       && fp->_IO_write_ptr == fp->_IO_write_base
-       && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
-           return -1;
-         }
- 
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-       fp->_flags &= ~_IO_EOF_SEEN;
-       fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
diff --git a/mklibs/Makefile b/mklibs/Makefile
index 906e994..3d091ef 100644
--- a/mklibs/Makefile
+++ b/mklibs/Makefile
@@ -18,6 +18,7 @@ HOST_FIXUP:=autoreconf
 include $(BUILD_DIR)/host-build.mk
 
 HOST_CFLAGS += -I$(CURDIR)/include
+HOST_CPPFLAGS += -std=gnu++98
 
 define Host/Install
        $(INSTALL_BIN) \
diff --git a/squashfskit4/patches/0003-mksquashfs-h-extern.patch b/squashfskit4/patches/0003-mksquashfs-h-extern.patch
new file mode 100644
index 0000000..a4ef70e
--- /dev/null
+++ b/squashfskit4/patches/0003-mksquashfs-h-extern.patch
@@ -0,0 +1,11 @@
+--- a/squashfs-tools/mksquashfs.h	2024-03-06 11:26:41.039679211 +0800
++++ b/squashfs-tools/mksquashfs.h	2024-03-06 11:27:23.774172147 +0800
+@@ -133,7 +133,7 @@
+ #define BLOCK_OFFSET 2
+ 
+ extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
+-struct cache *bwriter_buffer, *fwriter_buffer;
++extern struct cache *bwriter_buffer, *fwriter_buffer;
+ extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
+ 	       *locked_fragment, *to_process_frag;
+ extern struct append_file **file_mapping;
-- 
2.34.1

上述补丁将tools目录下的工具进行了修补,使用方法如下:

  • 将上述补丁保存为文件,文件后缀名为.diff。
  • 在tools目录下执行git apply diff文件名 应用补丁。

如不能使用git应用补丁,则可参照补丁修改Tina目录下的tools目录。

上述补丁在以下环境测试通过,其它环境仅供参考:

  • ubuntu 22.04

笔记

D1s相对于F1C200sV3sRV1103 等廉价Linux芯片,具有2个USB口,可同时作为主机与从机,可实现在不影响OTG功能的同时,使用USB扩展各种外设。

硬件

  • D1s可采用三路DC-DC直接供电,可以不使用电源管理芯片。
  • 需采用负载电容大(如20pF)的晶振。
  • 可采用类似单片机SOC的结构,即挂一个SPI Nor Flash/SPI Nand Flash,直接跑裸机程序。

Tina

编译过程中遇到Linux内核Kconfig配置选项配置询问。

直接按Enter键使用默认选项即可。

如不使用默认选项,可能导致编译不过。一般情况下,各种厂商移植的Linux内核通常只支持少量定制(厂商通常只会测试自己移植的部分,不会考虑某些兼容性),随意更改配置极有可能导致编译不过。

这主要是由于预置的Linux内核Kconfig配置文件不全(一般是手动更改了选项但没使用Kconfig工具(如menuconfig)同步所致)所致,通常情况下使用默认选项即可。

官方资料

网站:https://www.allwinnertech.com/

aw-ol:https://bbs.aw-ol.com/

相关数据手册

文件:D1s Datasheet V1.0.pdf

文件:D1s User Manual V1.0.pdf

相关资料