e6b270b
From aa4472dbc10f3d669e24ac07293d7ac19e606866 Mon Sep 17 00:00:00 2001
e6b270b
From: Dennis Gilmore <dennis@ausil.us>
e6b270b
Date: Wed, 30 Aug 2017 14:03:45 -0500
e6b270b
Subject: [PATCH 1/8] remove the old crufty u-boot support
e6b270b
e6b270b
Fedora has only supported extlinux.conf for a few releases now
e6b270b
as a result it should be the only way we boot systems. Remove
e6b270b
the no longer needed uboot file
e6b270b
e6b270b
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
e6b270b
---
e6b270b
 new-kernel-pkg | 116 -------------------------------------------------
e6b270b
 uboot          |  43 ------------------
e6b270b
 2 files changed, 159 deletions(-)
e6b270b
 delete mode 100644 uboot
e6b270b
e6b270b
diff --git a/new-kernel-pkg b/new-kernel-pkg
e6b270b
index b634388a83f..962008e3c9d 100755
e6b270b
--- a/new-kernel-pkg
e6b270b
+++ b/new-kernel-pkg
e6b270b
@@ -37,7 +37,6 @@ else
e6b270b
 fi
e6b270b
 
e6b270b
 [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
e6b270b
-[ -f /etc/sysconfig/uboot ] && . /etc/sysconfig/uboot
e6b270b
 
e6b270b
 cfgGrub2=""
e6b270b
 cfgGrub2Efi=""
e6b270b
@@ -50,7 +49,6 @@ grubConfig=""
e6b270b
 grub2Config=""
e6b270b
 grub2EfiConfig=""
e6b270b
 extlinuxConfig=""
e6b270b
-ubootScript="/boot/boot.scr"
e6b270b
 
e6b270b
 ARCH=$(uname -m)
e6b270b
 
e6b270b
@@ -84,13 +82,6 @@ elif [[ ${ARCH} =~ armv[5|7].*l ]] ; then
e6b270b
     liloConfig=""
e6b270b
     bootPrefix=/boot
e6b270b
     extlinuxConfig=$(readlink -f /etc/extlinux.conf 2>/dev/null)
e6b270b
-    ubootDir=${UBOOT_DIR:-"/boot"}
e6b270b
-    ubootScript=$ubootDir/${UBOOT_SCR:-"boot.scr"}
e6b270b
-    ubootKList=${UBOOT_KLIST:-"klist.txt"}
e6b270b
-    ubootDevice=/dev/${UBOOT_DEVICE:-"mmcblk0p1"}
e6b270b
-    ubootDefaultImage=${UBOOT_UIMAGE:-"uImage"}
e6b270b
-    ubootDefaultInitrd=${UBOOT_UINITRD:-"uInitrd"}
e6b270b
-    ubootAddress=${UBOOT_IMGADDR:-"0x00008000"}
e6b270b
     mounted=""
e6b270b
     liloFlag=""
e6b270b
     isx86=""
e6b270b
@@ -382,53 +373,6 @@ remove() {
e6b270b
 	[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby"
e6b270b
     fi
e6b270b
 
e6b270b
-    if [ -n "$cfguBoot" ]; then
e6b270b
-	[ -n "$verbose" ] && echo "removing $version from $ubootDir..."
e6b270b
-
e6b270b
-	if [ -f $ubootDir/$ubootKList ]; then
e6b270b
-	    tmpKList=`mktemp $ubootDir/$ubootKList.XXXX`
e6b270b
-	    curversion=`tail -n1 $ubootDir/$ubootKList`
e6b270b
-	    sed "/$version$/d" $ubootDir/$ubootKList > $tmpKList
e6b270b
-	    newversion=`tail -n1 $tmpKList`
e6b270b
-	    if [ -f $ubootDir/uImage-$newversion ] && [ -f $ubootDir/uInitrd-$newversion ]; then
e6b270b
-		if [ "$curversion" != "$newversion" ]; then
e6b270b
-		    cp -fp $ubootDir/uImage-$newversion $ubootDir/${ubootDefaultImage}
e6b270b
-		    if [ $? -ne 0 ]; then
e6b270b
-			[ -n "$verbose" ] && echo "copy uImage-$newversion error, default kernel not replaced!" && exit
e6b270b
-		    fi
e6b270b
-		    cp -fp $ubootDir/uInitrd-$newversion $ubootDir/${ubootDefaultInitrd}
e6b270b
-		    if [ $? -ne 0 ]; then
e6b270b
-			[ -n "$verbose" ] && echo "copy uInitrd-$newversion error, default Initrd not replaced!" && exit
e6b270b
-		    fi
e6b270b
-		fi
e6b270b
-
e6b270b
-		[ -n "$verbose" ] && echo "removing uImage-$version"
e6b270b
-		if [ -f $ubootDir/uImage-$version ]; then
e6b270b
-		    rm -f $ubootDir/uImage-$version
e6b270b
-		else
e6b270b
-		    [ -n "$verbose" ] && echo "uImage-$version did not exist!"
e6b270b
-		fi
e6b270b
-
e6b270b
-		[ -n "$verbose" ] && echo "removing uInitrd-$version"
e6b270b
-		if [ -f $ubootDir/uInitrd-$version ]; then
e6b270b
-		    rm -f $ubootDir/uInitrd-$version
e6b270b
-		else
e6b270b
-		    [ -n "$verbose" ] && echo "uInitrd-$version did not exist!"
e6b270b
-		fi
e6b270b
-
e6b270b
-		mv $tmpKList $ubootDir/$ubootKList
e6b270b
-		[ -x /sbin/a-b-c ] && /sbin/a-b-c
e6b270b
-	    else
e6b270b
-		[ -n "$verbose" ] && echo "uImage $newversion does not exist!"
e6b270b
-		[ -f $tmpKList ] && rm -f $tmpKList
e6b270b
-	    fi
e6b270b
-        else
e6b270b
-            [ -n "$verbose" ] && echo "No previous kernel version.  U-Boot images not removed!"
e6b270b
-        fi
e6b270b
-    else
e6b270b
-	[ -n "$verbose" ] && echo "$ubootScript does not exist, not modifying $ubootDir"
e6b270b
-    fi
e6b270b
-
e6b270b
     if [ -n "$cfgExtlinux" ]; then
e6b270b
 	[ -n "$verbose" ] && echo "removing $version from $extlinuxConfig"
e6b270b
 	$grubby --extlinux -c $extlinuxConfig \
e6b270b
@@ -530,36 +474,6 @@ update() {
e6b270b
 	[ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby"
e6b270b
     fi
e6b270b
 
e6b270b
-    if [ -n "$cfguBoot" ]; then
e6b270b
-	[ -n "$verbose" ] && echo "adding $version to $ubootDir..."
e6b270b
-
e6b270b
-	[ -n "$verbose" ] && echo "creating uImage-$version"
e6b270b
-	mkimage -A arm -O linux -T kernel -C none -a $ubootAddress \
e6b270b
-		-e $ubootAddress -n $version \
e6b270b
-		-d $kernelImage $ubootDir/uImage-$version
e6b270b
-
e6b270b
-	[ -n "$verbose" ] && echo "creating uInitrd-$version"
e6b270b
-	mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 \
e6b270b
-		-n initramfs -d $initrdfile $ubootDir/uInitrd-$version
e6b270b
-
e6b270b
-	if [ -f $ubootDir/uImage-$version ] && [ -f $ubootDir/uInitrd-$version ]; then
e6b270b
-	    cp -fp $ubootDir/uImage-$version $ubootDir/${ubootDefaultImage}
e6b270b
-	    if [ $? -ne 0 ]; then
e6b270b
-		[ -n "$verbose" ] && echo "copy uImage-$version error, kernel not installed!" && exit
e6b270b
-	    fi
e6b270b
-	    cp -fp $ubootDir/uInitrd-$version $ubootDir/${ubootDefaultInitrd}
e6b270b
-	    if [ $? -ne 0 ]; then
e6b270b
-		[ -n "$verbose" ] && echo "copy uInitrd-$version error, kernel not installed!" && exit
e6b270b
-	    fi
e6b270b
-	    echo $version >> $ubootDir/$ubootKList
e6b270b
-	    [ -x /sbin/a-b-c ] && /sbin/a-b-c
e6b270b
-	else
e6b270b
-	    [ -n "$verbose" ] && echo "cannot make $version the default"
e6b270b
-	fi
e6b270b
-    else
e6b270b
-	[ -n "$verbose" ] && echo "$ubootScript does not exist, not setting up $ubootDir"
e6b270b
-    fi
e6b270b
-
e6b270b
     if [ -n "$cfgExtlinux" ]; then
e6b270b
 	[ -n "$verbose" ] && echo "updating $version from $extlinuxConfig"
e6b270b
 	ARGS="--extlinux -c $extlinuxConfig --update-kernel=$kernelImage \
e6b270b
@@ -877,33 +791,6 @@ fi
e6b270b
 [ -n "$liloConfig" ] && [ -f "$liloConfig" ] && cfgLilo=1;
e6b270b
 [ -n "$extlinuxConfig" ] && [ -f "$extlinuxConfig" ] && cfgExtlinux=1;
e6b270b
 
e6b270b
-# if we have a U-Boot directory, but no boot script, check if the directory
e6b270b
-# is mounted.  If not, mount it, and then check if a boot script exists.
e6b270b
-if [ -n "$ubootDir" ]; then
e6b270b
-    if [ -f "$ubootScript" ]; then
e6b270b
-        cfguBoot=1
e6b270b
-    else
e6b270b
-	mountEntry=`mount | grep $ubootDir`
e6b270b
-	if [ -z "$mountEntry" ]; then
e6b270b
-	    mount $ubootDevice $ubootDir
e6b270b
-	    mounted=1
e6b270b
-	fi
e6b270b
-	[ -f "$ubootScript" ] && cfguBoot=1;
e6b270b
-    fi
e6b270b
-fi
e6b270b
-
e6b270b
-# if we're using U-Boot, check if the default load address should change
e6b270b
-if [ -n "$cfguBoot" -a -z "$UBOOT_IMGADDR" ]; then
e6b270b
-    [[ $version  =~ .([^.]*)$ ]]
e6b270b
-    platform=${BASH_REMATCH[1]}
e6b270b
-    # A few platforms use an alternate kernel load address
e6b270b
-    if [ "$platform" = "omap" ]; then
e6b270b
-        ubootAddress=0x80008000
e6b270b
-    elif [ "$platform" = "imx" ]; then
e6b270b
-        ubootAddress=0x90008000
e6b270b
-    fi
e6b270b
-fi
e6b270b
-
e6b270b
 # if we have a lilo config on an x86 box, see if the default boot loader
e6b270b
 # is lilo to determine if it should be run
e6b270b
 if [ -n "$cfgLilo" -a -n "$isx86" ]; then
e6b270b
@@ -920,7 +807,4 @@ elif [ "$mode" == "--rpmposttrans" ]; then
e6b270b
     rpmposttrans
e6b270b
 fi
e6b270b
 
e6b270b
-# if we mounted the U-Boot directory, unmount it.
e6b270b
-[ -n "$mounted" ] && umount $ubootDir
e6b270b
-
e6b270b
 exit 0
e6b270b
diff --git a/uboot b/uboot
e6b270b
deleted file mode 100644
e6b270b
index 07d8671822f..00000000000
e6b270b
--- a/uboot
e6b270b
+++ /dev/null
e6b270b
@@ -1,43 +0,0 @@
e6b270b
-# Settings for uBoot setup in /sbin/new-kernel-pkg
e6b270b
-#
e6b270b
-# Default values are provided below (as comments)
e6b270b
-#
e6b270b
-# WARNING: These values affect where grubby installs and removes
e6b270b
-#          uBoot kernel images.  Changing these _after_ kernels have
e6b270b
-#          been installed may cause removing a kernel image to fail.
e6b270b
-
e6b270b
-# directory where uBoot images and scripts are found
e6b270b
-#UBOOT_DIR=/boot
e6b270b
-
e6b270b
-# Override the load address when running mkimage on the kernel.
e6b270b
-# OMAP such as Beagleboard and Pandaboard: Use 0x80008000
e6b270b
-# Tegra such as Trimslice: Use 0x00008000
e6b270b
-# IMX such as Efika mx51 smarttop: Use 0x90008000
e6b270b
-# Kirkwood such as Dreamplug, Guruplug, Sheevaplug: Use 0x00008000
e6b270b
-# If left undefined grubby will use defults for Tegra or OMAP depending
e6b270b
-# upon the contents of /proc/cpuinfo.
e6b270b
-#UBOOT_IMGADDR=0x0x00008000
e6b270b
-
e6b270b
-# name of the text file containing the list of installed kernel versions
e6b270b
-# NOTE: The versions are in order of installation.  The last entry should
e6b270b
-#       always be the default boot kernel version.
e6b270b
-#UBOOT_KLIST=klist.txt
e6b270b
-
e6b270b
-# device partition where uBoot images reside; mounted on $UBOOT_DIR
e6b270b
-#UBOOT_DEVICE=mmcblk0p1
e6b270b
-
e6b270b
-
e6b270b
-# NOTE: Both of the following files are automatically overwritte
e6b270b
-#       when a kernel package is installed or removed.
e6b270b
-
e6b270b
-# default kernel uImage file name
e6b270b
-#UBOOT_UIMAGE=uImage
e6b270b
-
e6b270b
-# default initrd uInitrd file name
e6b270b
-#UBOOT_UINITRD=uInitrd
e6b270b
-
e6b270b
-# defualt for platform shipping an onboard dtb.
e6b270b
-#SHIPSDTB=no
e6b270b
-
e6b270b
-# option to tell new-kernel-pkg a specific dtb file to load in extlinux.conf
e6b270b
-#dtbfile=foo.dtb
e6b270b
-- 
e6b270b
2.17.1
e6b270b