anchao commented on PR #17216: URL: https://github.com/apache/nuttx/pull/17216#issuecomment-3432365838
> > This isn't a fair comparison, and I'm not convinced that nsh could disable more commands to align with init. > > @anchao You're right. When making comparisons, the non-essential functions of NSH should be turned off. > > A rough estimate shows that after disabling the non-essential functions of NSH (as listed below), the ELF size has decreased by 397,448 bytes. It is estimated that the space required for NSH is approximately 220,184 bytes, and the init component takes up 61,488 bytes. > > ```diff > $ diff defconfig boards/arm64/qemu/qemu-armv8a/configs/fastboot/defconfig > 9d8 > < # CONFIG_NSH_CONSOLE is not set > 47c46 > < CONFIG_INIT_ENTRYPOINT="nsh_main" > --- > > CONFIG_INIT_ENTRYPOINT="init_main" > 78,135d76 > < CONFIG_NSH_DISABLE_ARP=y > < CONFIG_NSH_DISABLE_BASENAME=y > < CONFIG_NSH_DISABLE_CAT=y > < CONFIG_NSH_DISABLE_CD=y > < CONFIG_NSH_DISABLE_CMP=y > < CONFIG_NSH_DISABLE_CP=y > < CONFIG_NSH_DISABLE_DF=y > < CONFIG_NSH_DISABLE_DIRNAME=y > < CONFIG_NSH_DISABLE_DMESG=y > < CONFIG_NSH_DISABLE_ECHO=y > < CONFIG_NSH_DISABLE_ENV=y > < CONFIG_NSH_DISABLE_ERROR_PRINT=y > < CONFIG_NSH_DISABLE_EXEC=y > < CONFIG_NSH_DISABLE_EXIT=y > < CONFIG_NSH_DISABLE_EXPORT=y > < CONFIG_NSH_DISABLE_EXPR=y > < CONFIG_NSH_DISABLE_FDINFO=y > < CONFIG_NSH_DISABLE_FREE=y > < CONFIG_NSH_DISABLE_GET=y > < CONFIG_NSH_DISABLE_HELP=y > < CONFIG_NSH_DISABLE_HEXDUMP=y > < CONFIG_NSH_DISABLE_IFCONFIG=y > < CONFIG_NSH_DISABLE_IFUPDOWN=y > < CONFIG_NSH_DISABLE_KILL=y > < CONFIG_NSH_DISABLE_LOSETUP=y > < CONFIG_NSH_DISABLE_LS=y > < CONFIG_NSH_DISABLE_MD5=y > < CONFIG_NSH_DISABLE_MKDIR=y > < CONFIG_NSH_DISABLE_MKFATFS=y > < CONFIG_NSH_DISABLE_MKFIFO=y > < CONFIG_NSH_DISABLE_MKRD=y > < CONFIG_NSH_DISABLE_MOUNT=y > < CONFIG_NSH_DISABLE_MV=y > < CONFIG_NSH_DISABLE_NFSMOUNT=y > < CONFIG_NSH_DISABLE_NSLOOKUP=y > < CONFIG_NSH_DISABLE_PIDOF=y > < CONFIG_NSH_DISABLE_PKILL=y > < CONFIG_NSH_DISABLE_PRINTF=y > < CONFIG_NSH_DISABLE_PS=y > < CONFIG_NSH_DISABLE_PUT=y > < CONFIG_NSH_DISABLE_PWD=y > < CONFIG_NSH_DISABLE_RM=y > < CONFIG_NSH_DISABLE_RMDIR=y > < CONFIG_NSH_DISABLE_SET=y > < CONFIG_NSH_DISABLE_SLEEP=y > < CONFIG_NSH_DISABLE_SOURCE=y > < CONFIG_NSH_DISABLE_TEST=y > < CONFIG_NSH_DISABLE_TIME=y > < CONFIG_NSH_DISABLE_TRUNCATE=y > < CONFIG_NSH_DISABLE_UMOUNT=y > < CONFIG_NSH_DISABLE_UNAME=y > < CONFIG_NSH_DISABLE_UNSET=y > < CONFIG_NSH_DISABLE_UPTIME=y > < CONFIG_NSH_DISABLE_USLEEP=y > < CONFIG_NSH_DISABLE_WAIT=y > < CONFIG_NSH_DISABLE_WATCH=y > < CONFIG_NSH_DISABLE_WGET=y > < CONFIG_NSH_DISABLE_XD=y > ``` So nsh still has room for improvement, right? If it's just a size issue, why can't nsh be optimized to support Android init syntax, rather than making a drastic change like replacing the initialization path? My other question is, why is Android's approach the right one? Is it because apple IOS isn't open source? If functionality is aligned with Android, I don't think it's necessary. Each operating system has its own unique characteristics. I like implementations that are superior to Nuttx/Android systems. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
