mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 02:42:58 +02:00
Swap-Abfrage gefixt.
Prototyp der Core-Scripte. sshctrl gefixt. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@839 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -360,7 +360,7 @@ int main(int argc, char *argv[])
|
||||
swap_file = memory;
|
||||
|
||||
/* Calculating Root-Size dependend of Max Disk Space */
|
||||
if ( disk < 1024 )
|
||||
if ( disk < 756 )
|
||||
root_partition = 256;
|
||||
else if ( disk >= 1024 && disk <= 3072 )
|
||||
root_partition = 512;
|
||||
@@ -375,8 +375,17 @@ int main(int argc, char *argv[])
|
||||
fprintf(flog, ", boot = %ld, swap = %ld, mylog = %ld, root = %ld\n",
|
||||
boot_partition, swap_file, system_partition, root_partition);
|
||||
|
||||
if ( (!unattended) && (((disk - (root_partition + swap_file + boot_partition)) < 256 ) && ((disk - (root_partition + boot_partition)) > 256)) ) {
|
||||
rc = newtWinChoice(title, ctr[TR_CONTINUE_NO_SWAP], ctr[TR_OK], ctr[TR_CANCEL]);
|
||||
if ( (!unattended) && (((disk - (root_partition + swap_file + boot_partition)) < 256 ) && ((disk - (root_partition + boot_partition + 32 )) > 256)) ) {
|
||||
rc = newtWinChoice(title, ctr[TR_OK], ctr[TR_CANCEL], ctr[TR_CONTINUE_NO_SWAP]);
|
||||
if (rc != 0){
|
||||
swap_file = 32;
|
||||
system_partition = disk - ( root_partition + swap_file + boot_partition );
|
||||
fprintf(flog, "Changing Swap Size to 32 MB.\n");
|
||||
}
|
||||
else {
|
||||
fprintf(flog, "Disk is too small.\n");
|
||||
errorbox(ctr[TR_DISK_TOO_SMALL]);goto EXIT;
|
||||
}
|
||||
}
|
||||
else if (disk - (root_partition + swap_file + boot_partition) >= 256) {
|
||||
|
||||
@@ -385,11 +394,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(flog, "Disk is too small.\n");
|
||||
errorbox(ctr[TR_DISK_TOO_SMALL]);goto EXIT;
|
||||
}
|
||||
if (rc != 1){
|
||||
swap_file = 0;
|
||||
fprintf(flog, "Changing Swap Size to 0.\n");
|
||||
}
|
||||
|
||||
|
||||
handle = fopen("/tmp/partitiontable", "w");
|
||||
|
||||
/* Make swapfile */
|
||||
|
||||
@@ -130,7 +130,6 @@ int main(int argc, char *argv[])
|
||||
sleep(5);
|
||||
unlink("/var/ipfire/remote/enablessh");
|
||||
safe_system("cat /var/ipfire/remote/settings | sed 's/ENABLE_SSH=on/ENABLE_SSH=off/' > /var/ipfire/remote/settings2 && mv /var/ipfire/remote/settings2 /var/ipfire/remote/settings");
|
||||
argv[1]
|
||||
snprintf(command, BUFFER_SIZE-1, "sleep %s && /usr/local/bin/sshctrl &", argv[2]);
|
||||
safe_system(command);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user