| 890 | } |
| 891 | |
| 892 | static void |
| 893 | vfs_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 | |
| 939 | static int |
| 940 | vfs_mountroot_readconf(struct thread *td, struct sbuf *sb) |
no test coverage detected