Skip to content

Commit

Permalink
finalizing alpha4 build.
Browse files Browse the repository at this point in the history
- create a script for easy switching between builds.
- include loading messeges.
- fixes sdl2 old patches. disable mssa while blittering.
  • Loading branch information
ajmandourah committed Jul 22, 2024
1 parent 71ea466 commit 8383ff1
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mount -o remount,rw /boot
if [[ -f /boot/boot/first_boot ]]; then
# remove the trigger
rm -f /boot/boot/first_boot

/usr/bin/progressbar "finalizing the partition for windows recognition"
mkfs.exfat -n SHARE ${PART}
gdisk $1 <<EOF
t
Expand Down Expand Up @@ -91,6 +91,7 @@ then

# --- BEGIN RESIZE ---
# /userdata partition
/usr/bin/progressbar "resizing and formating the share parition"
PART=$(batocera-part "share_internal")
PARTNUM=$(batocera-part "share_internal_num")
echo "Partition name: $PART & number: $PARTNUM" >> $log
Expand Down
10 changes: 9 additions & 1 deletion board/batocera/allwinner/h700/rg28xx/fsoverlay/etc/init.d/rcS
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

/usr/bin/progressbar

haveged -w 1024 -F --once
# We need the graphics module in order to use SDL since we are
# using the sdl-compat/SDL2 for rendering
Expand All @@ -14,31 +16,37 @@ fbset -g 480 640 480 1280 32


#udev
/usr/bin/progressbar "Starting required services"
/etc/init.d/S27debugmount start
/etc/init.d/S00udev.sh start
/etc/init.d/S01dbus start
/etc/init.d/S21haveged start

/etc/init.d/S02resize start
/usr/bin/progressbar "mounting the share partition"
/etc/init.d/S02share start
/etc/init.d/S02systctl start

/etc/init.d/S01date start &
/etc/init.d/S02overclock start &



/usr/bin/progressbar "populate share data"
/etc/init.d/S03populateshare start
/etc/init.d/S03triggerhappy start
# /etc/init.d/S03urandom start &
/etc/init.d/S04populate start &
/etc/init.d/S05avahi-setup.sh start &

/usr/bin/progressbar "start the logging service"
/etc/init.d/S01syslogd restart &

/usr/bin/progressbar "configure audio"
/etc/init.d/S06audio start
/etc/init.d/S07audioconfig start &
/etc/init.d/S03pico8

/usr/bin/progressbar "all done. starting now"
/etc/init.d/S07emulationstation start &

insmod /lib/modules/4.9.170/kernel/drivers/net/wireless/rtl8821cs/8821cs.ko
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mount -o remount,rw /boot
if [[ -f /boot/boot/first_boot ]]; then
# remove the trigger
rm -f /boot/boot/first_boot

/usr/bin/progressbar "finalizing the partition for windows recognition"
mkfs.exfat -n SHARE ${PART}
gdisk $1 <<EOF
t
Expand Down Expand Up @@ -91,6 +91,8 @@ then

# --- BEGIN RESIZE ---
# /userdata partition
/usr/bin/progressbar "resizing and formating the share parition"

PART=$(batocera-part "share_internal")
PARTNUM=$(batocera-part "share_internal_num")
echo "Partition name: $PART & number: $PARTNUM" >> $log
Expand Down
12 changes: 10 additions & 2 deletions board/batocera/allwinner/h700/rg35xx-plus/fsoverlay/etc/init.d/rcS
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

/usr/bin/progressbar

haveged -w 1024 -F --once
# We need the graphics module in order to use SDL since we are
# using the sdl-compat/SDL2 for rendering
Expand All @@ -18,31 +20,37 @@ fbset -g 640 480 640 960 32
# display="/sys/kernel/debug/dispdbg"
# echo suspend > $display/command; echo disp0 > $display/name; echo 1 > $display/start
# echo resume > $display/command; echo disp0 > $display/name; echo 1 > $display/start

/usr/bin/progressbar "starting required services"
/etc/init.d/S00udev.sh start
/etc/init.d/S01dbus start
/etc/init.d/S21haveged start

/etc/init.d/S02resize start

/usr/bin/progressbar "mounting share partition"
/etc/init.d/S02share start
/etc/init.d/S02systctl start

/etc/init.d/S01date start &
/etc/init.d/S02overclock start &



/usr/bin/progressbar "populate share data"
/etc/init.d/S03populateshare start
/etc/init.d/S03triggerhappy start
# /etc/init.d/S03urandom start &
/etc/init.d/S04populate start &
/etc/init.d/S05avahi-setup.sh start &

/usr/bin/progressbar "Starting logging service"
/etc/init.d/S01syslogd restart &

/usr/bin/progressbar "Configure audio"
/etc/init.d/S06audio start
/etc/init.d/S07audioconfig start &
/etc/init.d/S03pico8

/usr/bin/progressbar "all done. Starting now"
/etc/init.d/S07emulationstation start &

insmod /lib/modules/4.9.170/kernel/drivers/net/wireless/rtl8821cs/8821cs.ko
Expand Down
65 changes: 65 additions & 0 deletions config_device.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# Check if an argument is provided
if [ $# -ne 1 ]; then
echo "Usage: \$0 <rg28xx|rg35xx-plus|rg35xx-h>"
exit 1
fi

# Argument (converted to lowercase for case-insensitivity)
ARG=$(echo $1 | tr '[:upper:]' '[:lower:]')

# Validate the argument and determine the replacement value
case $ARG in
"rg28xx")
REPLACEMENT="rg28xx"
;;
"rg35xx-plus"|"rg35xx-h")
REPLACEMENT="rg35xx-plus"
;;
*)
echo "Invalid argument. Only 'rg28xx', 'rg35xx-plus', or 'rg35xx-H' are allowed."
exit 1
;;
esac

# Define file paths relative to the script location
SCRIPT_DIR=$(dirname $0)
CONFIG_FILE="$SCRIPT_DIR/configs/batocera-h700.board"
CONFIG_IN_FILE="$SCRIPT_DIR/package/batocera/core/batocera-system/Config.in"

# Function to update a line in a file if it doesn't match the replacement value
update_line_if_needed() {
local file=$1
local search_pattern=$2
local replacement=$3

if grep -q "$search_pattern" "$file"; then
current_value=$(grep "$search_pattern" "$file" | sed -E "s/.*\/([^\/]*)\/patches.*/\1/")
if [ "$current_value" != "$REPLACEMENT" ]; then
sed -i "s|$search_pattern.*|$replacement|" "$file"
fi
else
echo "Pattern not found in $file"
exit 1
fi
}

# Update configs/batocera-h700.board
if [ -f "$CONFIG_FILE" ]; then
update_line_if_needed "$CONFIG_FILE" 'BR2_GLOBAL_PATCH_DIR=' "BR2_GLOBAL_PATCH_DIR=\"\$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/patches \$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/patches \$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/h700/patches \$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/h700/$REPLACEMENT/patches \""
update_line_if_needed "$CONFIG_FILE" 'BR2_ROOTFS_OVERLAY=' "BR2_ROOTFS_OVERLAY=\"\$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/fsoverlay \$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/h700/fsoverlay \$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/h700/$REPLACEMENT/fsoverlay \""
else
echo "File $CONFIG_FILE not found!"
exit 1
fi

# Update package/batocera/core/batocera-system/Config.in
if [ -f "$CONFIG_IN_FILE" ]; then
update_line_if_needed "$CONFIG_IN_FILE" 'default "allwinner/h700/' "default \"allwinner/h700/$REPLACEMENT\" if BR2_PACKAGE_BATOCERA_TARGET_H700"
else
echo "File $CONFIG_IN_FILE not found!"
exit 1
fi

echo "Files updated successfully."
2 changes: 1 addition & 1 deletion configs/batocera-h700.board
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BR2_PACKAGE_BATOCERA_KODI20=n
#BR2_PACKAGE_MTD=y

######
#BR2_GLOBAL_PATCH_DIR="board/batocera/allwinner/h700/rg35xx-plus/patches"
#BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/patches $(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/patches $(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/h700/patches $(BR2_EXTERNAL_BATOCERA_PATH)/board/batocera/allwinner/h700/rg35xx-plus/patches "
# Linux headers same as kernel, a 4.9 series
BR2_LINUX_KERNEL=y
BR2_KERNEL_HEADERS_AS_KERNEL=y
Expand Down
2 changes: 1 addition & 1 deletion package/batocera/core/batocera-system/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ config BR2_TARGET_BATOCERA_IMAGES_DEFINITIONS
default "allwinner/h5/tritium-h5 allwinner/h5/orangepi-pc2" if BR2_PACKAGE_BATOCERA_TARGET_H5
default "allwinner/h6/orangepi-3-lts allwinner/h6/orangepi-3 allwinner/h6/orangepi-one-plus" if BR2_PACKAGE_BATOCERA_TARGET_H6
default "allwinner/h616/orangepi-zero2 allwinner/h616/orangepi-zero3 allwinner/h616/x96-mate" if BR2_PACKAGE_BATOCERA_TARGET_H616
default "allwinner/h700/rg35xx-plus" if BR2_PACKAGE_BATOCERA_TARGET_H700
default "allwinner/h700/rg35xx-plus" if BR2_PACKAGE_BATOCERA_TARGET_H700
default "allwinner/a133/trimui-smart-pro" if BR2_PACKAGE_BATOCERA_TARGET_A133
default "actions/atm7039/rg35xx" if BR2_PACKAGE_BATOCERA_TARGET_ATM7039
default "amlogic/s812" if BR2_PACKAGE_BATOCERA_TARGET_S812
Expand Down

0 comments on commit 8383ff1

Please sign in to comment.