bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH parted] Handle swap flag in msdos type labels


From: Hans de Goede
Subject: Re: [PATCH parted] Handle swap flag in msdos type labels
Date: Tue, 13 Oct 2009 12:25:44 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4

Hi,

On 10/13/2009 12:07 PM, Jim Meyering wrote:
Hans de Goede wrote:
From: David Cantrell<address@hidden>

Original patch by David Cantrell<address@hidden>, I
(Hans de Goede<address@hidden>) made the following changes:
-msdos_partition_is_flag_available() should return 1 for swap flag
-Only change the partition type to 82 when setting the swap flag
  on dos labels, not when resetting it

Hans,

What is the motivation for this change?

The existing "set 1 swap on" functionality is documented to be
specific to MAC partition tables:

     `swap'
           (Mac) - this flag should be enabled if the partition is the
           swap device to be used by Linux.


AFAICS, it's not intended to be a general (partition-table-independent)
way to set the per- partition "type".  For an msdos partition table,
if you just want to set the type of a newly-created partition to swap(82),
use mkpart's file system type argument:

     parted -s $dev mkpart primary linux-swap 60s 100s

ATM anaconda is not calling ped_partition_set_system() but only
setting the flag for swap partitions. It would seem reasonable to expect
this to work for any label type which has a separate type for swap partitions.

I must say having both flags and fstype in the first place is a bit confusing,
other then the boot, lba and hidden flag most other flags seem to just be
duplicating things which could / should be done by fstype so if we ever decide
to break API we should clean this up.

Also having non partition-table-independent API calls in general is a bad idea
IMHO. Why can't the MAC label code check fstype too, or the others honour the
swap flag too? The current behaviour seems rather confusing.

As for the swap flag, if you don't want to take this patch (and probably a
similar patch for gpt soon too), then we will fix anaconda to set the fstype,
given the above description of the swap flag, I take it that to work correctly
independent of the label type, we should set both the flag and the fstype ?

Regards,

Hans




reply via email to

[Prev in Thread] Current Thread [Next in Thread]