Chameleon

Chameleon Commit Details

Date:2012-04-01 23:31:43 (12 years 24 days ago)
Author:armel cadet-petit
Commit:1914
Parents: 1913
Message:Regression for selectBootVolume, should work fine now with clang, llvm or gcc
Changes:
M/branches/cparm/i386/libsaio/sys.c

File differences

branches/cparm/i386/libsaio/sys.c
846846
847847
848848
849
849
850
850851
851852
852853
853
854
854
855
855856
856857
857858
858859
859860
860861
861
862862
863863
864864
......
873873
874874
875875
876
877
876
877
878878
879879
880880
881881
882882
883883
884
884
885885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
904919
905
906
907
908
909
910
911920
912921
922
923
913924
914925
915
916
926
927
917928
929
918930
919
920
931
932
933
934
921935
922936
923937
BVRef selectBootVolume( BVRef chain )
{
bool filteredChain = false;
BVRef bvr = 0;
bool foundPrimary = false;
BVRef bvr, bvr1 = 0, bvr2 = 0;
if (chain->filtered) filteredChain = true;
int gBIOSDev = (int)get_env(envgBIOSDev);
int gBIOSDev = (int)get_env(envgBIOSDev);
#if UNUSED
if (multiboot_partition_set)
for ( bvr = chain; bvr; bvr = bvr->next )
if ( bvr->part_no == multiboot_partition && bvr->biosdev == gBIOSDev )
return bvr;
#endif
/*
* Checking "Default Partition" key in system configuration - use format: hd(x,y), the volume UUID or label -
* to override the default selection.
}
}
free(val);
}
}
/*
* Scannig the volume chain backwards and trying to find
* a HFS+ volume with valid boot record signature.
* If not found any active partition then we will
* select this volume as the boot volume.
*/
for ( bvr = chain; bvr; bvr = bvr->next )
{
// zhell -- Undo a regression that was introduced from r491 to 492.
// if gBIOSBootVolume is set already, no change is required
if ( (bvr->flags & (kBVFlagBootable|kBVFlagSystemVolume))
&& gBIOSBootVolume
&& (!filteredChain || (filteredChain && bvr->visible))
&& (bvr->biosdev == gBIOSDev) )
{
goto out; /* (1) */
}
// zhell -- if gBIOSBootVolume is NOT set, we use the "if" statement
// from r491,
if ( (bvr->flags & kBVFlagBootable)
&& ! gBIOSBootVolume
&& (bvr->biosdev == gBIOSDev) )
{
goto out; /* (2) */
}
}
bvr = chain;
do {
#if UNUSED
if (multiboot_skip_partition_set) {
if (bvr->part_no == multiboot_skip_partition) {bvr = bvr->next; continue;}
}
#endif
if ( (bvr->flags & kBVFlagPrimary) && (bvr->biosdev == gBIOSDev) ) foundPrimary = true;
// zhell -- Undo a regression that was introduced from r491 to 492.
// if gBIOSBootVolume is set already, no change is required
if ( (bvr->flags & (kBVFlagBootable|kBVFlagSystemVolume))
&& gBIOSBootVolume
&& (!filteredChain || (filteredChain && bvr->visible))
&& (bvr->biosdev == gBIOSDev) )
{
bvr2 = bvr;
bvr = bvr->next;
continue;
}
// zhell -- if gBIOSBootVolume is NOT set, we use the "if" statement
// from r491,
if ( bvr->flags & kBVFlagBootable
&& ! gBIOSBootVolume
&& bvr->biosdev == gBIOSDev )
{
bvr2 = bvr;
bvr = bvr->next;
continue;
}
} while (bvr != NULL);
}
/*
* cparm:
* For cases (1) and (2), there is no need to continue the loop since only one biosdev can be the gBIOSDev
*
*/
/*
* Use the standrad method for selecting the boot volume.
*/
if (foundPrimary)
{
for ( bvr = chain; bvr; bvr = bvr->next )
{
if ( (bvr->flags & kBVFlagNativeBoot) && (bvr->biosdev == gBIOSDev) ) {break;}
if ( (bvr->flags & kBVFlagPrimary) && (bvr->biosdev == gBIOSDev) ) {break;}
if ( bvr->flags & kBVFlagNativeBoot && bvr->biosdev == gBIOSDev ) bvr1 = bvr;
if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) bvr2 = bvr;
}
}
out:
return bvr ? bvr : chain;
bvr = bvr2 ? bvr2 :
bvr1 ? bvr1 : chain;
return bvr;
}
//==========================================================================

Archive Download the corresponding diff file

Revision: 1914