Index: branches/rekursor/doc/BootHelp.txt =================================================================== --- branches/rekursor/doc/BootHelp.txt (revision 8) +++ branches/rekursor/doc/BootHelp.txt (revision 9) @@ -51,6 +51,9 @@ "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) [;hd(m,n) ...] + 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). Index: branches/rekursor/CHANGES =================================================================== --- branches/rekursor/CHANGES (revision 8) +++ branches/rekursor/CHANGES (revision 9) @@ -1,3 +1,5 @@ +- 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 Index: branches/rekursor/i386/libsaio/disk.c =================================================================== --- branches/rekursor/i386/libsaio/disk.c (revision 8) +++ branches/rekursor/i386/libsaio/disk.c (revision 9) @@ -1679,6 +1679,27 @@ //========================================================================== +/* 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; @@ -1690,6 +1711,14 @@ 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. @@ -1714,12 +1743,13 @@ } } + /* 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; Index: branches/rekursor/i386/boot2/boot.h =================================================================== --- branches/rekursor/i386/boot2/boot.h (revision 8) +++ branches/rekursor/i386/boot2/boot.h (revision 9) @@ -85,6 +85,7 @@ #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