7 infernoroot = ENVIRON["ROOT"];
8 init = ENVIRON["INIT"];
9 data2c = ENVIRON["DATA2C"];
23 collect && section ~ "root"{
26 src[nroot] = infernoroot $2;
27 else if (dst[nroot] == "/osinit.dis")
28 src[nroot] = infernoroot "/dis/" init ".dis";
30 src[nroot] = infernoroot $1;
31 for(i=0; i<nroot; i++)
32 if(dst[i] == dst[nroot])
38 if($0 ~ "(code|dev|ether|ip|lib|link|mod|misc|port|root|vga)"){
45 rootdata = conf ".root.c";
46 system("rm -f " rootdata);
47 print("/* Generated by mkroot */") >rootdata;
52 for (i = 0; i < nroot; i++) {
53 ncomp = split(dst[i], comp, "/");
54 if (comp[1] != "" || ncomp < 2)
57 for (j = 2; j <= ncomp; j++) {
70 if (system("test -d " src[i]) == 0)
73 if (system(data2c " root" q " <" src[i] " >>" rootdata) != 0)
75 print("extern unsigned char root" q "code[];");
76 print("extern int root" q "len;");
83 for (q = 0; q < qid; q++) {
86 for (q2 = 1; q2 < qid; q2++) {
87 if (dotdot[q2] == q) {
91 unsort[sort[q2]] = q2;
97 print("int rootmaxq = " qid ";");
99 print("Dirtab roottab[" qid "] = {");
100 for (oq = 0; oq < qid; oq++) {
103 print("\t\"" name[q] "\",\t{" oq ", 0, QTFILE},\t", "0,\t0444,");
105 print("\t\"" name[q] "\",\t{" oq ", 0, QTDIR},\t", "0,\t0555,");
109 print("Rootdata rootdata[" qid "] = {");
110 for (oq = 0; oq < qid; oq++) {
113 print("\t" sort[dotdot[q]] ",\t", "root" q "code,\t", "0,\t", "&root" q "len,");
115 print("\t" sort[dotdot[q]] ",\t", "&roottab[" child0[q] "],\t", nchild[q] ",\tnil,");
117 print("\t" sort[dotdot[q]] ",\t", "nil,\t", "0,\t", "nil,");