From e6ed8c6782f9ecd0552330e6c0aca81267af00f5 Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Wed, 8 May 2024 17:23:49 +0800 Subject: [PATCH] sim: add sqlite config Signed-off-by: yinshengkai --- .../platforms/sim/sim/boards/sim/index.rst | 29 +++++++++- boards/sim/sim/sim/configs/sqlite/defconfig | 58 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 boards/sim/sim/sim/configs/sqlite/defconfig diff --git a/Documentation/platforms/sim/sim/boards/sim/index.rst b/Documentation/platforms/sim/sim/boards/sim/index.rst index 85748ad30e..472bfdabfd 100644 --- a/Documentation/platforms/sim/sim/boards/sim/index.rst +++ b/Documentation/platforms/sim/sim/boards/sim/index.rst @@ -1374,6 +1374,33 @@ and 32-bit modules. This has apps/examples/sotest enabled. This configuration is intended for 64-bit host OS. +sqlite +------- + +This configuration is used to test sqlite. Since hostfs does not support +FIOC_FILEPATH, it cannot currently be used in hostfs. + +Basic usage example:: + + nsh> cd tmp + nsh> sqlite3 test.db + SQLite version 3.45.1 2024-01-30 16:01:20 + Enter ".help" for usage hints. + sqlite> + CREATE TABLE COMPANY( + ID INT PRIMARY KEY sqlite> (x1...> NOT NULL, + NAME TEXT NOT NULL, + AGE (x1...> (x1...> INT NOT NULL, + ADDRESS CHAR(50), + SALARY (x1...> (x1...> REAL + );(x1...> + sqlite> .quit + sqlite> + nsh> + nsh> ls -l + /tmp: + -rwxrwxrwx 12288 test.db + tcploop ------- @@ -1682,7 +1709,7 @@ This is a configuration with sim usbdev support. Then you can use commands such as adb shell, adb push, adb pull as normal. 2> Run RNDIS: - + NuttX enter command:: $ conn 0 diff --git a/boards/sim/sim/sim/configs/sqlite/defconfig b/boards/sim/sim/sim/configs/sqlite/defconfig new file mode 100644 index 0000000000..a787eb702e --- /dev/null +++ b/boards/sim/sim/sim/configs/sqlite/defconfig @@ -0,0 +1,58 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_NSH_CMDOPT_HEXDUMP is not set +CONFIG_ARCH="sim" +CONFIG_ARCH_BOARD="sim" +CONFIG_ARCH_BOARD_SIM=y +CONFIG_ARCH_CHIP="sim" +CONFIG_ARCH_SIM=y +CONFIG_BOARDCTL_POWEROFF=y +CONFIG_BOARD_LOOPSPERMSEC=0 +CONFIG_BOOT_RUNFROMEXTSRAM=y +CONFIG_BUILTIN=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEV_LOOP=y +CONFIG_DEV_ZERO=y +CONFIG_ETC_FATDEVNO=2 +CONFIG_ETC_ROMFS=y +CONFIG_ETC_ROMFSDEVNO=1 +CONFIG_EXAMPLES_HELLO=y +CONFIG_FAT_LCNAMES=y +CONFIG_FAT_LFN=y +CONFIG_FSUTILS_PASSWD=y +CONFIG_FSUTILS_PASSWD_READONLY=y +CONFIG_FS_FAT=y +CONFIG_FS_HOSTFS=y +CONFIG_FS_LARGEFILE=y +CONFIG_FS_LOCK_BUCKET_SIZE=4 +CONFIG_FS_PROCFS=y +CONFIG_FS_ROMFS=y +CONFIG_FS_TMPFS=y +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_INTERPRETERS_MINIBASIC=y +CONFIG_INTERPRETER_MINIBASIC_TESTSCRIPT=y +CONFIG_LIBC_DLFCN=y +CONFIG_LIBC_ENVPATH=y +CONFIG_LIBC_EXECFUNCS=y +CONFIG_LIBC_MAX_EXITFUNS=1 +CONFIG_LIB_SQLITE=y +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILE_APPS=y +CONFIG_NSH_READLINE=y +CONFIG_PATH_INITIAL="/bin" +CONFIG_PSEUDOFS_SOFTLINKS=y +CONFIG_PTHREAD_MUTEX_TYPES=y +CONFIG_READLINE_TABCOMPLETION=y +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SIM_HOSTFS=y +CONFIG_START_MONTH=6 +CONFIG_START_YEAR=2008 +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_SYSTEM=y +CONFIG_UTILS_SQLITE=y