FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 07-16-2010, 07:11 PM
Mark Pustjens
 
Default gdisk patches

Hi List,

Below a patch wich fixes two bugs in the gdisk package. They have been
submitted uptream but not yet been accepted. The first bug fixed is that
partition attributes are read/stored backwards. The second bug fixed is that
when changing an undefined attribute no longer junk is displayed.


I'm not sure if this is the right place, but i sent to this list mainly because
there is no official gpt fdisk list afai could find. Now this patch has a place
on the net.


Cheers!

Greetings/Groetjes

Mark Pustjens

--
diff --git a/extra/gdisk/PKGBUILD b/extra/gdisk/PKGBUILD
index 0664a57..af9b44e 100644
--- a/extra/gdisk/PKGBUILD
+++ b/extra/gdisk/PKGBUILD
@@ -9,10 +9,12 @@ arch=('i686' 'x86_64')
url="http://www.rodsbooks.com/gdisk"
depends=('gcc-libs' 'util-linux-ng' 'popt')
license=('GPL2')
-source=(http://www.rodsbooks.com/gdisk/gdisk-$pkgver.tgz)
+source=(http://www.rodsbooks.com/gdisk/gdisk-$pkgver.tgz
+ gdisk_attributes.patch)

build() {
cd $srcdir/$pkgname-$pkgver
+ patch -p1 -i "$srcdir/gdisk_attributes.patch"
make
install -D -m755 gdisk $pkgdir/sbin/gdisk
install -D -m755 sgdisk $pkgdir/sbin/sgdisk
@@ -23,4 +25,6 @@ build() {
install -D -m644 README $pkgdir/usr/share/gdisk/README
install -D -m644 NEWS pkgdir/usr/share/gdisk/NEWS
}
-md5sums=('48740d8de518f79ae9dae7ec58068d05')
+
+md5sums=('48740d8de518f79ae9dae7ec58068d05'
+ '106a4186587ab572f6397ba1702e8d47')
diff --git a/extra/gdisk/gdisk_attributes.patch
b/extra/gdisk/gdisk_attributes.patch

new file mode 100644
index 0000000..e03c957
--- /dev/null
+++ b/extra/gdisk/gdisk_attributes.patch
@@ -0,0 +1,29 @@
+diff --git a/attributes.cc b/attributes.cc
+index 527dc87..a7b2afd 100644
+--- a/attributes.cc
++++ b/attributes.cc
+@@ -26,6 +26,7 @@ Attributes::Attributes(void) {
+ // Most bits are undefined, so start by giving them an
+ // appropriate name
+ for (i = 1; i < NUM_ATR; i++) {
++ temp.str(""); // empty stream
+ temp << "Undefined bit #" << i;
+ atNames[i] = temp.str();
+ } // for
+@@ -75,12 +76,12 @@ void Attributes::ChangeAttributes(void) {
+ do {
+ response = GetNumber(0, 64, -1, (string) "Toggle which attribute field
(0-63, 64 to exit): ");

+ if (response != 64) {
+- bitValue = PowerOf2(uint32_t (NUM_ATR - response - 1)); // Find the
integer value of the bit

+- if ((bitValue & attributes) == bitValue) { // bit is set
+- attributes -= bitValue; // so unset it
++ bitValue = 1 << response;
++ if (bitValue & attributes) { // bit is set
++ attributes &= ~bitValue; // so unset it
+ cout << "Have disabled the '" << atNames[response] << "'
attribute.
";

+ } else { // bit is not set
+- attributes += bitValue; // so set it
++ attributes |= bitValue; // so set it
+ cout << "Have enabled the '" << atNames[response] << "'
attribute.
";

+ } // if/else
+ } // if
 

Thread Tools




All times are GMT. The time now is 07:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org