diff --git a/board/miyoo/boot/firstboot b/board/miyoo/boot/firstboot old mode 100755 new mode 100644 index c5962274..56cccb32 --- a/board/miyoo/boot/firstboot +++ b/board/miyoo/boot/firstboot @@ -1,6 +1,7 @@ #!/bin/busybox sh - MOUNTDIR=/boot +export TERM=linux + # expect to be run from /boot, where the boot partition is mounted (readonly) export LOG=$(mktemp) #LOG=/dev/null @@ -35,7 +36,7 @@ entirely at your own risk. We shall not be held \ responsible for any damages, losses, or adverse \ consequences arising from the use or misuse of this software. \n\n -\ZuDo you acknowledge and agree to these terms?\Zn +\Z5Do you acknowledge and agree to these terms?\Zn \n\n Select an option & press START" @@ -161,8 +162,8 @@ default_console_func(){ #Test-prompt dialogs fo various scenarios test_image_func(){ - dialog --defaultno --ok-label NO --cancel-label Inverted --stdout --title " Test Image" \ - --colors --pause "\n\n \ZuAre your colors Inverted?\Zn\n\nSelect an option & press START" 12 34 10 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --defaultno --ok-label NO --cancel-label Inverted --stdout --title " Test Image" \ + --colors --pause "\n\n \Z5Are your colors Inverted?\Zn\n\nSelect an option & press START" 12 34 10 echo $? > $TEMP ## Read the user's last choice from the tmp file @@ -170,7 +171,7 @@ test_image_func(){ # "NO" choice for Test_Image msgbox DIALOG_OK exit code ## thus we have valid version and simply continue if test $CHOICE -eq 0; then - dialog --timeout 2 --msgbox "Colors are correct, proceed with flashing" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "Colors are correct, proceed with flashing" 0 0 # "INVERTED" choice for Test_Iamge msgbox DIALOG_CANCEL exit code and -1/255 ## thus correct "invert" colors parameter on video driver else @@ -181,8 +182,8 @@ test_image_func(){ } test_video_func(){ - dialog --defaultno --ok-label NO --cancel-label "Flipped!" --extra-button --extra-label YES --stdout --title " Test Video" \ - --colors --pause "\n\n \ZuCan you see this message?\Zn\n\nSelect an option & press START" 12 34 10 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --defaultno --ok-label NO --cancel-label "Flipped!" --extra-button --extra-label YES --stdout --title " Test Video" \ + --colors --pause "\n\n \Z5Can you see this message?\Zn\n\nSelect an option & press START" 12 34 10 echo $? > $TEMP ## Read the user's first choice from the tmp file @@ -203,14 +204,14 @@ test_video_func(){ safe_reboot_func # Error (DIALOG_ERROR) or ESCAPE button pressed (DIALOG_ESCAPE) thus exit code -1/255 else - dialog --timeout 2 --msgbox "Invalid choice, please redo the test!" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "Invalid choice, please redo the test!" 0 0 sleep 1.5 fi } test_video2_func(){ - dialog --defaultno --ok-label NO --cancel-label YES --stdout --title " Test Video'2" \ - --colors --pause "\n\n \ZuCan you see this message?\Zn\n\nSelect an option & press START" 12 34 10 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --defaultno --ok-label NO --cancel-label YES --stdout --title " Test Video'2" \ + --colors --pause "\n\n \Z5Can you see this message?\Zn\n\nSelect an option & press START" 12 34 10 echo $? > $TEMP ## Read the user's last choice from the tmp file @@ -228,8 +229,8 @@ test_video2_func(){ } test_keyboard_func(){ - dialog --ok-label NO --cancel-label YES --stdout --title " Test Keyboard" \ - --colors --pause "\n\n \ZuDoes D-pad works correctly?\Zn\n\nSelect an option & press START" 12 34 10 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --ok-label NO --cancel-label YES --stdout --title " Test Keyboard" \ + --colors --pause "\n\n \Z5Does D-pad works correctly?\Zn\n\nSelect an option & press START" 12 34 10 echo $? > $TEMP ## Read the user's last choice from the tmp file @@ -265,13 +266,13 @@ test_keyboard_func(){ safe_reboot_func # Error (DIALOG_ERROR) or ESCAPE button pressed (DIALOG_ESCAPE) thus exit code -1/255 else - dialog --timeout 2 --msgbox "Invalid choice, please redo the test!" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "Invalid choice, please redo the test!" 0 0 sleep 1.5 fi } test_variant_func(){ - dialog --defaultno --ok-label NO --cancel-label YES --stdout --title " Test Variant" \ + dialog --backtitle "MiyooCFW 2.0" --no-shadow --defaultno --ok-label NO --cancel-label YES --stdout --title " Test Variant" \ --colors --pause "Does this device match yours?" 0 0 15 echo $? > $TEMP @@ -286,16 +287,16 @@ test_variant_func(){ } test_flip_func(){ - if (dialog --stdout --ok-label YES --cancel-label NO --title "Test Flip" --pause " \n Flipped? \n\nAre you sure?!" 12 15 10); then + 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" > ${MOUNTDIR}/console.cfg - dialog --timeout 2 --msgbox "Image flipped! correct&reboot" 0 0 + 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.: - ## dialog --timeout 2 --msgbox "ƃuᴉʇooqǝɹ⅋uᴉʇɔǝɹɹoɔ 'pǝddᴉןɟ ǝƃɐɯᴉ \n\n image flipped, correcting&rebooting" 0 0 + ## dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "ƃuᴉʇooqǝɹ⅋uᴉʇɔǝɹɹoɔ 'pǝddᴉןɟ ǝƃɐɯᴉ \n\n image flipped, correcting&rebooting" 0 0 safe_reboot_func else - dialog --timeout 2 --msgbox "Invalid choice, please redo the test!" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "Invalid choice, please redo the test!" 0 0 sleep 1.5 fi } @@ -310,7 +311,7 @@ fi detect_console_func if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then if (grep -q "$DETECTED_1" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_1" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_1" 0 0 # Test_Video-prompt if proper miyoo video's version driver was loaded: ## Loop Test_Video until correct selection has been performed (CHOICE=0/3) ### former CHOICE=1 meant safe_reboot if correct and shouldn't reach to this point @@ -321,10 +322,10 @@ if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then fi done elif (grep -q "$DETECTED_2" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_2" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_2" 0 0 echo "CONSOLE_VARIANT=m3" > ${MOUNTDIR}/console.cfg elif (grep -q "$DETECTED_3" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_3" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_3" 0 0 echo "CONSOLE_VARIANT=m3_r61520" > ${MOUNTDIR}/console.cfg # Test_Image-prompt if proper "invert" colors parameter was loaded: INVERSION=0 #applied only if colors are inverted @@ -333,19 +334,19 @@ if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then ## DETECTED_4 - bittboy ## DETECTED_5 - bittboy3/2 elif (grep -q "$DETECTED_6" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_6" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_6" 0 0 echo "CONSOLE_VARIANT=m3_rm68090" > ${MOUNTDIR}/console.cfg elif (grep -q "$DETECTED_7" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_7" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_7" 0 0 #echo "CONSOLE_VARIANT=r61520" > ${MOUNTDIR}/console.cfg elif (grep -q "$DETECTED_8" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_8" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_8" 0 0 #echo "CONSOLE_VARIANT=r61505w" > ${MOUNTDIR}/console.cfg elif (grep -q "$DETECTED_9" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_9" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_9" 0 0 echo "CONSOLE_VARIANT=m3_hx8347d" > ${MOUNTDIR}/console.cfg elif (grep -q "$DETECTED_10" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_10" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_10" 0 0 #echo "CONSOLE_VARIANT=unknown-error" > ${MOUNTDIR}/console.cfg fi # Overwrite CONSOLE_VARIANT from new entry @@ -361,7 +362,7 @@ detect_console_func if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then # show selection menu for ST7789S devices if (test "$CONSOLE_VARIANT" == "st7789s" && grep -q "$DETECTED_1" "${MOUNTDIR}/uEnv.txt"); then - dialog --clear --timeout 60 --title "Select your device:" --menu " " 15 40 5 \ + dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --timeout 60 --title "Select your device:" --menu " " 15 40 5 \ 1 "Powkiddy Q20" \ 2 "Powkiddy Q90" \ 3 "Powkiddy V90" \ @@ -394,16 +395,16 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb ;; *) - dialog --timeout 4 --msgbox "Invalid choice. Exiting and selecting default device from autodetection." 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 4 --msgbox "Invalid choice. Exiting and selecting default device from autodetection." 0 0 default_console_func sleep 0.1 ;; esac elif (((test "$CONSOLE_VARIANT" == "bittboy2" || test "$CONSOLE_VARIANT" == "bittboy3") && grep -q "$DETECTED_5" "${MOUNTDIR}/uEnv.txt") || ((test "$CONSOLE_VARIANT" == "xyc" || test "$CONSOLE_VARIANT" == "m3") && grep -q "$DETECTED_2" "${MOUNTDIR}/uEnv.txt")); then if (grep -q "$DETECTED_5" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_5" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_5" 0 0 elif (grep -q "$DETECTED_2" "${MOUNTDIR}/uEnv.txt"); then - dialog --timeout 4 --msgbox "Correcting $DETECTED_2 - wait for further instructions" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 4 --msgbox "Correcting $DETECTED_2 - wait for further instructions" 0 0 fi # Test_Keyboard-prompt if proper miyoo.kbd version was loaded: ## Loop Test_Keyboard until correct selection has been performed (CHOICE=0/1) @@ -414,7 +415,7 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then fi done elif (test "$CONSOLE_VARIANT" == "bittboy" && grep -q "$DETECTED_4" "${MOUNTDIR}/uEnv.txt") ; then - dialog --timeout 3 --msgbox "Auto-Detected $DETECTED_4" 0 0 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 3 --msgbox "Auto-Detected $DETECTED_4" 0 0 # Test_Video'2-prompt if proper miyoo video's version driver was loaded: test_video2_func fi @@ -428,69 +429,69 @@ if $FOUND_CONSOLE; then # Info_Box about selected/edited device in console.cfg case $CONSOLE_VARIANT in bittboy2x_v1) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " BittBoy2x v1" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " BittBoy2x v1" 5 18 BITTBOY_CONFIG=true ;; bittboy2x_v2) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " BittBoy2x v2" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " BittBoy2x v2" 5 18 BITTBOY_CONFIG=true ;; bittboy3.5) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " BittBoy3.5" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " BittBoy3.5" 5 18 BITTBOY_CONFIG=true ;; q20) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " Powkiddy Q20" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " Powkiddy Q20" 5 18 MIYOO_CONFIG=true ;; q90) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " Powkiddy Q90" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " Powkiddy Q90" 5 18 MIYOO_CONFIG=true ;; v90) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " Powkiddy V90" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " Powkiddy V90" 5 18 MIYOO_CONFIG=true ;; pocketgo) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " PocketGo" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " PocketGo" 5 18 MIYOO_CONFIG=true ;; pocketgo_TE) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " PocketGo+TE" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " PocketGo+TE" 5 18 MIYOO_CONFIG=true ;; xyc_gc9306) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " XYC Q8" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " XYC Q8" 5 18 MIYOO_CONFIG=true ;; m3_r61520) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n (controller of r61520fb)" 6 29 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n (controller of r61520fb)" 6 29 MIYOO_CONFIG=true ;; m3_rm68090) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n(RM68090 controller)" 6 24 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n(RM68090 controller)" 6 24 MIYOO_CONFIG=true ;; m3_hx8347d) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n(HX8347D controller)" 6 24 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n(HX8347D controller)" 6 24 MIYOO_CONFIG=true ;; m3_gc9306) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n(GC9306 controller)" 6 24 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox " SUP M3\n(GC9306 controller)" 6 24 MIYOO_CONFIG=true ;; *) - dialog --colors --timeout 2 --ok-label " Your device " --msgbox "\Zb\Z1 Unknown-Error\Zn" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox "\Zb\Z1 Unknown-Error\Zn" 5 18 esac # Test_Variant-prompt if correct CONSOLE_VARIANT has been written to console.cfg test_variant_func else - dialog --colors --timeout 2 --ok-label " Your device " --msgbox "\Zb\Z1 Unknown\Zn" 5 18 + dialog --backtitle "MiyooCFW 2.0" --no-shadow --colors --timeout 2 --ok-label " Your device " --msgbox "\Zb\Z1 Unknown\Zn" 5 18 console_unknown_func fi # License_agreement-prompt -if (dialog --clear --ok-label NO --cancel-label YES --stdout --title " License agreement" \ +if (dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --ok-label NO --cancel-label YES --stdout --title " License agreement" \ --colors --pause "\n \ZbMiyooCFW\Zn\n$LICENSE" 22 60 30 || test $? -eq 255); then echo -en " We understand. Have a nice day!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" sleep 1 @@ -526,8 +527,8 @@ SD_MAX_AVAIL_SIZE_IN_KiB=$((SD_MAX_AVAIL_SIZE * 512 / 1024)) # Expand_MAIN_Partition-prompt for fatresize the p4 partition if requested RESIZE_COMMENCED=false -if (dialog --clear --stdout --ok-label YES --cancel-label NO --title " AUTO-RESIZE" \ - --colors --pause "\n\n \ZuExpand MAIN partition?\Zn\n\n Select an option & press START +if (dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --stdout --ok-label YES --cancel-label NO --title " AUTO-RESIZE" \ + --colors --pause "\n\n \Z5Expand MAIN partition?\Zn\n\n Select an option & press START \n\n \ZbWARNING:\Zn\n After 10s auto-resize\n of BTRFS partition will begin." 15 60 10); then clear SD_MAX_AVAIL_SIZE_IN_GiB=$(echo "scale=1; ${SD_MAX_AVAIL_SIZE_IN_KiB} / 1024 / 1024" | bc) #only to inform user about end point for resize @@ -579,6 +580,12 @@ echo "firstboot script finished." | tee -a ${LOG} touch ${HOME}/firstboot.completed echo +#install IPK packages +if ( $RESIZE_COMMENCED ); then + echo "starting ipk install manager..." | tee -a ${LOG} + ${BASEDIR}/ipk_install.sh | tee -a ${LOG} +fi + # Reboot device if CONSOLE_VARIANT was overwritten from $CHOICE so that it could be applied in u-boot by readID ## or resizing BTRFS partition has completed / found firstboot custom script if ($CONSOLE_OVERWRITE || $RESIZE_COMMENCED || test -r "${BASEDIR}/firstboot.custom.sh"); then diff --git a/board/miyoo/boot/ipk_install.sh b/board/miyoo/boot/ipk_install.sh new file mode 100755 index 00000000..023cae7a --- /dev/null +++ b/board/miyoo/boot/ipk_install.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +export TERM=linux +WARN=" +MiyooCFW team is not responsible for any issues \ +arising from the use of third-party applications \ +with current software. Support, bug fixes, or \ +improvements for 3rd-party apps are not provided \ +by our team members unless explicitly stated otherwise \ +(contact Maintainer of the app). +\n\n +\Z5 Do you still wish to CONTINUE with install?\Zn +\n\n + Select an option & press START" +ipk_directory="/mnt/pkgs" +package_list=() +help_messages=() +index=1 +for ipk_file in "$ipk_directory"/*.ipk; do + if [[ -f "$ipk_file" ]]; then + ipk_name=$(basename -s .ipk "$ipk_file") + package_list+=("$index" "$ipk_name" "off") + help_messages[$((2 * index))]="$index" + help_messages[$((2 * index + 1))]="$ipk_file" + ((index++)) + fi +done +if [[ ${#package_list[@]} -eq 0 ]]; then + echo "No packages to install." + exit 1 +fi + +dialog --backtitle "MiyooCFW 2.0" --timeout 10 --title "IPK package manager" --colors --no-shadow --msgbox "\nSelect pkg with \Zb\Z3Y\Zn button on the list." 8 28 +until selected_packages=$(dialog --backtitle "MiyooCFW 2.0" --title "IPK package manager" --colors --no-shadow --help-button --help-status --checklist "Press \Zb\Z3Y\Zn to select packages to install:" 20 60 15 "${package_list[@]}" 3>&1 1>&2 2>&3); do + case $? in + (1) btn=Cancel && break;; + (2) + set -- $selected_packages + shift + index=$1 + package_info=$(opkg info "${help_messages[$((2 * index + 1))]}") + package_name=$(echo "$package_info" | grep "^Package:" | cut -d' ' -f2) + package_description=$(echo "$package_info" | grep "^Description:" | cut -d' ' -f2-) + package_version=$(echo "$package_info" | grep "^Version:" | cut -d' ' -f2-) + package_source=$(echo "$package_info" | grep "^Source:" | cut -d' ' -f2-) + package_maintainer=$(echo "$package_info" | grep "^Maintainer:" | cut -d' ' -f2-) + dialog --backtitle "MiyooCFW 2.0" --no-shadow --msgbox "$package_name\n\n$package_description\n\nVersion: $package_version\nMaintainer: $package_maintainer\nSource: $package_source" 0 0 + for ((i = 2; i < ${#package_list[@]}; i += 3)); do + package_list[$i]="off" + done + shift + for selected in "$@"; do + package_list[$((3 * selected - 1))]="on" + done + esac +done + +clear +if [[ $? -ne 0 || -z "$selected_packages" ]]; then + echo "No packages were selected." + exit 1 +fi + +if (dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --stdout --title "WARNING" \ + --colors --pause "\n \ZbMiyooCFW\Zn\n$WARN" 22 60 30 || test $? -eq 255); then + clear + for package in $selected_packages; do + ipk_package="${help_messages[$((2 * package + 1))]}" + echo "Installing $ipk_package..." + if opkg install "$ipk_package" 2>/dev/null; then + echo "$ipk_package installed successfully." + else + echo "Failed to install $ipk_package." + fi + done + echo "Installation complete." +else + clear + echo "Installation complete." +fi diff --git a/board/miyoo/genimage-sdcard.cfg b/board/miyoo/genimage-sdcard.cfg index f7838a02..5f15ab57 100644 --- a/board/miyoo/genimage-sdcard.cfg +++ b/board/miyoo/genimage-sdcard.cfg @@ -14,6 +14,7 @@ image bootfs.vfat { "boot/firstboot.custom.sh-OFF", "boot/modules.custom.sh", "boot/normalboot.custom.sh", + "boot/ipk_install.sh", } } size = 8M diff --git a/package/miyoo/ipk-drpocketsnes/ipk-drpocketsnes.mk b/package/miyoo/ipk-drpocketsnes/ipk-drpocketsnes.mk index 6fee0bae..d2efe046 100644 --- a/package/miyoo/ipk-drpocketsnes/ipk-drpocketsnes.mk +++ b/package/miyoo/ipk-drpocketsnes/ipk-drpocketsnes.mk @@ -6,12 +6,12 @@ IPK_DRPOCKETSNES_LICENSE = Custom #IPK_DRPOCKETSNES_LICENSE_FILES = COPYRIGHT define IPK_DRPOCKETSNES_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-drpocketsnes/$(IPK_DRPOCKETSNES_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-drpocketsnes/$(IPK_DRPOCKETSNES_SOURCE) . endef define IPK_DRPOCKETSNES_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_DRPOCKETSNES_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package)) diff --git a/package/miyoo/ipk-fceux/ipk-fceux.mk b/package/miyoo/ipk-fceux/ipk-fceux.mk index 5abe3146..df14c48c 100644 --- a/package/miyoo/ipk-fceux/ipk-fceux.mk +++ b/package/miyoo/ipk-fceux/ipk-fceux.mk @@ -6,12 +6,12 @@ IPK_FCEUX_LICENSE = GPL-2.0 #IPK_FCEUX_LICENSE_FILES = COPYING define IPK_FCEUX_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-fceux/$(IPK_FCEUX_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-fceux/$(IPK_FCEUX_SOURCE) . endef define IPK_FCEUX_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_FCEUX_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package)) diff --git a/package/miyoo/ipk-gambatte/ipk-gambatte.mk b/package/miyoo/ipk-gambatte/ipk-gambatte.mk index 8453f4d8..89c8af4e 100644 --- a/package/miyoo/ipk-gambatte/ipk-gambatte.mk +++ b/package/miyoo/ipk-gambatte/ipk-gambatte.mk @@ -6,12 +6,12 @@ IPK_GAMBATTE_LICENSE = GPL-2.0 #IPK_GAMBATTE_LICENSE_FILES = COPYING define IPK_GAMBATTE_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-gambatte/$(IPK_GAMBATTE_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-gambatte/$(IPK_GAMBATTE_SOURCE) . endef define IPK_GAMBATTE_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_GAMBATTE_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package)) diff --git a/package/miyoo/ipk-gngeo/ipk-gngeo.mk b/package/miyoo/ipk-gngeo/ipk-gngeo.mk index 3f0e1d54..ad481c07 100644 --- a/package/miyoo/ipk-gngeo/ipk-gngeo.mk +++ b/package/miyoo/ipk-gngeo/ipk-gngeo.mk @@ -6,12 +6,12 @@ IPK_GNGEO_LICENSE = GPL-2.0, Custom #IPK_GNGEO_LICENSE_FILES = COPYING define IPK_GNGEO_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-gngeo/$(IPK_GNGEO_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-gngeo/$(IPK_GNGEO_SOURCE) . endef define IPK_GNGEO_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_GNGEO_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package)) diff --git a/package/miyoo/ipk-gpsp/ipk-gpsp.mk b/package/miyoo/ipk-gpsp/ipk-gpsp.mk index fee988c6..af9a0456 100644 --- a/package/miyoo/ipk-gpsp/ipk-gpsp.mk +++ b/package/miyoo/ipk-gpsp/ipk-gpsp.mk @@ -6,12 +6,12 @@ IPK_GPSP_LICENSE = GPL-2.0 #IPK_GPSP_LICENSE_FILES = COPYING.DOC define IPK_GPSP_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-gpsp/$(IPK_GPSP_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-gpsp/$(IPK_GPSP_SOURCE) . endef define IPK_GPSP_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_GPSP_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package)) diff --git a/package/miyoo/ipk-pcsx_rearmed/ipk-pcsx_rearmed.mk b/package/miyoo/ipk-pcsx_rearmed/ipk-pcsx_rearmed.mk index 5a57d92d..30d0769d 100644 --- a/package/miyoo/ipk-pcsx_rearmed/ipk-pcsx_rearmed.mk +++ b/package/miyoo/ipk-pcsx_rearmed/ipk-pcsx_rearmed.mk @@ -6,12 +6,12 @@ IPK_PCSX_REARMED_LICENSE = GPL-2.0 #IPK_PCSX_REARMED_LICENSE_FILES = COPYING define IPK_PCSX_REARMED_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-pcsx_rearmed/$(IPK_PCSX_REARMED_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-pcsx_rearmed/$(IPK_PCSX_REARMED_SOURCE) . endef define IPK_PCSX_REARMED_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_PCSX_REARMED_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package)) diff --git a/package/miyoo/ipk-race/ipk-race.mk b/package/miyoo/ipk-race/ipk-race.mk index 3ddc37f8..a4542dd4 100644 --- a/package/miyoo/ipk-race/ipk-race.mk +++ b/package/miyoo/ipk-race/ipk-race.mk @@ -6,12 +6,12 @@ IPK_RACE_LICENSE = GPL-2.0 #IPK_RACE_LICENSE_FILES = License.txt define IPK_RACE_EXTRACT_CMDS - cd $(@D) && ar x $(DL_DIR)/ipk-race/$(IPK_RACE_SOURCE) + cd $(@D) && cp $(DL_DIR)/ipk-race/$(IPK_RACE_SOURCE) . endef define IPK_RACE_INSTALL_TARGET_CMDS - mkdir -p $(BINARIES_DIR)/main - tar -xzf $(@D)/data.tar.gz --strip-components=2 -C $(BINARIES_DIR)/main + mkdir -p $(BINARIES_DIR)/main/pkgs + $(INSTALL) -D -m 0666 $(@D)/$(IPK_RACE_SOURCE) $(BINARIES_DIR)/main/pkgs endef $(eval $(generic-package))