| |
@@ -1,11 +1,11 @@
|
| |
#!/bin/sh
|
| |
|
| |
- # Copyright (C) 2014-2015 Red Hat Inc.
|
| |
+ # Copyright (C) 2014-2024 Red Hat Inc.
|
| |
# SPDX-License-Identifier: GPL-2.0+
|
| |
|
| |
# Automate Media Creation for Fedora ARM
|
| |
# Current version
|
| |
- VERSION=3.9
|
| |
+ VERSION=4.0
|
| |
|
| |
# usage message
|
| |
usage() {
|
| |
@@ -26,10 +26,10 @@
|
| |
--target=TARGET - target board for uboot
|
| |
-y - Assumes yes, will not wait for confirmation
|
| |
Help
|
| |
- --supported - List of supported hardware
|
| |
+ --supported - List of hardware we support writing out boot firmware
|
| |
--version - Display version and exit
|
| |
|
| |
- Example: $(basename ${0}) --image=Fedora-Rawhide.xz --target=Bananapi --media=/dev/mmcblk0
|
| |
+ Example: $(basename ${0}) --image=Fedora-Rawhide.xz --target=pine64_plus --media=/dev/mmcblk0
|
| |
|
| |
"
|
| |
}
|
| |
@@ -46,6 +46,12 @@
|
| |
DOC_DIR="${DIR}/"
|
| |
fi
|
| |
|
| |
+ # Return help for no args
|
| |
+ if [ $# -eq 0 ]; then
|
| |
+ usage
|
| |
+ exit 0
|
| |
+ fi
|
| |
+
|
| |
# check the args
|
| |
while [ $# -gt 0 ]; do
|
| |
case $1 in
|
| |
@@ -150,9 +156,6 @@
|
| |
--relabel)
|
| |
RELABEL=1
|
| |
;;
|
| |
- --lpae)
|
| |
- LPAE=1
|
| |
- ;;
|
| |
--showboot)
|
| |
SHOWBOOT=1
|
| |
;;
|
| |
@@ -221,11 +224,6 @@
|
| |
fi
|
| |
fi
|
| |
|
| |
- # change cubietruck target to uppercase
|
| |
- if [ "$TARGET" = "cubietruck" ]; then
|
| |
- TARGET="Cubietruck"
|
| |
- fi
|
| |
-
|
| |
# check for boards
|
| |
if [ "$TARGET" != "" ] && ! [ -e "${BOARDDIR}/${TARGET}" ]; then
|
| |
echo "Error: You must choose a supported board or none at all."
|
| |
@@ -302,10 +300,6 @@
|
| |
if [ "$SSH_KEY" != "" ]; then
|
| |
echo "= SSH Public Key $SSH_KEY will be added."
|
| |
fi
|
| |
- # Use the lpae kernel
|
| |
- if [ "$LPAE" != "" ]; then
|
| |
- echo "= The LPAE kernel will be the default."
|
| |
- fi
|
| |
# show boot messages
|
| |
if [ "$SHOWBOOT" != "" ]; then
|
| |
echo "= Boot messages will be shown onscreen."
|
| |
@@ -550,7 +544,7 @@
|
| |
|
| |
# determine uboot and write to disk
|
| |
if [ "$TARGET" != "" ]; then
|
| |
- if echo "$TARGET" | grep -q 'rpi[234]' || [ "$TARGET" = "olpc_xo175" ] || [ "$TARGET" = "beagleplay" ]; then
|
| |
+ if echo "$TARGET" | grep -q 'rpi[34]' || [ "$TARGET" = "beagleplay" ]; then
|
| |
. "${BOARDDIR}/${TARGET}"
|
| |
elif [ -d "${PREFIX}/usr/share/uboot/${TARGET}" ]; then
|
| |
. "${BOARDDIR}/${TARGET}"
|
| |
@@ -615,18 +609,11 @@
|
| |
echo "= Adding console $SYSCON to kernel parameters ..."
|
| |
add_kernel_parameter "console=$SYSCON console=tty0"
|
| |
|
| |
- if echo "$TARGET" | grep -q 'rpi[234]'; then
|
| |
+ if echo "$TARGET" | grep -q 'rpi[34]'; then
|
| |
sed -i "s|# enable_uart=1|enable_uart=1|" /tmp/fw/config.txt
|
| |
fi
|
| |
fi
|
| |
|
| |
- # fix up rpi2/3
|
| |
- if [ "$FIX_RPI" != "" ]; then
|
| |
- echo "= Blacklisting the VC4 Driver for the Raspberry Pi 2/3"
|
| |
- echo blacklist vc4 > ${PREFIX}/etc/modprobe.d/blacklist-vc4.conf
|
| |
- add_kernel_parameter "rd.driver.blacklist=vc4"
|
| |
- fi
|
| |
-
|
| |
# check if host system has selinux disabled, if it does autorelabel is required
|
| |
if [ "$(getenforce)" = "Disabled" ]; then
|
| |
echo "= NOTE: System Relabel required on first boot."
|
| |
@@ -648,25 +635,6 @@
|
| |
echo "= Parameter: $OPT_ARGS"
|
| |
add_kernel_parameter "$OPT_ARGS"
|
| |
fi
|
| |
- # if using rpi4 && armhfp limit ram to 1GB with warning
|
| |
- if [ $TARGET = "rpi4" ] && [ "$(echo $IMAGE | grep -i armhfp)" != "" ]; then
|
| |
- # edit config.txt to limit memory on boot
|
| |
- echo "#################################################################"
|
| |
- echo "# The Raspberry Pi 4 must be limited to 1 GB of RAM on first boot."
|
| |
- echo "# To enable the additional RAM, install the lpae kernel and edit the"
|
| |
- echo "# /boot/config.txt and remove or comment the line 'total_mem=1024'."
|
| |
- echo "#################################################################"
|
| |
- # issue warning for the change
|
| |
- echo "total_mem=1024" >> /tmp/fw/config.txt
|
| |
-
|
| |
- fi
|
| |
-
|
| |
- # prefer the lpae kernel
|
| |
- if [ "$LPAE" != "" ]; then
|
| |
- if [ -f /tmp/boot/grub2/grubenv ]; then
|
| |
- sed -i 's|^saved_entry.*|&+lpae|' /tmp/boot/grub2/grubenv
|
| |
- fi
|
| |
- fi
|
| |
# remove quiet from kargs
|
| |
if [ "$SHOWBOOT" != "" ]; then
|
| |
sed -i 's|rhgb quiet ||g' /tmp/boot/loader/entries/*.conf
|
| |
A number of updates and cleanups: