- Timestamp:
- 01/16/21 14:50:50 (3 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/global.h
r45159 r45162 8314 8314 } 8315 8315 8316 int multiboot() 8317 { 8318 int ret = 1; 8319 struct menulist* mlist = NULL, *mbox = NULL; 8320 8321 char* skintitle = _("Select Multiboot"); 8322 char* cmd = NULL; 8323 8324 #ifdef OEBUILD 8325 char* devicelist = command("cat /boot/STARTUP* | sed -nr 's/.*root=\\/dev\\/([^\\/]+) rootfstype.*/\\1/p' | sed 's! rootsubdir=!/!g' | sort -u"); 8326 char* rootpart = string_newline(command("cat /proc/cmdline | sed -nr 's/.*root=\\/dev\\/([^\\/]+) rootfstype.*/\\1/p' | sed 's! rootsubdir=!/!g'")); 8327 #else 8328 char* devicelist = command("cat /proc/diskstats | awk {'print $3'} | grep 'sd[a-z][0-9]'"); 8329 char* rootpart = string_newline(command("cat /proc/cmdline | sed 's/^.*root=//;s/ .*$//' | sed 's!/dev/!!'")); 8316 8330 #endif 8331 printf("devicelist: %s\n", devicelist); 8332 if(devicelist != NULL && strlen(devicelist) != 0) 8333 { 8334 char* pch; 8335 char* label = NULL; 8336 char* showname = NULL; 8337 char* version = NULL; 8338 pch = strtok (devicelist, "\n"); 8339 int count = 0; 8340 while(pch != NULL) 8341 { 8342 count += 1; 8343 #ifdef OEBUILD 8344 label= ostrcat("STARTUP_", oitoa(count), 0, 1); 8345 #else 8346 label = get_label(pch); 8347 #endif 8348 if(ostrstr(label, "MINI") != NULL || ostrstr(label, "STARTUP") != NULL) 8349 { 8350 cmd = ostrcat("cat /autofs/", pch, 0, 0); 8351 cmd = ostrcat(cmd, "/etc/version-svn", 1, 0); 8352 version = command(cmd); 8353 8354 showname = ostrcat(label, " ", 0, 0); 8355 8356 if(version == NULL) 8357 { 8358 showname = ostrcat(label, " (", 0, 0); 8359 showname = ostrcat(showname, pch, 1, 0); 8360 showname = ostrcat(showname, ") ", 1, 0); 8361 showname = ostrcat(showname, _("non-version"), 1, 0); 8362 } 8363 else 8364 showname = ostrcat(showname, strstrip(version), 1, 0); 8365 printf("rootpart: %s\n", rootpart); 8366 printf("pch: %s\n", pch); 8367 8368 if(ostrcmp(pch, rootpart) == 0) 8369 showname = ostrcat(showname, " (active)", 1, 0); 8370 8371 debug(40, "addchoicebox: device=%s, label=%s showname=%s", pch, label, showname); 8372 addmenulist(&mlist, showname, label, NULL, 0, 0); 8373 8374 free(cmd), cmd = NULL; 8375 free(showname), showname = NULL; 8376 free(version), version = NULL; 8377 } 8378 8379 pch = strtok (NULL, "\n"); 8380 free(label), label = NULL; 8381 } 8382 free(pch), pch = NULL; 8383 8384 } 8385 else 8386 addmenulist(&mlist, "no device found", _("no device found"), NULL, 0, 0); 8387 8388 free(devicelist), devicelist = NULL; 8389 free(rootpart), rootpart = NULL; 8390 8391 mbox = menulistbox(mlist, NULL, skintitle, _("Choose your Multiboot STARTUP entry from the following list"), NULL, NULL, 1, 0); 8392 if(mbox != NULL) 8393 { 8394 printf("mbox->name=%s\n", mbox->name); 8395 printf("mbox->text=%s\n", mbox->text); 8396 8397 cmd = ostrcat(cmd, "cp /boot/", 1, 0); 8398 cmd = ostrcat(cmd, mbox->text, 1, 0); 8399 cmd = ostrcat(cmd, " /boot/STARTUP", 1, 0); 8400 printf("cmd=%s\n", cmd); 8401 system(cmd); 8402 free(cmd), cmd = NULL; 8403 8404 oshutdown(2, 1); 8405 } 8406 8407 freemenulist(mlist, 1); mlist = NULL; 8408 drawscreen(skin, 0, 0); 8409 resettvpic(); 8410 8411 return ret; 8412 } 8413 8414 #endif -
titan/titan/menu.h
r45139 r45162 567 567 return 1; 568 568 } 569 screenmultiboot(); 569 multiboot(); 570 // install via systemupdate 571 // screenmultiboot(); 570 572 } 571 573 else if(ostrcmp("guirestart", menuentry->name) == 0)
Note: See TracChangeset
for help on using the changeset viewer.