diff --git a/calamares-1.0.1-openmamba_autopartitioning.patch b/calamares-1.0.1-openmamba_autopartitioning.patch new file mode 100644 index 0000000..2e86019 --- /dev/null +++ b/calamares-1.0.1-openmamba_autopartitioning.patch @@ -0,0 +1,82 @@ +--- calamares-1.0.1/src/modules/partition/gui/EraseDiskPage.cpp.orig 2015-05-21 12:53:55.003623191 +0200 ++++ calamares-1.0.1/src/modules/partition/gui/EraseDiskPage.cpp 2015-05-21 15:26:40.937147517 +0200 +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + EraseDiskPage::EraseDiskPage( QWidget* parent ) + : QWidget( parent ) +@@ -170,18 +171,70 @@ + m_core->createPartitionTable( dev, PartitionTable::msdos ); + } + ++#define GiB * 1024ul * 1024ul * 1024ul ++ ++ qint64 total_size = (dev->totalSectors() - first_free_sector) * dev->logicalSectorSize(); ++ qint64 root_size = 30 GiB; ++ ++ QProcess p; ++ p.start( "awk", { "/MemTotal/ {print $2}", "/proc/meminfo" } ); ++ p.waitForFinished(); ++ QString memoryLine = p.readAllStandardOutput().simplified(); ++ // Set automatic swap size to RAM * 1.1 ++ qint64 swap_size = memoryLine.toLongLong() * 1152ul; ++ // No swap on small disks ++ if (total_size - swap_size < 30 GiB) swap_size = 0; ++ ++ // home partition if big enough disk ++ qint64 home_size = total_size - swap_size - 30 GiB; ++ if (home_size < 30 GiB) { ++ home_size = 0; ++ root_size = total_size - swap_size; ++ } ++ + Partition* rootPartition = PMUtils::createNewPartition( + dev->partitionTable(), + *dev, + PartitionRole( PartitionRole::Primary ), + FileSystem::Ext4, + first_free_sector, +- dev->totalSectors() - 1 //last sector ++ first_free_sector + root_size / dev->logicalSectorSize() - 1 + ); + PartitionInfo::setMountPoint( rootPartition, "/" ); + PartitionInfo::setFormat( rootPartition, true ); + m_core->createPartition( dev, rootPartition ); ++ first_free_sector = first_free_sector + root_size / dev->logicalSectorSize(); ++ ++ if (swap_size > 0) { ++ Partition* swapPartition = PMUtils::createNewPartition( ++ dev->partitionTable(), ++ *dev, ++ PartitionRole( PartitionRole::Primary ), ++ FileSystem::LinuxSwap, ++ first_free_sector, ++ first_free_sector + swap_size / dev->logicalSectorSize() - 1 ++ ); ++ //PartitionInfo::setMountPoint( swapPartition, "" ); ++ PartitionInfo::setFormat( swapPartition, true ); ++ m_core->createPartition( dev, swapPartition ); ++ first_free_sector = first_free_sector + swap_size / dev->logicalSectorSize(); ++ } ++ ++ if (home_size > 0) { ++ Partition* homePartition = PMUtils::createNewPartition( ++ dev->partitionTable(), ++ *dev, ++ PartitionRole( PartitionRole::Primary ), ++ FileSystem::Ext4, ++ first_free_sector, ++ first_free_sector + home_size / dev->logicalSectorSize() - 1 ++ ); ++ PartitionInfo::setMountPoint( homePartition, "/home" ); ++ PartitionInfo::setFormat( homePartition, true ); ++ m_core->createPartition( dev, homePartition ); ++ } + ++ m_core->setBootLoaderInstallPath( dev->deviceNode() ); + + { + qDeleteAll( m_previewFrame->children() ); diff --git a/calamares.spec b/calamares.spec index ecdade9..4efe35a 100644 --- a/calamares.spec +++ b/calamares.spec @@ -1,6 +1,6 @@ Name: calamares Version: 1.0.1 -Release: 7mamba +Release: 8mamba Summary: Distribution-independent installer framework Group: Graphical Desktop/Applications/Utilities Vendor: openmamba @@ -17,6 +17,7 @@ Patch3: calamares-1.0.1-fix_reboot.patch Patch4: calamares-1.0.1-dracut_hostonly.patch Patch5: calamares-1.0.1-locale_use_LANG.patch Patch6: calamares-1.0.1-replace_chroot_call.patch +Patch7: calamares-1.0.1-openmamba_autopartitioning.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -69,6 +70,8 @@ This package contains libraries and header files for developing applications tha %prep %setup -q -a1 +#-D -T +#:<< _EOF %patch0 -p1 %patch1 -p1 %patch2 -p1 @@ -76,9 +79,10 @@ This package contains libraries and header files for developing applications tha %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 rmdir src/modules/partition/partitionmanager -mv partitionmanager-%{version} src/modules/partition/partitionmanager +mv partitionmanager-%{version} src/modules/partition/partitionmanager %build %cmake -d build \ @@ -198,6 +202,9 @@ install -D -m0755 src/branding/default/squid.png %{buildroot}%{_datadir}/pixmaps %changelog +* Thu May 21 2015 Silvan Calarco 1.0.1-8mamba +- added openmamba automatic partitioning patch + * Sat Mar 07 2015 Silvan Calarco 1.0.1-7mamba - add upstream patch to fix error in chroot_call in EFI installation - require grub and grub-efi-x86_64