mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Really set boot slice correctly
This commit is contained in:
parent
99623bd57a
commit
febdce5a6c
@ -57,6 +57,7 @@ if(strstr($REAL_BOOT_DEVICE, "s1")) {
|
||||
$UFS_ID="1";
|
||||
$OLD_UFS_ID="0";
|
||||
$BOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
|
||||
|
||||
} else {
|
||||
$SLICE="1";
|
||||
$OLDSLICE="2";
|
||||
@ -90,21 +91,21 @@ EOF;
|
||||
if(strstr($_POST['bootslice'], "s2")) {
|
||||
$ASLICE="2";
|
||||
$AOLDSLICE="1";
|
||||
$ATOFLASH="{$BOOT_DRIVE}s{$SLICE}";
|
||||
$ACOMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
|
||||
$ATOFLASH="{$BOOT_DRIVE}s{$ASLICE}";
|
||||
$ACOMPLETE_PATH="{$ABOOT_DRIVE}s{$ASLICE}a";
|
||||
$AGLABEL_SLICE="pfsense1";
|
||||
$AUFS_ID="1";
|
||||
$AOLD_UFS_ID="0";
|
||||
$ABOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
|
||||
$ABOOTFLASH="{$ABOOT_DRIVE}s{$AOLDSLICE}";
|
||||
} else {
|
||||
$ASLICE="1";
|
||||
$AOLDSLICE="2";
|
||||
$ATOFLASH="{$BOOT_DRIVE}s{$SLICE}";
|
||||
$ACOMPLETE_PATH="{$BOOT_DRIVE}s{$SLICE}a";
|
||||
$ATOFLASH="{$ABOOT_DRIVE}s{$ASLICE}";
|
||||
$ACOMPLETE_PATH="{$ABOOT_DRIVE}s{$ASLICE}a";
|
||||
$AGLABEL_SLICE="pfsense0";
|
||||
$AUFS_ID="0";
|
||||
$AOLD_UFS_ID="1";
|
||||
$ABOOTFLASH="{$BOOT_DRIVE}s{$OLDSLICE}";
|
||||
$ABOOTFLASH="{$ABOOT_DRIVE}s{$AOLDSLICE}";
|
||||
}
|
||||
exec("gpart set -a active -i {$ASLICE} {$ABOOT_DRIVE}");
|
||||
exec("/usr/sbin/boot0cfg -s {$ASLICE} -v /dev/{$ABOOT_DRIVE}");
|
||||
@ -112,13 +113,13 @@ EOF;
|
||||
exec("/sbin/fsck_ufs -y /dev/{$ACOMPLETE_PATH}");
|
||||
exec("/sbin/mount /dev/ufs/{$AGLABEL_SLICE} /tmp/{$AGLABEL_SLICE}");
|
||||
exec("/bin/cp /etc/fstab /tmp/{$AGLABEL_SLICE}/etc/fstab");
|
||||
$status = exec("sed -i \"\" \"s/pfsense{$OLD_UFS_ID}/pfsense{$UFS_ID}/g\" /tmp/{$AGLABEL_SLICE}/etc/fstab");
|
||||
if($status) {
|
||||
file_notice("UpgradeFailure","Something went wrong when trying to update the fstab entry. Aborting upgrade.");
|
||||
exec("/sbin/umount /tmp/{$AGLABEL_SLICE}");
|
||||
}
|
||||
$fstab = <<<EOF
|
||||
/dev/ufs/{$AGLABEL_SLICE} / ufs ro 1 1
|
||||
/dev/ufs/cf /cf ufs ro 1 1
|
||||
EOF;
|
||||
file_put_contents("/tmp/{$AGLABEL_SLICE}/etc/fstab", $fstab);
|
||||
exec("/sbin/umount /tmp/{$AGLABEL_SLICE}");
|
||||
$savemsg = "The boot slice has been set to {$ABOOT_DRIVE} {$ASLICE}";
|
||||
$savemsg = "The boot slice has been set to {$ABOOT_DRIVE} {$AGLABEL_SLICE}";
|
||||
}
|
||||
|
||||
if($_POST['destslice']) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user