diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33689583..72c2f42c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,7 +91,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: rootfs (uClibc) - path: ${{ inputs.submodule || '.' }}/output/images/rootfs.ext4 + path: ${{ inputs.submodule || '.' }}/output/images/rootfs.btrfs if-no-files-found: error # 'error', 'warn', 'ignore'; defaults to `warn` build-image-musl: @@ -175,7 +175,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: rootfs (musl) - path: ${{ inputs.submodule || '.' }}/output/images/rootfs.ext4 + path: ${{ inputs.submodule || '.' }}/output/images/rootfs.btrfs if-no-files-found: error # 'error', 'warn', 'ignore'; defaults to `warn` build-sdk-uclibc-static: diff --git a/board/miyoo/boot/configs/manifest b/board/miyoo/boot/configs/manifest deleted file mode 100644 index 19f7997b..00000000 --- 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 82d6a34e..7c175c2b 100755 --- a/board/miyoo/boot/firstboot +++ b/board/miyoo/boot/firstboot @@ -154,6 +154,7 @@ console_unknown_func(){ ## Default CONSOLE_VARIANT for st7789s screens default_console_func(){ echo "CONSOLE_VARIANT=pocketgo" > ${MOUNTDIR}/console.cfg + cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb # No need to overwrite uboot FORCE version for default so continue procedure CONSOLE_OVERWRITE=false } @@ -375,18 +376,22 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then case $CHOICE in 1) echo "CONSOLE_VARIANT=q20" > ${MOUNTDIR}/console.cfg + cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb ;; 2) echo "CONSOLE_VARIANT=q90" > ${MOUNTDIR}/console.cfg + cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb ;; 3) echo "CONSOLE_VARIANT=v90" > ${MOUNTDIR}/console.cfg + cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb ;; 4) default_console_func ;; 5) echo "CONSOLE_VARIANT=pocketgo_TE" > ${MOUNTDIR}/console.cfg + 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 @@ -518,21 +523,8 @@ SD_MAX_AVAIL_SIZE_IN_KiB=$((SD_MAX_AVAIL_SIZE * 512 / 1024)) 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) @@ -548,21 +540,15 @@ if (dialog --clear --stdout --ok-label YES --cancel-label NO --title " AUTO-RE 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 to ${SD_MAX_AVAIL_SIZE_IN_GiB}GB." | tee -a ${LOG} + echo "This can take a few seconds." | tee -a ${LOG} + umount /dev/mmcblk0p4 | tee -a ${LOG} + P4_START_POINT=` parted /dev/mmcblk0 unit MB print | grep '4' | tail -n1 | awk '{print $2}'` + parted -a optimal /dev/mmcblk0 --script rm 4 | tee -a ${LOG} + parted -a optimal /dev/mmcblk0 --script mkpart primary $P4_START_POINT 100% | tee -a ${LOG} + partx -u /dev/mmcblk0 | tee -a ${LOG} + mount /dev/mmcblk0p4 ${HOME} | tee -a ${LOG} + btrfs filesystem resize max ${HOME} | tee -a ${LOG} RESIZE_COMMENCED=true fi @@ -577,32 +563,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/ | tee -a ${LOG} sync echo "firstboot script finished." | tee -a ${LOG} @@ -610,7 +578,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 8d84c970..b0ccbf79 100644 --- a/board/miyoo/genimage-sdcard.cfg +++ b/board/miyoo/genimage-sdcard.cfg @@ -4,6 +4,7 @@ image bootfs.vfat { files = { "zImage", "suniv-f1c100s-miyoo.dtb", + "suniv-f1c100s-miyoo-4bit.dtb", "boot.scr", "boot/miyoo-boot.bmp", "boot/autorun.inf", @@ -14,32 +15,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} { @@ -60,7 +39,7 @@ image ${IMAGE_NAME:-miyoo-cfw-2.0.0.img} { partition rootfs { partition-type = 0x83 - image = "rootfs.ext4" + image = "rootfs.btrfs" } partition swap { @@ -70,8 +49,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 deleted file mode 100644 index 60305afc..00000000 --- a/board/miyoo/main/apps/fsck/fsck.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -sync - -echo " " -echo "Checking FAT filesystem..." -echo " " -sleep 2 - -if dmesg | grep "mmcblk0p1"; then -echo -e "\e[31mUnclean shutdown detected.\e[0m" -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 " " -sync -read -t 2 -sleep 1 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 6c98de9e..90a8b525 --- a/board/miyoo/main/apps/usb-hid/usb-hid.sh +++ b/board/miyoo/main/apps/usb-hid/usb-hid.sh @@ -5,20 +5,14 @@ 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 + echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode + 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 00000000..c21652a9 --- /dev/null +++ b/board/miyoo/main/apps/usb-mtd/usb-mtd.sh @@ -0,0 +1,6 @@ +#!/bin/busybox sh + +echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode +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-serial-console/usb-serial.sh old mode 100644 new mode 100755 similarity index 63% rename from board/miyoo/main/apps/usb-serial-mass-storage/usb-serial-mass-storage.sh rename to board/miyoo/main/apps/usb-serial-console/usb-serial.sh index 02d858ea..1c215249 --- a/board/miyoo/main/apps/usb-serial-mass-storage/usb-serial-mass-storage.sh +++ b/board/miyoo/main/apps/usb-serial-console/usb-serial.sh @@ -1,2 +1,4 @@ #!/bin/busybox sh -echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode \ No newline at end of file +echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode +killall umtprd +modprobe g_serial diff --git a/board/miyoo/main/gmenu2x/sections/applications/fsck b/board/miyoo/main/gmenu2x/sections/applications/fsck deleted file mode 100644 index d40af52d..00000000 --- a/board/miyoo/main/gmenu2x/sections/applications/fsck +++ /dev/null @@ -1,3 +0,0 @@ -title=File System Check -exec=/usr/bin/st -params=-k -e /mnt/apps/fsck/fsck.sh 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 00000000..9e22d086 --- /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-serial-console b/board/miyoo/main/gmenu2x/sections/applications/usb-serial-console new file mode 100644 index 00000000..fec9d8d5 --- /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 04c5b0ab..00000000 --- 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 39fc0f29..ebb8d172 100644 --- a/board/miyoo/main/options.cfg +++ b/board/miyoo/main/options.cfg @@ -1,5 +1,5 @@ -MODULES_CUSTOM=0 -FAT_CHECK=1 +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 b38c6983..22c29c15 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 e7eb6a8e..f396ef31 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=0x1fc9 idProduct=0x0146 iSerialNumber="01234567" iProduct="Miyoo CFW 2.0" iManufacturer="Miyoo Handheld" 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 @@ -77,19 +77,18 @@ elif test -r "${HOME}/firstboot.completed"; then 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 +##Check if 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" + echo -e "\e[32mChecking&Repairing FAT16 BOOT partition...\e[0m" + umount /dev/mmcblk0p1 + fsck.vfat -y /dev/mmcblk0p1 > /dev/null; + mount /dev/mmcblk0p1 "${BOOTDIR}" -t vfat -o ro,exec,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 00000000..ef789b71 --- /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 "Miyoo 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 0x8000 # MAX usb read size. Must be a multiple of 512 and be less than read_buffer_cache_size + usb_max_wr_buffer_size 0x8000 # MAX usb write size. Must be a multiple of 512. +# read_buffer_cache_size 0x8000 # 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 e9222cb0..61c7ec81 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 3f1525d0..7c05e3b3 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,10 +229,11 @@ 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 -BR2_TARGET_ROOTFS_EXT2_SIZE="256M" +BR2_TARGET_ROOTFS_BTRFS=y +BR2_TARGET_ROOTFS_BTRFS_LABEL="rootfs" +BR2_TARGET_ROOTFS_BTRFS_SIZE="256M" # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y @@ -243,6 +245,7 @@ BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/configs/miyoo_uclibc_defconfig b/configs/miyoo_uclibc_defconfig index 3045cc0f..dbafc179 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,10 +206,11 @@ 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 -BR2_TARGET_ROOTFS_EXT2_SIZE="256M" +BR2_TARGET_ROOTFS_BTRFS=y +BR2_TARGET_ROOTFS_BTRFS_LABEL="rootfs" +BR2_TARGET_ROOTFS_BTRFS_SIZE="256M" # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y @@ -220,6 +222,7 @@ BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y