diff --git a/board/miyoo/boot/configs/manifest b/board/miyoo/boot/configs/manifest deleted file mode 100644 index 19f7997b3..000000000 --- a/board/miyoo/boot/configs/manifest +++ /dev/null @@ -1,11 +0,0 @@ -! manifest -! format: each line corresponds to one file to be copied over -! from_file(as_appears_in_this_directory) to_file(relative_to_root_of_main_partition) -! to_file is optional; if missing will use from_file -.backlight.conf -.volume.conf -.buttons.conf -.batterylow.conf -gmenu2x.conf gmenu2x/gmenu2x.conf -input.conf gmenu2x/input.conf -! leave this last line here diff --git a/board/miyoo/boot/firstboot b/board/miyoo/boot/firstboot index 82d6a34e7..2cd84f391 100755 --- a/board/miyoo/boot/firstboot +++ b/board/miyoo/boot/firstboot @@ -493,76 +493,19 @@ if (dialog --clear --ok-label NO --cancel-label YES --stdout --title " License safe_poweroff_func fi mount -o remount,ro "${MOUNTDIR}" | tee -a ${LOG} - -#grep all partitions current size -SD_SIZE=$(cat "/sys/block/mmcblk0/size") -P1_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p1/size") -P2_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p2/size") -P3_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p3/size") -P4_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p4/size") -SD_SIZE_IN_MiB=$((SD_SIZE * 512 / 1024 / 1024)) -SD_SIZE_IN_GiB=$((SD_SIZE * 512 / 1024 / 1024 / 1024)) -BOOT_SIZE=$(((1016+1) * 1024 / 512)) #bootloader partition=1016K (see `genimage` script in buildroot) -## boot_size calculated to 512 byte sector size blocks, adding +1K as a safety measure for roundups (at fatresize we use KibiBits) - -#Calculate unallocated left space to expand MAIN: -SD_MAX_UNALL_SIZE="$((${SD_SIZE} - (${P1_SIZE} + ${P2_SIZE} + ${P3_SIZE} + ${P4_SIZE}) - $BOOT_SIZE))" -SD_MAX_UNALL_SIZE_IN_MiB=$((SD_MAX_UNALL_SIZE * 512 / 1024 / 1024)) -SD_MAX_UNALL_SIZE_IN_GiB=$(echo "scale=1; ${SD_MAX_UNALL_SIZE} * 512 / 1024 / 1024 / 1024" | bc) - -#Calculate available space for 4'th partition (MAIN): -SD_MAX_AVAIL_SIZE="$((${SD_SIZE} - (${P1_SIZE} + ${P2_SIZE} + ${P3_SIZE}) - $BOOT_SIZE))" -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 - \n\n \ZbWARNING:\Zn\n After 10s auto-resize\n of FAT32 partition will begin." 15 60 10); then + \n\n \ZbWARNING:\Zn\n After 10s auto-resize\n of BTRFS partition will begin." 15 60 10); then clear - RESIZE_ABORT=false - if test "$SD_SIZE_IN_GiB" -gt 128; then - if (dialog --clear --stdout --ok-label NO --cancel-label YES --title " \Zb\Z1WARNING!\Zn" \ - --colors --pause "\nYour SD card exceeds max. size for auto-resizing! - \n\nWe could however expand it to 118GB. \n\n \ZuDo you AGREE?\Zn - \n\n\ZbINFO: For microSD >128GB big we\n recommend to use your PC!\Zn" 0 0 30 || test $? -eq 255); then - dialog --clear --colors --timeout 2 --msgbox " FAT resizing \ZuABORTED!\Zn" 5 27 - clear - RESIZE_ABORT=true - else - SD_MAX_AVAIL_SIZE_IN_KiB=123731968 - fi - fi - 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 - SD_MAX_AVAIL_SIZE_IN_GB=$(echo "scale=1; ${SD_MAX_AVAIL_SIZE_IN_KiB} * 1024 / 1000 / 1000 / 1000" | bc) - P4_SIZE_IN_GB=$(echo "scale=1; ${P4_SIZE} * 512 / 1000 / 1000 / 1000" | bc) - # roundup GB value to 0,1GB for integer calculations: - SD_MAX_AVAIL_SIZE_IN_GBx10=$(echo "$SD_MAX_AVAIL_SIZE_IN_GB" | tr -d ".") - P4_SIZE_IN_GBx10=$(echo "$P4_SIZE_IN_GB" | tr -d ".") - #Sanity checks if we don't down- or over-resize partition: - if (test "$P4_SIZE_IN_GBx10" -ge "$SD_MAX_AVAIL_SIZE_IN_GBx10" || test "$SD_MAX_UNALL_SIZE_IN_MiB" -le 15); then - echo "Your MAIN partition is greater than available space for resizing or you lack unallocated sectors space" | tee -a ${LOG} - sleep 1.5 - RESIZE_ABORT=true - fi - echo "The full size of your SD is ${SD_SIZE_IN_MiB}MB large" | tee -a ${LOG} - echo "Unallocated space available for resizing equals ${SD_MAX_UNALL_SIZE_IN_GiB}GB," | tee -a ${LOG} - echo "and more precisely it's ${SD_MAX_UNALL_SIZE_IN_MiB}MB big" | tee -a ${LOG} - if ! $RESIZE_ABORT; then - echo "Resizing the MAIN partition to ${SD_MAX_AVAIL_SIZE_IN_GiB}GB." | tee -a ${LOG} - echo "This can take A LONG TIME, so be patient." | tee -a ${LOG} - umount /dev/mmcblk0p4 | tee -a ${LOG} - fsck.fat -y /dev/mmcblk0p4 | tee -a ${LOG} - #TODO: fix outputting logs from fatresize stdout - fatresize --size="${SD_MAX_AVAIL_SIZE_IN_KiB}"ki -v -p /dev/mmcblk0p4 -n4 | tee -a ${LOG} - fsck.fat -y /dev/mmcblk0p4 | tee -a ${LOG} - echo -n -e \\xEB\\x58\\x90 > /dev/mmcblk0p4 - sync - mount -t vfat -o rw,sync,utf8 /dev/mmcblk0p4 ${HOME} | tee -a ${LOG} - else - echo "MAIN fat partition resizing was aborted!" | tee -a ${LOG} - sleep 2 - fi + echo "Resizing the MAIN partition." | tee -a ${LOG} + echo "This can take few seconds." | tee -a ${LOG} + umount /dev/mmcblk0p4 | tee -a ${LOG} + parted -a optimal /dev/mmcblk0 --script rm 4 | tee -a ${LOG} + parted -a optimal /dev/mmcblk0 --script mkpart primary 546MB 100% | tee -a ${LOG} + partx -u /dev/mmcblk0 | tee -a ${LOG} + mount /dev/mmcblk0p4 ${HOME} | tee -a ${LOG} + btrfs filesystem resize max ${HOME} RESIZE_COMMENCED=true fi @@ -577,32 +520,14 @@ mv "${MOUNTDIR}/firstboot" "${MOUNTDIR}/firstboot.done" | tee -a ${LOG} # copy over the config files echo "Copying default configuration files into place..." | tee -a ${LOG} if $BITTBOY_CONFIG; then - cp "${HOME}/gmenu2x/input_bittboy.conf" "${MOUNTDIR}/configs/input.conf" + cp "${HOME}/gmenu2x/input_bittboy.conf" "${HOME}/gmenu2x/input.conf" elif $MIYOO_CONFIG; then - cp "${HOME}/gmenu2x/input_miyoo.conf" "${MOUNTDIR}/configs/input.conf" + cp "${HOME}/gmenu2x/input_miyoo.conf" "${HOME}/gmenu2x/input.conf" fi mount -o remount,ro "${MOUNTDIR}" | tee -a ${LOG} -if test -r "${BASEDIR}/configs/manifest"; then - cat "${BASEDIR}/configs/manifest" | while read -r LINE; do - if test "${LINE}" == "${LINE#!}" -a "${LINE}" != "" ; then - set -- ${LINE} - # 1 2 - # source_filename target_filename/inside main/ - if test -r "${BASEDIR}/configs/$1"; then - TO="$2" - if test "${TO}" == ""; then - TO="$1" - fi - echo "Copying $1 to ${HOME}/$TO..." | tee -a ${LOG} - cp -f "${BASEDIR}/configs/$1" "${HOME}/$TO" | tee -a ${LOG} - fi - fi - done -fi -echo "Renaming ${HOME}/retroarch directory to ${HOME}/.retroarch" | tee -a ${LOG} -mv "${HOME}/retroarch" "${HOME}/.retroarch" | tee -a ${LOG} -echo +echo "fix permsissions" | tee -a ${LOG} +chmod -R +x /mnt/apps/ | tee -a ${LOG} sync echo "firstboot script finished." | tee -a ${LOG} @@ -610,7 +535,7 @@ touch ${HOME}/firstboot.completed echo # Reboot device if CONSOLE_VARIANT was overwritten from $CHOICE so that it could be applied in u-boot by readID -## or resizing FAT partition has completed / found firstboot custom script +## or resizing BTRFS partition has completed / found firstboot custom script if ($CONSOLE_OVERWRITE || $RESIZE_COMMENCED || test -r "${BASEDIR}/firstboot.custom.sh"); then safe_reboot_func else diff --git a/board/miyoo/genimage-sdcard.cfg b/board/miyoo/genimage-sdcard.cfg index 8d84c9704..f9a9ccba2 100644 --- a/board/miyoo/genimage-sdcard.cfg +++ b/board/miyoo/genimage-sdcard.cfg @@ -14,32 +14,10 @@ image bootfs.vfat { "boot/modules.custom.sh", "boot/normalboot.custom.sh", } - file configs/manifest { - image = "boot/configs/manifest" - } - file configs/.volume.conf { - image = "boot/configs/.volume.conf" - } - file configs/.buttons.conf { - image = "boot/configs/.buttons.conf" - } - file configs/.batterylow.conf { - image = "boot/configs/.batterylow.conf" - } - file configs/.backlight.conf { - image = "boot/configs/.backlight.conf" - } } size = 8M } -image mainfs.vfat { - vfat { - label = "MAIN" - } - mountpoint = "../../../images/main/" - size = 640M -} image ${IMAGE_NAME:-miyoo-cfw-2.0.0.img} { @@ -70,8 +48,8 @@ image ${IMAGE_NAME:-miyoo-cfw-2.0.0.img} { } partition main { - partition-type = 0xc + partition-type = 0x83 bootable = "false" - image = "mainfs.vfat" + image = "main.img" } } diff --git a/board/miyoo/boot/configs/.backlight.conf b/board/miyoo/main/.backlight.conf similarity index 100% rename from board/miyoo/boot/configs/.backlight.conf rename to board/miyoo/main/.backlight.conf diff --git a/board/miyoo/boot/configs/.batterylow.conf b/board/miyoo/main/.batterylow.conf similarity index 100% rename from board/miyoo/boot/configs/.batterylow.conf rename to board/miyoo/main/.batterylow.conf diff --git a/board/miyoo/boot/configs/.buttons.conf b/board/miyoo/main/.buttons.conf similarity index 100% rename from board/miyoo/boot/configs/.buttons.conf rename to board/miyoo/main/.buttons.conf diff --git a/board/miyoo/boot/configs/.volume.conf b/board/miyoo/main/.volume.conf similarity index 100% rename from board/miyoo/boot/configs/.volume.conf rename to board/miyoo/main/.volume.conf diff --git a/board/miyoo/main/apps/arecord/audio_record.sh b/board/miyoo/main/apps/arecord/audio_record.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/ffmpeg/ffplay.man.txt b/board/miyoo/main/apps/ffmpeg/ffplay.man.txt old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/ffmpeg/ffplay_launch.sh b/board/miyoo/main/apps/ffmpeg/ffplay_launch.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/ffmpeg/video_record.sh b/board/miyoo/main/apps/ffmpeg/video_record.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/fsck/fsck.sh b/board/miyoo/main/apps/fsck/fsck.sh old mode 100644 new mode 100755 index 60305afc3..664a40a03 --- a/board/miyoo/main/apps/fsck/fsck.sh +++ b/board/miyoo/main/apps/fsck/fsck.sh @@ -13,18 +13,6 @@ echo -e "\e[32mChecking FAT32 (BOOT) partition...\e[0m" fsck.vfat -a /dev/mmcblk0p1 fi -if dmesg | grep "mmcblk0p4"; then -echo -e "\e[31mUnclean shutdown detected.\e[0m" -echo -e "\e[32mChecking FAT32 (MAIN) partition...\e[0m" -fsck.vfat -a /dev/mmcblk0p4 -echo " " -echo "Rebooting device, please wait..." -echo " " -sleep 2 -sync -reboot -fi - echo "Finished!" echo " " echo " " diff --git a/board/miyoo/main/apps/joymap/input_info.sh b/board/miyoo/main/apps/joymap/input_info.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/joymap/joymap.sh b/board/miyoo/main/apps/joymap/joymap.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/tvout/tvout.sh b/board/miyoo/main/apps/tvout/tvout.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/usb-hid/usb-hid.man.txt b/board/miyoo/main/apps/usb-hid/usb-hid.man.txt old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/usb-hid/usb-hid.py b/board/miyoo/main/apps/usb-hid/usb-hid.py old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/usb-hid/usb-hid.sh b/board/miyoo/main/apps/usb-hid/usb-hid.sh old mode 100644 new mode 100755 index 6c98de9ef..bf84e9f07 --- a/board/miyoo/main/apps/usb-hid/usb-hid.sh +++ b/board/miyoo/main/apps/usb-hid/usb-hid.sh @@ -5,20 +5,13 @@ st_error_func(){ st_exec_func(){ st -k -e "/bin/sh" "-c" "${1}" } - -MUSB_MODE=$(cat /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode) -if ! (test "${MUSB_MODE}" = "b_peripheral"); then - st_error_func "\n\n\n\n\n\n\n\n First connect handheld to device!" - exit -else - gadget-vid-pid-remove 0x1d6b:0x0104 + killall umtprd + modprobe -r g_serial + mount none /sys/kernel/config -t configfs gadget-hid - st_exec_func "\ echo -e \"\e[32m\n\n\n\n\n\n Starting USB-HID mode\e[0m\n\n\n\"; \ sleep 1; \ python /mnt/apps/usb-hid/usb-hid.py" - gadget-vid-pid-remove 0x1d6b:0x0104 - gadget-ms /dev/mmcblk0p1 /dev/mmcblk0p4 -fi + gadget-vid-pid-remove 0x1d6b:0x0104 \ No newline at end of file diff --git a/board/miyoo/main/apps/usb-host/usb-host.sh b/board/miyoo/main/apps/usb-host/usb-host.sh old mode 100644 new mode 100755 diff --git a/board/miyoo/main/apps/usb-mtd/usb-mtd.sh b/board/miyoo/main/apps/usb-mtd/usb-mtd.sh new file mode 100755 index 000000000..816e64442 --- /dev/null +++ b/board/miyoo/main/apps/usb-mtd/usb-mtd.sh @@ -0,0 +1,5 @@ +#!/bin/busybox sh + +modprobe -r g_serial +killall umtprd +umtprd & diff --git a/board/miyoo/main/apps/usb-serial-mass-storage/usb-serial-mass-storage.sh b/board/miyoo/main/apps/usb-peripheral/usb-peripheral.sh old mode 100644 new mode 100755 similarity index 100% rename from board/miyoo/main/apps/usb-serial-mass-storage/usb-serial-mass-storage.sh rename to board/miyoo/main/apps/usb-peripheral/usb-peripheral.sh diff --git a/board/miyoo/main/apps/usb-serial-console/usb-serial.sh b/board/miyoo/main/apps/usb-serial-console/usb-serial.sh new file mode 100755 index 000000000..1cd88bb52 --- /dev/null +++ b/board/miyoo/main/apps/usb-serial-console/usb-serial.sh @@ -0,0 +1,3 @@ +#!/bin/busybox sh +killall umtprd +modprobe g_serial diff --git a/board/miyoo/main/gmenu2x/sections/applications/usb-mtd b/board/miyoo/main/gmenu2x/sections/applications/usb-mtd new file mode 100644 index 000000000..9e22d0862 --- /dev/null +++ b/board/miyoo/main/gmenu2x/sections/applications/usb-mtd @@ -0,0 +1,3 @@ +title=USB MTD +description=USB MTD mass storage +exec=/mnt/apps/usb-mtd/usb-mtd.sh diff --git a/board/miyoo/main/gmenu2x/sections/applications/usb-peripheral b/board/miyoo/main/gmenu2x/sections/applications/usb-peripheral new file mode 100644 index 000000000..4ac0bd7ec --- /dev/null +++ b/board/miyoo/main/gmenu2x/sections/applications/usb-peripheral @@ -0,0 +1,3 @@ +title=USB peripheral +description=USB peripheral mode +exec=/mnt/apps/usb-peripheral/usb-peripheral.sh diff --git a/board/miyoo/main/gmenu2x/sections/applications/usb-serial-console b/board/miyoo/main/gmenu2x/sections/applications/usb-serial-console new file mode 100644 index 000000000..fec9d8d50 --- /dev/null +++ b/board/miyoo/main/gmenu2x/sections/applications/usb-serial-console @@ -0,0 +1,3 @@ +title=USB serial console +description=USB Serial console +exec=/mnt/apps/usb-serial-console/usb-serial.sh diff --git a/board/miyoo/main/gmenu2x/sections/applications/usb-serial-mass-storage b/board/miyoo/main/gmenu2x/sections/applications/usb-serial-mass-storage deleted file mode 100644 index 04c5b0ab2..000000000 --- a/board/miyoo/main/gmenu2x/sections/applications/usb-serial-mass-storage +++ /dev/null @@ -1,3 +0,0 @@ -title=USB serial MS -description=USB Serial mass storage mode -exec=/mnt/apps/usb-serial-mass-storage/usb-serial-mass-storage.sh diff --git a/board/miyoo/main/options.cfg b/board/miyoo/main/options.cfg index 39fc0f291..0e811aced 100644 --- a/board/miyoo/main/options.cfg +++ b/board/miyoo/main/options.cfg @@ -1,5 +1,4 @@ MODULES_CUSTOM=0 -FAT_CHECK=1 BOOT_LOGO=1 FLIP= (put 0 or 1 to overwrite) INVERT= (put 0 or 1 to overwrite) diff --git a/board/miyoo/rootfs/etc/inittab b/board/miyoo/rootfs/etc/inittab index b38c69838..22c29c153 100644 --- a/board/miyoo/rootfs/etc/inittab +++ b/board/miyoo/rootfs/etc/inittab @@ -20,7 +20,7 @@ ::sysinit:/bin/mkdir -p /dev/shm ::sysinit:/bin/mount -a ::sysinit:/bin/hostname -F /etc/hostname -::sysinit:/bin/mount /dev/mmcblk0p4 /mnt -t vfat -o rw,sync,utf8 +::sysinit:/bin/mount /dev/mmcblk0p4 /mnt -o discard=async,noatime,nodiratime,exec ::sysinit:/bin/mount /dev/mmcblk0p1 /boot -t vfat -o ro,exec,sync,utf8 ::sysinit:/sbin/mkswap /dev/mmcblk0p3 ::sysinit:/sbin/swapon /dev/mmcblk0p3 diff --git a/board/miyoo/rootfs/etc/main b/board/miyoo/rootfs/etc/main index e7eb6a8e8..2a6bcc537 100755 --- a/board/miyoo/rootfs/etc/main +++ b/board/miyoo/rootfs/etc/main @@ -26,9 +26,9 @@ fi # load kernel modules # load usb gadget -mount -t configfs none /sys/kernel/config >> "${LOGS}" 2>&1 -gadget-ms /dev/mmcblk0p1 /dev/mmcblk0p4 >> "${LOGS}" 2>&1 - +modprobe g_ffs idVendor=0x1D6B iSerialNumber=01234567 functions=mtp >> "${LOGS}" 2>&1 +mkdir /dev/ffs-mtp && mount -t functionfs mtp /dev/ffs-mtp >> "${LOGS}" 2>&1 +umtprd >> "${LOGS}" 2>&1 & # Load the expected one screen driver from here with modprobe ## automatically from rootfs/lib/modules/VERSION @@ -76,20 +76,6 @@ elif test -r "${HOME}/firstboot.completed"; then rm "${HOME}/firstboot.completed" fi -if !(grep -q FAT_CHECK\=\0 "${HOME}/options.cfg"); then -##Check if fat32 is flagged as "dirty", and if so unmount, repair, remount - if dmesg | grep "mmcblk0p4" > /dev/null; then - echo -e "\e[31mUnclean shutdown detected.\e[0m" - echo -e "\e[32mChecking FAT32 partition...\e[0m" - umount /dev/mmcblk0p4 - fsck.vfat -y /dev/mmcblk0p4 > /dev/null; - mount /dev/mmcblk0p4 "${HOME}" -t vfat -o rw,sync,utf8 - echo -e "\e[32mCheck complete.\e[0m" - fi -fi - -clear - # try to read what handheld we're on if test -r "${BOOTDIR}/console.cfg"; then source "${BOOTDIR}/console.cfg" diff --git a/board/miyoo/rootfs/etc/umtprd/umtprd.conf b/board/miyoo/rootfs/etc/umtprd/umtprd.conf new file mode 100644 index 000000000..b723494ea --- /dev/null +++ b/board/miyoo/rootfs/etc/umtprd/umtprd.conf @@ -0,0 +1,88 @@ +# +# uMTP Responder config file +# Must be copied to /etc/umtprd/umtprd.conf +# + +# Loop / daemon mode +# Set to 1 to don't shutdown uMTPrd when the link is disconnected. + +loop_on_disconnect 1 + +#storage command : Create add a storage entry point. Up to 16 entry points supported +#Syntax : storage "PATH" "NAME" + +storage "/" "rootfs" "ro" +storage "/mnt" "MAIN" "rw" +storage "/boot" "BOOT" "ro" + +# +# Uncomment the following line if you want to +# override the system default umask value for +# the uploaded files. +# + +umask 000 + +# Set the USB manufacturer string + +manufacturer "MIyoo CFW 2.0" + +# Set the USB Product string + +product "handheld" + +# Set the USB Serial number string + +serial "01234567" + +# Set the USB interface string. Should be always "MTP" + +interface "MTP" + +# Set the USB Vendor ID, Product ID and class + +usb_vendor_id 0x1D6B # Linux Foundation +usb_product_id 0x0100 # PTP Gadget +usb_class 0x6 # Image +usb_subclass 0x1 # Still Imaging device +usb_protocol 0x1 # + +# Device version + +usb_dev_version 0x3008 + +# inotify support +# If you want disable the events support (beta), uncomment the following line : + +# no_inotify 0x1 + +# +# Internal buffers size +# + +# Internal default usb_max_rd_buffer_size and usb_max_wr_buffer_size value set to 0x10000. +# Internal default read_buffer_cache_size value set to 0x100000. +# Uncomment the following lines to reduce the buffers sizes to fix USB issues on iMX6 based systems. + + usb_max_rd_buffer_size 0x10000 # MAX usb read size. Must be a multiple of 512 and be less than read_buffer_cache_size + usb_max_wr_buffer_size 0x10000 # MAX usb write size. Must be a multiple of 512. + read_buffer_cache_size 0x80000 # Read file cache buffer. Must be a 2^x value. + +# +# USB gadget device driver path +# + +######################################################################## +# +# -- Generic FunctionFS Mode -- +# +######################################################################## + +usb_functionfs_mode 0x1 + +usb_dev_path "/dev/ffs-mtp/ep0" +usb_epin_path "/dev/ffs-mtp/ep1" +usb_epout_path "/dev/ffs-mtp/ep2" +usb_epint_path "/dev/ffs-mtp/ep3" + +usb_max_packet_size 0x200 diff --git a/board/miyoo/scripts/genimage.sh b/board/miyoo/scripts/genimage.sh index e9222cb0d..61c7ec815 100755 --- a/board/miyoo/scripts/genimage.sh +++ b/board/miyoo/scripts/genimage.sh @@ -17,7 +17,7 @@ cp -r board/miyoo/main "${BINARIES_DIR}" test -d "${BINARIES_DIR}/gmenu2x" && cp -r "${BINARIES_DIR}/gmenu2x/" "${BINARIES_DIR}/main/" test -d "${BINARIES_DIR}/emus" && cp -r "${BINARIES_DIR}/emus/" "${BINARIES_DIR}/main/" if test -d "${BINARIES_DIR}/retroarch";then - cp -r "${BINARIES_DIR}/retroarch/" "${BINARIES_DIR}/main/" + rsync -avzh "${BINARIES_DIR}/retroarch/" "${BINARIES_DIR}/main/.retroarch/" ## Generate list of cores to be used CORES_DIR="${BINARIES_DIR}/retroarch/cores" for file in $CORES_DIR/*; do @@ -47,4 +47,9 @@ fi # Write CFW version to splash image convert board/miyoo/miyoo-boot.png -pointsize 12 -fill white -annotate +10+230 "v${CFW_RELEASE} ${CFW_VERSION} (${LIBC}) ${STATUS}" -alpha off -type truecolor -strip -define bmp:format=bmp4 -define bmp:subtype=RGB565 "${BINARIES_DIR}"/boot/miyoo-boot.bmp +# Generate MAIN BTRFS partition +image="${BINARIES_DIR}/main.img" +label="MAIN" +sudo mkfs.btrfs -r "${BINARIES_DIR}/main/" --shrink -v -f -L ${label} ${image} + support/scripts/genimage.sh ${1} -c board/miyoo/genimage-sdcard.cfg diff --git a/configs/miyoo_musl_defconfig b/configs/miyoo_musl_defconfig index 3f1525d03..802e6d69e 100644 --- a/configs/miyoo_musl_defconfig +++ b/configs/miyoo_musl_defconfig @@ -56,6 +56,7 @@ BR2_PACKAGE_BINUTILS=y BR2_PACKAGE_BINUTILS_TARGET=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LIBTOOL=y +BR2_PACKAGE_BTRFS_PROGS=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FATLABEL=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y @@ -228,6 +229,7 @@ BR2_PACKAGE_OPKG=y BR2_PACKAGE_OPKG_UTILS=y BR2_PACKAGE_DIALOG=y BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y +BR2_PACKAGE_UTIL_LINUX_PARTX=y BR2_PACKAGE_NANO=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/miyoo_uclibc_defconfig b/configs/miyoo_uclibc_defconfig index 3045cc0f3..6742debd7 100644 --- a/configs/miyoo_uclibc_defconfig +++ b/configs/miyoo_uclibc_defconfig @@ -55,6 +55,7 @@ BR2_PACKAGE_LTRACE=y BR2_PACKAGE_STRACE=y BR2_PACKAGE_GETTEXT=y BR2_PACKAGE_LIBTOOL=y +BR2_PACKAGE_BTRFS_PROGS=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FATLABEL=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y @@ -205,6 +206,7 @@ BR2_PACKAGE_OPKG=y BR2_PACKAGE_OPKG_UTILS=y BR2_PACKAGE_DIALOG=y BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y +BR2_PACKAGE_UTIL_LINUX_PARTX=y BR2_PACKAGE_NANO=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y