MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vfs_mountroot_conf0

Function vfs_mountroot_conf0

freebsd/kern/vfs_mountroot.c:892–937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890}
891
892static void
893vfs_mountroot_conf0(struct sbuf *sb)
894{
895 char *s, *tok, *mnt, *opt;
896 int error;
897
898 sbuf_printf(sb, ".onfail panic\n");
899 sbuf_printf(sb, ".timeout %d\n", root_mount_timeout);
900 if (boothowto & RB_ASKNAME)
901 sbuf_printf(sb, ".ask\n");
902#ifdef ROOTDEVNAME
903 if (boothowto & RB_DFLTROOT)
904 sbuf_printf(sb, "%s\n", ROOTDEVNAME);
905#endif
906 if (boothowto & RB_CDROM) {
907 sbuf_printf(sb, "cd9660:/dev/cd0 ro\n");
908 sbuf_printf(sb, ".timeout 0\n");
909 sbuf_printf(sb, "cd9660:/dev/cd1 ro\n");
910 sbuf_printf(sb, ".timeout %d\n", root_mount_timeout);
911 }
912 s = kern_getenv("vfs.root.mountfrom");
913 if (s != NULL) {
914 opt = kern_getenv("vfs.root.mountfrom.options");
915 tok = s;
916 error = parse_token(&tok, &mnt);
917 while (!error) {
918 sbuf_printf(sb, "%s %s\n", mnt,
919 (opt != NULL) ? opt : "");
920 free(mnt, M_TEMP);
921 error = parse_token(&tok, &mnt);
922 }
923 if (opt != NULL)
924 freeenv(opt);
925 freeenv(s);
926 }
927 if (rootdevnames[0] != NULL)
928 sbuf_printf(sb, "%s\n", rootdevnames[0]);
929 if (rootdevnames[1] != NULL)
930 sbuf_printf(sb, "%s\n", rootdevnames[1]);
931#ifdef ROOTDEVNAME
932 if (!(boothowto & RB_DFLTROOT))
933 sbuf_printf(sb, "%s\n", ROOTDEVNAME);
934#endif
935 if (!(boothowto & RB_ASKNAME))
936 sbuf_printf(sb, ".ask\n");
937}
938
939static int
940vfs_mountroot_readconf(struct thread *td, struct sbuf *sb)

Callers 1

vfs_mountrootFunction · 0.85

Calls 5

sbuf_printfFunction · 0.85
parse_tokenFunction · 0.85
kern_getenvFunction · 0.70
freeFunction · 0.70
freeenvFunction · 0.70

Tested by

no test coverage detected