| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There is an unidentified condition that prevents udevd calling the
BLKRRPART ioctl after a partition table is written. It looks like
either the kernel or udevd drops device change events if they are
too closely spaced in time. So, in the case where we expect udevd
to call BLKRRPART, check /proc/partitions to make sure it has done
so. Arbitrarily try 5 times, 100ms apart, before giving up and
informing the kernel ourselves.
|
|
|
|
|
|
|
| |
diskdrake allows the user to clear all partitions even when some of those
partitions are currently mounted. partition_table::dos::need_to_tell_kernel()
must return true in this case, as the automatic reread of the partition table
triggered by udevd will fail.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids unnecessary udev events, which in some cases were causing
udevd to trigger a kernel partition table reread, causing the kernel
to get out of sync with drakx.
In order to do so, the libparted bindings are enhanced so that we
manipulate a 'ped_disk' object:
- disk_open() returns such an object
- set_disk_type() is removed
- disk_commit() writes back the partition table and tell the kernel
about it
if we fails to write the partition table, we let
partition_table::write() fire an exceptionc
if we only have succeed in writing the partition table, we let
partition_table::write() try harder (umounting partitions before
trying againt to tell the kernel again)
- need_to_tell_kernel() is overrided
The last change is needed because we now tell the kernel about the new
partition layout in partition_table::gpt::write() when calling
disk_commit() while previously we were deferring that to
partition_table::write() which after having called the gpt's write()
calls tell_kernel() -> c::tell_kernel_to_reread_partition_table()
So we must tell partition_table::write() that telling the kernel to
reread the partition_table is not needed if we already succeeded in
that.
|
|
|
|
|
|
| |
Now we force the kernel to reread the partition table when we initialise
it, there's no need to also inform it that we've deleted all the existing
partitions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 532fd1d60df306e204bae79c5158ca2302739966, which
introduced a new bug when clearing GPT partitions in an interactive
session (mga#20264), and replaces it with a new solution.
When a partition table is initialised, we now add an 'init' action to
the $hd->{will_tell_kernel} list. This is used both by gpt::write()
(to clear the partition table) and by partition_table::tell_kernel()
(to force the kernel to reread the partition table). Previous changes
stored in $hd->{will_tell_kernel} are discarded, as they are no longer
of interest.
This also removes support for the will_tell_kernel 'force_reboot'
action, as nothing uses that any more.
|
|
|
|
|
| |
rather than lost on console
printf() was introduced in commit 9e6b327ca2b1f46db62e0811fabf0a6cf0b114a7
|
|
|
|
|
|
|
|
| |
classic installer (mga#20074).
The automatic rescan of the partition table is triggered by udevd. The
udev rule that causes this is not present on the cut-down system that
runs the classic installer.
|
|
|
|
|
|
|
|
|
| |
(mga#20074).
To minimise the changes this close to mga6 release (and until we fix
the bug in partition auto-allocation that mistakenly creates BIOS boot
partitions non-GPT disks), reuse the BIOS_GRUB flag for flagging Empty
partitions, as the real partition ID (0x00) is used to flag free space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
automatically (mga#20074).
When no partitions on a DOS-partitioned disk are mounted, the kernel
automatically rescans the partition table when it is written to disk.
We shouldn't then try to update the kernel's view of the partition
table, as the list of deltas we have recorded is relative to the
previous state of the partition table, not the newly rescanned state.
The behaviour for other partition table types is unchanged.
v2 (tvignaud): just make base class assume the kernel doesn't reread, only mbr
subclass overrides need_to_tell_kernel() in order to be smarter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(mga#20074).
When no partitions on a DOS-partitioned disk are mounted, the kernel
automatically rescans the partition table when the file handle to the
raw device is released. Currently the code opens and closes the raw
device when writing the primary partition table and when writing each
extended partition table segment. As the extended partition table
segments form a linked list, this allows the kernel to get in and
rescan the table when the list is not in a coherent state. This patch
changes the code to open the raw device before writing the primary
partition table and to close it only after writing the last extended
partition table segment.
The behaviour for other partition table types is unchanged.
v2 (tvignaud): simplify by moving copies of noop funcs into the base class
|
|
|
|
|
|
|
|
| |
same rationale as in commit 767048570e8c44061cb0d6faf689698d3313870c for
mga#18666
this wasn't an issue as we later round partition on 1MB boundary but
it's still cleaner/safer...
|
|
|
|
|
|
|
|
|
| |
in order to prevent overlapping errors when adding partitions:
(b/c libparted doesn't know that diskdrake already removed the
partitions in its memory view)
"failed to add partition #1 on /dev/vda"
"Error: Can't have overlapping partitions."
"add_partition failed"
|
| |
|
|
|
|
| |
Resolves: mga#18666, mga#17796
|
|
|
|
| |
basically reverting: commit 36c2fc004bf445ff784bde423ba7aa27885539f8
|
| |
|
| |
|
|
|
|
| |
let's abuse ->{pt_type} for tracking such partitions
|
| |
|
|
|
|
|
|
| |
disk_{add,del}_partition call ped_disk_commit() which result in udev events
(and also already tell the kernel to reread the partition table (several
times))
|
| |
|
|
|
|
|
| |
let's diskdrake show the same types as for MBR partitions.
to be cleaned once we switch to libparted for everything...
|
|
|
|
|
| |
not that important as we do the format/..., we only rely on libparted
for writing the partition table & setting the GUID, but just in case...
|
|
|
|
|
|
|
| |
fix fs returned by libparted
thus fixing mount point for FAT partitions on GTP (mga#15987)
this also fix setting the proper GUID for FAT partitions on GPT
|
|
|
|
| |
needed for next commit
|
|
|
|
|
|
|
|
| |
On some machines, calls to ped_disk_new() in libparted take of
the order of seconds, so doing this for each flag and partition
in turn makes partition_table::gpt::read_one take an inordinate
amount of time (mga#15621). Instead, collect the flags during the
call to c::get_disk_partitions.
|
|
|
|
| |
fix "set_partition_flag: unknown type: recovery" (mga#15621)
|
| |
|
| |
|
| |
|
|
|
|
| |
Thomas rushed to push before I run perl_checker... :-(
|
|
|
|
|
|
| |
this is making it more readable regarding:
"I cannot read the partition table of device XXX, it is too corrupted"
(mga#13592, mga#15272, mga#15472)
|
| |
|
| |
|
| |
|
|
|
|
| |
libparted needs it to be named like this in order to put the right
|
|
|
|
|
| |
libparted needs it to be named like this in order to put the right
GUID...
|
|
|
|
| |
simimar to commit ee22664bcb1fdedece15e07d047ba86f3d791ee6
|
|
|
|
| |
just bind the libparted function (needed for next commit)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
ESP are the only partitions we're detecting through their pt_type
(modulo 0x12 which was Compaq Diagnostic & unlikely to be found on
GPT...)
However GPT has no equivalent to pt_type
But we can test for ESP flag
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
create directly the hash in XS instead of instead of sprintf()ing it
into a string which was then parsed in perl in order to actually create
the hash
this fixes several issues:
- due to adding some fields to the string under if (),
we could silently have ignored some partitions
-
this also simplifies adding further fields
|
|
|
|
|
|
|
| |
needed for next commit
also we were passing '' as fs_type to c::disk_add_partition()
$part was undef since commit 9e6b327ca2b1f46db62e0811fabf0a6cf0b114a7
|
| |
|