ausil pushed to extlinux-bootloader (f22). "add a new extlinux script to setup dtb handling on arm"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed Apr 1 17:39:44 UTC 2015


>From cddc13b5adf9163cd8a114c950d4804ce06c80b4 Mon Sep 17 00:00:00 2001
From: Dennis Gilmore <dennis at ausil.us>
Date: Mon, 30 Mar 2015 22:52:06 -0500
Subject: add a new extlinux script to setup dtb handling on arm


diff --git a/extlinux b/extlinux
new file mode 100755
index 0000000..a52ef36
--- /dev/null
+++ b/extlinux
@@ -0,0 +1,66 @@
+#!/usr/bin/python2
+
+# Copyright (C) 2015 Red Hat Inc.
+# Author(s): Dennis Gilmore <dennis at ausil.us>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
+# the full text of the license.
+
+
+def is_calxeda():
+    #is the system a calxeda one
+    fd = open('/proc/cpuinfo','r')
+    cpuinfo = fd.readlines()
+    fd.close()
+    for line in cpuinfo:
+        if line.startswith('Hardware'):
+            if line.split(' ')[1].startswith('Highbank'):
+                return True
+            if line.split(' ')[1].startswith('Midway'):
+                return True
+    return False
+
+def update_sysconfig():
+    '''
+    update /etc/sysconfig/uboot to reflect if the platform provides its own dtb and
+    we do not need to pass anything.
+    '''
+    configfile = '/etc/sysconfig/uboot'
+    fd = open(configfile, 'r')
+    uboot = fd.read()
+    fd.close()
+    newuboot = uboot.replace('#SHIPSDTB=no','SHIPSDTB=yes')
+    fd = open(configfile, 'w')
+    fd.write(newuboot)
+    fd.close()
+
+def insert_fdtdir():
+    '''
+    insert into /boot/extlinux/extlinux.conf a fdtdir line
+    '''
+    configfile = '/boot/extlinux/extlinux.conf'
+    fd = open(configfile, 'r')
+    extlinux = fd.readlines()
+    fd.close()
+    newextlinux = []
+    fdtdirline = ''
+    for line in extlinux:
+        newextlinux.append(line)
+        if line.startswith('\tkernel'):
+            fdtdirline = line.replace('kernel','fdtdir').replace('vmlinuz', 'dtb')
+        if line.startswith('\tappend'):
+            newextlinux.append(fdtdirline)
+    fd = open(configfile, 'w')
+    fd.writelines(newextlinux)
+    fd.close()
+
+if __name__ == "__main__":
+    # platform ships its own dtb
+    if is_calxeda():
+        update_sysconfig()
+    else:
+    # need to add fdtdir to extlinux.conf
+        insert_fdtdir()
diff --git a/extlinux-bootloader.spec b/extlinux-bootloader.spec
index 4b3d517..e347fe5 100644
--- a/extlinux-bootloader.spec
+++ b/extlinux-bootloader.spec
@@ -1,10 +1,11 @@
 Name:           extlinux-bootloader
-Version:        1.0
-Release:        5%{?dist}
+Version:        1.1
+Release:        1%{?dist}
 Summary:        The EXTLINUX bootloader framework, for booting the local system
 
 License:        GPLv2+
 URL:            http://fedoraproject.org/wiki/extlinux-bootloader
+Source1:        extlinux
 
 Provides:       syslinux-extlinux
 
@@ -26,14 +27,7 @@ mkdir -p %{buildroot}/boot/extlinux/
 
 mkdir -p %{buildroot}/etc
 ( cd %{buildroot}/etc && ln -s ../boot/extlinux/extlinux.conf . )
-cat > %{buildroot}%{_sbindir}/extlinux <<EOF
-#!/bin/bash
-# dummy script to allow anaconda code to call extlinux to install bootloader
-# needed to allow the same code used for anaconda to work everywhere
-true
-EOF
-chmod 755 %{buildroot}%{_sbindir}/extlinux
-
+install -p %{SOURCE1} %{buildroot}%{_sbindir}
 
 %files
 %doc
@@ -44,6 +38,9 @@ chmod 755 %{buildroot}%{_sbindir}/extlinux
 
 
 %changelog
+* Mon Mar 30 2015 Dennis Gilmore <dennis at ausil.us> - 1.1-1
+- add a new extlinux script to setup dtb handling on arm 
+
 * Sat Aug 16 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/extlinux-bootloader.git/commit/?h=f22&id=cddc13b5adf9163cd8a114c950d4804ce06c80b4


More information about the scm-commits mailing list