summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2008-01-15 12:05:21 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2008-01-15 12:05:21 +0000
commit9840537aefcfc622f7f965cacaa8f60382307faf (patch)
tree6cb8938e4cdb02b9ea22a1569a101f2ddd31712d /sys-block
parentMove bubblemon-2.0.8 from SLOT 0 to 1. (diff)
downloadgentoo-2-9840537aefcfc622f7f965cacaa8f60382307faf.tar.gz
gentoo-2-9840537aefcfc622f7f965cacaa8f60382307faf.tar.bz2
gentoo-2-9840537aefcfc622f7f965cacaa8f60382307faf.zip
Version bump, ported patches, fixed pam auth, fixed amd64.
(Portage version: 2.1.3.9)
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/partimage/ChangeLog20
-rw-r--r--sys-block/partimage/files/digest-partimage-0.6.63
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch860
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch35
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-chown.patch40
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch110
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-datadir-path.patch58
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch15
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch64
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-gui.diff37
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-not_install_info.patch21
-rw-r--r--sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch39
-rw-r--r--sys-block/partimage/partimage-0.6.4-r3.ebuild4
-rw-r--r--sys-block/partimage/partimage-0.6.4-r4.ebuild4
-rw-r--r--sys-block/partimage/partimage-0.6.6.ebuild175
15 files changed, 1479 insertions, 6 deletions
diff --git a/sys-block/partimage/ChangeLog b/sys-block/partimage/ChangeLog
index ee818dd6369c..5ac32aa1fad6 100644
--- a/sys-block/partimage/ChangeLog
+++ b/sys-block/partimage/ChangeLog
@@ -1,6 +1,22 @@
# ChangeLog for sys-block/partimage
-# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/ChangeLog,v 1.28 2007/04/28 13:10:38 tove Exp $
+# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/ChangeLog,v 1.29 2008/01/15 12:05:20 xmerlin Exp $
+
+*partimage-0.6.6 (15 Jan 2008)
+
+ 15 Jan 2008; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/partimage-0.6.6-andre-przywara_amd64.patch,
+ +files/partimage-0.6.6-andre-przywara_warnings.patch,
+ +files/partimage-0.6.6-chown.patch,
+ +files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch,
+ +files/partimage-0.6.6-datadir-path.patch,
+ +files/partimage-0.6.6-disable_header_check.patch,
+ +files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch,
+ +files/partimage-0.6.6-gui.diff,
+ +files/partimage-0.6.6-not_install_info.patch,
+ +files/partimage-0.6.6-thread-privilege-fix.patch,
+ +partimage-0.6.6.ebuild:
+ Version bump, ported patches, fixed pam auth, fixed amd64.
28 Apr 2007; Torsten Veller <tove@gentoo.org> partimage-0.6.4-r3.ebuild,
partimage-0.6.4-r4.ebuild:
diff --git a/sys-block/partimage/files/digest-partimage-0.6.6 b/sys-block/partimage/files/digest-partimage-0.6.6
new file mode 100644
index 000000000000..0281b39435a6
--- /dev/null
+++ b/sys-block/partimage/files/digest-partimage-0.6.6
@@ -0,0 +1,3 @@
+MD5 abfa9fd02f3ab46bcc636eadf2308580 partimage-0.6.6.tar.bz2 524695
+RMD160 8bad0dd706d88dee27531766daf7611d95bb0a04 partimage-0.6.6.tar.bz2 524695
+SHA256 0bf5d720094777ae0aa258a00f30cee6988c026558eea20087aa20d46b81b2bd partimage-0.6.6.tar.bz2 524695
diff --git a/sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch b/sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch
new file mode 100644
index 000000000000..d81e260cd6de
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-andre-przywara_amd64.patch
@@ -0,0 +1,860 @@
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_afs.cpp
+--- a/src/client/fs/fs_afs.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_afs.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -285,10 +285,10 @@ void CAfsPart::printfInformations()
+ getStdInfos(szText, sizeof(szText), false);
+
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+- "Allocation groups count:......%lu\n"
+- "Byte order:...................%lu\n"
+- "Blocks per group:.............%lu\n"
+- "Boot loader size:.............%lu blocks\n"),
++ "Allocation groups count:......%u\n"
++ "Byte order:...................%u\n"
++ "Blocks per group:.............%u\n"
++ "Boot loader size:.............%u blocks\n"),
+ szText, m_info.dwAllocGroupCount, m_info.dwByteOrder,
+ m_info.dwBlockPerGroup, m_info.dwBootLoaderSize);
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_base.cpp
+--- a/src/client/fs/fs_base.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_base.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -14,6 +14,9 @@
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
++
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+
+ #include "fs_base.h"
+ #include "partimage.h"
+@@ -727,10 +730,10 @@ int CFSBase::getStdInfos(char *szDest, i
+
+ if (bShowBlocksInfo)
+ {
+- SNPRINTF(szBlocksInfo, i18n("Block size....................%llu bytes\n"
+- "Total blocks count............%llu\n"
+- "Used blocks count.............%llu\n"
+- "Free blocks count.............%llu\n"),
++ SNPRINTF(szBlocksInfo, i18n("Block size....................%"PRIu64" bytes\n"
++ "Total blocks count............%"PRIu64"\n"
++ "Used blocks count.............%"PRIu64"\n"
++ "Free blocks count.............%"PRIu64"\n"),
+ m_header.qwBlockSize,
+ m_header.qwBlocksCount,
+ m_header.qwUsedBlocks,
+@@ -742,7 +745,7 @@ int CFSBase::getStdInfos(char *szDest, i
+ }
+
+ snprintf(szDest, nMaxLen, i18n("%s" // Blocks infos
+- "Space usage:..................%llu %%\n"
++ "Space usage:..................%"PRIu64" %%\n"
+ "Used space....................%s\n"
+ "Free space....................%s\n"
+ "Bitmap size...................%s\n"
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_ext2.cpp
+--- a/src/client/fs/fs_ext2.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_ext2.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -103,12 +103,12 @@ void CExt2Part::printfInformations()
+ getStdInfos(szText, sizeof(szText), false);
+
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+- "Number of groups..............%lu\n"
+- "First block...................%lu\n"
++ "Number of groups..............%u\n"
++ "First block...................%u\n"
+ "Ext3fs journalization.........%s\n"
+ "Sparse super block............%s\n"
+ "Large files support...........%s\n"
+- "File system revision..........%lu\n"),
++ "File system revision..........%u\n"),
+ szText, m_info.dwGroupsCount, m_info.dwFirstBlock,
+ (m_info.dwFeatureCompat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) ? i18n("yes") : i18n("no"),
+ (m_info.dwFeatureRoCompat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER) ? i18n("yes") : i18n("no"),
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_fat.cpp
+--- a/src/client/fs/fs_fat.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_fat.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -124,14 +124,14 @@ void CFatPart::printfInformations()
+ "Sector Size...................%u\n"
+ "Sectors per cluster...........%u\n"
+ "Reserved Sectors count........%u\n"
+- "Root directory sectors........%lu\n"
++ "Root directory sectors........%u\n"
+ "FAT tables count..............%u\n"
+- "Total Sectors Count...........%lu\n"
+- "Sectors per FAT...............%lu\n"
+- "Clusters count:...............%lu\n"
+- "Used clusters.................%lu\n"
+- "Free clusters.................%lu\n"
+- "Damaged clusters..............%lu\n"),
++ "Total Sectors Count...........%u\n"
++ "Sectors per FAT...............%u\n"
++ "Clusters count:...............%u\n"
++ "Used clusters.................%u\n"
++ "Free clusters.................%u\n"
++ "Damaged clusters..............%u\n"),
+ szText, m_info.wBytesPerSector, m_info.cSectorsPerCluster,
+ m_info.wReservedSectorsCount, m_info.dwRootDirSectors,
+ m_info.cNumberOfFATs,m_info.dwTotalSectorsCount,
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_hfs.cpp
+--- a/src/client/fs/fs_hfs.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_hfs.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -22,6 +22,8 @@
+ #include "gui_text.h"
+
+ #include <stdio.h>
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+
+ // =======================================================
+ CHfsPart::CHfsPart(char *szDevice, FILE *fDeviceFile, QWORD qwPartSize): CFSBase(szDevice, fDeviceFile, qwPartSize)
+@@ -140,10 +142,10 @@ void CHfsPart::printfInformations()
+ getStdInfos(szText, sizeof(szText), true);
+
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+- "Allocation Group count:.......%llu\n"
+- "Blocks per Allocation Group...%lu\n"
++ "Allocation Group count:.......%"PRIu64"\n"
++ "Blocks per Allocation Group...%u\n"
+ "Allocation Group size:........%s\n"
+- "First allocation block:.......%llu\n"),
++ "First allocation block:.......%"PRIu64"\n"),
+ szText, m_info.qwAllocCount, m_info.dwBlocksPerAlloc,
+ formatSize(m_info.dwAllocSize,szTemp1), m_info.qwFirstAllocBlock);
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_ntfs.cpp
+--- a/src/client/fs/fs_ntfs.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_ntfs.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -18,6 +18,9 @@
+ #include "partimage.h"
+ #include "imagefile.h"
+ #include "fs_ntfs.h"
++
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+
+ // =======================================================
+ CNtfsPart::CNtfsPart(char *szDevice, FILE *fDeviceFile, QWORD qwPartSize): CFSBase(szDevice, fDeviceFile, qwPartSize)
+@@ -308,8 +311,8 @@ void CNtfsPart::printfInformations()
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+ "Bytes per sector..............%u\n"
+ "Sectors per cluster...........%u\n"
+- "File record size..............%lu\n"
+- "LCN of MFT Data attrib........%llu\n"),
++ "File record size..............%u\n"
++ "LCN of MFT Data attrib........%"PRIu64"\n"),
+ szText, m_info.nBytesPerSector, m_info.cSectorsPerCluster,
+ m_info.dwFileRecordSize, m_info.qwLCNOfMftDataAttrib);
+
+@@ -726,7 +729,7 @@ void CNtfsRunList::show()
+ QWORD i;
+
+ for (i=0L; i < m_qwClustersCount; i++)
+- fprintf(stderr, "cluster[%llu] = %llu\n", i, m_qwOffset[i]);
++ fprintf(stderr, "cluster[%llu] = %"PRIu64"\n", i, m_qwOffset[i]);
+
+ }
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_ufs.cpp
+--- a/src/client/fs/fs_ufs.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_ufs.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -25,6 +25,9 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
++
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+
+ #include "fs_ufs.h"
+ #include "partimage.h"
+@@ -210,11 +213,11 @@ void CUfsPart::printfInformations()
+ getStdInfos(szText, sizeof(szText), true);
+
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+- "Cylinder groups count:........%lu\n"
++ "Cylinder groups count:........%u\n"
+ "Cylinder group size:..........%s\n"
+- "Basic blocks per CG:..........%lu\n"
+- "Basic block size:.............%lu\n"
+- "Data frags count:.............%llu\n"),
++ "Basic blocks per CG:..........%u\n"
++ "Basic block size:.............%u\n"
++ "Data frags count:.............%"PRIu64"\n"),
+ szText, m_info.dwCylinderGroupsCount,
+ formatSize(m_info.dwCylinderGroupSize*m_info.dwBasicBlockSize,szTemp1),
+ m_info.dwCylinderGroupSize, m_info.dwBasicBlockSize, m_info.qwDataFrags);
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/fs/fs_xfs.cpp
+--- a/src/client/fs/fs_xfs.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/fs/fs_xfs.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -208,8 +208,8 @@ void CXfsPart::printfInformations()
+ getStdInfos(szText, sizeof(szText), true);
+
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+- "Allocation Group count:.......%lu\n"
+- "Blocks per Allocation Group...%lu\n"
++ "Allocation Group count:.......%u\n"
++ "Blocks per Allocation Group...%u\n"
+ "Allocation Group size:........%s\n"),
+ szText, m_info.dwAgCount, m_info.dwAgBlocksCount,
+ formatSize(m_info.dwAgBlocksCount*m_header.qwBlockSize,szTemp1));
+@@ -300,7 +300,7 @@ char* blocknum(char *szBuffer, DWORD dwB
+ char* blocknum(char *szBuffer, DWORD dwBn)
+ {
+ if (dwBn != NULLAGBLOCK)
+- sprintf(szBuffer, "%lu", dwBn);
++ sprintf(szBuffer, "%u", dwBn);
+ else
+ sprintf(szBuffer, "NULLAGBLOCK");
+ return szBuffer;
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/gui_text.cpp
+--- a/src/client/gui_text.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/gui_text.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -29,6 +29,8 @@
+ #include <stdlib.h>
+ #include <errno.h>
+
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+ // =======================================================
+ void CRestoreMbrWindow::addHardDisk(char *szText, DWORD dwNumber)
+ {
+@@ -81,12 +83,12 @@ int CRestoreMbrWindow::create()
+ }
+
+ // =======================================================
+-void CRestoreMbrWindow::getValues(DWORD *dwCurrentMbrNb, DWORD *dwOriginalMbrNb, int *nRestoreMode)
+-{
+- BEGIN;
+-
+- *dwCurrentMbrNb = (DWORD) newtListboxGetCurrent(m_list1);
+- *dwOriginalMbrNb = (DWORD) newtListboxGetCurrent(m_list2);
++void CRestoreMbrWindow::getValues(uintptr_t *dwCurrentMbrNb, uintptr_t *dwOriginalMbrNb, int *nRestoreMode)
++{
++ BEGIN;
++
++ *dwCurrentMbrNb = (uintptr_t) newtListboxGetCurrent(m_list1);
++ *dwOriginalMbrNb = (uintptr_t) newtListboxGetCurrent(m_list2);
+
+ if (newtRadioGetCurrent(m_radioFull) == m_radioFull)
+ *nRestoreMode = MBR_RESTORE_WHOLE;
+@@ -339,7 +341,7 @@ int CSaveOptWindow::create(char *szImage
+ m_labelSplit = newtLabel(1, 12, i18n("Image split mode"));
+ m_radioSplitAuto = newtRadiobutton(1, 13, i18n("Automatic split (when no space left)"), !options.qwSplitSize, NULL);
+ m_radioSplitSize = newtRadiobutton(1, 14, i18n("Into files whose size is:............"), !!options.qwSplitSize, m_radioSplitAuto);
+- SNPRINTF(szTemp, "%llu", (!!options.qwSplitSize) ? (options.qwSplitSize/1024/1024) : 2048);
++ SNPRINTF(szTemp, "%"PRIu64"", (!!options.qwSplitSize) ? (options.qwSplitSize/1024/1024) : 2048);
+ m_editSplitSize = newtEntry(43, 14, szTemp, 8, NULL, 0);
+ m_labelSplitSizeKB = newtLabel(52, 14, i18n("MiB"));
+ m_checkSplitWait = newtCheckbox(1, 15, i18n("Wait after each volume change"), (!!options.bSplitWait ? 'X' : ' '), " X", NULL);
+@@ -460,7 +462,7 @@ int CSavingWindow::create(const char *sz
+ SNPRINTF(szTemp, i18n("Partition to save:...........%s"), szDevice);
+ m_labelPartition = newtLabel(1, 0, szTemp);
+
+- SNPRINTF(szTemp, i18n("Size of the Partition:.......%s = %llu bytes"), formatSize(qwPartSize, szTemp2), qwPartSize);
++ SNPRINTF(szTemp, i18n("Size of the Partition:.......%s = %"PRIu64" bytes"), formatSize(qwPartSize, szTemp2), qwPartSize);
+ m_labelPartitionSize = newtLabel(1, 1, szTemp);
+
+ SNPRINTF(szTemp, i18n("Image file to create.........%s"), szImageFile);
+@@ -608,7 +610,7 @@ void CSavingWindow::showImageFileInfo(ch
+ newtLabelSetText(m_labelImageFileSize, szTemp);
+ }
+
+- SNPRINTF (szTemp, i18n("Available space for image:...%s = %llu bytes"), formatSize(qwFreeSpace, szTemp2), qwFreeSpace);
++ SNPRINTF (szTemp, i18n("Available space for image:...%s = %"PRIu64" bytes"), formatSize(qwFreeSpace, szTemp2), qwFreeSpace);
+ newtLabelSetText(m_labelFreeSpace, szTemp);
+
+ //option -B gui=no
+@@ -696,8 +698,27 @@ int CRestoreOptWindow::getValues(COption
+ RETURN_int(0);
+ }
+
+-// =======================================================
+-int CRestoringWindow::create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, tm dateCreate, QWORD qwOrigPartSize, COptions * options)
++static char *asctime_portable (const struct portable_tm *__tp)
++{
++struct tm tms;
++
++ tms.tm_sec=__tp->tm_sec;
++ tms.tm_min=__tp->tm_min;
++ tms.tm_hour=__tp->tm_hour;
++ tms.tm_mday=__tp->tm_mday;
++ tms.tm_mon=__tp->tm_mon;
++ tms.tm_year=__tp->tm_year;
++ tms.tm_wday=__tp->tm_wday;
++ tms.tm_yday=__tp->tm_yday;
++ tms.tm_isdst=__tp->tm_isdst;
++ tms.tm_gmtoff=__tp->tm_gmtoff;
++ tms.tm_zone="UTC";
++
++ return asctime (&tms);
++}
++
++// =======================================================
++int CRestoringWindow::create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, struct portable_tm dateCreate, QWORD qwOrigPartSize, COptions * options)
+ {
+ BEGIN;
+
+@@ -713,7 +734,7 @@ int CRestoringWindow::create(char *szDev
+ SNPRINTF(szTemp, i18n("Partition to restore:.............%s"), szDevice);
+ m_labelPartition = newtLabel(1, 0, szTemp);
+
+- SNPRINTF(szTemp, i18n("Size of partition to restore:.....%s = %llu bytes"), formatSize(qwCurPartSize, szTemp2), qwCurPartSize);
++ SNPRINTF(szTemp, i18n("Size of partition to restore:.....%s = %"PRIu64" bytes"), formatSize(qwCurPartSize, szTemp2), qwCurPartSize);
+ m_labelPartitionSize = newtLabel(1, 1, szTemp);
+
+ SNPRINTF(szTemp, i18n("Image file to use.................%s"), szImageFile);
+@@ -727,10 +748,10 @@ int CRestoringWindow::create(char *szDev
+ SNPRINTF(szTemp, i18n("Partition was on device:..........%s\n"), szOriginalDevice);
+ m_labelOldDevice = newtLabel(1, 5, szTemp);
+
+- SNPRINTF(szTemp, i18n("Image created on:.................%s\n"), asctime(&dateCreate));
++ SNPRINTF(szTemp, i18n("Image created on:.................%s\n"), asctime_portable(&dateCreate));
+ m_labelDate = newtLabel(1, 6, szTemp);
+
+- SNPRINTF(szTemp, i18n("Size of the original partition:...%s = %llu bytes"), formatSize(qwOrigPartSize, szTemp2), qwOrigPartSize);
++ SNPRINTF(szTemp, i18n("Size of the original partition:...%s = %"PRIu64" bytes"), formatSize(qwOrigPartSize, szTemp2), qwOrigPartSize);
+ m_labelOriginalPartitionSize = newtLabel(1, 7, szTemp);
+
+ // stats
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/gui_text.h
+--- a/src/client/gui_text.h Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/gui_text.h Tue Sep 04 21:43:30 2007 +0200
+@@ -56,7 +56,7 @@ class CRestoreMbrWindow: public COptions
+ void addMbr(char *szText, DWORD dwNumber);
+ //int runForm();
+ //void destroyForm();
+- void getValues(DWORD *dwCurrentMbrNb, DWORD *dwOriginalMbrNb, int *nRestoreMode);
++ void getValues(uintptr_t *dwCurrentMbrNb, uintptr_t *dwOriginalMbrNb, int *nRestoreMode);
+
+ private:
+ //newtComponent m_formMain;
+@@ -124,7 +124,7 @@ class CRestoringWindow
+ class CRestoringWindow
+ {
+ public:
+- int create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, tm dateCreate, QWORD qwOrigPartSize, COptions * options);
++ int create(char *szDevice, char *szImageFile, QWORD qwCurPartSize, DWORD dwCompressionMode, char *szOriginalDevice, char *szFileSystem, struct portable_tm dateCreate, QWORD qwOrigPartSize, COptions * options);
+ int runForm();
+ void destroyForm();
+ void showImageFileInfo(char *szImageFile, int nCompressionMode, char *szFullyBatchMode);
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/imagefile.cpp
+--- a/src/client/imagefile.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/imagefile.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -488,7 +488,7 @@ void CImage::splitChangeImageFileWrite()
+ }
+
+ set_dwVolumeNumber(get_dwVolumeNumber()+1); // increase the volume number
+- SNPRINTF(aux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
++ SNPRINTF(aux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
+ //*(aux+MAXPATHLEN-1) = '\0';
+
+ set_szImageFilename(aux);
+@@ -514,7 +514,7 @@ void CImage::splitChangeImageFileRead()
+
+ // increase volume number
+ set_dwVolumeNumber(get_dwVolumeNumber()+1);
+- SNPRINTF(aux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
++ SNPRINTF(aux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
+ //*(aux+MAXPATHLEN-1) = '\0';
+ set_szImageFilename(aux);
+
+@@ -700,7 +700,7 @@ int CImage::openWritingFdDisk()
+ set_szPath(aux2);
+ extractFilenameFromFullPath(szAux, aux2); // filename without path
+ set_szOriginalFilename(aux2);
+- SNPRINTF(szAux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
++ SNPRINTF(szAux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
+ set_szImageFilename(szAux);
+ nRes = openWritingFdDisk();
+ RETURN_int(nRes);
+@@ -728,7 +728,7 @@ int CImage::openWritingFdDisk()
+ case ERR_RETRY:
+ strcpy(szAux, excep->getNewString()); // endding '/' were removed
+ set_szPath(szAux);
+- SNPRINTF(aux2, "%s/%s.%.3ld", szAux, get_szOriginalFilename(),
++ SNPRINTF(aux2, "%s/%s.%.3d", szAux, get_szOriginalFilename(),
+ get_dwVolumeNumber());
+ set_szImageFilename(aux2);
+
+@@ -1068,7 +1068,7 @@ void CImage::openReading(CVolumeHeader *
+ set_szPath(aux2);
+ extractFilenameFromFullPath(szAux, aux2);
+ set_szOriginalFilename(aux2);
+- SNPRINTF(szAux, "%s/%s.%.3ld", get_szPath(),
++ SNPRINTF(szAux, "%s/%s.%.3d", get_szPath(),
+ get_szOriginalFilename(), get_dwVolumeNumber());
+ set_szImageFilename(szAux);
+ umountImageLocation();
+@@ -1132,7 +1132,7 @@ void CImage::openReading(CVolumeHeader *
+
+ if (strcmp(headVolume.szMagicString, MAGIC_BEGIN_VOLUME) != 0)
+ {
+- SNPRINTF(szAux, "%s/%s.%.3ld", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
++ SNPRINTF(szAux, "%s/%s.%.3d", get_szPath(), get_szOriginalFilename(), get_dwVolumeNumber());
+ THROW(ERR_NOTAPARTIMAGEFILE, szAux);
+ }
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/imginfo.cpp
+--- a/src/client/imginfo.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/imginfo.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -26,6 +26,29 @@
+ #include "imagefile.h"
+ #include "interface_newt.h"
+
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
++
++static char *asctime_portable (const struct portable_tm *__tp)
++{
++struct tm tms;
++
++ tms.tm_sec=__tp->tm_sec;
++ tms.tm_min=__tp->tm_min;
++ tms.tm_hour=__tp->tm_hour;
++ tms.tm_mday=__tp->tm_mday;
++ tms.tm_mon=__tp->tm_mon;
++ tms.tm_year=__tp->tm_year;
++ tms.tm_wday=__tp->tm_wday;
++ tms.tm_yday=__tp->tm_yday;
++ tms.tm_isdst=__tp->tm_isdst;
++ tms.tm_gmtoff=__tp->tm_gmtoff;
++ tms.tm_zone="UTC";
++
++ return asctime (&tms);
++}
++
++
+ // =======================================================
+ void imageInfoShowRegular(char *szText, int nMaxTextLen, CMainHeader *head, char *szImagefile, DWORD dwCompression)
+ {
+@@ -65,20 +88,20 @@ void imageInfoShowRegular(char *szText,
+ "Description:...........%s\n"
+ "Original device:.......%s\n"
+ "Original filepath:.... %s\n"
+- "Flags:.................%ld: %s\n"
++ "Flags:.................%d: %s\n"
+ "Creation date:.........%s"
+ "Partition size:........%s\n"
+ "Hostname:..............%s\n"
+ "Compatible Version:....%s\n"
+- "Encryption algorithm:..%ld -> %s\n"
+- "MBR saved count:.......%lu\n\n"
++ "Encryption algorithm:..%d -> %s\n"
++ "MBR saved count:.......%u\n\n"
+ "System of the backup:\n"
+ "- machine:.............%s\n"
+ "- operating system:....%s\n"
+ "- release:.............%s\n"
+ "\n\n"),
+ head->szFileSystem, szDescription, head->szOriginalDevice, head->szFirstImageFilepath,
+- head->dwMainFlags, szFlags, asctime(&head->dateCreate), formatSize(head->qwPartSize, cTemp), head->szHostname,
++ head->dwMainFlags, szFlags, asctime_portable(&head->dateCreate), formatSize(head->qwPartSize, cTemp), head->szHostname,
+ head->szVersion, head->dwEncryptAlgo, szEncryption, head->dwMbrCount, head->szUnameMachine,
+ head->szUnameSysname, head->szUnameRelease);
+ }
+@@ -88,7 +111,7 @@ void imageInfoShowMBR(char *szText, int
+ {
+ snprintf(szText, nMaxTextLen, i18n("-------------------- MBR %.3d -------------------\n"
+ "Device:................%s\n"
+- "Device blocks count:...%llu\n"
++ "Device blocks count:...%"PRIu64"\n"
+ "Device model:..........%s\n\n"),
+ i, mbr->szDevice, mbr->qwBlocksCount, mbr->szDescModel);
+ }
+@@ -127,10 +150,10 @@ void imageInfoShowVolume(char *szText, i
+ break;
+ }
+
+- snprintf(szText, nMaxTextLen, i18n("Volume number:.........%lu\n"
++ snprintf(szText, nMaxTextLen, i18n("Volume number:.........%u\n"
+ "Volume size:...........%s\n"
+- "Compression level: ....%ld -> %s\n"
+- "Identificator:.........%llu=%llX\n\n"),
++ "Compression level: ....%d -> %s\n"
++ "Identificator:.........%"PRIu64"=%"PRIX64"\n\n"),
+ head->dwVolumeNumber, formatSize(qwImageSize, cTemp), dwCompression,
+ szCompression, head->qwIdentificator, head->qwIdentificator);
+ }
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/interface_newt.cpp
+--- a/src/client/interface_newt.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/interface_newt.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -239,7 +239,7 @@ int CInterfaceNewt::guiInitMainWindow(ch
+ labelNetwork = newtLabel(5, 18, i18n("IP/name of the server:"));
+ editNetwork = newtEntry(28, 18, szNetworkIP, 25, NULL, 0);
+ labelPort = newtLabel(54, 18, i18n("Port:"));
+- SNPRINTF(szTemp, "%lu", *dwServerPort);
++ SNPRINTF(szTemp, "%u", *dwServerPort);
+ editPort = newtEntry(60, 18, szTemp, 6, NULL, 0);
+
+ btnContinue = newtCompactButton(50, 12, i18n("Next (F5)"));
+@@ -473,7 +473,7 @@ WORD CInterfaceNewt::askNewPath(char * s
+ char szMess[2048];
+
+ SNPRINTF(szMess, i18n("Disk full! Can't write next volume file "
+- "(%s.%.3ld)\nto %s\nPlease, enter another directory path "
++ "(%s.%.3d)\nto %s\nPlease, enter another directory path "
+ "(without filename):"), szOrigFilename, dwVolume, szPath);
+ //*(szMess+2047) = '\0';
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/main.cpp
+--- a/src/client/main.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/main.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -29,6 +29,10 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <unistd.h>
++
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
++
+ #include <sched.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+@@ -278,7 +282,7 @@ int main(int argc, char *argv[])
+ case 'V': // split image into multiple files
+
+ options.qwSplitSize = (QWORD)atol(optarg) * 1024 * 1024;
+- fprintf (stderr, i18n("Volume size: %llu bytes (%ld MiB)\n"),
++ fprintf (stderr, i18n("Volume size: %"PRIu64" bytes (%ld MiB)\n"),
+ options.qwSplitSize, atol(optarg));
+ break;
+
+@@ -971,15 +975,15 @@ int checkStructSizes()
+ {
+ // ---- check types sizes
+
+- if (sizeof(unsigned long int) != 4)
++ if (sizeof(DWORD) != 4)
+ {
+- fprintf (stderr, "Error: sizeof(DWORD) != 4 (%d)\n", sizeof(unsigned long int));
+- goto errcheck;
+- }
+-
+- if (sizeof(unsigned long long int) != 8)
++ fprintf (stderr, "Error: sizeof(DWORD) != 4 (%zd)\n", sizeof(DWORD));
++ goto errcheck;
++ }
++
++ if (sizeof(QWORD) != 8)
+ {
+- fprintf (stderr, "Error: sizeof(QWORD) != 8 (%d)\n", sizeof(unsigned long long int));
++ fprintf (stderr, "Error: sizeof(QWORD) != 8 (%zd)\n", sizeof(QWORD));
+ goto errcheck;
+ }
+
+@@ -988,7 +992,7 @@ int checkStructSizes()
+ // check main header size is 16384
+ if (sizeof(CMainHeader) != 16384)
+ {
+- fprintf (stderr, "Error: main header size != 16384 (%d)\n",
++ fprintf (stderr, "Error: main header size != 16384 (%zd)\n",
+ sizeof(CMainHeader));
+ goto errcheck;
+ }
+@@ -996,7 +1000,7 @@ int checkStructSizes()
+ // check ext2 header size is 16384
+ if (sizeof(CInfoExt2Header) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: ext2 header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: ext2 header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoExt2Header));
+ goto errcheck;
+ }
+@@ -1004,7 +1008,7 @@ int checkStructSizes()
+ // check reiserfs header size is 16384
+ if (sizeof(CInfoReiserHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: reiserfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: reiserfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoReiserHeader));
+ goto errcheck;
+ }
+@@ -1012,7 +1016,7 @@ int checkStructSizes()
+ // check fat header size is 16384
+ if (sizeof(CInfoFatHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: fat header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: fat header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoFatHeader));
+ goto errcheck;
+ }
+@@ -1020,7 +1024,7 @@ int checkStructSizes()
+ // check ntfs header size is 16384
+ if (sizeof(CInfoNtfsHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: ntfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: ntfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoNtfsHeader));
+ goto errcheck;
+ }
+@@ -1028,7 +1032,7 @@ int checkStructSizes()
+ // check hpfs header size is 16384
+ if (sizeof(CInfoHpfsHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: hpfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: hpfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoHpfsHeader));
+ goto errcheck;
+ }
+@@ -1036,7 +1040,7 @@ int checkStructSizes()
+ // check jfs header size is 16384
+ if (sizeof(CInfoJfsHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: jfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: jfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoJfsHeader));
+ goto errcheck;
+ }
+@@ -1044,7 +1048,7 @@ int checkStructSizes()
+ // check xfs header size is 16384
+ if (sizeof(CInfoXfsHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: xfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: xfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoXfsHeader));
+ goto errcheck;
+ }
+@@ -1052,7 +1056,7 @@ int checkStructSizes()
+ // check hfs header size is 16384
+ if (sizeof(CInfoHfsHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: hfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
++ fprintf (stderr, "Error: hfs header size != %d (%zd)\n", INFOS_STRUCT_SIZE,
+ sizeof(CInfoHfsHeader));
+ goto errcheck;
+ }
+@@ -1060,36 +1064,39 @@ int checkStructSizes()
+ // check ufs header size is 16384
+ if (sizeof(CInfoUfsHeader) != INFOS_STRUCT_SIZE)
+ {
+- fprintf (stderr, "Error: jfs header size != %d (%d)\n", INFOS_STRUCT_SIZE,
+- sizeof(CInfoUfsHeader));
++ fprintf (stderr, "Error: jfs header size != %d (%zd)\n",
++ INFOS_STRUCT_SIZE, sizeof(CInfoUfsHeader));
+ goto errcheck;
+ }
+
+ // check tail size is 16384
+ if (sizeof(CMainTail) != 16384)
+ {
+- fprintf (stderr, "Error: main footer size != 16384 (%d)\n", sizeof(CMainTail));
++ fprintf (stderr, "Error: main footer size != 16384 (%zd)\n",
++ sizeof(CMainTail));
+ goto errcheck;
+ }
+
+ // check volume header size is 512
+ if (sizeof(CVolumeHeader) != 512)
+ {
+- fprintf (stderr, "Error: volume hedaer size != 512 (%d)\n", sizeof(CVolumeHeader));
++ fprintf (stderr, "Error: volume hedaer size != 512 (%zd)\n",
++ sizeof(CVolumeHeader));
+ goto errcheck;
+ }
+
+ // check MBR size is 2048
+ if (sizeof(CMbr) != 2048)
+ {
+- fprintf (stderr, "Error: MBR size != 2048 (%d)\n", sizeof(CMbr));
++ fprintf (stderr, "Error: MBR size != 2048 (%zd)\n", sizeof(CMbr));
+ goto errcheck;
+ }
+
+ // check volume header size is 512
+ if (sizeof(CLocalHeader) != 16384)
+ {
+- fprintf (stderr, "Error: local header size != 16384 (%d)\n", sizeof(CLocalHeader));
++ fprintf (stderr, "Error: local header size != 16384 (%zd)\n",
++ sizeof(CLocalHeader));
+ goto errcheck;
+ }
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/mbr_backup.cpp
+--- a/src/client/mbr_backup.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/mbr_backup.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -164,7 +164,7 @@ int mbrParseProcPart(char *szHdList, int
+ //if (isDriveReady(szTemp))
+ {
+ nCount++; // number of hard disks
+- SNPRINTF(szTemp, "/dev/%s#%lu#",szDevice, (DWORD)nBlocks);
++ SNPRINTF(szTemp, "/dev/%s#%u#",szDevice, (DWORD)nBlocks);
+ if (szHdList)
+ strncat(szHdList, szTemp, nMaxLen);
+ }
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/misc.cpp
+--- a/src/client/misc.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/misc.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -22,6 +22,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+
+ #ifdef HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+@@ -88,8 +90,8 @@ void restoreMbr(char *szImageFile, COpti
+
+ CRestoreMbrWindow optGui;
+ DWORD dwDiskCount;
+- DWORD dwOriginalMbrNb;
+- DWORD dwCurrentMbrNb;
++ uintptr_t dwOriginalMbrNb;
++ uintptr_t dwCurrentMbrNb;
+ char szHdList[2048];
+ char szTemp[512];
+ char szTemp2[512];
+@@ -209,7 +211,7 @@ void restoreMbr(char *szImageFile, COpti
+ image.closeReading(true);
+ throw excep;
+ }
+- SNPRINTF(szTemp, "%.3lu: %s [%llu blocks]", i, mbrOriginal[i].szDevice, mbrOriginal[i].qwBlocksCount);
++ SNPRINTF(szTemp, "%.3u: %s [%"PRIu64" blocks]", i, mbrOriginal[i].szDevice, mbrOriginal[i].qwBlocksCount);
+ if (options->bBatchMode == false)
+ optGui.addMbr(szTemp, i);
+
+@@ -319,6 +321,28 @@ void restoreMbr(char *szImageFile, COpti
+ THROW(ERR_ERRNO, errno);
+
+ RETURN;
++}
++
++struct portable_tm *localtime_portable (const time_t *__timer)
++{
++static struct portable_tm ret;
++struct tm *host_tm;
++
++ host_tm=localtime (__timer);
++ ret.tm_sec=host_tm->tm_sec;
++ ret.tm_min=host_tm->tm_min;
++ ret.tm_hour=host_tm->tm_hour;
++ ret.tm_mday=host_tm->tm_mday;
++ ret.tm_mon=host_tm->tm_mon;
++ ret.tm_year=host_tm->tm_year;
++ ret.tm_wday=host_tm->tm_wday;
++ ret.tm_yday=host_tm->tm_yday;
++ ret.tm_isdst=host_tm->tm_isdst;
++
++ ret.tm_gmtoff=host_tm->tm_gmtoff;
++ ret.tm_zone=0;
++
++ return &ret;
+ }
+
+ // =======================================================
+@@ -467,7 +491,7 @@ void savePartition(char *szDevice, char
+ time(&dt);
+
+ // current time/date (date of image creation)
+- headMain.dateCreate = *localtime(&dt);
++ headMain.dateCreate = *localtime_portable(&dt);
+
+ // file format version
+ strcpy(headMain.szVersion, CURRENT_IMAGE_FORMAT);
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/client/partimage.h
+--- a/src/client/partimage.h Tue Sep 04 21:36:14 2007 +0200
++++ b/src/client/partimage.h Tue Sep 04 21:43:30 2007 +0200
+@@ -21,6 +21,7 @@
+ #include <errno.h>
+ #include <libintl.h> // intl translation
+ #include <stdio.h>
++#include <stdint.h>
+ #include <time.h>
+
+ #ifdef HAVE_CONFIG_H
+@@ -53,10 +54,10 @@ extern time_t g_timeEnd; // End of the
+ extern time_t g_timeEnd; // End of the operation
+
+ typedef bool BOOL; // variant size
+-typedef unsigned char BYTE; // 8 bits
+-typedef unsigned short int WORD; // 16 bits
+-typedef unsigned long int DWORD; // 32 bits
+-typedef unsigned long long int QWORD; // 64 bits
++typedef uint8_t BYTE; // 8 bits
++typedef uint16_t WORD; // 16 bits
++typedef uint32_t DWORD; // 32 bits
++typedef uint64_t QWORD; // 64 bits
+
+ #include "endianess.h"
+
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/shared/common.cpp
+--- a/src/shared/common.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/shared/common.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -23,6 +23,9 @@
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <fcntl.h>
++
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+@@ -268,7 +271,7 @@ char *formatSize2(QWORD qwSize, char *sz
+
+ if (qwSize < llKiloB) // In Bytes
+ {
+- snprintf(szText, nMaxLen, i18n("%lld bytes"), qwSize);
++ snprintf(szText, nMaxLen, i18n("%"PRId64" bytes"), qwSize);
+ }
+ else if (qwSize < llMegaB) // In KiloBytes
+ {
+@@ -307,7 +310,7 @@ char *formatSizeNoGui(QWORD qwSize, char
+
+ if (qwSize < llKiloB) // In Bytes
+ {
+- snprintf(szText, nMaxLen, i18n("%lldb"), qwSize);
++ snprintf(szText, nMaxLen, i18n("%"PRId64"b"), qwSize);
+ }
+ else if (qwSize < llMegaB) // In KiloBytes
+ {
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/shared/common.h
+--- a/src/shared/common.h Tue Sep 04 21:36:14 2007 +0200
++++ b/src/shared/common.h Tue Sep 04 21:43:30 2007 +0200
+@@ -146,6 +146,23 @@ struct COptions
+
+ #define MAX_UNAMEINFOLEN 65 //SYS_NMLN
+
++struct portable_tm
++{
++ uint32_t tm_sec;
++ uint32_t tm_min;
++ uint32_t tm_hour;
++ uint32_t tm_mday;
++ uint32_t tm_mon;
++ uint32_t tm_year;
++ uint32_t tm_wday;
++ uint32_t tm_yday;
++ uint32_t tm_isdst;
++
++ uint32_t tm_gmtoff;
++ uint32_t tm_zone;
++};
++
++
+ // ================================================
+ struct CMainHeader // size must be 16384 (adjust the reserved data)
+ {
+@@ -163,7 +180,7 @@ struct CMainHeader // size must be 16384
+
+ DWORD dwCompression; // COMPRESS_XXXXXX
+ DWORD dwMainFlags;
+- struct tm dateCreate; // date of image creation
++ struct portable_tm dateCreate; // date of image creation
+ QWORD qwPartSize; // size of the partition in bytes
+ char szHostname[MAX_HOSTNAMESIZE];
+ char szVersion[64]; // version of the image file
+diff -r 0ffb61b8c31d -r 88ac9824fc14 src/shared/image_disk.cpp
+--- a/src/shared/image_disk.cpp Tue Sep 04 21:36:14 2007 +0200
++++ b/src/shared/image_disk.cpp Tue Sep 04 21:43:30 2007 +0200
+@@ -524,7 +524,7 @@ void CImageDisk::openWriting() // [Main-
+ if (m_bIsOpened == true)
+ THROW(ERR_OPENED);
+
+- SNPRINTF(szShortName, "pi%.8lx", (DWORD)generateIdentificator());
++ SNPRINTF(szShortName, "pi%.8x", (DWORD)generateIdentificator());
+ extractFilepathFromFullPath(m_szImageFilename, szPathDir); // filepath without filename
+ if (access(szPathDir, R_OK) == -1) mkdir(szPathDir, 0755);
+ snprintf(m_szSpaceFilename, MAXPATHLEN, "%s/%8s.tmp", szPathDir, szShortName);
diff --git a/sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch b/sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch
new file mode 100644
index 000000000000..587ba84e44fc
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-andre-przywara_warnings.patch
@@ -0,0 +1,35 @@
+diff -uNr partimage-0.6.6.orig/src/client/fs/fs_base.cpp partimage-0.6.6/src/client/fs/fs_base.cpp
+--- partimage-0.6.6.orig/src/client/fs/fs_base.cpp 2008-01-14 01:34:19.000000000 +0100
++++ partimage-0.6.6/src/client/fs/fs_base.cpp 2008-01-14 01:34:47.000000000 +0100
+@@ -134,6 +134,7 @@
+ check.cMagic[0] = 'C';
+ check.cMagic[1] = 'H';
+ check.cMagic[2] = 'K';
++ check.cMagic[3] = 0;
+
+ dwStats = 0;
+ i = 0;
+diff -uNr partimage-0.6.6.orig/src/client/fs/fs_base.h partimage-0.6.6/src/client/fs/fs_base.h
+--- partimage-0.6.6.orig/src/client/fs/fs_base.h 2006-04-22 16:24:14.000000000 +0200
++++ partimage-0.6.6/src/client/fs/fs_base.h 2008-01-14 01:34:47.000000000 +0100
+@@ -39,7 +39,7 @@
+ // ================================================
+ struct CCheck
+ {
+- char cMagic[3]; // must be 'C','H','K'
++ char cMagic[4]; // must be 'C','H','K'
+ DWORD dwCRC; // CRC of the CHECK_FREQUENCY blocks
+ QWORD qwPos; // number of the last block written
+ };
+diff -uNr partimage-0.6.6.orig/src/client/misc.cpp partimage-0.6.6/src/client/misc.cpp
+--- partimage-0.6.6.orig/src/client/misc.cpp 2008-01-14 01:34:19.000000000 +0100
++++ partimage-0.6.6/src/client/misc.cpp 2008-01-14 01:34:47.000000000 +0100
+@@ -2392,7 +2392,7 @@
+ }
+ p = strdup(p);
+ char *q;
+- while (q = strchr(p, '/')) *q = '_';
++ while ((q = strchr(p, '/'))!=NULL) *q = '_';
+
+ return p;
+ }
diff --git a/sys-block/partimage/files/partimage-0.6.6-chown.patch b/sys-block/partimage/files/partimage-0.6.6-chown.patch
new file mode 100644
index 000000000000..d06d12a89922
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-chown.patch
@@ -0,0 +1,40 @@
+diff -uNr partimage-0.6.6.orig/Makefile.am partimage-0.6.6/Makefile.am
+--- partimage-0.6.6.orig/Makefile.am 2006-04-22 16:59:22.000000000 +0200
++++ partimage-0.6.6/Makefile.am 2008-01-14 23:11:00.000000000 +0100
+@@ -23,8 +23,6 @@
+ rm ${sysconfdir}/partimaged/partimaged.csr ;\
+ chmod 600 ${sysconfdir}/partimaged/partimaged.key ;\
+ chmod 600 ${sysconfdir}/partimaged/partimaged.cert ;\
+- chown partimag:root ${sysconfdir}/partimaged/partimaged.key ;\
+- chown partimag:root ${sysconfdir}/partimaged/partimaged.cert ;\
+ else \
+ echo "SSL disabled, no certificate will be generated." ;\
+ fi
+@@ -57,7 +55,6 @@
+ echo "#sample # user 'sample' is allowed to connect partimaged" >> \
+ ${sysconfdir}/partimaged/partimagedusers ;\
+ chmod 600 ${sysconfdir}/partimaged/partimagedusers ;\
+- chown partimag:root ${sysconfdir}/partimaged/partimagedusers ;\
+ fi
+
+ $(mkinstalldirs) ${infodir}
+diff -uNr partimage-0.6.6.orig/Makefile.in partimage-0.6.6/Makefile.in
+--- partimage-0.6.6.orig/Makefile.in 2008-01-14 23:09:15.000000000 +0100
++++ partimage-0.6.6/Makefile.in 2008-01-14 23:11:07.000000000 +0100
+@@ -670,8 +670,6 @@
+ rm ${sysconfdir}/partimaged/partimaged.csr ;\
+ chmod 600 ${sysconfdir}/partimaged/partimaged.key ;\
+ chmod 600 ${sysconfdir}/partimaged/partimaged.cert ;\
+- chown partimag:root ${sysconfdir}/partimaged/partimaged.key ;\
+- chown partimag:root ${sysconfdir}/partimaged/partimaged.cert ;\
+ else \
+ echo "SSL disabled, no certificate will be generated." ;\
+ fi
+@@ -703,7 +701,6 @@
+ echo "#sample # user 'sample' is allowed to connect partimaged" >> \
+ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ chmod 600 ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+- chown partimag:root ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ fi
+
+ $(mkinstalldirs) ${DESTDIR}${infodir}
diff --git a/sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch b/sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch
new file mode 100644
index 000000000000..adb102a844ec
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-clonezilla_ext3_blocks-per-group.patch
@@ -0,0 +1,110 @@
+diff --unified --recursive partimage-0.6.7_beta1.org/src/client/fs/fs_base.cpp partimage-0.6.7_beta1/src/client/fs/fs_base.cpp
+--- partimage-0.6.7_beta1.org/src/client/fs/fs_base.cpp 2007-09-17 02:59:23.000000000 +0800
++++ partimage-0.6.7_beta1/src/client/fs/fs_base.cpp 2007-10-08 16:51:29.000000000 +0800
+@@ -773,6 +773,7 @@
+ QWORD qwFreeBlocksCount = 0;
+ QWORD i;
+
++ showDebug(1, "BITMAP: m_header.qwBlocksCount = %llu\n", m_header.qwBlocksCount);
+ for (i=0; i < m_header.qwBlocksCount; i++)
+ {
+ if (m_bitmap.isBitSet(i))
+diff --unified --recursive partimage-0.6.7_beta1.org/src/client/fs/fs_ext2.cpp partimage-0.6.7_beta1/src/client/fs/fs_ext2.cpp
+--- partimage-0.6.7_beta1.org/src/client/fs/fs_ext2.cpp 2007-09-17 02:55:59.000000000 +0800
++++ partimage-0.6.7_beta1/src/client/fs/fs_ext2.cpp 2007-10-08 18:21:03.000000000 +0800
+@@ -158,6 +158,7 @@
+ m_info.dwTotalBlocksCount = Le32ToCpu(sb.s_blocks_count);
+ showDebug(1, "total blocks=%lu\n", m_info.dwTotalBlocksCount);
+ m_info.dwBlocksPerGroup = Le32ToCpu(sb.s_blocks_per_group);
++ showDebug(1, "BlocksPerGroup=%lu\n", m_info.dwBlocksPerGroup);
+
+ m_info.dwGroupsCount = (m_info.dwTotalBlocksCount - m_info.dwFirstBlock + m_info.dwBlocksPerGroup - 1) / Le32ToCpu(sb.s_blocks_per_group);
+ showDebug(1, "groups=%lu\n", m_info.dwGroupsCount);
+@@ -211,6 +212,7 @@
+ DWORD dwBit, dwByte;
+ DWORD dwExt2DataBlock;
+ char *cPtr;
++ int group = 0;
+
+ // debug
+ DWORD dwUsed;
+@@ -228,6 +230,7 @@
+
+ // init bitmap size
+ nRes = m_bitmap.init(m_header.qwBitmapSize);
++ showDebug(1, "m_bitmap.init(m_header.qwBitmapSize = %lu)\n", m_header.qwBitmapSize);
+ if (nRes == -1)
+ {
+ showDebug(1, "CExt2Part::readBitmap(): Error 002\n");
+@@ -236,6 +239,7 @@
+
+ // load group descriptors
+ desc = new CExt2GroupDesc[m_info.dwGroupsCount+m_info.dwDescPerBlock];
++ showDebug(1, "dwGroupsCount = %lu, m_info.dwDescPerBlock = %lu\n",m_info.dwGroupsCount, m_info.dwDescPerBlock);
+ if (!desc)
+ {
+ showDebug(1, "CExt2Part::readBitmap(): Error 003\n");
+@@ -243,6 +247,7 @@
+ }
+
+ // for each descriptor BLOCK (not group descriptor!)
++ showDebug(1, "readData m_info.dwBlockSize = %lu\n", m_info.dwBlockSize);
+ for (cPtr=(char*)desc, i=0; i < m_info.dwDescBlocks; i++,cPtr+=m_info.dwBlockSize)
+ {
+ nRes = readData(cPtr, ((QWORD)m_info.dwBlockSize) * ((QWORD)(m_info.dwFirstBlock+1+i)), m_info.dwBlockSize);
+@@ -255,7 +260,7 @@
+
+ dwUsed=0;
+ dwFree=0;
+-
++ showDebug(1, "m_info.dwBlocksPerGroup = %lu\n", m_info.dwBlocksPerGroup);
+ for (i = 0; i < m_info.dwGroupsCount; i++)
+ {
+ if (m_info.dwFirstBlock+((i+1)*m_info.dwBlocksPerGroup) > m_info.dwTotalBlocksCount)
+@@ -267,8 +272,8 @@
+ {
+ // -- read the bitmap block
+ errno = 0;
+- nRes = readData(cTempBitmap+(i*m_info.dwBlockSize), ((QWORD)m_info.dwBlockSize) *
+- ((QWORD)Le32ToCpu(desc[i].bg_block_bitmap)), m_info.dwBlockSize);
++ nRes = readData(cTempBitmap+(i*(m_info.dwBlocksPerGroup/8)), ((QWORD)m_info.dwBlockSize) *
++ ((QWORD)Le32ToCpu(desc[i].bg_block_bitmap)), (m_info.dwBlocksPerGroup/8));
+ if (nRes == -1)
+ {
+ showDebug(1, "CExt2Part::readBitmap(): Error 005\n");
+@@ -278,7 +283,7 @@
+ }
+ else
+ {
+- memset(cTempBitmap+(i*m_info.dwBlockSize), 0, m_info.dwBlockSize);
++ memset(cTempBitmap+(i*(m_info.dwBlocksPerGroup/8)), 0, (m_info.dwBlocksPerGroup/8));
+ }
+ }
+
+@@ -302,22 +307,25 @@
+ {
+ dwBit = dwExt2DataBlock % 8;
+ dwByte = (dwExt2DataBlock - dwBit) / 8;
++ group = (dwExt2DataBlock/m_info.dwBlocksPerGroup);
+
+ if ((cTempBitmap[dwByte] & (1 << dwBit)) != 0)
+ {
+ for (j=0; j < m_info.dwLogicalBlocksPerExt2Block; j++, i++)
+ m_bitmap.setBit(i, true);
++ showDebug(3, "m_bitmap.setBit(%1u, true), g = %i\n", (i/4), group);
+ dwUsed++;
+ }
+ else
+ {
+ for (j=0; j < m_info.dwLogicalBlocksPerExt2Block; j++, i++)
+ m_bitmap.setBit(i, false);
++ showDebug(3, "m_bitmap.setBit(%1u, false), g = %i\n", (i/4), group);
+ dwFree++;
+ }
+ }
+
+- //debugWin("used=%lu\nfree=%lu\ntotal=%lu",dwUsed,dwFree,dwUsed+dwFree);
++ showDebug(1,"used=%lu\nfree=%lu\ntotal=%lu\n",dwUsed,dwFree,dwUsed+dwFree);
+ calculateSpaceFromBitmap();
+
+ //success_readBitmap:
diff --git a/sys-block/partimage/files/partimage-0.6.6-datadir-path.patch b/sys-block/partimage/files/partimage-0.6.6-datadir-path.patch
new file mode 100644
index 000000000000..d867d834fda9
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-datadir-path.patch
@@ -0,0 +1,58 @@
+--- partimage-0.6.6/Makefile.in.orig 2007-08-11 12:36:57.000000000 +0200
++++ partimage-0.6.6/Makefile.in 2008-01-14 00:39:42.000000000 +0100
+@@ -688,34 +688,34 @@
+ @echo "/etc/pam.d/partimaged"
+
+ install-data-local:
+- $(mkinstalldirs) ${sysconfdir}
+- $(mkinstalldirs) ${sysconfdir}/partimaged
++ $(mkinstalldirs) ${DESTDIR}${sysconfdir}
++ $(mkinstalldirs) ${DESTDIR}${sysconfdir}/partimaged
+
+- if test ! -f ${sysconfdir}/partimaged/partimagedusers ; then \
++ if test ! -f ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ; then \
+ echo "# note: '#' introduces comments" > \
+- ${sysconfdir}/partimaged/partimagedusers ;\
++ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ echo -n "#add only users allowed to " >> \
+- ${sysconfdir}/partimaged/partimagedusers ;\
+- echo "connect partimaged" >> ${sysconfdir}/partimaged/partimagedusers ;\
++ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
++ echo "connect partimaged" >> ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ echo "# (only one login per line)" >> \
+- ${sysconfdir}/partimaged/partimagedusers ;\
+- echo "" >> ${sysconfdir}/partimaged/partimagedusers ;\
++ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
++ echo "" >> ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ echo "#sample # user 'sample' is allowed to connect partimaged" >> \
+- ${sysconfdir}/partimaged/partimagedusers ;\
+- chmod 600 ${sysconfdir}/partimaged/partimagedusers ;\
+- chown partimag:root ${sysconfdir}/partimaged/partimagedusers ;\
++ ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
++ chmod 600 ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
++ chown partimag:root ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ fi
+
+- $(mkinstalldirs) ${infodir}
+- $(INSTALL_DATA) AUTHORS ${infodir}/AUTHORS
+- $(INSTALL_DATA) BUGS ${infodir}/BUGS
+- $(INSTALL_DATA) COPYING ${infodir}/COPYING
+- $(INSTALL_DATA) ChangeLog ${infodir}/ChangeLog
+- $(INSTALL_DATA) INSTALL ${infodir}/INSTALL
+- $(INSTALL_DATA) README ${infodir}/README
+- $(INSTALL_DATA) README.partimaged ${infodir}/README.partimaged
+- $(INSTALL_DATA) TODO ${infodir}/TODO
+- $(INSTALL_DATA) partimage.lsm ${infodir}/partimage.lsm
++ $(mkinstalldirs) ${DESTDIR}${infodir}
++ $(INSTALL_DATA) AUTHORS ${DESTDIR}${infodir}/AUTHORS
++ $(INSTALL_DATA) BUGS ${DESTDIR}${infodir}/BUGS
++ $(INSTALL_DATA) COPYING ${DESTDIR}${infodir}/COPYING
++ $(INSTALL_DATA) ChangeLog ${DESTDIR}${infodir}/ChangeLog
++ $(INSTALL_DATA) INSTALL ${DESTDIR}${infodir}/INSTALL
++ $(INSTALL_DATA) README ${DESTDIR}${infodir}/README
++ $(INSTALL_DATA) README.partimaged ${DESTDIR}${infodir}/README.partimaged
++ $(INSTALL_DATA) TODO ${DESTDIR}${infodir}/TODO
++ $(INSTALL_DATA) partimage.lsm ${DESTDIR}${infodir}/partimage.lsm
+
+ uninstall-local:
+ -rm -f ${infodir}/AUTHORS
diff --git a/sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch b/sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch
new file mode 100644
index 000000000000..37c32a81035c
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-disable_header_check.patch
@@ -0,0 +1,15 @@
+diff -uNr partimage-0.6.6.orig/src/client/main.cpp partimage-0.6.6/src/client/main.cpp
+--- partimage-0.6.6.orig/src/client/main.cpp 2008-01-15 00:39:28.000000000 +0100
++++ partimage-0.6.6/src/client/main.cpp 2008-01-15 01:30:57.000000000 +0100
+@@ -1015,6 +1015,11 @@
+ // =======================================================
+ int checkStructSizes()
+ {
++ // Disable header check for AMD64, because it fails
++#if defined(__x86_64__)
++ return 0;
++#endif
++
+ // ---- check types sizes
+
+ if (sizeof(DWORD) != 4)
diff --git a/sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch b/sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch
new file mode 100644
index 000000000000..c34822fd36e3
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-dont-discard-error-message-in-batch-mode.patch
@@ -0,0 +1,64 @@
+diff -uNr partimage-0.6.6.orig/src/client/interface_none.cpp partimage-0.6.6/src/client/interface_none.cpp
+--- partimage-0.6.6.orig/src/client/interface_none.cpp 2006-04-22 16:24:14.000000000 +0200
++++ partimage-0.6.6/src/client/interface_none.cpp 2008-01-14 01:48:22.000000000 +0100
+@@ -96,7 +96,8 @@
+ void CInterfaceNone::msgBoxError(char *title, ...) {
+ va_list al;
+ va_start(al,title);
+- message_only("Error", title, "", al, 0);
++ vfprintf(stderr,title,al);
++ fputc('\n',stderr);
+ va_end(al);
+ }
+
+diff -uNr partimage-0.6.6.orig/src/client/main.cpp partimage-0.6.6/src/client/main.cpp
+--- partimage-0.6.6.orig/src/client/main.cpp 2008-01-14 01:44:21.000000000 +0100
++++ partimage-0.6.6/src/client/main.cpp 2008-01-14 01:47:46.000000000 +0100
+@@ -139,6 +139,12 @@
+ }*/
+ }
+
++void ensure_interface_is_non_interactive()
++{
++ delete g_interface;
++ g_interface = new CInterfaceNone("");
++}
++
+ // =======================================================
+ int main(int argc, char *argv[])
+ {
+@@ -579,8 +585,9 @@
+ goto beginMainWin;
+ }
+
+- if (!options.bBatchMode)
+- g_interface -> Error(excep, szImageFile, szDevice);
++ if (options.bBatchMode) ensure_interface_is_non_interactive();
++
++ g_interface -> Error(excep, szImageFile, szDevice);
+
+ showDebug(1, "\nFINAL ERROR\n\n");
+
+@@ -591,8 +598,11 @@
+ else
+ {
+ showDebug(1, "The file system of [%s] is [%s], and is not supported\n", szDevice, szFileSystem);
+- if (!options.bBatchMode)
+- g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem);
++
++ if (options.bBatchMode) ensure_interface_is_non_interactive();
++
++ g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem);
++
+ nRes = -1;
+ }
+ //#endif // DEVEL_SUPPORT
+@@ -696,7 +706,7 @@
+ {
+ if (options.bBatchMode)
+ fprintf(stderr,"\n\n");
+- g_interface -> StatusLine(i18n("commiting buffer cache to disk."));
++ if (!options.bBatchMode) g_interface -> StatusLine(i18n("commiting buffer cache to disk."));
+ sync();
+ }
+ closeDebugFiles();
diff --git a/sys-block/partimage/files/partimage-0.6.6-gui.diff b/sys-block/partimage/files/partimage-0.6.6-gui.diff
new file mode 100644
index 000000000000..fe364b0b085a
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-gui.diff
@@ -0,0 +1,37 @@
+diff -uNr partimage-0.6.6.orig/src/server/partimaged-main.cpp partimage-0.6.6/src/server/partimaged-main.cpp
+--- partimage-0.6.6.orig/src/server/partimaged-main.cpp 2006-04-22 16:24:14.000000000 +0200
++++ partimage-0.6.6/src/server/partimaged-main.cpp 2008-01-14 23:30:21.000000000 +0100
+@@ -98,6 +98,11 @@
+ else if (signo == SIGINT)
+ {
+ g_bSigInt = true;
++ delete g_Server;
++ delete g_Window;
++ g_Server = NULL;
++ g_Window = NULL;
++ exit(0);
+ }
+ else if (signo == SIGSEGV)
+ {
+@@ -235,7 +240,7 @@
+ case 'd':
+ if (chdir(optarg) != 0)
+ {
+- printf("%s: %s\n", optarg, strerror(errno));
++ printf("Directory %s: %s\n", optarg, strerror(errno));
+ exit(-1);
+ }
+ break;
+@@ -313,9 +318,9 @@
+ #endif
+
+ // register signals
+-// signal(SIGTERM, catch_sigint);
+-// signal(SIGINT, catch_sigint);
+-// signal(SIGSEGV, catch_sigint); // segmentation fault
++ signal(SIGTERM, catch_sigint);
++ signal(SIGINT, catch_sigint);
++ signal(SIGSEGV, catch_sigint); // segmentation fault
+ // signal(SIGHUP, catch_sigint);
+ // signal(SIGQUIT, catch_sigint);
+ // signal(SIGCHLD, catch_sigint);
diff --git a/sys-block/partimage/files/partimage-0.6.6-not_install_info.patch b/sys-block/partimage/files/partimage-0.6.6-not_install_info.patch
new file mode 100644
index 000000000000..e4d1f7162c1f
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-not_install_info.patch
@@ -0,0 +1,21 @@
+diff -uNr partimage-0.6.6.orig/Makefile.in partimage-0.6.6/Makefile.in
+--- partimage-0.6.6.orig/Makefile.in 2008-01-14 23:11:07.000000000 +0100
++++ partimage-0.6.6/Makefile.in 2008-01-14 23:14:55.000000000 +0100
+@@ -703,17 +703,6 @@
+ chmod 600 ${DESTDIR}${sysconfdir}/partimaged/partimagedusers ;\
+ fi
+
+- $(mkinstalldirs) ${DESTDIR}${infodir}
+- $(INSTALL_DATA) AUTHORS ${DESTDIR}${infodir}/AUTHORS
+- $(INSTALL_DATA) BUGS ${DESTDIR}${infodir}/BUGS
+- $(INSTALL_DATA) COPYING ${DESTDIR}${infodir}/COPYING
+- $(INSTALL_DATA) ChangeLog ${DESTDIR}${infodir}/ChangeLog
+- $(INSTALL_DATA) INSTALL ${DESTDIR}${infodir}/INSTALL
+- $(INSTALL_DATA) README ${DESTDIR}${infodir}/README
+- $(INSTALL_DATA) README.partimaged ${DESTDIR}${infodir}/README.partimaged
+- $(INSTALL_DATA) TODO ${DESTDIR}${infodir}/TODO
+- $(INSTALL_DATA) partimage.lsm ${DESTDIR}${infodir}/partimage.lsm
+-
+ uninstall-local:
+ -rm -f ${infodir}/AUTHORS
+ -rm -f ${infodir}/BUGS
diff --git a/sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch b/sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch
new file mode 100644
index 000000000000..44d5e0bb98ca
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.6-thread-privilege-fix.patch
@@ -0,0 +1,39 @@
+diff -uNr partimage-0.6.6.orig/src/server/partimaged-main.cpp partimage-0.6.6/src/server/partimaged-main.cpp
+--- partimage-0.6.6.orig/src/server/partimaged-main.cpp 2008-01-15 12:32:50.000000000 +0100
++++ partimage-0.6.6/src/server/partimaged-main.cpp 2008-01-15 12:36:06.000000000 +0100
+@@ -32,6 +32,8 @@
+ #include <sys/stat.h>
+ #include <signal.h>
+ #include <fcntl.h>
++#include <errno.h>
++#include <cstring>
+
+ #include "net.h"
+ #include "netserver.h"
+@@ -321,6 +323,7 @@
+ signal(SIGTERM, catch_sigint);
+ signal(SIGINT, catch_sigint);
+ signal(SIGSEGV, catch_sigint); // segmentation fault
++ signal(SIGCHLD, SIG_IGN); // ignore child exits
+ // signal(SIGHUP, catch_sigint);
+ // signal(SIGQUIT, catch_sigint);
+ // signal(SIGCHLD, catch_sigint);
+@@ -426,9 +429,15 @@
+ g_Window->SetLocation(client, "(wrong password)");
+ }
+ else
+- pthread_create(&threads[client], NULL,
+- partimaged, &client);
+-
++ {
++ int rv = fork();
++ if ( rv < 0 )
++ {
++ showDebug(1, "Cannot fork() on incoming connection - %s\n", strerror(errno));
++ continue;
++ }
++ if ( ! rv ) partimaged(&client); // child process
++ }
+ } // infernal loop
+
+ showDebug(1, "end of partimaged-main\n");
diff --git a/sys-block/partimage/partimage-0.6.4-r3.ebuild b/sys-block/partimage/partimage-0.6.4-r3.ebuild
index 166d28b9d0aa..a13607cd1825 100644
--- a/sys-block/partimage/partimage-0.6.4-r3.ebuild
+++ b/sys-block/partimage/partimage-0.6.4-r3.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.4-r3.ebuild,v 1.21 2007/04/28 13:10:38 tove Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.4-r3.ebuild,v 1.22 2008/01/15 12:05:20 xmerlin Exp $
WANT_AUTOMAKE="1.8"
diff --git a/sys-block/partimage/partimage-0.6.4-r4.ebuild b/sys-block/partimage/partimage-0.6.4-r4.ebuild
index 8592aa98f977..6f9bdf32408b 100644
--- a/sys-block/partimage/partimage-0.6.4-r4.ebuild
+++ b/sys-block/partimage/partimage-0.6.4-r4.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.4-r4.ebuild,v 1.15 2007/04/28 13:10:38 tove Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.4-r4.ebuild,v 1.16 2008/01/15 12:05:20 xmerlin Exp $
WANT_AUTOMAKE="1.8"
diff --git a/sys-block/partimage/partimage-0.6.6.ebuild b/sys-block/partimage/partimage-0.6.6.ebuild
new file mode 100644
index 000000000000..2956cfa3e45f
--- /dev/null
+++ b/sys-block/partimage/partimage-0.6.6.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.6.ebuild,v 1.1 2008/01/15 12:05:20 xmerlin Exp $
+
+WANT_AUTOMAKE="1.10"
+
+inherit eutils flag-o-matic pam autotools
+
+DESCRIPTION="Console-based application to efficiently save raw partition data to an image file. Optional encryption/compression support."
+HOMEPAGE="http://www.partimage.org/"
+SRC_URI="mirror://sourceforge/partimage/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~ppc ~sparc"
+IUSE="ssl nologin nls pam static"
+
+DEPEND="virtual/libc
+ >=sys-libs/zlib-1.1.4
+ >=dev-libs/newt-0.51.6
+ app-arch/bzip2
+ =sys-libs/slang-1*
+ nls? ( sys-devel/gettext )
+ ssl? ( >=dev-libs/openssl-0.9.6g )"
+
+RDEPEND="!static? ( virtual/libc
+ >=sys-libs/zlib-1.1.4
+ >=dev-libs/lzo-1.08
+ >=dev-libs/newt-0.51.6
+ app-arch/bzip2
+ =sys-libs/slang-1*
+ nls? ( sys-devel/gettext ) ssl? ( >=dev-libs/openssl-0.9.6g )
+ pam? ( virtual/pam )
+ )"
+
+PARTIMAG_GROUP_GID=91
+PARTIMAG_USER_UID=91
+PARTIMAG_GROUP_NAME=partimag
+PARTIMAG_USER_NAME=partimag
+PARTIMAG_USER_SH=-1
+PARTIMAG_USER_HOMEDIR=/var/log/partimage
+PARTIMAG_USER_GROUPS=partimag
+
+pkg_setup() {
+ # Now add users if needed
+ enewgroup ${PARTIMAG_GROUP_NAME} ${PARTIMAG_GROUP_GID}
+ enewuser ${PARTIMAG_USER_NAME} ${PARTIMAG_USER_UID} ${PARTIMAG_USER_SH} ${PARTIMAG_USER_HOMEDIR} ${PARTIMAG_USER_GROUPS}
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # we can do better security ourselves
+ epatch "${FILESDIR}"/${P}-datadir-path.patch || die
+ epatch "${FILESDIR}"/${P}-dont-discard-error-message-in-batch-mode.patch || die
+ epatch "${FILESDIR}"/${PN}-0.6.4-save_file_and_rest_file_actions.patch || die
+ epatch "${FILESDIR}"/${PN}-0.6.4-varargs.patch || die
+ epatch "${FILESDIR}"/${PN}-0.6.4-empty-salt.patch || die
+ epatch "${FILESDIR}"/${PN}-0.6.4-port.patch || die
+ epatch "${FILESDIR}"/${P}-andre-przywara_amd64.patch || die
+ epatch "${FILESDIR}"/${P}-andre-przywara_warnings.patch || die
+ epatch "${FILESDIR}"/${P}-clonezilla_ext3_blocks-per-group.patch || die
+ epatch "${FILESDIR}"/${P}-not_install_info.patch || die
+ epatch "${FILESDIR}"/${P}-chown.patch || die
+ epatch "${FILESDIR}"/${P}-gui.diff || die
+ epatch "${FILESDIR}"/${P}-disable_header_check.patch || die
+ epatch "${FILESDIR}"/${P}-thread-privilege-fix.patch || die
+}
+
+src_compile() {
+ filter-flags -fno-exceptions
+ use ppc && append-flags -fsigned-char
+
+ local myconf
+ use nologin && myconf="${myconf} --disable-login"
+ if use static
+ then
+ use pam && ewarn "pam and static compilation are mutually exclusive - using static and ignoring pam"
+ else
+ myconf="${myconf} `use_enable pam`"
+ fi
+ econf \
+ ${myconf} \
+ --sysconfdir=/etc \
+ `use_enable ssl` \
+ `use_enable nls` \
+ `use_enable static all-static` \
+ || die "econf failed"
+
+ emake || die "make failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" \
+ MKINSTALLDIRS=/usr/share/automake-1.10/mkinstalldirs install || die
+
+ keepdir /var/log/partimage
+
+ insinto /etc/partimaged; doins "${FILESDIR}"/servercert.cnf || die
+
+ # init.d / conf.d
+ newinitd "${FILESDIR}"/${PN}d.init ${PN}d || die
+ newconfd "${FILESDIR}"/${PN}d.conf ${PN}d || die
+
+ doman doc/en/man/partimage.1 doc/en/man/partimaged.8 doc/en/man/partimagedusers.5
+ dodoc AUTHORS BUGS COPYING ChangeLog INSTALL README* TODO partimage.lsm
+
+ # pam
+ if use pam
+ then
+ newpamd "${FILESDIR}"/partimaged.pam partimaged || die
+ fi
+}
+
+# vars for SSL stuff
+confdir="${ROOT}etc/partimaged"
+privkey="${confdir}/partimaged.key"
+cnf="${confdir}/servercert.cnf"
+csr="${confdir}/partimaged.csr"
+cert="${confdir}/partimaged.cert"
+
+pkg_config() {
+ if use ssl; then
+ ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!"
+ ewarn "Press Ctrl-C to break now for it, or press enter to continue."
+ read
+ if [ ! -f ${privkey} ]; then
+ einfo "Generating unencrypted private key: ${privkey}"
+ openssl genrsa -out ${privkey} 1024 || die "Failed!"
+ else
+ einfo "Private key already exists: ${privkey}"
+ fi
+ if [ ! -f ${csr} ]; then
+ einfo "Generating certificate request: ${csr}"
+ openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die "Failed!"
+ else
+ einfo "Certificate request already exists: ${csr}"
+ fi
+ if [ ! -f ${cert} ]; then
+ einfo "Generating self-signed certificate: ${cert}"
+ openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die "Failed!"
+ else
+ einfo "Self-signed certifcate already exists: ${cert}"
+ fi
+ einfo "Setting permissions"
+ partimagesslperms || die "Failed!"
+ einfo "Done"
+ else
+ einfo "SSL is disabled, not building certificates"
+ fi
+}
+
+partimagesslperms() {
+ local ret=0
+ chmod 600 ${privkey} 2>/dev/null
+ ret=$((${ret}+$?))
+ chown partimag:0 ${privkey} 2>/dev/null
+ ret=$((${ret}+$?))
+ chmod 644 ${cert} ${csr} 2>/dev/null
+ ret=$((${ret}+$?))
+ chown root:0 ${cert} ${csr} 2>/dev/null
+ ret=$((${ret}+$?))
+ return $ret
+}
+
+pkg_postinst() {
+ if use ssl; then
+ einfo "To create the required SSL certificates, please do:"
+ einfo "emerge --config =${PF}"
+ # force a permmissions fixup
+ partimagesslperms
+ return 0
+ fi
+ chown partimag:0 /etc/partimaged/partimagedusers || die
+}