From 55ff24a2413af60f049f731272e868e893a7dfe3 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:11:41 +0100 Subject: [PATCH 01/10] use options.cfg from boot + add logs to mount new vars: CONSOLE_CFG & OPTIONS_CFG from main --- board/miyoo/boot/firstboot | 76 ++++++++++++++++++------------------ board/miyoo/boot/options.cfg | 13 ++++++ board/miyoo/main/options.cfg | 13 ------ board/miyoo/rootfs/etc/main | 30 +++++++------- 4 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 board/miyoo/boot/options.cfg delete mode 100644 board/miyoo/main/options.cfg diff --git a/board/miyoo/boot/firstboot b/board/miyoo/boot/firstboot index e348a851b..c07310e33 100644 --- a/board/miyoo/boot/firstboot +++ b/board/miyoo/boot/firstboot @@ -118,8 +118,8 @@ done # try to read what handheld we're on when calling func console_var_func(){ - if (test -r "${BOOTDIR}/console.cfg"); then - source "${BOOTDIR}/console.cfg" + if (test -r "${CONSOLE_CFG}"); then + source "${CONSOLE_CFG}" else export CONSOLE_VARIANT="unknown" fi @@ -163,13 +163,13 @@ safe_poweroff_func(){ } console_unknown_func(){ - echo "CONSOLE_VARIANT=unknown" | tee ${BOOTDIR}/console.cfg >> ${LOG} - echo "##DO_NOT_REMOVE_THIS_LINE##" >> ${BOOTDIR}/console.cfg + echo "CONSOLE_VARIANT=unknown" | tee ${CONSOLE_CFG} >> ${LOG} + echo "##DO_NOT_REMOVE_THIS_LINE##" >> ${CONSOLE_CFG} } ## Default CONSOLE_VARIANT for st7789s screens default_console_func(){ - echo "CONSOLE_VARIANT=pocketgo" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=pocketgo" | tee ${CONSOLE_CFG} >> ${LOG} cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb # No need to overwrite uboot FORCE version for default so continue procedure CONSOLE_OVERWRITE=false @@ -194,8 +194,8 @@ test_image_func(){ else #TODO - make "invert" flag overwriting less dependent echo "Colors are inverted, changing..." | tee -a ${LOG} - sed -i '/^INVERT=/d' ${HOME}/options.cfg | tee -a ${LOG} - echo "INVERT=${INVERSION}" >> ${HOME}/options.cfg + sed -i '/^INVERT=/d' ${OPTIONS_CFG} | tee -a ${LOG} + echo "INVERT=${INVERSION}" >> ${OPTIONS_CFG} safe_reboot_func fi } @@ -212,7 +212,7 @@ test_video_func(){ # "YES" choice for Test_Video msgbox DIALOG_EXTRA exit code if test $CHOICE -eq 3; then # Correct variant for st7789s (non forced) - echo "CONSOLE_VARIANT=st7789s" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=st7789s" | tee ${CONSOLE_CFG} >> ${LOG} # "Flipped!" choice for Test_Video msgbox DIALOG_CANCEL exit code elif test $CHOICE -eq 1; then # Test_Flip-prompt double checks if user selected correct answer for 1'st video test @@ -220,7 +220,7 @@ test_video_func(){ # "NO" or timeout choice for Test_Video msgbox thus DIALOG_OK exit code elif test $CHOICE -eq 0; then # Correct variant for bittboy2x_v1 (non forced) - echo "CONSOLE_VARIANT=bittboy" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=bittboy" | tee ${CONSOLE_CFG} >> ${LOG} safe_reboot_func # Error (DIALOG_ERROR) or ESCAPE button pressed (DIALOG_ESCAPE) thus exit code -1/255 else @@ -240,7 +240,7 @@ test_video2_func(){ # "YES" choice for Test_Video'2 msgbox DIALOG_CANCEL exit code ## thus we have valid version, just update to FORCE_VERSION and continue if test $CHOICE -eq 1; then - echo "CONSOLE_VARIANT=bittboy2x_v1" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=bittboy2x_v1" | tee ${CONSOLE_CFG} >> ${LOG} # "NO" or timeout choice for Test_Video msgbox thus DIALOG_OK exit code 0 (or ERROR/ESCAPE with -1/255) ## correct variant to unknown and redo whole flashing_prd again else @@ -262,28 +262,28 @@ test_keyboard_func(){ ## thus we have valid version, just update to FORCE_VERSION and continue if test $CHOICE -eq 1; then if test "$CONSOLE_VARIANT" == "bittboy3"; then - echo "CONSOLE_VARIANT=bittboy3.5" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=bittboy3.5" | tee ${CONSOLE_CFG} >> ${LOG} elif test "$CONSOLE_VARIANT" == "bittboy2"; then - echo "CONSOLE_VARIANT=bittboy2x_v2" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=bittboy2x_v2" | tee ${CONSOLE_CFG} >> ${LOG} elif test "$CONSOLE_VARIANT" == "xyc"; then - echo "CONSOLE_VARIANT=xyc_gc9306" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=xyc_gc9306" | tee ${CONSOLE_CFG} >> ${LOG} # Test_Image-prompt if proper "invert" colors parameter was loaded: INVERSION=1 #applied only if colors are inverted test_image_func elif test "$CONSOLE_VARIANT" == "m3"; then - echo "CONSOLE_VARIANT=m3_gc9306" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=m3_gc9306" | tee ${CONSOLE_CFG} >> ${LOG} fi # "NO" or timeout choice for Test_Keyboard msgbox DIALOG_OK exit code ## thus correct Auto-Detection variant and reboot elif test $CHOICE -eq 0; then if test "$CONSOLE_VARIANT" == "bittboy3"; then - echo "CONSOLE_VARIANT=bittboy2" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=bittboy2" | tee ${CONSOLE_CFG} >> ${LOG} elif test "$CONSOLE_VARIANT" == "bittboy2"; then console_unknown_func elif test "$CONSOLE_VARIANT" == "xyc"; then console_unknown_func elif test "$CONSOLE_VARIANT" == "m3"; then - echo "CONSOLE_VARIANT=xyc" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=xyc" | tee ${CONSOLE_CFG} >> ${LOG} fi safe_reboot_func # Error (DIALOG_ERROR) or ESCAPE button pressed (DIALOG_ESCAPE) thus exit code -1/255 @@ -313,7 +313,7 @@ test_flip_func(){ echo "Performing Confirmation Flip Test" >> ${LOG} if (dialog --backtitle "MiyooCFW 2.0" --no-shadow --stdout --ok-label YES --cancel-label NO --title "Test Flip" --pause " \n Flipped? \n\nAre you sure?!" 12 15 10); then # Correct variant for bittboy3.5 (non forced) and display info about flipped image - echo "CONSOLE_VARIANT=bittboy3" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=bittboy3" | tee ${CONSOLE_CFG} >> ${LOG} dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "Image flipped! correct&reboot" 0 0 sleep 1.5 #TODO: use special Unicode characters to draw text upside-down e.g.: @@ -350,10 +350,10 @@ if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then done elif (grep -q "$DETECTED_2" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_2" 0 0 - echo "CONSOLE_VARIANT=m3" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=m3" | tee ${CONSOLE_CFG} >> ${LOG} elif (grep -q "$DETECTED_3" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_3" 0 0 - echo "CONSOLE_VARIANT=m3_r61520" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=m3_r61520" | tee ${CONSOLE_CFG} >> ${LOG} # Test_Image-prompt if proper "invert" colors parameter was loaded: INVERSION=0 #applied only if colors are inverted test_image_func @@ -362,23 +362,23 @@ if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then ## DETECTED_5 - bittboy3/2 elif (grep -q "$DETECTED_6" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_6" 0 0 - echo "CONSOLE_VARIANT=m3_rm68090" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=m3_rm68090" | tee ${CONSOLE_CFG} >> ${LOG} elif (grep -q "$DETECTED_7" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_7" 0 0 - #echo "CONSOLE_VARIANT=r61520" | tee ${BOOTDIR}/console.cfg >> ${LOG} + #echo "CONSOLE_VARIANT=r61520" | tee ${CONSOLE_CFG} >> ${LOG} elif (grep -q "$DETECTED_8" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_8" 0 0 - #echo "CONSOLE_VARIANT=r61505w" | tee ${BOOTDIR}/console.cfg >> ${LOG} + #echo "CONSOLE_VARIANT=r61505w" | tee ${CONSOLE_CFG} >> ${LOG} elif (grep -q "$DETECTED_9" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_9" 0 0 - echo "CONSOLE_VARIANT=m3_hx8347d" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=m3_hx8347d" | tee ${CONSOLE_CFG} >> ${LOG} elif (grep -q "$DETECTED_10" "${BOOTDIR}/uEnv.txt"); then dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_10" 0 0 echo "Auto-Detected $DETECTED_10, so we have trouble finding correct drivers..." >> ${LOG} - #echo "CONSOLE_VARIANT=unknown-error" | tee ${BOOTDIR}/console.cfg >> ${LOG} + #echo "CONSOLE_VARIANT=unknown-error" | tee ${CONSOLE_CFG} >> ${LOG} fi # Overwrite CONSOLE_VARIANT from new entry - source "${BOOTDIR}/console.cfg" + source "${CONSOLE_CFG}" fi # II - Test_Block @@ -406,22 +406,22 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then ## Perform actions based on the user's choice case $CHOICE in 1) - echo "CONSOLE_VARIANT=q20" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=q20" | tee ${CONSOLE_CFG} >> ${LOG} cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb ;; 2) - echo "CONSOLE_VARIANT=q90" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=q90" | tee ${CONSOLE_CFG} >> ${LOG} cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb ;; 3) - echo "CONSOLE_VARIANT=v90" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=v90" | tee ${CONSOLE_CFG} >> ${LOG} cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb ;; 4) default_console_func ;; 5) - echo "CONSOLE_VARIANT=pocketgo_TE" | tee ${BOOTDIR}/console.cfg >> ${LOG} + echo "CONSOLE_VARIANT=pocketgo_TE" | tee ${CONSOLE_CFG} >> ${LOG} cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb ;; *) @@ -649,7 +649,7 @@ fi if ${CHANGE_FS_P4}; then echo "Correcting inittab of p4 at ${HOME} procedure" >> ${LOG} sleep 1 - mount -o remount,rw / / + mount -o remount,rw / / 2>&1 | tee -a ${LOG} while (pgrep "mount"); do sleep 1 done @@ -658,7 +658,7 @@ if ${CHANGE_FS_P4}; then elif test "${P4_FS_TYPE}" == "BTRFS" ; then sed -i "s|\(::sysinit:/bin/mount /dev/mmcblk0p4\).*|\1 "${HOME}" -o commit=5,flushoncommit,noatime,nodiratime,exec|" /etc/inittab fi - mount -o remount,ro / / + mount -o remount,ro / / 2>&1 | tee -a ${LOG} cat /etc/inittab >> ${LOG} fi @@ -747,7 +747,7 @@ if $CHANGE_FS_P5; then ## Correct inittab for new p5 filesystem type echo "Correcting inittab of p5 at ${ROMS} procedure" >> ${LOG} sleep 1 - mount -o remount,rw / / + mount -o remount,rw / / 2>&1 | tee -a ${LOG} while (pgrep "mount"); do sleep 1 done @@ -758,14 +758,14 @@ if $CHANGE_FS_P5; then elif test "${P5_FS_TYPE}" == "EXT4"; then sed -i "s|\(::sysinit:/bin/mount /dev/mmcblk0p5\).*|\1 "${ROMS}" -o rw,noatime|" /etc/inittab fi - mount -o remount,ro / / + mount -o remount,ro / / 2>&1 | tee -a ${LOG} cat /etc/inittab >> ${LOG} fi ## Correct inittab & check if btrfs module needed for p4/p5 if ($CHANGE_FS_P4 || $CHANGE_FS_P5); then echo "Correcting inittab for btrfs module loading" >> ${LOG} - mount -o remount,rw / / + mount -o remount,rw / / 2>&1 | tee -a ${LOG} if test "${P4_FS_TYPE}" != "BTRFS" && test "${P5_FS_TYPE}" != "BTRFS" ; then sed -i 's|^::sysinit:/sbin/modprobe btrfs|#&|' /etc/inittab modprobe -r btrfs 2>&1 | tee -a "${LOGS}" @@ -773,7 +773,7 @@ if ($CHANGE_FS_P4 || $CHANGE_FS_P5); then sed -i 's|^#::sysinit:/sbin/modprobe btrfs|::sysinit:/sbin/modprobe btrfs|' /etc/inittab modprobe btrfs 2>&1 | tee -a "${LOGS}" fi - mount -o remount,ro / / + mount -o remount,ro / / 2>&1 | tee -a ${LOG} cat /etc/inittab >> ${LOG} fi @@ -876,9 +876,9 @@ rm $TEMP # disable this script mount -o remount,rw "${BOOTDIR}" 2>&1 | tee -a ${LOG} echo "Disabling the firstboot script." | tee -a ${LOG} -if grep -sq FIRSTBOOT\=\1 "${HOME}/options.cfg"; then - sed -i '/^FIRSTBOOT=/d' ${HOME}/options.cfg 2>&1 | tee -a ${LOG} - echo "FIRSTBOOT=0" >> ${HOME}/options.cfg +if grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"; then + sed -i '/^FIRSTBOOT=/d' ${OPTIONS_CFG} 2>&1 | tee -a ${LOG} + echo "FIRSTBOOT=0" >> ${OPTIONS_CFG} else mv "${BOOTDIR}/firstboot" "${BOOTDIR}/firstboot.done" 2>&1 | tee -a ${LOG} fi diff --git a/board/miyoo/boot/options.cfg b/board/miyoo/boot/options.cfg new file mode 100644 index 000000000..568d61bcc --- /dev/null +++ b/board/miyoo/boot/options.cfg @@ -0,0 +1,13 @@ +In options only "0" and "1" are accepted values + +MODULES_CUSTOM=0 #load custom drivers from /boot/modules_custom.sh +DEBUG=0 #debug whole OS & output logs to $HOME/log.txt +DEBUG_GMENU2X=0 #debug gmenu2x & output logs to $HOME/log_gmenu2x.txt +DEBUG_UMTPR=0 #debug USB storage protocol $HOME/log_umtpr.txt +FIRSTBOOT=0 #perform again firstboot setup (once after reboot) +FS_CHECK=1 #check FileSystems at startup (except BTRFS) +BOOT_LOGO=1 #display scrolling boot-logo at startup +FLIP= (put 0 or 1 to overwrite) #flip display up/down +INVERT= (put 0 or 1 to overwrite) #invert colors on display +HOTKEY_CUSTOM=1 #use hotkeys from $HOME/.buttons.conf if present +USB_OTG=1 #activate USB On-The-Go for plugging ext. devices diff --git a/board/miyoo/main/options.cfg b/board/miyoo/main/options.cfg deleted file mode 100644 index a535d59c6..000000000 --- a/board/miyoo/main/options.cfg +++ /dev/null @@ -1,13 +0,0 @@ -MODULES_CUSTOM=0 -DEBUG=0 -DEBUG_GMENU2X=0 -DEBUG_UMTPR=0 -FIRSTBOOT=0 -FS_CHECK=1 -BOOT_LOGO=1 -FLIP= (put 0 or 1 to overwrite) -INVERT= (put 0 or 1 to overwrite) -HOTKEY_CUSTOM=1 -USB_OTG=1 - -Only "0" and "1" are accepted values \ No newline at end of file diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index 4311c3a88..29ed9cd39 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -6,24 +6,29 @@ export ROMS=/roms export BOOTDIR=/boot # we expect /dev/mmcblk0p1 has been mounted here read only, from inittab export SDL_NOMOUSE=1 START="${HOME}/autoexec.sh" +export OPTIONS_CFG="${BOOTDIR}/options.cfg" +export CONSOLE_CFG="${BOOTDIR}/console.cfg" LOGS=/dev/null LOGS_TEMP=/dev/null UMTPR_LOGS=/dev/null GMENU2X_LOGS=/dev/null +! test -r "${OPTIONS_CFG}"\ + && echo "Did not find valid ${OPTIONS_CFG} file, using default configuration." >> ${LOGS} + # check if it's first boot and turn on messages if yes -if (grep -sq DEBUG\=\1 "${HOME}/options.cfg" || test -r "${BOOTDIR}/firstboot" || test -r "${HOME}/firstboot.completed" || grep -sq FIRSTBOOT\=\1 "${HOME}/options.cfg"); then +if (grep -sq DEBUG\=\1 "${OPTIONS_CFG}" || test -r "${BOOTDIR}/firstboot" || test -r "${HOME}/firstboot.completed" || grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"); then DEBUG_MSG="yes" LOGS="${HOME}/log.txt" GMENU2X_LOGS="${HOME}/log_gmenu2x.txt" # just standard stdout/stderr #UMTPR_LOGS=/dev/null # see description at umtprd cmd fi -if (grep -sq DEBUG_GMENU2X\=\1 "${HOME}/options.cfg"); then +if (grep -sq DEBUG_GMENU2X\=\1 "${OPTIONS_CFG}"); then DEBUG_GMENU2X="yes" GMENU2X_LOGS="${HOME}/log_gmenu2x.txt" fi -if (grep -sq DEBUG_UMTPR\=\1 "${HOME}/options.cfg"); then +if (grep -sq DEBUG_UMTPR\=\1 "${OPTIONS_CFG}"); then DEBUG_UMTPR="yes" UMTPR_LOGS="${HOME}/log_umtpr.txt" fi @@ -49,9 +54,6 @@ restore_temp_log_func(){ export LOGS_TEMP } -! test -r "${HOME}/options.cfg"\ - && echo "Did not find valid ${HOME}/options.cfg file, using default configuration." >> ${LOGS} - # load kernel modules # Load the expected one screen driver from here with modprobe @@ -86,11 +88,11 @@ else mv ${HOME}/.backlight.bak ${HOME}/.backlight.conf fi # MODULES_CUSTOM scripting - if ( ! test -r "${BOOTDIR}/modules.custom.sh" || ! grep -sq MODULES_CUSTOM\=\1 "${HOME}/options.cfg"); then + if ( ! test -r "${BOOTDIR}/modules.custom.sh" || ! grep -sq MODULES_CUSTOM\=\1 "${OPTIONS_CFG}"); then # Load video module read from uEnv.txt & defined by variant in console.cfg #FLIP & INVERT options.cfg setting - flip=$(grep -o FLIP=[0-1] "${HOME}/options.cfg" | tr '[:upper:]' '[:lower:]') - invert=$(grep -o INVERT=[0-1] "${HOME}/options.cfg" | tr '[:upper:]' '[:lower:]') + flip=$(grep -o FLIP=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') + invert=$(grep -o INVERT=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') echo "Loding video module ${video} with args flip=${flip} invert=${invert}" >> "${LOGS}" modprobe $video $flip $invert 2>&1 | tee -a "${LOGS}" else @@ -114,7 +116,7 @@ else fi # check if it's first boot and defer to the firstboot script if yes -if grep -sq FIRSTBOOT\=\1 "${HOME}/options.cfg"; then +if grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"; then test -r "${BOOTDIR}/firstboot.done" \ && sh "${BOOTDIR}/firstboot.done" fi @@ -124,7 +126,7 @@ elif test -r "${HOME}/firstboot.completed"; then rm "${HOME}/firstboot.completed" fi -if ! (grep -sq FS_CHECK\=\0 "${HOME}/options.cfg"); then +if ! (grep -sq FS_CHECK\=\0 "${OPTIONS_CFG}"); then ##Check if BOOT (FAT16) is flagged as "dirty", and if so unmount, repair, remount if dmesg | grep "mmcblk0p1" > /dev/null; then echo -e "\e[31mDirty sectors detected.\e[0m" | tee -a "${LOGS}" @@ -169,7 +171,7 @@ else fi # load usb modules & gadget -if ! (grep -sq USB_OTG\=\0 "${HOME}/options.cfg"); then +if ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}"); then if test -r "${HOME}/.usbmode"; then source ${HOME}/.usbmode else @@ -192,7 +194,7 @@ else fi # run boot logo animation -if ! (grep -sq BOOT_LOGO\=\0 "${HOME}/options.cfg"); then +if ! (grep -sq BOOT_LOGO\=\0 "${OPTIONS_CFG}"); then ${BOOTLOGO} >> "${LOGS}" 2>&1 fi @@ -219,7 +221,7 @@ do else ./gmenu2x >> "${GMENU2X_LOGS}" 2>&1 fi - if (test -r "${HOME}/.usbmode" && ! (grep -sq USB_OTG\=\0 "${HOME}/options.cfg")); then + if (test -r "${HOME}/.usbmode" && ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}")); then source ${HOME}/.usbmode export USB_MODE fi From 9679498c311d6e62b981f5b4bfda8c6fb295b299 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:26:10 +0100 Subject: [PATCH 02/10] BOARD: main / firstboot: export properly CONSOLE_VARIANT --- board/miyoo/boot/firstboot | 3 ++- board/miyoo/rootfs/etc/main | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/board/miyoo/boot/firstboot b/board/miyoo/boot/firstboot index c07310e33..285ebcf3f 100644 --- a/board/miyoo/boot/firstboot +++ b/board/miyoo/boot/firstboot @@ -121,8 +121,9 @@ console_var_func(){ if (test -r "${CONSOLE_CFG}"); then source "${CONSOLE_CFG}" else - export CONSOLE_VARIANT="unknown" + CONSOLE_VARIANT="unknown" fi + export CONSOLE_VARIANT } detect_console_func(){ diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index 29ed9cd39..fa2d2a898 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -167,8 +167,9 @@ clear if test -r "${BOOTDIR}/console.cfg"; then source "${BOOTDIR}/console.cfg" else - export CONSOLE_VARIANT="unknown" + CONSOLE_VARIANT="unknown" fi +export CONSOLE_VARIANT # load usb modules & gadget if ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}"); then From f0a791f6ad3d4179d24d3b02d4d603e056a293e7 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Sat, 15 Nov 2025 21:47:50 +0100 Subject: [PATCH 03/10] display gm2x logs in terminal if gmenu2x-debug --- board/miyoo/rootfs/etc/main | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index fa2d2a898..da9a6da62 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -218,7 +218,7 @@ do echo "Starting GMenu2x" >> "${LOGS}" cd "${HOME}"/gmenu2x || { echo "Failed to cd into ${HOME}/gmenu2x" >> "${LOGS}" ; exit; } if test "x${DEBUG_GMENU2X}" == "xyes"; then - gdb -ex="set confirm off" -ex=run -ex="bt full" -ex=q ./gmenu2x-debug >> "${GMENU2X_LOGS}" 2>&1 + gdb -ex="set confirm off" -ex=run -ex="bt full" -ex=q ./gmenu2x-debug 2>&1 | tee -a "${GMENU2X_LOGS}" else ./gmenu2x >> "${GMENU2X_LOGS}" 2>&1 fi From d62621f9126a7a1801bb9bef308311f4aa54c5fa Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Tue, 18 Nov 2025 19:07:40 +0100 Subject: [PATCH 04/10] BOARD: main: refactor(rm) while loop for frontend use tmp file read --- board/miyoo/rootfs/etc/main | 320 ++++++++++++++++++------------------ 1 file changed, 162 insertions(+), 158 deletions(-) diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index da9a6da62..af7df7a98 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -14,6 +14,11 @@ LOGS_TEMP=/dev/null UMTPR_LOGS=/dev/null GMENU2X_LOGS=/dev/null +FRONTEND_ACTIVE=false +test -f /tmp/frontend.active \ + && FRONTEND_ACTIVE=true +echo "FRONTEND active status: ${FRONTEND_ACTIVE}" >> ${LOGS} + ! test -r "${OPTIONS_CFG}"\ && echo "Did not find valid ${OPTIONS_CFG} file, using default configuration." >> ${LOGS} @@ -54,180 +59,179 @@ restore_temp_log_func(){ export LOGS_TEMP } -# load kernel modules - -# Load the expected one screen driver from here with modprobe -## automatically from rootfs/lib/modules/VERSION -# The uEnv.txt is autogenerated by u-boot from HW which outputs -## environmental variables needed for ID of screen type -video=$(cat /sys/kernel/miyoo_video/miyoo_video) \ - || echo "Couldn't read video module from /sys/kernel/miyoo_video/miyoo_video" | tee -a "${LOGS}" - -test -r "${HOME}/.backlight.conf" \ - && BACKLIGHT=$(cat ${HOME}/.backlight.conf) - -# TVout scripting backend -TVOUT="OFF" -test -r "${HOME}/.tvmode" \ - || echo "0" > ${HOME}/.tvmode #default is OFF thus "0" (NTSC=1, PAL!=1) -tvmode=$(cat ${HOME}/.tvmode) -if test $tvmode -ne 0 || test -z "$tvmode" ; then - TVOUT="ON" - echo "Starting TVout video." >> "${LOGS}" - echo 0 > /sys/class/backlight/backlight/brightness - echo 0 > /sys/class/vtconsole/vtcon1/bind - if test $BACKLIGHT -ne 0; then - cp ${HOME}/.backlight.conf ${HOME}/.backlight.bak 2>&1 | tee -a "${LOGS}" - fi - echo 0 > ${HOME}/.backlight.conf - echo "Loding TV module miyoo-tvout with args tvmode=${tvmode}" >> "${LOGS}" - modprobe miyoo-tvout $tvmode 2>&1 | tee -a "${LOGS}" - echo 1 > /sys/class/vtconsole/vtcon1/bind -else - if test -r "${HOME}/.backlight.bak"; then - mv ${HOME}/.backlight.bak ${HOME}/.backlight.conf +if ! $FRONTEND_ACTIVE; then + # load kernel modules + + # Load the expected one screen driver from here with modprobe + ## automatically from rootfs/lib/modules/VERSION + # The uEnv.txt is autogenerated by u-boot from HW which outputs + ## environmental variables needed for ID of screen type + video=$(cat /sys/kernel/miyoo_video/miyoo_video) \ + || echo "Couldn't read video module from /sys/kernel/miyoo_video/miyoo_video" | tee -a "${LOGS}" + + test -r "${HOME}/.backlight.conf" \ + && BACKLIGHT=$(cat ${HOME}/.backlight.conf) + + # TVout scripting backend + TVOUT="OFF" + test -r "${HOME}/.tvmode" \ + || echo "0" > ${HOME}/.tvmode #default is OFF thus "0" (NTSC=1, PAL!=1) + tvmode=$(cat ${HOME}/.tvmode) + if test $tvmode -ne 0 || test -z "$tvmode" ; then + TVOUT="ON" + echo "Starting TVout video." >> "${LOGS}" + echo 0 > /sys/class/backlight/backlight/brightness + echo 0 > /sys/class/vtconsole/vtcon1/bind + if test $BACKLIGHT -ne 0; then + cp ${HOME}/.backlight.conf ${HOME}/.backlight.bak 2>&1 | tee -a "${LOGS}" + fi + echo 0 > ${HOME}/.backlight.conf + echo "Loding TV module miyoo-tvout with args tvmode=${tvmode}" >> "${LOGS}" + modprobe miyoo-tvout $tvmode 2>&1 | tee -a "${LOGS}" + echo 1 > /sys/class/vtconsole/vtcon1/bind + else + if test -r "${HOME}/.backlight.bak"; then + mv ${HOME}/.backlight.bak ${HOME}/.backlight.conf + fi + # MODULES_CUSTOM scripting + if ( ! test -r "${BOOTDIR}/modules.custom.sh" || ! grep -sq MODULES_CUSTOM\=\1 "${OPTIONS_CFG}"); then + # Load video module read from uEnv.txt & defined by variant in console.cfg + #FLIP & INVERT options.cfg setting + flip=$(grep -o FLIP=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') + invert=$(grep -o INVERT=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') + echo "Loding video module ${video} with args flip=${flip} invert=${invert}" >> "${LOGS}" + modprobe $video $flip $invert 2>&1 | tee -a "${LOGS}" + else + echo "Loding custom modules." >> "${LOGS}" + (cd "${BOOTDIR}" && sh modules.custom.sh ) >> "${LOGS}" 2>&1 + fi fi - # MODULES_CUSTOM scripting - if ( ! test -r "${BOOTDIR}/modules.custom.sh" || ! grep -sq MODULES_CUSTOM\=\1 "${OPTIONS_CFG}"); then - # Load video module read from uEnv.txt & defined by variant in console.cfg - #FLIP & INVERT options.cfg setting - flip=$(grep -o FLIP=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') - invert=$(grep -o INVERT=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') - echo "Loding video module ${video} with args flip=${flip} invert=${invert}" >> "${LOGS}" - modprobe $video $flip $invert 2>&1 | tee -a "${LOGS}" + export TVOUT + + # Load sound modules + if cmdline=$(cat /proc/cmdline 2>/dev/null | tee -a "${LOGS}"); then + snd_val=$(echo "$cmdline" | sed -n 's/.*miyoo\.miyoo_snd=\([0-9]\+\).*/\1/p') + test -z "$snd_val" && snd_val=1 # default to 1 from kernel, otherwise module fails to load + tvjack_val=$(echo "$cmdline" | sed -n 's/.*miyoo\.miyoo_tvjack=\([0-9]\+\).*/\1/p') + test -z "$tvjack_val" && tvjack_val=0 # default to 0 from kernel, otherwise module fails to load + echo "Loding sound module miyoo with args miyoo_snd=${snd_val} miyoo_tvjack=${tvjack_val} " >> "${LOGS}" + modprobe miyoo miyoo_snd="$snd_val" miyoo_tvjack="$tvjack_val" 2>&1 | tee -a "${LOGS}" else - echo "Loding custom modules." >> "${LOGS}" - (cd "${BOOTDIR}" && sh modules.custom.sh ) >> "${LOGS}" 2>&1 + echo "Couldn't read /proc/cmdline, loading miyoo_snd with default args" + modprobe miyoo 2>&1 | tee -a "${LOGS}" fi -fi -export TVOUT - -# Load sound modules -if cmdline=$(cat /proc/cmdline 2>/dev/null | tee -a "${LOGS}"); then - snd_val=$(echo "$cmdline" | sed -n 's/.*miyoo\.miyoo_snd=\([0-9]\+\).*/\1/p') - test -z "$snd_val" && snd_val=1 # default to 1 from kernel, otherwise module fails to load - tvjack_val=$(echo "$cmdline" | sed -n 's/.*miyoo\.miyoo_tvjack=\([0-9]\+\).*/\1/p') - test -z "$tvjack_val" && tvjack_val=0 # default to 0 from kernel, otherwise module fails to load - echo "Loding sound module miyoo with args miyoo_snd=${snd_val} miyoo_tvjack=${tvjack_val} " >> "${LOGS}" - modprobe miyoo miyoo_snd="$snd_val" miyoo_tvjack="$tvjack_val" 2>&1 | tee -a "${LOGS}" -else - echo "Couldn't read /proc/cmdline, loading miyoo_snd with default args" - modprobe miyoo 2>&1 | tee -a "${LOGS}" -fi - -# check if it's first boot and defer to the firstboot script if yes -if grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"; then - test -r "${BOOTDIR}/firstboot.done" \ - && sh "${BOOTDIR}/firstboot.done" -fi -if test -r "${BOOTDIR}/firstboot"; then - sh "${BOOTDIR}/firstboot" -elif test -r "${HOME}/firstboot.completed"; then - rm "${HOME}/firstboot.completed" -fi -if ! (grep -sq FS_CHECK\=\0 "${OPTIONS_CFG}"); then -##Check if BOOT (FAT16) is flagged as "dirty", and if so unmount, repair, remount - if dmesg | grep "mmcblk0p1" > /dev/null; then - echo -e "\e[31mDirty sectors detected.\e[0m" | tee -a "${LOGS}" - echo -e "\e[32mChecking&Repairing FAT16 BOOT partition...\e[0m" | tee -a "${LOGS}" - umount /dev/mmcblk0p1 2>&1 | tee -a "${LOGS}" - fsck.vfat -y /dev/mmcblk0p1 >> "${LOGS}" 2>&1 - mount /dev/mmcblk0p1 "${BOOTDIR}" -t vfat -o ro,exec,utf8 2>&1 | tee -a "${LOGS}" - echo -e "\e[32mCheck complete.\e[0m" | tee -a "${LOGS}" - fi -##Check if MAIN (EXT4) is flagged as "dirty", and if so unmount, repair, remount - if dmesg | grep "EXT4-fs (mmcblk0p4): warning: mounting fs with errors, running e2fsck is recommended" > /dev/null; then - echo -e "\e[31mUnclean shutdown detected.\e[0m" | tee -a "${LOGS}" - echo -e "\e[32mChecking MAIN(EXT4) partition...\e[0m" | tee -a "${LOGS}" - umount /dev/mmcblk0p4 2>&1 | tee -a "${LOGS_TEMP}" - e2fsck -y /dev/mmcblk0p4 >> "${LOGS_TEMP}"; - mount /dev/mmcblk0p4 "${HOME}" -o rw,sync,exec 2>&1 | tee -a "${LOGS_TEMP}" - restore_temp_log_func + # check if it's first boot and defer to the firstboot script if yes + if grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"; then + test -r "${BOOTDIR}/firstboot.done" \ + && sh "${BOOTDIR}/firstboot.done" fi -##Check if ROMS (EXT4 or FAT32) is flagged as "dirty", and if so unmount, repair, remount - if dmesg | grep "EXT4-fs (mmcblk0p5): warning: mounting fs with errors, running e2fsck is recommended" > /dev/null; then - echo -e "\e[31mUnclean shutdown detected.\e[0m" | tee -a "${LOGS}" - echo -e "\e[32mChecking ROMS(EXT4) partition...\e[0m" | tee -a "${LOGS}" - umount /dev/mmcblk0p5 2>&1 | tee -a "${LOGS}" - e2fsck -y /dev/mmcblk0p5 >> "${LOGS}" 2>&1; - mount /dev/mmcblk0p5 "${ROMS}" -o rw,noatime 2>&1 | tee -a "${LOGS}" - elif dmesg | grep "FAT-fs (mmcblk0p5): Volume was not properly unmounted. Some data may be corrupt. Please run fsck." > /dev/null; then - echo -e "\e[31mDirty sectors detected.\e[0m" | tee -a "${LOGS}" - echo -e "\e[32mChecking&Repairing ROMS(FAT32) partition...\e[0m" | tee -a "${LOGS}" - umount /dev/mmcblk0p5 2>&1 | tee -a "${LOGS}" - fsck.vfat -y /dev/mmcblk0p5 >> "${LOGS}" 2>&1 - mount /dev/mmcblk0p5 "${ROMS}" -t vfat -o rw,utf8 2>&1 | tee -a "${LOGS}" - echo -e "\e[32mCheck complete.\e[0m" | tee -a "${LOGS}" + if test -r "${BOOTDIR}/firstboot"; then + sh "${BOOTDIR}/firstboot" + elif test -r "${HOME}/firstboot.completed"; then + rm "${HOME}/firstboot.completed" fi -fi -clear -# try to read what handheld we're on -if test -r "${BOOTDIR}/console.cfg"; then - source "${BOOTDIR}/console.cfg" -else - CONSOLE_VARIANT="unknown" -fi -export CONSOLE_VARIANT + if ! (grep -sq FS_CHECK\=\0 "${OPTIONS_CFG}"); then + ##Check if BOOT (FAT16) is flagged as "dirty", and if so unmount, repair, remount + if dmesg | grep "mmcblk0p1" > /dev/null; then + echo -e "\e[31mDirty sectors detected.\e[0m" | tee -a "${LOGS}" + echo -e "\e[32mChecking&Repairing FAT16 BOOT partition...\e[0m" | tee -a "${LOGS}" + umount /dev/mmcblk0p1 2>&1 | tee -a "${LOGS}" + fsck.vfat -y /dev/mmcblk0p1 >> "${LOGS}" 2>&1 + mount /dev/mmcblk0p1 "${BOOTDIR}" -t vfat -o ro,exec,utf8 2>&1 | tee -a "${LOGS}" + echo -e "\e[32mCheck complete.\e[0m" | tee -a "${LOGS}" + fi + ##Check if MAIN (EXT4) is flagged as "dirty", and if so unmount, repair, remount + if dmesg | grep "EXT4-fs (mmcblk0p4): warning: mounting fs with errors, running e2fsck is recommended" > /dev/null; then + echo -e "\e[31mUnclean shutdown detected.\e[0m" | tee -a "${LOGS}" + echo -e "\e[32mChecking MAIN(EXT4) partition...\e[0m" | tee -a "${LOGS}" + umount /dev/mmcblk0p4 2>&1 | tee -a "${LOGS_TEMP}" + e2fsck -y /dev/mmcblk0p4 >> "${LOGS_TEMP}"; + mount /dev/mmcblk0p4 "${HOME}" -o rw,sync,exec 2>&1 | tee -a "${LOGS_TEMP}" + test "x${DEBUG_MSG}" == "xyes"\ + && restore_temp_log_func + fi + ##Check if ROMS (EXT4 or FAT32) is flagged as "dirty", and if so unmount, repair, remount + if dmesg | grep "EXT4-fs (mmcblk0p5): warning: mounting fs with errors, running e2fsck is recommended" > /dev/null; then + echo -e "\e[31mUnclean shutdown detected.\e[0m" | tee -a "${LOGS}" + echo -e "\e[32mChecking ROMS(EXT4) partition...\e[0m" | tee -a "${LOGS}" + umount /dev/mmcblk0p5 2>&1 | tee -a "${LOGS}" + e2fsck -y /dev/mmcblk0p5 >> "${LOGS}" 2>&1; + mount /dev/mmcblk0p5 "${ROMS}" -o rw,noatime 2>&1 | tee -a "${LOGS}" + elif dmesg | grep "FAT-fs (mmcblk0p5): Volume was not properly unmounted. Some data may be corrupt. Please run fsck." > /dev/null; then + echo -e "\e[31mDirty sectors detected.\e[0m" | tee -a "${LOGS}" + echo -e "\e[32mChecking&Repairing ROMS(FAT32) partition...\e[0m" | tee -a "${LOGS}" + umount /dev/mmcblk0p5 2>&1 | tee -a "${LOGS}" + fsck.vfat -y /dev/mmcblk0p5 >> "${LOGS}" 2>&1 + mount /dev/mmcblk0p5 "${ROMS}" -t vfat -o rw,utf8 2>&1 | tee -a "${LOGS}" + echo -e "\e[32mCheck complete.\e[0m" | tee -a "${LOGS}" + fi + fi -# load usb modules & gadget -if ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}"); then - if test -r "${HOME}/.usbmode"; then - source ${HOME}/.usbmode + clear + # try to read what handheld we're on + if test -r "${BOOTDIR}/console.cfg"; then + source "${BOOTDIR}/console.cfg" else - USB_MODE="mtp" # default setup + CONSOLE_VARIANT="unknown" fi - echo "Loading USB ${USB_MODE} default gadget" >> "${LOGS}" - usb-mode ${USB_MODE} 2>&1 | tee -a "${LOGS}" - export USB_MODE -fi + export CONSOLE_VARIANT -echo "Boot!" >> "${LOGS}" -echo "Handheld type is ${CONSOLE_VARIANT}" >> "${LOGS}" + # load usb modules & gadget + if ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}"); then + if test -r "${HOME}/.usbmode"; then + source ${HOME}/.usbmode + else + USB_MODE="mtp" # default setup + fi + echo "Loading USB ${USB_MODE} default gadget" >> "${LOGS}" + usb-mode ${USB_MODE} 2>&1 | tee -a "${LOGS}" + export USB_MODE + fi -# run any custom commands ('daemon' expected to be run from there) -if test -r "${BOOTDIR}/normalboot.custom.sh" ; then - (cd "${BOOTDIR}" && sh normalboot.custom.sh) # don't redirect, want output on screen -else - # at least run 'daemon' - daemon >> "${LOGS}" 2>&1 -fi + echo "Boot!" >> "${LOGS}" + echo "Handheld type is ${CONSOLE_VARIANT}" >> "${LOGS}" -# run boot logo animation -if ! (grep -sq BOOT_LOGO\=\0 "${OPTIONS_CFG}"); then - ${BOOTLOGO} >> "${LOGS}" 2>&1 -fi + # run any custom commands ('daemon' expected to be run from there) + if test -r "${BOOTDIR}/normalboot.custom.sh" ; then + (cd "${BOOTDIR}" && sh normalboot.custom.sh) # don't redirect, want output on screen + else + # at least run 'daemon' + daemon >> "${LOGS}" 2>&1 + fi -# we could unmount /boot here but since it's read-only it doesn't hurt to leave it running -## umount /dev/mmcblk0p1 + # run boot logo animation + if ! (grep -sq BOOT_LOGO\=\0 "${OPTIONS_CFG}"); then + ${BOOTLOGO} >> "${LOGS}" 2>&1 + fi -# Writes dmesg after firstboot procedure or if DEBUG_MSG=yes -if test "x${DEBUG_MSG}" == "xyes"; then - sleep 1 - echo -en "\n\nNew DMESG log:\n" >> ${HOME}/dmesg.txt - dmesg >> ${HOME}/dmesg.txt - restore_temp_log_func + # we could unmount /boot here but since it's read-only it doesn't hurt to leave it running + ## umount /dev/mmcblk0p1 + + # Writes dmesg after firstboot procedure or if DEBUG_MSG=yes + if test "x${DEBUG_MSG}" == "xyes"; then + sleep 1 + echo -en "\n\nNew DMESG log:\n" >> ${HOME}/dmesg.txt + dmesg >> ${HOME}/dmesg.txt + restore_temp_log_func + fi fi -while [ 1 ] -do - if test -f "${START}"; then - source "${START}" +if test -f "${START}"; then + echo "Starting ${START} script." >> "${LOGS}" + source "${START}" >> "${LOGS}" 2>&1 +else + echo "Starting GMenu2x" >> "${LOGS}" + cd "${HOME}"/gmenu2x || { echo "Failed to cd into ${HOME}/gmenu2x" >> "${LOGS}" ; exit; } + if test "x${DEBUG_GMENU2X}" == "xyes"; then + gdb -ex="set confirm off" -ex=run -ex="bt full" -ex=q ./gmenu2x-debug 2>&1 | tee -a "${GMENU2X_LOGS}" else - echo "Starting GMenu2x" >> "${LOGS}" - cd "${HOME}"/gmenu2x || { echo "Failed to cd into ${HOME}/gmenu2x" >> "${LOGS}" ; exit; } - if test "x${DEBUG_GMENU2X}" == "xyes"; then - gdb -ex="set confirm off" -ex=run -ex="bt full" -ex=q ./gmenu2x-debug 2>&1 | tee -a "${GMENU2X_LOGS}" - else - ./gmenu2x >> "${GMENU2X_LOGS}" 2>&1 - fi - if (test -r "${HOME}/.usbmode" && ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}")); then - source ${HOME}/.usbmode - export USB_MODE - fi - test "x${DEBUG_MSG}" == "xyes"\ - && restore_temp_log_func + ./gmenu2x >> "${GMENU2X_LOGS}" 2>&1 fi - clear -done +fi + +touch /tmp/frontend.active 2>&1 | tee -a "${LOGS}" +echo -en "\n\nOops what are u doing here?\nEnding /etc/main run..." | tee -a "${LOGS}" +sleep 2 +clear From 1b84fe7b59453df555d84c20ff47393f811dd9db Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Tue, 18 Nov 2025 22:30:56 +0100 Subject: [PATCH 05/10] show info on normal debug txt color +small cleanup --- board/miyoo/rootfs/etc/main | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index af7df7a98..c666b8fe3 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -48,7 +48,6 @@ export DEBUG_MSG DEBUG_UMTPR DEBUG_GMENU2X if test "x${DEBUG_MSG}" == "xyes"; then echo -e "\e[0m" # normal foreground color - export DEBUG_MSG # set it globally for further programs else echo -e "\e[30m" # black foreground color fi @@ -80,15 +79,17 @@ if ! $FRONTEND_ACTIVE; then if test $tvmode -ne 0 || test -z "$tvmode" ; then TVOUT="ON" echo "Starting TVout video." >> "${LOGS}" - echo 0 > /sys/class/backlight/backlight/brightness - echo 0 > /sys/class/vtconsole/vtcon1/bind + echo 0 > /sys/class/backlight/backlight/brightness 2>>"$LOGS" + echo 0 > /sys/class/vtconsole/vtcon1/bind 2>>"$LOGS" if test $BACKLIGHT -ne 0; then cp ${HOME}/.backlight.conf ${HOME}/.backlight.bak 2>&1 | tee -a "${LOGS}" fi echo 0 > ${HOME}/.backlight.conf - echo "Loding TV module miyoo-tvout with args tvmode=${tvmode}" >> "${LOGS}" - modprobe miyoo-tvout $tvmode 2>&1 | tee -a "${LOGS}" - echo 1 > /sys/class/vtconsole/vtcon1/bind + echo "Loading TV module miyoo-tvout with args tvmode=${tvmode}" >> "${LOGS}" + if (modprobe miyoo-tvout $tvmode 2>&1 | tee -a "${LOGS}"); then + echo "Loaded TV-out with tvmode=${tvmode}" + fi + echo 1 > /sys/class/vtconsole/vtcon1/bind 2>>"$LOGS" else if test -r "${HOME}/.backlight.bak"; then mv ${HOME}/.backlight.bak ${HOME}/.backlight.conf @@ -99,10 +100,12 @@ if ! $FRONTEND_ACTIVE; then #FLIP & INVERT options.cfg setting flip=$(grep -o FLIP=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') invert=$(grep -o INVERT=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') - echo "Loding video module ${video} with args flip=${flip} invert=${invert}" >> "${LOGS}" - modprobe $video $flip $invert 2>&1 | tee -a "${LOGS}" + echo "Loading video module ${video} with args flip=${flip} invert=${invert}" >> "${LOGS}" + if (modprobe $video $flip $invert 2>&1 | tee -a "${LOGS}"); then + echo "Loaded video with flip=${flip} invert=${invert}" + fi else - echo "Loding custom modules." >> "${LOGS}" + echo "Loading custom modules." | tee -a "${LOGS}" (cd "${BOOTDIR}" && sh modules.custom.sh ) >> "${LOGS}" 2>&1 fi fi @@ -114,10 +117,10 @@ if ! $FRONTEND_ACTIVE; then test -z "$snd_val" && snd_val=1 # default to 1 from kernel, otherwise module fails to load tvjack_val=$(echo "$cmdline" | sed -n 's/.*miyoo\.miyoo_tvjack=\([0-9]\+\).*/\1/p') test -z "$tvjack_val" && tvjack_val=0 # default to 0 from kernel, otherwise module fails to load - echo "Loding sound module miyoo with args miyoo_snd=${snd_val} miyoo_tvjack=${tvjack_val} " >> "${LOGS}" + echo "Loading sound module miyoo with args miyoo_snd=${snd_val} miyoo_tvjack=${tvjack_val} " | tee -a "${LOGS}" modprobe miyoo miyoo_snd="$snd_val" miyoo_tvjack="$tvjack_val" 2>&1 | tee -a "${LOGS}" else - echo "Couldn't read /proc/cmdline, loading miyoo_snd with default args" + echo "Couldn't read /proc/cmdline, loading miyoo_snd with default args" | tee -a "${LOGS}" modprobe miyoo 2>&1 | tee -a "${LOGS}" fi @@ -169,7 +172,6 @@ if ! $FRONTEND_ACTIVE; then fi fi - clear # try to read what handheld we're on if test -r "${BOOTDIR}/console.cfg"; then source "${BOOTDIR}/console.cfg" @@ -185,13 +187,13 @@ if ! $FRONTEND_ACTIVE; then else USB_MODE="mtp" # default setup fi - echo "Loading USB ${USB_MODE} default gadget" >> "${LOGS}" + echo "Loading USB ${USB_MODE} default gadget" | tee -a "${LOGS}" usb-mode ${USB_MODE} 2>&1 | tee -a "${LOGS}" export USB_MODE fi - echo "Boot!" >> "${LOGS}" - echo "Handheld type is ${CONSOLE_VARIANT}" >> "${LOGS}" + echo "Boot!" | tee -a "${LOGS}" + echo "Handheld type is ${CONSOLE_VARIANT}" | tee -a "${LOGS}" # run any custom commands ('daemon' expected to be run from there) if test -r "${BOOTDIR}/normalboot.custom.sh" ; then @@ -218,8 +220,9 @@ if ! $FRONTEND_ACTIVE; then fi fi +clear if test -f "${START}"; then - echo "Starting ${START} script." >> "${LOGS}" + echo "Starting ${START} script." | tee -a "${LOGS}" source "${START}" >> "${LOGS}" 2>&1 else echo "Starting GMenu2x" >> "${LOGS}" From a950380a1bcb4d6f34f0f16c9b8123c3cc3a84bf Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Tue, 18 Nov 2025 22:25:37 +0100 Subject: [PATCH 06/10] add opt to overwrite force TV_OUT --- board/miyoo/boot/options.cfg | 9 +++++---- board/miyoo/rootfs/etc/main | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/board/miyoo/boot/options.cfg b/board/miyoo/boot/options.cfg index 568d61bcc..191c7c700 100644 --- a/board/miyoo/boot/options.cfg +++ b/board/miyoo/boot/options.cfg @@ -1,4 +1,4 @@ -In options only "0" and "1" are accepted values +#In options only "0" and "1" are accepted values MODULES_CUSTOM=0 #load custom drivers from /boot/modules_custom.sh DEBUG=0 #debug whole OS & output logs to $HOME/log.txt @@ -7,7 +7,8 @@ DEBUG_UMTPR=0 #debug USB storage protocol $HOME/log_umtpr.txt FIRSTBOOT=0 #perform again firstboot setup (once after reboot) FS_CHECK=1 #check FileSystems at startup (except BTRFS) BOOT_LOGO=1 #display scrolling boot-logo at startup -FLIP= (put 0 or 1 to overwrite) #flip display up/down -INVERT= (put 0 or 1 to overwrite) #invert colors on display HOTKEY_CUSTOM=1 #use hotkeys from $HOME/.buttons.conf if present -USB_OTG=1 #activate USB On-The-Go for plugging ext. devices +USB_OTG=1 #activate USB On-The-Go for plugging ext. devices (use $HOME/.usbmode FILE for mode change) +FLIP= #(put 0 or 1 to overwrite) flip display up/down +INVERT= #(put 0 or 1 to overwrite) change colors on display to normal/invert +TV_OUT= #(put 0 or 1 to overwrite) force TV-output OFF/ON (use $HOME/.tvmode FILE for PAL/NTSC change) \ No newline at end of file diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index c666b8fe3..1fa5940f7 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -74,10 +74,16 @@ if ! $FRONTEND_ACTIVE; then # TVout scripting backend TVOUT="OFF" test -r "${HOME}/.tvmode" \ - || echo "0" > ${HOME}/.tvmode #default is OFF thus "0" (NTSC=1, PAL!=1) + || echo "0" > ${HOME}/.tvmode #default is OFF thus "0" this is inline with frontend (NTSC!=1, PAL=1 - in kernel) tvmode=$(cat ${HOME}/.tvmode) - if test $tvmode -ne 0 || test -z "$tvmode" ; then - TVOUT="ON" + if test $tvmode -ne 0 && ! test -z "$tvmode" \ + && ! grep -sq TV_OUT\=\0 "${OPTIONS_CFG}" || grep -sq TV_OUT\=\1 "${OPTIONS_CFG}" #ovewrite TV_OUT from options + then + if (grep -sq TV_OUT\=\0 "${OPTIONS_CFG}" || grep -sq TV_OUT\=\1 "${OPTIONS_CFG}"); then + unset TVOUT #since we have no real idea what video backend should be running + else + TVOUT="ON" + fi echo "Starting TVout video." >> "${LOGS}" echo 0 > /sys/class/backlight/backlight/brightness 2>>"$LOGS" echo 0 > /sys/class/vtconsole/vtcon1/bind 2>>"$LOGS" @@ -86,8 +92,8 @@ if ! $FRONTEND_ACTIVE; then fi echo 0 > ${HOME}/.backlight.conf echo "Loading TV module miyoo-tvout with args tvmode=${tvmode}" >> "${LOGS}" - if (modprobe miyoo-tvout $tvmode 2>&1 | tee -a "${LOGS}"); then - echo "Loaded TV-out with tvmode=${tvmode}" + if (modprobe miyoo-tvout $tvmode >> "${LOGS}" 2>&1); then + echo "Loaded TV-out with tvmode=${tvmode}" | tee -a "${LOGS}" fi echo 1 > /sys/class/vtconsole/vtcon1/bind 2>>"$LOGS" else @@ -101,8 +107,8 @@ if ! $FRONTEND_ACTIVE; then flip=$(grep -o FLIP=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') invert=$(grep -o INVERT=[0-1] "${OPTIONS_CFG}" | tr '[:upper:]' '[:lower:]') echo "Loading video module ${video} with args flip=${flip} invert=${invert}" >> "${LOGS}" - if (modprobe $video $flip $invert 2>&1 | tee -a "${LOGS}"); then - echo "Loaded video with flip=${flip} invert=${invert}" + if (modprobe $video $flip $invert >> "${LOGS}" 2>&1); then + echo "Loaded video with flip=${flip} invert=${invert}" | tee -a "${LOGS}" fi else echo "Loading custom modules." | tee -a "${LOGS}" From 8737a32cd133f8747a953b0299114e4bee3f7362 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Wed, 19 Nov 2025 22:08:11 +0100 Subject: [PATCH 07/10] clean TV_OUT scripting --- board/miyoo/rootfs/etc/main | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index 1fa5940f7..a4223b9b4 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -72,17 +72,17 @@ if ! $FRONTEND_ACTIVE; then && BACKLIGHT=$(cat ${HOME}/.backlight.conf) # TVout scripting backend - TVOUT="OFF" - test -r "${HOME}/.tvmode" \ - || echo "0" > ${HOME}/.tvmode #default is OFF thus "0" this is inline with frontend (NTSC!=1, PAL=1 - in kernel) + if ! test -r "${HOME}/.tvmode" || grep -sq TV_OUT\=\0 "${OPTIONS_CFG}"; then + echo "0" > ${HOME}/.tvmode #default is OFF thus "0" this is inline with frontend (NTSC!=1, PAL=1 - in kernel) + fi tvmode=$(cat ${HOME}/.tvmode) - if test $tvmode -ne 0 && ! test -z "$tvmode" \ - && ! grep -sq TV_OUT\=\0 "${OPTIONS_CFG}" || grep -sq TV_OUT\=\1 "${OPTIONS_CFG}" #ovewrite TV_OUT from options - then - if (grep -sq TV_OUT\=\0 "${OPTIONS_CFG}" || grep -sq TV_OUT\=\1 "${OPTIONS_CFG}"); then - unset TVOUT #since we have no real idea what video backend should be running - else - TVOUT="ON" + if test $tvmode -eq 0 && grep -sq TV_OUT\=\1 "${OPTIONS_CFG}"; then + tvmode=1; + fi + if test $tvmode -ne 0 && ! test -z "$tvmode"; then + TVOUT="ON" + if grep -sq TV_OUT\=\0 "${OPTIONS_CFG}" || grep -sq TV_OUT\=\1 "${OPTIONS_CFG}"; then + unset TVOUT #since we have no real idea what video backend should be running when forcing TVout fi echo "Starting TVout video." >> "${LOGS}" echo 0 > /sys/class/backlight/backlight/brightness 2>>"$LOGS" @@ -97,6 +97,7 @@ if ! $FRONTEND_ACTIVE; then fi echo 1 > /sys/class/vtconsole/vtcon1/bind 2>>"$LOGS" else + TVOUT="OFF" if test -r "${HOME}/.backlight.bak"; then mv ${HOME}/.backlight.bak ${HOME}/.backlight.conf fi From 00fb652681885d231f7583e1b64add6f96b6eb74 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Mon, 1 Dec 2025 22:31:33 +0100 Subject: [PATCH 08/10] export again variables + usb bg if fronted fails for second main run --- board/miyoo/rootfs/etc/main | 84 ++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index a4223b9b4..64be0de55 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -20,7 +20,7 @@ test -f /tmp/frontend.active \ echo "FRONTEND active status: ${FRONTEND_ACTIVE}" >> ${LOGS} ! test -r "${OPTIONS_CFG}"\ - && echo "Did not find valid ${OPTIONS_CFG} file, using default configuration." >> ${LOGS} + && echo "Did not find valid ${OPTIONS_CFG} file, using default configuration." | tee -a "${LOGS}" # check if it's first boot and turn on messages if yes if (grep -sq DEBUG\=\1 "${OPTIONS_CFG}" || test -r "${BOOTDIR}/firstboot" || test -r "${HOME}/firstboot.completed" || grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"); then @@ -179,29 +179,17 @@ if ! $FRONTEND_ACTIVE; then fi fi - # try to read what handheld we're on - if test -r "${BOOTDIR}/console.cfg"; then - source "${BOOTDIR}/console.cfg" - else - CONSOLE_VARIANT="unknown" - fi - export CONSOLE_VARIANT + # we could unmount /boot here but since it's read-only it doesn't hurt to leave it running + ## umount /dev/mmcblk0p1 - # load usb modules & gadget - if ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}"); then - if test -r "${HOME}/.usbmode"; then - source ${HOME}/.usbmode - else - USB_MODE="mtp" # default setup - fi - echo "Loading USB ${USB_MODE} default gadget" | tee -a "${LOGS}" - usb-mode ${USB_MODE} 2>&1 | tee -a "${LOGS}" - export USB_MODE + # Writes dmesg after firstboot procedure or if DEBUG_MSG=yes + restor temp logs from fsck + if test "x${DEBUG_MSG}" == "xyes"; then + sleep 1 + echo -en "\n\nNew DMESG log:\n" >> ${HOME}/dmesg.txt + dmesg >> ${HOME}/dmesg.txt + restore_temp_log_func fi - echo "Boot!" | tee -a "${LOGS}" - echo "Handheld type is ${CONSOLE_VARIANT}" | tee -a "${LOGS}" - # run any custom commands ('daemon' expected to be run from there) if test -r "${BOOTDIR}/normalboot.custom.sh" ; then (cd "${BOOTDIR}" && sh normalboot.custom.sh) # don't redirect, want output on screen @@ -209,31 +197,59 @@ if ! $FRONTEND_ACTIVE; then # at least run 'daemon' daemon >> "${LOGS}" 2>&1 fi + echo "Boot!" | tee -a "${LOGS}" +fi - # run boot logo animation - if ! (grep -sq BOOT_LOGO\=\0 "${OPTIONS_CFG}"); then - ${BOOTLOGO} >> "${LOGS}" 2>&1 +# try to read if TVOUT is active +if test -z "${TVOUT}"; then + if test -f /tmp/tvout.enabled; then + export TVOUT="ON" + elif test -f /tmp/tvout.disabled; then + export TVOUT="OFF" + else + echo "TVOUT module disabled, or with no hot-plugin detection" | tee -a "${LOGS}" fi +elif test "${TVOUT}" == "ON"; then + touch /tmp/tvout.enabled 2>&1 | tee -a "${LOGS}" + #echo "TVOUT module enabled" | tee -a "${LOGS}" +elif test "${TVOUT}" == "OFF"; then + touch /tmp/tvout.disabled 2>&1 | tee -a "${LOGS}" + #echo "TVOUT module disabled" | tee -a "${LOGS}" +fi - # we could unmount /boot here but since it's read-only it doesn't hurt to leave it running - ## umount /dev/mmcblk0p1 +# try to read what handheld we're on +if test -r "${BOOTDIR}/console.cfg"; then + source "${BOOTDIR}/console.cfg" +else + CONSOLE_VARIANT="unknown" +fi +export CONSOLE_VARIANT +echo "Handheld type is ${CONSOLE_VARIANT}" | tee -a "${LOGS}" - # Writes dmesg after firstboot procedure or if DEBUG_MSG=yes - if test "x${DEBUG_MSG}" == "xyes"; then - sleep 1 - echo -en "\n\nNew DMESG log:\n" >> ${HOME}/dmesg.txt - dmesg >> ${HOME}/dmesg.txt - restore_temp_log_func +# load usb modules & gadget +if ! (grep -sq USB_OTG\=\0 "${OPTIONS_CFG}"); then + if test -r "${HOME}/.usbmode"; then + source ${HOME}/.usbmode + else + USB_MODE="mtp" # default setup fi + echo "Loading USB ${USB_MODE} default gadget" | tee -a "${LOGS}" + usb-mode ${USB_MODE} 2>&1 | tee -a "${LOGS}" + export USB_MODE +fi + +# run boot logo animation +if ! (grep -sq BOOT_LOGO\=\0 "${OPTIONS_CFG}" || $FRONTEND_ACTIVE); then + ${BOOTLOGO} 2>&1 | tee -a "${LOGS}" fi clear if test -f "${START}"; then - echo "Starting ${START} script." | tee -a "${LOGS}" + echo "Starting ${START} script." >> "${LOGS}" source "${START}" >> "${LOGS}" 2>&1 else echo "Starting GMenu2x" >> "${LOGS}" - cd "${HOME}"/gmenu2x || { echo "Failed to cd into ${HOME}/gmenu2x" >> "${LOGS}" ; exit; } + cd "${HOME}"/gmenu2x || { echo -en "Failed to cd into ${HOME}/gmenu2x, no frontend to launch.\n\nPOWEROFF..." >> "${LOGS}" ; sync; poweroff; } if test "x${DEBUG_GMENU2X}" == "xyes"; then gdb -ex="set confirm off" -ex=run -ex="bt full" -ex=q ./gmenu2x-debug 2>&1 | tee -a "${GMENU2X_LOGS}" else From 69d28db2529a5c8300d91572224188d1645f2afc Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Thu, 4 Dec 2025 23:28:48 +0100 Subject: [PATCH 09/10] main: restore date&time in firstrun --- board/miyoo/rootfs/etc/main | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index 64be0de55..cd19e96f8 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -59,6 +59,10 @@ restore_temp_log_func(){ } if ! $FRONTEND_ACTIVE; then + # restore date&time + test -r "${HOME}/.date.conf" \ + && date "+%Y-%m-%d %H:%M" -s "$(cat ${HOME}/.date.conf)" >> "${LOGS}" 2>&1 + # load kernel modules # Load the expected one screen driver from here with modprobe @@ -66,10 +70,10 @@ if ! $FRONTEND_ACTIVE; then # The uEnv.txt is autogenerated by u-boot from HW which outputs ## environmental variables needed for ID of screen type video=$(cat /sys/kernel/miyoo_video/miyoo_video) \ - || echo "Couldn't read video module from /sys/kernel/miyoo_video/miyoo_video" | tee -a "${LOGS}" + || echo "Couldn't read video module from /sys/kernel/miyoo_video/miyoo_video" | tee -a "${LOGS}" test -r "${HOME}/.backlight.conf" \ - && BACKLIGHT=$(cat ${HOME}/.backlight.conf) + && BACKLIGHT=$(cat ${HOME}/.backlight.conf) # TVout scripting backend if ! test -r "${HOME}/.tvmode" || grep -sq TV_OUT\=\0 "${OPTIONS_CFG}"; then @@ -134,7 +138,7 @@ if ! $FRONTEND_ACTIVE; then # check if it's first boot and defer to the firstboot script if yes if grep -sq FIRSTBOOT\=\1 "${OPTIONS_CFG}"; then test -r "${BOOTDIR}/firstboot.done" \ - && sh "${BOOTDIR}/firstboot.done" + && sh "${BOOTDIR}/firstboot.done" fi if test -r "${BOOTDIR}/firstboot"; then sh "${BOOTDIR}/firstboot" @@ -160,7 +164,7 @@ if ! $FRONTEND_ACTIVE; then e2fsck -y /dev/mmcblk0p4 >> "${LOGS_TEMP}"; mount /dev/mmcblk0p4 "${HOME}" -o rw,sync,exec 2>&1 | tee -a "${LOGS_TEMP}" test "x${DEBUG_MSG}" == "xyes"\ - && restore_temp_log_func + && restore_temp_log_func fi ##Check if ROMS (EXT4 or FAT32) is flagged as "dirty", and if so unmount, repair, remount if dmesg | grep "EXT4-fs (mmcblk0p5): warning: mounting fs with errors, running e2fsck is recommended" > /dev/null; then From bbf5507e66b18023ee4c74ade1d454a708d9e087 Mon Sep 17 00:00:00 2001 From: Apaczer <94932128+Apaczer@users.noreply.github.com> Date: Sat, 6 Dec 2025 15:40:42 +0100 Subject: [PATCH 10/10] genimage-sdcard.cfg: add options.cfg --- board/miyoo/genimage-sdcard.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/board/miyoo/genimage-sdcard.cfg b/board/miyoo/genimage-sdcard.cfg index 0aac7e2e7..80a72576a 100644 --- a/board/miyoo/genimage-sdcard.cfg +++ b/board/miyoo/genimage-sdcard.cfg @@ -10,6 +10,7 @@ image bootfs.vfat { "boot/autorun.inf", "boot/boot.ico", "boot/console.cfg", + "boot/options.cfg", "boot/firstboot", "boot/firstboot.custom.sh-OFF", "boot/modules.custom.sh",