diff --git a/.extlinux-bootloader.metadata b/.extlinux-bootloader.metadata new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.extlinux-bootloader.metadata diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.gitignore diff --git a/SOURCES/extlinux.sh b/SOURCES/extlinux.sh new file mode 100755 index 0000000..f8679d3 --- /dev/null +++ b/SOURCES/extlinux.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +# Copyright (C) 2015, 2017 Red Hat Inc. +# Author(s): Dennis Gilmore +# Merlin Mathesius +# +# 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. + +# is the system a calxeda one +is_calxeda() { + grep -Eq '^Hardware[^ ]* (Highbank|Midway)' /proc/cpuinfo +} + +# update /etc/sysconfig/uboot to reflect if the platform provides its own dtb and +# we do not need to pass anything. +update_sysconfig() { + sed -i -e 's/#SHIPSDTB=no/SHIPSDTB=yes/g' /etc/sysconfig/uboot +} + +# insert into /boot/extlinux/extlinux.conf a fdtdir line +insert_fdtdir() { + # for every 'kernel' directive found, map it to an 'fdtdir' directive + # referencing the dtb directory and add it after the 'append' directive + sed -i \ + -e '/ fdtdir/d' \ + -e '/ kernel/{h;s/kernel/fdtdir/g;s/vmlinuz/dtb/g;x}' \ + -e '/ append/{p;x}' \ + /boot/extlinux/extlinux.conf +} + +# check if there is a rescue image and copy the dtb files if there is +copy_rescue_dtbs() { + has_rescue=0 + for target in /boot/vmlinuz-0-rescue* ; do + # if target exists, the glob matched a file + if [ -e "$target" ] ; then + has_rescue=1 + dtbdest=$(echo "$target" | sed -e 's/vmlinuz/dtb/g') + fi + break + done + for target in /boot/dtb* ; do + # if target exists, the glob matched a file + if [ -e "$target" ] ; then + dtbsource="$target" + fi + break + done + if [ $has_rescue = 1 ] && [ ! -d "$dtbdest" ] ; then + mkdir "$dtbdest" + for dtb in $(ls "$dtbsource") ; do + cp "$dtbsource/$dtb" "$dtbdest/$dtb" + done + fi +} + +# platform ships its own dtb +if is_calxeda +then + update_sysconfig +else + # need to add fdtdir to extlinux.conf + insert_fdtdir + copy_rescue_dtbs +fi diff --git a/SPECS/extlinux-bootloader.spec b/SPECS/extlinux-bootloader.spec new file mode 100644 index 0000000..d4f61a7 --- /dev/null +++ b/SPECS/extlinux-bootloader.spec @@ -0,0 +1,109 @@ +Name: extlinux-bootloader +Version: 1.2 +Release: 10%{?dist} +Summary: The EXTLINUX bootloader framework, for booting the local system + +License: GPLv2+ +URL: https://src.fedoraproject.org/rpms/extlinux-bootloader +Source1: extlinux.sh +BuildRequires: coreutils +%if 0%{?fedora} > 29 +Requires: grubby-deprecated +%endif +Provides: syslinux-extlinux + +ExclusiveArch: %{arm} aarch64 + +%description +The EXTLINUX bootloader framework, for booting the local system. +u-boot on arm supports extlinux.conf config files + +%prep + + +%build + + +%install +mkdir -p %{buildroot}%{_sbindir} +mkdir -p %{buildroot}/boot/extlinux/ + +mkdir -p %{buildroot}/etc +( cd %{buildroot}/etc && ln -s ../boot/extlinux/extlinux.conf . ) +install -p %{SOURCE1} %{buildroot}%{_sbindir}/extlinux + +%files +%doc +%{_sbindir}/extlinux +/boot/extlinux +%config(noreplace) /etc/extlinux.conf + + + +%changelog +* Thu Jul 25 2019 Fedora Release Engineering - 1.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 03 2019 Petr Pisar - 1.2-9 +- Correct URL in RPM metadata (bug #1510763) + +* Thu Jan 31 2019 Fedora Release Engineering - 1.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Nov 30 2018 Javier Martinez Canillas - 1.2-7 +- Make syslinux-extlinux to Require grubby-deprecated + Resolves: rhbz#1654841 + +* Thu Nov 22 2018 Pablo Greco - 1.2-6 +* Avoid multiple fdtdir entries + +* Fri Jul 13 2018 Fedora Release Engineering - 1.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 1.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed May 10 2017 Merlin Mathesius - 1.2-1 +- Convert extlinux to bash script to eliminate need for Python. + +* Fri Feb 10 2017 Fedora Release Engineering - 1.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Feb 03 2016 Fedora Release Engineering - 1.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Jul 20 2015 Peter Robinson 1.1-5 +- Use python3 + +* Wed Jun 17 2015 Fedora Release Engineering - 1.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Apr 01 2015 Dennis Gilmore - 1.1-3 +- add a missing / when listing the contents of /boot + +* Wed Apr 01 2015 Dennis Gilmore - 1.1-2 +- add a function to copy the dtbs to the rescue boot target if one exists + +* Mon Mar 30 2015 Dennis Gilmore - 1.1-1 +- add a new extlinux script to setup dtb handling on arm + +* Sat Aug 16 2014 Fedora Release Engineering - 1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jun 16 2014 Peter Robinson 1.0-4 +- Enable for build on aarch64 too + +* Sat Jun 07 2014 Fedora Release Engineering - 1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jun 05 2013 Dennis Gilmore - 1.0-1 +- initial package