apps/nshlib/nsh_romfsetc.c: Add support for CROMFS start-up script
This commit is contained in:
parent
09a108b507
commit
8eb249eea5
@ -730,6 +730,14 @@ config NSH_ROMFSETC
|
||||
|
||||
if NSH_ROMFSETC
|
||||
|
||||
config NSH_CROMFSETC
|
||||
bool "Support CROMFS (compressed) start-up script"
|
||||
default n
|
||||
depends on NSH_ROMFSETC && FS_CROMFS
|
||||
---help---
|
||||
Mount a CROMFS filesystem at /etc and provide a compressed startup
|
||||
script at /etc/init.d/rcS.
|
||||
|
||||
config NSH_ROMFSRC
|
||||
bool "Support ROMFS login script"
|
||||
default n
|
||||
|
@ -97,6 +97,7 @@ int nsh_romfsetc(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#if !defined(CONFIG_NSH_CROMFSETC)
|
||||
/* Create a ROM disk for the /etc filesystem */
|
||||
|
||||
ret = romdisk_register(CONFIG_NSH_ROMFSDEVNO, romfs_img,
|
||||
@ -106,13 +107,18 @@ int nsh_romfsetc(void)
|
||||
ferr("ERROR: romdisk_register failed: %d\n", -ret);
|
||||
return ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Mount the file system */
|
||||
|
||||
finfo("Mounting ROMFS filesystem at target=%s with source=%s\n",
|
||||
CONFIG_NSH_ROMFSMOUNTPT, MOUNT_DEVNAME);
|
||||
|
||||
#if defined(CONFIG_NSH_CROMFSETC)
|
||||
ret = mount(MOUNT_DEVNAME, CONFIG_NSH_ROMFSMOUNTPT, "cromfs", MS_RDONLY, NULL);
|
||||
#else
|
||||
ret = mount(MOUNT_DEVNAME, CONFIG_NSH_ROMFSMOUNTPT, "romfs", MS_RDONLY, NULL);
|
||||
#endif
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: mount(%s,%s,romfs) failed: %d\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user