Version 0.6.1; very minor changes from last commit
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
0.6.1 (1/??/2009):
|
0.6.1 (1/20/2009):
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- Fixed bug that returned incorrect disk size on 32-bit versions of
|
- Fixed bug that returned incorrect disk size on 32-bit versions of
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
- Fixed bug that prevented FreeBSD version from working on disk image
|
- Fixed bug that prevented FreeBSD version from working on disk image
|
||||||
files.
|
files.
|
||||||
|
|
||||||
- Fixed bug that caused BSD disklabel conversion to not work.
|
- Fixed bug that caused BSD disklabel conversion to fail.
|
||||||
|
|
||||||
0.6.0 (1/15/2009):
|
0.6.0 (1/15/2009):
|
||||||
------------------
|
------------------
|
||||||
|
|||||||
3
gdisk.8
3
gdisk.8
@@ -539,7 +539,8 @@ tested, with the x86\-64 version having seen the most testing.
|
|||||||
The FreeBSD version of the program can't write changes to the partition
|
The FreeBSD version of the program can't write changes to the partition
|
||||||
table to a disk when existing partitions on that disk are mounted. (The
|
table to a disk when existing partitions on that disk are mounted. (The
|
||||||
same problem exists with many other FreeBSD utilities, such as
|
same problem exists with many other FreeBSD utilities, such as
|
||||||
\fBgpt\fR, \fBfdisk\fR, and \fBdd\fR.)
|
\fBgpt\fR, \fBfdisk\fR, and \fBdd\fR.) This limitation can be overcome
|
||||||
|
by typing \fBsysctl kern.geom.debugflags=16\fR at a shell prompt.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B *
|
.B *
|
||||||
|
|||||||
8
gpt.cc
8
gpt.cc
@@ -542,8 +542,14 @@ int GPTData::LoadPartitions(char* deviceFilename) {
|
|||||||
fd = OpenForWrite(deviceFilename);
|
fd = OpenForWrite(deviceFilename);
|
||||||
if ((fd == -1) && (!justLooking)) {
|
if ((fd == -1) && (!justLooking)) {
|
||||||
printf("\aNOTE: Write test failed with error number %d. It will be "
|
printf("\aNOTE: Write test failed with error number %d. It will be "
|
||||||
"impossible to save\nchanges to this disk's partition table!\n\n",
|
"impossible to save\nchanges to this disk's partition table!\n",
|
||||||
errno);
|
errno);
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
printf("You may be able to enable writes by exiting this program, typing\n"
|
||||||
|
"'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this\n"
|
||||||
|
"program.\n");
|
||||||
|
#endif
|
||||||
|
printf("\n");
|
||||||
justLooking = 1;
|
justLooking = 1;
|
||||||
} // if
|
} // if
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|||||||
2
gpt.h
2
gpt.h
@@ -16,7 +16,7 @@
|
|||||||
#ifndef __GPTSTRUCTS
|
#ifndef __GPTSTRUCTS
|
||||||
#define __GPTSTRUCTS
|
#define __GPTSTRUCTS
|
||||||
|
|
||||||
#define GPTFDISK_VERSION "0.6.1-pre3"
|
#define GPTFDISK_VERSION "0.6.1"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|||||||
3
sgdisk.8
3
sgdisk.8
@@ -367,7 +367,8 @@ tested, with the x86\-64 version having seen the most testing.
|
|||||||
The FreeBSD version of the program can't write changes to the partition
|
The FreeBSD version of the program can't write changes to the partition
|
||||||
table to a disk when existing partitions on that disk are mounted. (The
|
table to a disk when existing partitions on that disk are mounted. (The
|
||||||
same problem exists with many other FreeBSD utilities, such as
|
same problem exists with many other FreeBSD utilities, such as
|
||||||
\fBgpt\fR, \fBfdisk\fR, and \fBdd\fR.)
|
\fBgpt\fR, \fBfdisk\fR, and \fBdd\fR.) This limitation can be overcome
|
||||||
|
by typing \fBsysctl kern.geom.debugflags=16\fR at a shell prompt.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B *
|
.B *
|
||||||
|
|||||||
10
support.cc
10
support.cc
@@ -585,10 +585,10 @@ int myWrite(int fd, char* buffer, int numBytes) {
|
|||||||
**************************************************************************************/
|
**************************************************************************************/
|
||||||
|
|
||||||
// The disksize function is taken from the Linux fdisk code and modified
|
// The disksize function is taken from the Linux fdisk code and modified
|
||||||
// to work around a problem returning a uint64_t value on Mac OS.
|
// greatly since then to enable FreeBSD and MacOS support, as well as to
|
||||||
|
// return correct values for disk image files.
|
||||||
uint64_t disksize(int fd, int *err) {
|
uint64_t disksize(int fd, int *err) {
|
||||||
long sz; // Do not delete; needed for Linux
|
long sz; // Do not delete; needed for Linux
|
||||||
off_t size = 0; // Do not delete; needed for FreeBSD
|
|
||||||
long long b; // Do not delete; needed for Linux
|
long long b; // Do not delete; needed for Linux
|
||||||
uint64_t sectors = 0; // size in sectors
|
uint64_t sectors = 0; // size in sectors
|
||||||
off_t bytes = 0; // size in bytes
|
off_t bytes = 0; // size in bytes
|
||||||
@@ -603,9 +603,9 @@ uint64_t disksize(int fd, int *err) {
|
|||||||
*err = ioctl(fd, DKIOCGETBLOCKCOUNT, §ors);
|
*err = ioctl(fd, DKIOCGETBLOCKCOUNT, §ors);
|
||||||
#else
|
#else
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
*err = ioctl(fd, DIOCGMEDIASIZE, &size);
|
*err = ioctl(fd, DIOCGMEDIASIZE, &bytes);
|
||||||
b = GetBlockSize(fd);
|
b = GetBlockSize(fd);
|
||||||
sectors = size / b;
|
sectors = bytes / b;
|
||||||
#else
|
#else
|
||||||
*err = ioctl(fd, BLKGETSIZE, &sz);
|
*err = ioctl(fd, BLKGETSIZE, &sz);
|
||||||
if (*err) {
|
if (*err) {
|
||||||
@@ -629,7 +629,7 @@ uint64_t disksize(int fd, int *err) {
|
|||||||
// what have you) and see what stat() gives us....
|
// what have you) and see what stat() gives us....
|
||||||
if ((sectors == 0) || (*err == -1)) {
|
if ((sectors == 0) || (*err == -1)) {
|
||||||
if (fstat64(fd, &st) == 0) {
|
if (fstat64(fd, &st) == 0) {
|
||||||
bytes = (uint64_t) st.st_size;
|
bytes = (off_t) st.st_size;
|
||||||
if ((bytes % UINT64_C(512)) != 0)
|
if ((bytes % UINT64_C(512)) != 0)
|
||||||
fprintf(stderr, "Warning: File size is not a multiple of 512 bytes!"
|
fprintf(stderr, "Warning: File size is not a multiple of 512 bytes!"
|
||||||
" Misbehavior is likely!\n\a");
|
" Misbehavior is likely!\n\a");
|
||||||
|
|||||||
Reference in New Issue
Block a user