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 > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 02-27-2012, 09:37 PM
David Lehman
 
Default Don't allow /boot on logical partition except for grub.

Related: rhbz#725418
---
pyanaconda/bootloader.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 45905d1..db0626f 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -242,6 +242,7 @@ class BootLoader(object):
stage2_format_types = ["ext4", "ext3", "ext2"]
stage2_mountpoints = ["/boot", "/"]
stage2_bootable = False
+ stage2_must_be_primary = True
stage2_description = N_("/boot filesystem")
stage2_max_end_mb = 2 * 1024 * 1024

@@ -568,6 +569,15 @@ class BootLoader(object):
log.debug("_is_valid_location(%s) returning %s" % (device.name,ret))
return ret

+ def _is_valid_partition(self, device, primary=None, desc=""):
+ ret = True
+ if device.type == "partition" and primary and not device.isPrimary:
+ self.errors.append(_("%s must be on a primary partition.") % desc)
+ ret = False
+
+ log.debug("_is_valid_partition(%s) returning %s" % (device.name,ret))
+ return ret
+
#
# target/stage1 device access
#
@@ -766,6 +776,10 @@ class BootLoader(object):
desc=self.stage2_description):
valid = False

+ if not self._is_valid_partition(device,
+ primary=self.stage2_must_be_primary):
+ valid = False
+
if not self._is_valid_md(device, device_types=self.stage2_device_types,
raid_levels=self.stage2_raid_levels,
metadata=self.stage2_raid_metadata,
@@ -1100,6 +1114,7 @@ class GRUB(BootLoader):

stage2_is_valid_stage1 = True
stage2_bootable = True
+ stage2_must_be_primary = False

# list of strings representing options for boot device types
stage2_device_types = ["partition", "mdarray"]
--
1.7.7.6

_______________________________________________
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 11:10 AM.

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