FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 03-01-2012, 11:10 AM
Martin Gracik
 
Default Make sure /boot is on the same disk as prepboot (#727136)

If there is no separate /boot partition, treat the
root partition as the /boot partition, because that's
where /boot will end up.
---
storage/partitioning.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index a6a5f81..20d79af 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -991,6 +991,15 @@ def allocatePartitions(storage, disks, partitions, freespace):

removeNewPartitions(disks, new_partitions)

+ # Search for the /boot partition.
+ # If there is not a separate /boot partition,
+ # the /boot will end up on the / partition.
+ # We need this later for apple's bootstrap and prepboot,
+ # because this partition needs to be on the same disk
+ # as bootstrap/prepboot partition.
+ _mountpoints = [getattr(part.format, "mountpoint", "") for part in new_partitions]
+ _boot_part = "/boot" if "/boot" in _mountpoints else "/"
+
for _part in new_partitions:
if _part.partedPartition and _part.isExtended:
# ignore new extendeds as they are implicit requests
@@ -1183,7 +1192,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
if not mountpoint:
mountpoint = ""

- if free and (_part.req_bootable or mountpoint.startswith("/boot")):
+ if free and (_part.req_bootable or mountpoint.startswith(_boot_part)):
# if this is a bootable partition we want to
# use the first freespace region large enough
# to satisfy the request
--
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-01-2012, 12:51 PM
David Lehman
 
Default Make sure /boot is on the same disk as prepboot (#727136)

On Thu, 2012-03-01 at 13:10 +0100, Martin Gracik wrote:
> If there is no separate /boot partition, treat the
> root partition as the /boot partition, because that's
> where /boot will end up.

If this is only needed on ppc maybe we should avoid changing behavior of
other platforms.

Dave

> ---
> storage/partitioning.py | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/storage/partitioning.py b/storage/partitioning.py
> index a6a5f81..20d79af 100644
> --- a/storage/partitioning.py
> +++ b/storage/partitioning.py
> @@ -991,6 +991,15 @@ def allocatePartitions(storage, disks, partitions, freespace):
>
> removeNewPartitions(disks, new_partitions)
>
> + # Search for the /boot partition.
> + # If there is not a separate /boot partition,
> + # the /boot will end up on the / partition.
> + # We need this later for apple's bootstrap and prepboot,
> + # because this partition needs to be on the same disk
> + # as bootstrap/prepboot partition.
> + _mountpoints = [getattr(part.format, "mountpoint", "") for part in new_partitions]
> + _boot_part = "/boot" if "/boot" in _mountpoints else "/"
> +
> for _part in new_partitions:
> if _part.partedPartition and _part.isExtended:
> # ignore new extendeds as they are implicit requests
> @@ -1183,7 +1192,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
> if not mountpoint:
> mountpoint = ""
>
> - if free and (_part.req_bootable or mountpoint.startswith("/boot")):
> + if free and (_part.req_bootable or mountpoint.startswith(_boot_part)):
> # if this is a bootable partition we want to
> # use the first freespace region large enough
> # to satisfy the request


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-01-2012, 02:20 PM
"Brian C. Lane"
 
Default Make sure /boot is on the same disk as prepboot (#727136)

On Thu, Mar 01, 2012 at 01:10:32PM +0100, Martin Gracik wrote:
> If there is no separate /boot partition, treat the
> root partition as the /boot partition, because that's
> where /boot will end up.
> ---
> storage/partitioning.py | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/storage/partitioning.py b/storage/partitioning.py
> index a6a5f81..20d79af 100644
> --- a/storage/partitioning.py
> +++ b/storage/partitioning.py
> @@ -991,6 +991,15 @@ def allocatePartitions(storage, disks, partitions, freespace):
>
> removeNewPartitions(disks, new_partitions)
>
> + # Search for the /boot partition.
> + # If there is not a separate /boot partition,
> + # the /boot will end up on the / partition.
> + # We need this later for apple's bootstrap and prepboot,
> + # because this partition needs to be on the same disk
> + # as bootstrap/prepboot partition.
> + _mountpoints = [getattr(part.format, "mountpoint", "") for part in new_partitions]
> + _boot_part = "/boot" if "/boot" in _mountpoints else "/"

This kind of syntax is hard to read. Please expand it to traditional if:
else: blocks.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-02-2012, 11:06 AM
Martin Gracik
 
Default Make sure /boot is on the same disk as prepboot (#727136)

If there is no separate /boot partition, treat the
root partition as the /boot partition, because that's
where /boot will end up.
---
storage/partitioning.py | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 0484eb5..41172e2 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -28,6 +28,7 @@ import parted
from pykickstart.constants import *

from constants import *
+import platform

from errors import *
from deviceaction import *
@@ -996,6 +997,23 @@ def allocatePartitions(storage, disks, partitions, freespace):

removeNewPartitions(disks, new_partitions)

+ # Search for the /boot partition.
+ # If there is not a separate /boot partition,
+ # the /boot will end up on the / partition.
+ # We need this later for apple's bootstrap and prepboot,
+ # because this partition needs to be on the same disk
+ # as bootstrap/prepboot partition.
+ # Only do this on systems that need it.
+ _boot_part = "/boot"
+ pl = platform.getPlatform(None)
+ if pl.weight(fstype="prepboot") or pl.weight(fstype="appleboot"):
+ if "/boot" not in storage.mountpoints and "/" in storage.mountpoints:
+ _boot_part = "/"
+
+ #_mountpoints = [getattr(part.format, "mountpoint", "") for part in new_partitions]
+ #if "/boot" not in _mountpoints:
+ # _boot_part = "/"
+
for _part in new_partitions:
if _part.partedPartition and _part.isExtended:
# ignore new extendeds as they are implicit requests
@@ -1188,7 +1206,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
if not mountpoint:
mountpoint = ""

- if free and (_part.req_bootable or mountpoint.startswith("/boot")):
+ if free and (_part.req_bootable or mountpoint.startswith(_boot_part)):
# if this is a bootable partition we want to
# use the first freespace region large enough
# to satisfy the request
--
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-02-2012, 02:05 PM
Martin Gracik
 
Default Make sure /boot is on the same disk as prepboot (#727136)

If there is no separate /boot partition, treat the
root partition as the /boot partition, because that's
where /boot will end up.
---
storage/partitioning.py | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 0484eb5..46418a2 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -28,6 +28,7 @@ import parted
from pykickstart.constants import *

from constants import *
+import platform

from errors import *
from deviceaction import *
@@ -996,6 +997,19 @@ def allocatePartitions(storage, disks, partitions, freespace):

removeNewPartitions(disks, new_partitions)

+ # Search for the /boot partition.
+ # If there is not a separate /boot partition,
+ # the /boot will end up on the / partition.
+ # We need this later for apple's bootstrap and prepboot,
+ # because this partition needs to be on the same disk
+ # as bootstrap/prepboot partition.
+ # Only do this on systems that need it.
+ _boot_part = "/boot"
+ pl = platform.getPlatform(None)
+ if pl.weight(fstype="prepboot") or pl.weight(fstype="appleboot"):
+ if "/boot" not in storage.mountpoints and "/" in storage.mountpoints:
+ _boot_part = "/"
+
for _part in new_partitions:
if _part.partedPartition and _part.isExtended:
# ignore new extendeds as they are implicit requests
@@ -1188,7 +1202,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
if not mountpoint:
mountpoint = ""

- if free and (_part.req_bootable or mountpoint.startswith("/boot")):
+ if free and (_part.req_bootable or mountpoint == _boot_part):
# if this is a bootable partition we want to
# use the first freespace region large enough
# to satisfy the request
--
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-02-2012, 02:19 PM
David Lehman
 
Default Make sure /boot is on the same disk as prepboot (#727136)

On Fri, 2012-03-02 at 16:05 +0100, Martin Gracik wrote:
> If there is no separate /boot partition, treat the
> root partition as the /boot partition, because that's
> where /boot will end up.

Ack.

> ---
> storage/partitioning.py | 16 +++++++++++++++-
> 1 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/storage/partitioning.py b/storage/partitioning.py
> index 0484eb5..46418a2 100644
> --- a/storage/partitioning.py
> +++ b/storage/partitioning.py
> @@ -28,6 +28,7 @@ import parted
> from pykickstart.constants import *
>
> from constants import *
> +import platform
>
> from errors import *
> from deviceaction import *
> @@ -996,6 +997,19 @@ def allocatePartitions(storage, disks, partitions, freespace):
>
> removeNewPartitions(disks, new_partitions)
>
> + # Search for the /boot partition.
> + # If there is not a separate /boot partition,
> + # the /boot will end up on the / partition.
> + # We need this later for apple's bootstrap and prepboot,
> + # because this partition needs to be on the same disk
> + # as bootstrap/prepboot partition.
> + # Only do this on systems that need it.
> + _boot_part = "/boot"
> + pl = platform.getPlatform(None)
> + if pl.weight(fstype="prepboot") or pl.weight(fstype="appleboot"):
> + if "/boot" not in storage.mountpoints and "/" in storage.mountpoints:
> + _boot_part = "/"
> +
> for _part in new_partitions:
> if _part.partedPartition and _part.isExtended:
> # ignore new extendeds as they are implicit requests
> @@ -1188,7 +1202,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
> if not mountpoint:
> mountpoint = ""
>
> - if free and (_part.req_bootable or mountpoint.startswith("/boot")):
> + if free and (_part.req_bootable or mountpoint == _boot_part):
> # if this is a bootable partition we want to
> # use the first freespace region large enough
> # to satisfy the request


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org