Chameleon

Chameleon Commit Details

Date:2010-01-16 08:20:15 (9 years 9 months ago)
Author:Rekursor
Commit:9
Parents: 8
Message:Added a new 'Rename Partition' feature permitting to rename 1 or several partition name, syntax is documented in BootHelp.txt file. Works great, say goodbye to 'system reserved' partition names !
Changes:
M/branches/rekursor/doc/BootHelp.txt
M/branches/rekursor/i386/libsaio/disk.c
M/branches/rekursor/i386/boot2/boot.h
M/branches/rekursor/CHANGES

File differences

branches/rekursor/doc/BootHelp.txt
5151
5252
5353
54
55
56
5457
5558
5659
"Hide Partition" Remove unwanted partition(s) from the boot menu.
=hd(x,y) [hd(m,n)]
"Rename Partition" Rename partition(s) for the boot menu.
=hd(x,y) <alias>[;hd(m,n) <alias2> ...]
GUI=No Disable the GUI (enabled by default).
"Boot Banner"=Yes|No Show boot banner in GUI mode (enabled by default).
"Legacy Logo"=Yes|No Use the legacy grey apple logo (disabled by default).
branches/rekursor/CHANGES
1
2
13
24
35
- Added a new 'Rename Partition Feature', now permitting to rename partition
like 'System reserved' to a more meaningful name
- Added SystemID option permitting to change the System UUID to a fixed/reproduceable value.
- Added the PciRoot autodetection feature imported from pcefi10.5
- Added automatic "system-id" injection from dmi bios, also compatible with SystemID boot option and former SMUUID from smbios,plist
branches/rekursor/i386/libsaio/disk.c
16791679
16801680
16811681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
16821703
16831704
16841705
......
16901711
16911712
16921713
1714
1715
1716
1717
1718
1719
1720
1721
16931722
16941723
16951724
......
17141743
17151744
17161745
1746
1747
17171748
17181749
17191750
17201751
17211752
1722
17231753
17241754
17251755
//==========================================================================
/* If Rename Partition has defined an alias, then extract it for description purpose */
static const char * getVolumeLabelAlias( BVRef bvr, const char * str, long strMaxLen)
{
const int MAX_ALIAS_SIZE=31;
static char szAlias[MAX_ALIAS_SIZE+1];
char *q=szAlias;
const char * szAliases = getStringForKey(kRenamePartition, &bootInfo->bootConfig);
if (!str || !*str || !szAliases) return 0; // no renaming wanted
const char * p = strstr(szAliases, str);
if(!p || !(*p)) return 0; // this volume must not be renamed, or option is malformed
p+= strlen(str); // skip the "hd(n,m) " field
// multiple aliases can be found separated by a semi-column
while(*p && *p != ';' && q<(szAlias+MAX_ALIAS_SIZE)) *q++=*p++;
*q='\0';
return szAlias;
}
void getBootVolumeDescription( BVRef bvr, char * str, long strMaxLen, bool verbose )
{
unsigned char type = (unsigned char) bvr->part_type;
for (; strMaxLen > 0 && *p != '\0'; p++, strMaxLen--);
}
// See if we should get the renamed alias name for this partion:
const char * szAliasName = getVolumeLabelAlias(bvr, str, strMaxLen);
if (szAliasName && *szAliasName)
{
strncpy(bvr->label, szAliasName, strMaxLen);
return; // we're done here no need to seek for real name
}
//
// Get the volume label using filesystem specific functions
// or use the alternate volume label if available.
}
}
/* See if a partion rename is wanted: */
// Set the devices label
sprintf(bvr->label, p);
}
//==========================================================================
int readBootSector( int biosdev, unsigned int secno, void * buffer )
{
struct disk_blk0 * bootSector = (struct disk_blk0 *) buffer;
branches/rekursor/i386/boot2/boot.h
8585
8686
8787
88
8889
8990
9091
#define kDefaultPartition"Default Partition"/* sys.c */
#define kDeviceProperties"device-properties"/* device_inject.c */
#define kHidePartition"Hide Partition"/* disk.c */
#define kRenamePartition"Rename Partition"/* disk.c */
/*
* Flags to the booter or kernel

Archive Download the corresponding diff file

Revision: 9