|
From: <ow...@us...> - 2008-01-25 16:57:58
|
Revision: 1027
http://ipcop.svn.sourceforge.net/ipcop/?rev=1027&view=rev
Author: owes
Date: 2008-01-25 08:58:02 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
Test if fs_type supports labels before setting them.
Modified Paths:
--------------
ipcop/trunk/src/installer/partition.c
Modified: ipcop/trunk/src/installer/partition.c
===================================================================
--- ipcop/trunk/src/installer/partition.c 2008-01-23 21:10:55 UTC (rev 1026)
+++ ipcop/trunk/src/installer/partition.c 2008-01-25 16:58:02 UTC (rev 1027)
@@ -146,8 +146,10 @@
/* boot partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, 1, pedsector_boot);
- /* does not work for msdos type */
-// ped_partition_set_name(ped_part, "/boot");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/boot");
+ }
ped_partition_set_flag(ped_part, PED_PARTITION_BOOT, 1);
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
@@ -159,8 +161,10 @@
/* / partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_part->geom.end+1+pedsector_root);
- /* does not work for msdos type */
-// ped_partition_set_name(ped_part, "/");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -171,8 +175,10 @@
/* /var/log partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_dev->length - 1);
- /* does not work for msdos type */
-// ped_partition_set_name(ped_part, "/var/log");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/var/log");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -203,7 +209,10 @@
/* hfs bootstrap partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_file_system_type_get("hfs"), 1, pedsector_start);
- ped_partition_set_name(ped_part, "bootstrap");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "bootstrap");
+ }
ped_partition_set_flag(ped_part, PED_PARTITION_BOOT, 1);
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
@@ -214,7 +223,10 @@
/* boot partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_part->geom.end+1+pedsector_boot);
- ped_partition_set_name(ped_part, "/boot");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/boot");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -225,7 +237,10 @@
/* / partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_part->geom.end+1+pedsector_root);
- ped_partition_set_name(ped_part, "/");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -236,7 +251,10 @@
/* /var/log partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_dev->length - 1);
- ped_partition_set_name(ped_part, "/var/log");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/var/log");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -266,7 +284,10 @@
/* boot partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, 1, pedsector_boot);
- ped_partition_set_name(ped_part, "/boot");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/boot");
+ }
ped_partition_set_flag(ped_part, PED_PARTITION_BOOT, 1);
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
@@ -278,7 +299,10 @@
/* / partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_part->geom.end+1+pedsector_root);
- ped_partition_set_name(ped_part, "/");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -289,7 +313,10 @@
/* /var/log partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_dev->length - 1);
- ped_partition_set_name(ped_part, "/var/log");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/var/log");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -318,7 +345,10 @@
/* boot partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, 1, pedsector_boot);
- ped_partition_set_name(ped_part, "/boot");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/boot");
+ }
ped_partition_set_flag(ped_part, PED_PARTITION_BOOT, 1);
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
@@ -330,7 +360,10 @@
/* / partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_part->geom.end+1+pedsector_root);
- ped_partition_set_name(ped_part, "/");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
@@ -341,7 +374,10 @@
/* /var/log partition */
ped_part = ped_partition_new(ped_disk, PED_PARTITION_NORMAL, ped_fstype, ped_part->geom.end+1, ped_dev->length - 1);
- ped_partition_set_name(ped_part, "/var/log");
+ if ( ped_disk_type_check_feature (ped_disk->type, PED_DISK_TYPE_PARTITION_NAME) )
+ {
+ ped_partition_set_name(ped_part, "/var/log");
+ }
ped_disk_add_partition(ped_disk, ped_part, ped_constraint_exact(&ped_part->geom));
if ( !ped_disk_commit_to_dev(ped_disk) )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|