-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
El Mon, 23 Jul 2012 13:48:02 -0700 "Brian C. Lane" bcl@redhat.com escribió:
On Mon, Jul 16, 2012 at 11:24:44AM -0500, Dennis Gilmore wrote:
Signed-off-by: Dennis Gilmore dennis@ausil.us
pyanaconda/bootloader.py | 118 ++++++++++++++++++++++++++++++++++++++++++++++ pyanaconda/platform.py | 9 +--- 2 files changed, 120 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index ea4de5e..995ebba 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -2295,6 +2295,124 @@ class SILO(YabootSILOBase): if rc: raise BootLoaderError("bootloader install failed")
+class UBOOTBase(BootLoader):
*Base implies a class that is always subclassed before being used (eg. YabootSILOBase), Maybe Make this one UBOOT and the other ArmUBOOT since it has the arm specific logic in it.
Its intended to be the base ive not implemented any of the support needed for OMAP yet they use a uEnv.txt file instead of boot.scr
we cant easily support OMAP boot loaders support yet we need to put in place the bootloader binaries dependent on the exact board we are using.
not sure that we will ever support uboot on any of the other arches that it supports. maybe ill go with UBOOTuEnv and UBOOTboot for the config files
- #
- # configuration
- #
- @property
- def config_dir(self):
if self.stage2_device.format.mountpoint == "/boot/uboot/":
return "/boot/uboot"
else:
return "/boot"
- @property
- def config_file(self):
return "%s/%s" % (self.config_dir, self._config_file)
+class UBOOT(UBOOTbase):
- name = "UBOOT"
- _config_file = "boot.scr.in"
Is .in really the name of the script?
it can be anything generally we use boot.scr.in we then run mkimage on it to wrap it into a format that uboot will load I have seen boot.cmd used also.
- packages = ['uboot-tools']
- stage2_format_types = ["ext3", "ext2", "vfat"]
- can_dual_boot = False
- def write_config_header(self, config):
header = ("# boot.scr.in generated by anaconda\n\n"
"#boot=%(stage1dev)s\n"
% {"stage1dev": self.stage1_device.path})
config.write(header)
- def write_config_images(self, config):
for image in self.images:
args = Arguments()
armMachine = iutil.getARMMachine()
dtb_addr = ""
dtb_line = ""
load_method = "ext2load"
disk_info = "0:1"
if armMachine in ["highbank"]:
storage_type = "scsi"
elif armMachine in ["tegra", "kirkwood"]:
storage_type = "usb"
elif armMachine in ["imx"]:
storage_type = ""
disk_info = ""
load_method = "${loadcmd}"
else:
storage_type = "sata"
[snip]
I like to see blocks like these implemented as lookups instead of hard to read block of if/then, it makes it easier to maintain which settings go with each machine instead of digging through code. If you use a dict of dicts named for the fields you can then pass the dict to "%(storage_type)s ..." to generate the output.
really it needs to be based on the storage type used for the install. ive not yet worked out the best way to do that. this was just a generic mostly get it right to take the first step. im open to ideas on how to do it right.
Dennis