summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/disk.c
Commit message (Expand)AuthorAgeFilesLines
* add support for disk-iso auto-installThierry Vignaud2018-11-301-5/+22
* advertize "ext4" rather than "ext2"Thierry Vignaud2018-11-291-1/+1
* kill long dead argumentThierry Vignaud2013-03-231-1/+1
* (my_insmod) rename as (my_modprobe) as it really what it isThierry Vignaud2013-03-231-1/+1
* (try_with_device) fix segfaulting when ISO directory is not valid (mga#4592)Thierry Vignaud2012-02-261-3/+3
* kill dead emailsThierry Vignaud2012-01-271-1/+1
* mandrake is now mandrivaThierry Vignaud2009-03-061-2/+2
* try to use arch-prefixed location for automatic disk installsOlivier Blin2009-02-121-6/+9
* automatically find compressed stage2 with automatic=method:diskOlivier Blin2008-09-261-0/+63
* add back "ide-generic" support (incorrectly removed in 1.17), theOlivier Blin2008-06-121-0/+6
* - rename SCSI_ADAPTERS as MEDIA_ADAPTERS since we really mean media adpaters nowOlivier Blin2008-02-271-3/+3
* do not explicitely try to load ide-generic, ldetect will fallback to ide-gene...Olivier Blin2007-09-241-6/+0
* use '_' in module names when explicitely loading modulesOlivier Blin2007-08-211-1/+1
* - move parameters functions in params.cOlivier Blin2007-07-051-0/+2
* re-sync after the big svn lossPascal Rigaux2007-04-251-8/+5
* try to load ide-generic as fallback when no disk or cdrom is foundOlivier Blin2005-04-011-0/+6
* warn that the mount can fail if the partition hasn't been cleanly unmountedOlivier Blin2005-03-231-1/+2
* dirname may modify the string, so copy it firstOlivier Blin2005-03-221-1/+3
* fix messageOlivier Blin2005-03-091-1/+1
* move partition stuff in partition.c and common disk stuff in tools.cOlivier Blin2005-03-091-165/+2
* new option "keepmounted" to allow the rescue media to be kept mountedPascal Rigaux2005-02-281-1/+1
* - drop oem & recovery code (which was broken)Pascal Rigaux2004-11-291-71/+0
* major switch from ramdisk to clpPascal Rigaux2004-11-161-2/+1
* use IMAGE_LOCATION_DIR where it should bePascal Rigaux2004-11-021-2/+2
* compile less things when MANDRAKE_MOVE is definedPascal Rigaux2004-11-021-0/+2
* fix cancel in disk installOlivier Blin2004-09-021-4/+4
* adapt to new directories layout:Pascal Rigaux2004-07-261-2/+2
* MandrakeSoft -> MandrakesoftPascal Rigaux2004-07-201-1/+1
* - when the directory is bad, go back to choose another directory instead of c...Pascal Rigaux2004-07-061-6/+6
* split directory specific functions and move them from disk.c to directory.c (...Olivier Blin2004-06-211-156/+7
* in iso install, use ISOPATH environment variable instead of loopback device f...Olivier Blin2004-06-181-0/+1
* add disk-iso install methodOlivier Blin2004-06-171-3/+4
* do not delete loopbacks devices before umount but afterOlivier Blin2004-06-171-5/+5
* redesign of the ISO image selection dialog, add an entry in the list to allow...Olivier Blin2004-06-151-11/+26
* do not try to mount the partition in testing mode, assume it is already mountedOlivier Blin2004-06-151-1/+2
* del loop device after unmountOlivier Blin2004-06-151-0/+1
* rephrase question againOlivier Blin2004-06-141-1/+3
* rephrase again the disk install questions (thanks to Pierre Jarillon, Rapsys|...Olivier Blin2004-06-141-3/+6
* rephrase the partition selection messageOlivier Blin2004-06-141-1/+1
* let the user choose between ISO images containing a stage2 installer if a dir...Olivier Blin2004-06-111-2/+58
* ntfs support in install from disk (on nplanel request, but to actually work, ...Olivier Blin2004-06-101-1/+2
* instead of keeping stage1 (mostly as temporary space but with a fixed size, a...Pascal Rigaux2004-05-131-9/+2
* when in automatic=disk mode but no partition is given, fall backGuillaume Cottenceau2004-02-271-3/+1
* Patch from gc to allow booting a MandrakeMove on a Harddrive using theErwan Velu2004-02-251-10/+30
* until we haven't loaded the usb interface and the keyboard usb driver, we can...Guillaume Cottenceau2004-01-221-1/+1
* allow more than one loop device for more than one lomountGuillaume Cottenceau2003-10-221-7/+8
* fix pixelGuillaume Cottenceau2003-10-211-1/+1
* close file descriptorsGuillaume Cottenceau2003-09-181-2/+4
* fix recovery behaviour thx to francois commentsGuillaume Cottenceau2003-09-111-9/+5
* recoveryGuillaume Cottenceau2003-09-101-35/+137
span> extra % items; for (i = 0; i < items; i++) { list[i] += all; if (some) { list[i]++; some--; } } } static void shuffleGrid(newtGrid grid, int left, int top, int set) { struct gridField * field; int row, col; int i, j; int minWidth, minHeight; int * widths, * heights; int thisLeft, thisTop; int x, y, remx, remy; widths = alloca(sizeof(*widths) * grid->cols); memset(widths, 0, sizeof(*widths) * grid->cols); heights = alloca(sizeof(*heights) * grid->rows); memset(heights, 0, sizeof(*heights) * grid->rows); minWidth = 0; for (row = 0; row < grid->rows; row++) { i = 0; for (col = 0; col < grid->cols; col++) { field = &grid->fields[col][row]; if (field->type == NEWT_GRID_SUBGRID) { /* we'll have to redo this later */ if (field->u.grid->width == -1) shuffleGrid(field->u.grid, left, top, 0); j = field->u.grid->width; } else if (field->type == NEWT_GRID_COMPONENT) { if (field->u.co->ops == formOps) newtFormSetSize(field->u.co); j = field->u.co->width; } else j = 0; j += field->padLeft + field->padRight; if (j > widths[col]) widths[col] = j; i += widths[col]; } if (i > minWidth) minWidth = i; } minHeight = 0; for (col = 0; col < grid->cols; col++) { i = 0; for (row = 0; row < grid->rows; row++) { field = &grid->fields[col][row]; if (field->type == NEWT_GRID_SUBGRID) { /* we'll have to redo this later */ if (field->u.grid->height == -1) shuffleGrid(field->u.grid, 0, 0, 0); j = field->u.grid->height; } else if (field->type == NEWT_GRID_COMPONENT){ j = field->u.co->height; } else j = 0; j += field->padTop + field->padBottom; if (j > heights[row]) heights[row] = j; i += heights[row]; } if (i > minHeight) minHeight = i; } /* this catches the -1 case */ if (grid->width < minWidth) grid->width = minWidth; /* ack! */ if (grid->height < minHeight) grid->height = minHeight; /* ditto! */ if (!set) return; distSpace(grid->width - minWidth, grid->cols, widths); distSpace(grid->height - minHeight, grid->rows, heights); thisTop = top; for (row = 0; row < grid->rows; row++) { i = 0; thisLeft = left; for (col = 0; col < grid->cols; col++) { field = &grid->fields[col][row]; if (field->type == NEWT_GRID_EMPTY) continue; x = thisLeft + field->padLeft; remx = widths[col] - field->padLeft - field->padRight; y = thisTop + field->padTop; remy = heights[row] - field->padTop - field->padBottom; if (field->type == NEWT_GRID_SUBGRID) { remx -= field->u.grid->width; remy -= field->u.grid->height; } else if (field->type == NEWT_GRID_COMPONENT) { remx -= field->u.co->width; remy -= field->u.co->height; } if (!(field->flags & NEWT_GRID_FLAG_GROWX)) { if (field->anchor & NEWT_ANCHOR_RIGHT) x += remx; else if (!(field->anchor & NEWT_ANCHOR_LEFT)) x += (remx / 2); } if (!(field->flags & NEWT_GRID_FLAG_GROWY)) { if (field->anchor & NEWT_ANCHOR_BOTTOM) y += remx; else if (!(field->anchor & NEWT_ANCHOR_TOP)) y += (remy / 2); } if (field->type == NEWT_GRID_SUBGRID) { if (field->flags & NEWT_GRID_FLAG_GROWX) field->u.grid->width = widths[col] - field->padLeft - field->padRight; if (field->flags & NEWT_GRID_FLAG_GROWY) field->u.grid->height = heights[col] - field->padTop - field->padBottom; shuffleGrid(field->u.grid, x, y, 1); } else if (field->type == NEWT_GRID_COMPONENT) { field->u.co->ops->place(field->u.co, x, y); } thisLeft += widths[col]; } thisTop += heights[row]; } } void newtGridPlace(newtGrid grid, int left, int top) { shuffleGrid(grid, left, top, 1); } void newtGridFree(newtGrid grid, int recurse) { int row, col; for (col = 0; col < grid->cols; col++) { if (recurse) { for (row = 0; row < grid->rows; row++) { if (grid->fields[col][row].type == NEWT_GRID_SUBGRID) newtGridFree(grid->fields[col][row].u.grid, 1); } } free(grid->fields[col]); } free(grid->fields); free(grid); } void newtGridGetSize(newtGrid grid, int * width, int * height) { if (grid->width == -1 || grid->height == -1) { grid->width = grid->height = -1; shuffleGrid(grid, 0, 0, 1); } *width = grid->width; *height = grid->height; } void newtGridWrappedWindow(newtGrid grid, char * title) { int width, height, offset = 0; newtGridGetSize(grid, &width, &height); if ((size_t)width < strlen(title) + 2) { offset = ((strlen(title) + 2) - width) / 2; width = strlen(title) + 2; } newtCenteredWindow(width + 2, height + 2, title); newtGridPlace(grid, 1 + offset, 1); } void newtGridWrappedWindowAt(newtGrid grid, char * title, int left, int top) { int width, height; newtGridGetSize(grid, &width, &height); newtOpenWindow(left, top, width + 2, height + 2, title); newtGridPlace(grid, 1, 1); } void newtGridAddComponentsToForm(newtGrid grid, newtComponent form, int recurse) { int row, col; for (col = 0; col < grid->cols; col++) { for (row = 0; row < grid->rows; row++) { if (grid->fields[col][row].type == NEWT_GRID_SUBGRID && recurse) newtGridAddComponentsToForm(grid->fields[col][row].u.grid, form, 1); else if (grid->fields[col][row].type == NEWT_GRID_COMPONENT) newtFormAddComponent(form, grid->fields[col][row].u.co); } } } /* this handles up to 50 items */ static newtGrid stackem(int isVert, enum newtGridElement type1, void * what1, va_list args, int close) { struct item { enum newtGridElement type; void * what; } items[50]; int i, num; newtGrid grid; items[0].type = type1, items[0].what = what1, num = 1; while (1) { items[num].type = va_arg(args, enum newtGridElement); if (items[num].type == NEWT_GRID_EMPTY) break; items[num].what = va_arg(args, void *); num++; } grid = newtCreateGrid(isVert ? 1 : num, isVert ? num : 1); for (i = 0; i < num; i++) { newtGridSetField(grid, isVert ? 0 : i, isVert ? i : 0, items[i].type, items[i].what, close ? 0 : (i ? (isVert ? 0 : 1) : 0), close ? 0 : (i ? (isVert ? 1 : 0) : 0), 0, 0, 0, 0); } return grid; } newtGrid newtGridHCloseStacked(enum newtGridElement type1, void * what1, ...) { va_list args; newtGrid grid; va_start(args, what1); grid = stackem(0, type1, what1, args, 1); va_start(args, what1); return grid; } newtGrid newtGridVCloseStacked(enum newtGridElement type1, void * what1, ...) { va_list args; newtGrid grid; va_start(args, what1); grid = stackem(1, type1, what1, args, 1); va_start(args, what1); return grid; } newtGrid newtGridVStacked(enum newtGridElement type1, void * what1, ...) { va_list args; newtGrid grid; va_start(args, what1); grid = stackem(1, type1, what1, args, 0); va_start(args, what1); return grid; } newtGrid newtGridHStacked(enum newtGridElement type1, void * what1, ...) { va_list args; newtGrid grid; va_start(args, what1); grid = stackem(0, type1, what1, args, 0); va_start(args, what1); return grid; } newtGrid newtGridBasicWindow(newtComponent text, newtGrid middle, newtGrid buttons) { newtGrid grid; grid = newtCreateGrid(1, 3); newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, text, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); newtGridSetField(grid, 0, 1, NEWT_GRID_SUBGRID, middle, 0, 1, 0, 0, 0, 0); newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, buttons, 0, 1, 0, 0, 0, NEWT_GRID_FLAG_GROWX); return grid; } newtGrid newtGridSimpleWindow(newtComponent text, newtComponent middle, newtGrid buttons) { newtGrid grid; grid = newtCreateGrid(1, 3); newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, text, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); newtGridSetField(grid, 0, 1, NEWT_GRID_COMPONENT, middle, 0, 1, 0, 0, 0, 0); newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, buttons, 0, 1, 0, 0, 0, NEWT_GRID_FLAG_GROWX); return grid; }