FIRSBOOT: add extra p5 for ROMS (use GPT) & add option for switching FS (#168)

* BOARD: firstboot:  use ext4 for p1 explicitly
* BOARD: /etc/main : update fsck scripts
* BOARD: inittab: 
 - add /roms in p5
 - mount RO /boot in async (default)
* BOARD: genimage.sh: gen ROMS EXT4 image
* BAORD: prebuild.sh: 
 - create mount point for ROMS
 - increase MAIN & ROMS block size
 - the size of /mnt is "hardcoded" after image creation
 - we need real space for backup manipulation in ROMS
* BOARD: mv roms upward
* BOARD: firstboot: add p5 ROMS and resize
* BOARD: genimage-sdcard.cfg: 
 - use GPT
 - add p5 for roms

* PACKAGE/BOARD: patch/genimage: down-size gpt table
* PACKAGE/DEFCONFIG: add `gptfdisk` package to shared
* BOARD: firstboot: allow for switching FS type in MAIN and ROMS
* README: update firstboot_procedure.drawio.png
  - add FS change boxes and IPK installer
* BOARD: firstboot: not mandatory to resize for IPK manager
* DEFCONFIG: add default kernel patching
* DEFCONFIG: uppercase rootfs label
* BOARD: umtpr: uppercas partition LABELS
* DEFCONFIG/PACKAGE: add RSYNC pkg
* BOARD: mount FAT p5 in async (default)

* BOARD: add ROMS icons for Win
Co-Authored-By: TriForce <triforce@gznetwork.com>
This commit is contained in:
Apaczer
2025-05-18 16:27:05 +02:00
committed by GitHub
parent ae9408c067
commit bb94014294
24 changed files with 348 additions and 126 deletions

View File

@@ -106,7 +106,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: rootfs (uClibc)
path: ${{ inputs.submodule || '.' }}/output/images/rootfs.btrfs
path: ${{ inputs.submodule || '.' }}/output/images/rootfs.ext4
if-no-files-found: error # 'error', 'warn', 'ignore'; defaults to `warn`
build-image-musl:
@@ -198,7 +198,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: rootfs (musl)
path: ${{ inputs.submodule || '.' }}/output/images/rootfs.btrfs
path: ${{ inputs.submodule || '.' }}/output/images/rootfs.ext4
if-no-files-found: error # 'error', 'warn', 'ignore'; defaults to `warn`
build-sdk-uclibc-static:

View File

@@ -1,5 +1,4 @@
#!/bin/busybox sh
MOUNTDIR=/boot
export TERM=linux
# expect to be run from /boot, where the boot partition is mounted (readonly)
@@ -15,12 +14,10 @@ echo -e "\e[32m" # green
echo "firstboot script running..." | tee -a ${LOG}
echo
BASEDIR="${MOUNTDIR}"
# run a custom script if present - could be used to fix u-boot and such
if test -r "${BASEDIR}/firstboot.custom.sh"; then
if test -r "${BOOTDIR}/firstboot.custom.sh"; then
echo "Running a specific firstboot script..." | tee -a ${LOG}
(cd "${BASEDIR}" && sh firstboot.custom.sh) | tee -a ${LOG}
(cd "${BOOTDIR}" && sh firstboot.custom.sh) | tee -a ${LOG}
echo "Finished running a specific firstboot script." | tee -a ${LOG}
fi
@@ -44,7 +41,7 @@ consequences arising from the use or misuse of this software.
TEMP=$(mktemp)
## Access /boot directory
mount -o remount,rw "${MOUNTDIR}" | tee -a ${LOG}
mount -o remount,rw "${BOOTDIR}" | tee -a ${LOG}
# list of available devices in u-boot Environment parameters' read from FORCE_VERSION
devices_ID="
@@ -109,8 +106,8 @@ done
# try to read what handheld we're on when calling func
console_var_func(){
if (test -r "${MOUNTDIR}/console.cfg"); then
source "${MOUNTDIR}/console.cfg"
if (test -r "${BOOTDIR}/console.cfg"); then
source "${BOOTDIR}/console.cfg"
else
export CONSOLE_VARIANT="unknown"
fi
@@ -129,7 +126,7 @@ safe_shutdown_func(){
mv ${LOG} ${HOME}/log_firstboot.txt
sync
sleep 1
mount -o remount,ro "${MOUNTDIR}" | tee -a ${LOG}
mount -o remount,ro "${BOOTDIR}" | tee -a ${LOG}
umount /dev/mmcblk0p4 | tee -a ${LOG}
#umount /dev/mmcblk0p1 | tee -a ${LOG} # this fails
sleep 4
@@ -148,14 +145,14 @@ safe_poweroff_func(){
}
console_unknown_func(){
echo "CONSOLE_VARIANT=unknown" > ${MOUNTDIR}/console.cfg
echo "##DO_NOT_REMOVE_THIS_LINE##" >> ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=unknown" > ${BOOTDIR}/console.cfg
echo "##DO_NOT_REMOVE_THIS_LINE##" >> ${BOOTDIR}/console.cfg
}
## 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
echo "CONSOLE_VARIANT=pocketgo" > ${BOOTDIR}/console.cfg
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
}
@@ -192,7 +189,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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=st7789s" > ${BOOTDIR}/console.cfg
# "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
@@ -200,7 +197,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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=bittboy" > ${BOOTDIR}/console.cfg
safe_reboot_func
# Error (DIALOG_ERROR) or ESCAPE button pressed (DIALOG_ESCAPE) thus exit code -1/255
else
@@ -219,7 +216,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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=bittboy2x_v1" > ${BOOTDIR}/console.cfg
# "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
@@ -240,28 +237,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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=bittboy3.5" > ${BOOTDIR}/console.cfg
elif test "$CONSOLE_VARIANT" == "bittboy2"; then
echo "CONSOLE_VARIANT=bittboy2x_v2" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=bittboy2x_v2" > ${BOOTDIR}/console.cfg
elif test "$CONSOLE_VARIANT" == "xyc"; then
echo "CONSOLE_VARIANT=xyc_gc9306" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=xyc_gc9306" > ${BOOTDIR}/console.cfg
# 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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=m3_gc9306" > ${BOOTDIR}/console.cfg
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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=bittboy2" > ${BOOTDIR}/console.cfg
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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=xyc" > ${BOOTDIR}/console.cfg
fi
safe_reboot_func
# Error (DIALOG_ERROR) or ESCAPE button pressed (DIALOG_ESCAPE) thus exit code -1/255
@@ -289,7 +286,7 @@ test_variant_func(){
test_flip_func(){
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
echo "CONSOLE_VARIANT=bittboy3" > ${BOOTDIR}/console.cfg
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.:
@@ -303,14 +300,14 @@ test_flip_func(){
#Checking if device at hand is operational within flashing procedure
CONSOLE_DETECTED=false
if (grep -qE "${DETECTED_1}|${DETECTED_2}|${DETECTED_3}|${DETECTED_4}|${DETECTED_5}|${DETECTED_6}|${DETECTED_7}|${DETECTED_8}|${DETECTED_9}|${DETECTED_10}" "${MOUNTDIR}/uEnv.txt"); then
if (grep -qE "${DETECTED_1}|${DETECTED_2}|${DETECTED_3}|${DETECTED_4}|${DETECTED_5}|${DETECTED_6}|${DETECTED_7}|${DETECTED_8}|${DETECTED_9}|${DETECTED_10}" "${BOOTDIR}/uEnv.txt"); then
CONSOLE_DETECTED=true
fi
# I - Test_Block
detect_console_func
if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
if (grep -q "$DETECTED_1" "${MOUNTDIR}/uEnv.txt"); then
if (grep -q "$DETECTED_1" "${BOOTDIR}/uEnv.txt"); then
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)
@@ -321,36 +318,36 @@ if ! $FOUND_CONSOLE && ! $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
break
fi
done
elif (grep -q "$DETECTED_2" "${MOUNTDIR}/uEnv.txt"); then
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" > ${MOUNTDIR}/console.cfg
elif (grep -q "$DETECTED_3" "${MOUNTDIR}/uEnv.txt"); then
echo "CONSOLE_VARIANT=m3" > ${BOOTDIR}/console.cfg
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" > ${MOUNTDIR}/console.cfg
echo "CONSOLE_VARIANT=m3_r61520" > ${BOOTDIR}/console.cfg
# Test_Image-prompt if proper "invert" colors parameter was loaded:
INVERSION=0 #applied only if colors are inverted
test_image_func
# look in II Test block for following DETECTED versions as these imply devices_auto_ID variants:
## DETECTED_4 - bittboy
## DETECTED_5 - bittboy3/2
elif (grep -q "$DETECTED_6" "${MOUNTDIR}/uEnv.txt"); then
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" > ${MOUNTDIR}/console.cfg
elif (grep -q "$DETECTED_7" "${MOUNTDIR}/uEnv.txt"); then
echo "CONSOLE_VARIANT=m3_rm68090" > ${BOOTDIR}/console.cfg
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" > ${MOUNTDIR}/console.cfg
elif (grep -q "$DETECTED_8" "${MOUNTDIR}/uEnv.txt"); then
#echo "CONSOLE_VARIANT=r61520" > ${BOOTDIR}/console.cfg
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" > ${MOUNTDIR}/console.cfg
elif (grep -q "$DETECTED_9" "${MOUNTDIR}/uEnv.txt"); then
#echo "CONSOLE_VARIANT=r61505w" > ${BOOTDIR}/console.cfg
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" > ${MOUNTDIR}/console.cfg
elif (grep -q "$DETECTED_10" "${MOUNTDIR}/uEnv.txt"); then
echo "CONSOLE_VARIANT=m3_hx8347d" > ${BOOTDIR}/console.cfg
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 "CONSOLE_VARIANT=unknown-error" > ${MOUNTDIR}/console.cfg
#echo "CONSOLE_VARIANT=unknown-error" > ${BOOTDIR}/console.cfg
fi
# Overwrite CONSOLE_VARIANT from new entry
source "${MOUNTDIR}/console.cfg"
source "${BOOTDIR}/console.cfg"
fi
# II - Test_Block
@@ -361,7 +358,7 @@ detect_console_func
## test if no device specified in console.cfg
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
if (test "$CONSOLE_VARIANT" == "st7789s" && grep -q "$DETECTED_1" "${BOOTDIR}/uEnv.txt"); then
dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --timeout 60 --title "Select your device:" --menu " " 15 40 5 \
1 "Powkiddy Q20" \
2 "Powkiddy Q90" \
@@ -376,23 +373,23 @@ 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" > ${MOUNTDIR}/console.cfg
cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb
echo "CONSOLE_VARIANT=q20" > ${BOOTDIR}/console.cfg
cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb
;;
2)
echo "CONSOLE_VARIANT=q90" > ${MOUNTDIR}/console.cfg
cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb
echo "CONSOLE_VARIANT=q90" > ${BOOTDIR}/console.cfg
cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb
;;
3)
echo "CONSOLE_VARIANT=v90" > ${MOUNTDIR}/console.cfg
cp ${MOUNTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${MOUNTDIR}/suniv-f1c100s-miyoo.dtb
echo "CONSOLE_VARIANT=v90" > ${BOOTDIR}/console.cfg
cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/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
echo "CONSOLE_VARIANT=pocketgo_TE" > ${BOOTDIR}/console.cfg
cp ${BOOTDIR}/suniv-f1c100s-miyoo-4bit.dtb ${BOOTDIR}/suniv-f1c100s-miyoo.dtb
;;
*)
dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 4 --msgbox "Invalid choice. Exiting and selecting default device from autodetection." 0 0
@@ -400,10 +397,10 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
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
elif (((test "$CONSOLE_VARIANT" == "bittboy2" || test "$CONSOLE_VARIANT" == "bittboy3") && grep -q "$DETECTED_5" "${BOOTDIR}/uEnv.txt") || ((test "$CONSOLE_VARIANT" == "xyc" || test "$CONSOLE_VARIANT" == "m3") && grep -q "$DETECTED_2" "${BOOTDIR}/uEnv.txt")); then
if (grep -q "$DETECTED_5" "${BOOTDIR}/uEnv.txt"); then
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
elif (grep -q "$DETECTED_2" "${BOOTDIR}/uEnv.txt"); then
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:
@@ -414,7 +411,7 @@ if ! $FOUND_CONSOLE && $FOUND_CONSOLE_AUTO && $CONSOLE_DETECTED; then
break
fi
done
elif (test "$CONSOLE_VARIANT" == "bittboy" && grep -q "$DETECTED_4" "${MOUNTDIR}/uEnv.txt") ; then
elif (test "$CONSOLE_VARIANT" == "bittboy" && grep -q "$DETECTED_4" "${BOOTDIR}/uEnv.txt") ; then
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
@@ -503,69 +500,206 @@ fi
/sbin/mkswap /dev/mmcblk0p3
/sbin/swapon /dev/mmcblk0p3
mount -o remount,ro "${MOUNTDIR}" | tee -a ${LOG}
sync
sleep 1
mount -o remount,ro "${BOOTDIR}" | tee -a ${LOG}
#define priamry partitions FS types
P4_FS_TYPE="BTRFS"
P5_FS_TYPE="EXT4"
#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")
P1_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p1/size") # BOOT
P2_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p2/size") # ROOTFS
P3_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p3/size") # SWAP
P4_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p4/size") # MAIN
P5_SIZE=$(cat "/sys/block/mmcblk0/mmcblk0p5/size") # ROMS
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)
BOOT_SIZE=$(((1016+1 - 1000 + 1024) * 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)
## adding 1M (1024) for GPT align offset
#Calculate unallocated left space to expand MAIN:
SD_MAX_UNALL_SIZE="$((${SD_SIZE} - (${P1_SIZE} + ${P2_SIZE} + ${P3_SIZE} + ${P4_SIZE}) - $BOOT_SIZE))"
#Calculate unallocated left space to expand ROMS partition:
SD_MAX_UNALL_SIZE="$((${SD_SIZE} - (${P1_SIZE} + ${P2_SIZE} + ${P3_SIZE} + ${P4_SIZE} + ${P5_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))"
#Calculate available space for 5'th partition (ROMS):
SD_MAX_AVAIL_SIZE="$((${SD_SIZE} - (${P1_SIZE} + ${P2_SIZE} + ${P3_SIZE} + ${P4_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
# Change_MAIN_FileSystem-prompt for the p4 partition if requested
CHANGE_FS_P4=false
if (dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --stdout --ok-label ${P4_FS_TYPE}\(default\) --cancel-label EXT4 --title " Change FileSystem" \
--colors --pause "\n\n\Z5Change default FileSystem of MAIN?\Zn\n\n BTRFS - safe & reliable\Zn\n\n EXT4 - fast & optimal\Zn\n\n Select an option & press START
\n\n \ZbWARNING:\Zn\n After 30min changes\n to MAIN partition won't be possible." 15 60 1800); then
echo "Selected ${P4_FS_TYPE} for MAIN partition, continuing with default setup." | tee -a ${LOG}
sleep 2
else
P4_FS_TYPE="EXT4"
echo -en "\n\nConverting the MAIN partition filesystem to ${P4_FS_TYPE} type.\n\n" | tee -a ${LOG}
echo -en "This can take a few minutes, be patient!"
sleep 3
mkdir "${ROMS}"/backup
rsync -a --info=nonreg0 --info=progress2 "${HOME}" "${ROMS}"/backup
umount /dev/mmcblk0p4 | tee -a ${LOG}
clear
echo -en "\n\n"
mkfs.ext4 -d "${ROMS}"/backup/"${HOME}" -L MAIN -v -F /dev/mmcblk0p4 | tee -a ${LOG}
sleep 2
e2fsck -y /dev/mmcblk0p4 | tee -a ${LOG}
mount /dev/mmcblk0p4 "${HOME}" -o rw,sync,exec | tee -a ${LOG}
#cp -v -a "${ROMS}"/backup/"${HOME}" /
rm -r "${ROMS}"/backup
CHANGE_FS_P4=true
fi
## Correct inittab for new p4 filesystem type
if ( $CHANGE_FS_P4 ); then
mount -o remount,rw / /
sed -i "s|\(::sysinit:/bin/mount /dev/mmcblk0p4\).*|\1 "${HOME}" -o rw,sync,exec|" /etc/inittab
mount -o remount,ro / /
fi
# Change_ROMS_FileSystem-prompt for the p5 partition if requested
CHANGE_FS_P5=false
dialog --backtitle "MiyooCFW 2.0" --no-shadow --clear --stdout --ok-label "${P5_FS_TYPE}(def.)" --cancel-label BTRFS --extra-button --extra-label FAT32 --title " Change FileSystem" \
--colors --pause "\n\n\Z5Change default FileSystem for ROMS?\Zn\n\nEXT4 - fast write/read & UNIX compliant\Zn\n\nBTRFS - slow read but poweroff safe, UNIX compliant\Zn\n\nFAT32 - slow on-device write but Windows compatbile\Zn\n\n Select an option & press START
\n\n \ZbWARNING:\Zn\n After 30min changes to ROMS\n partition won't be possible." 25 60 1800
echo $? > $TEMP
## Read the user's first choice from the tmp file
CHOICE=$(cat $TEMP)
if test $CHOICE -eq 0; then
echo "Selected ${P5_FS_TYPE} for ROMS partition, continuing with default setup." | tee -a ${LOG}
sleep 2
elif test $CHOICE -eq 3; then
P5_FS_TYPE="FAT32"
CHANGE_FS_P5=true
elif test $CHOICE -eq 1; then
P5_FS_TYPE="BTRFS"
CHANGE_FS_P5=true
else
dialog --backtitle "MiyooCFW 2.0" --no-shadow --timeout 2 --msgbox "Invalid choice, continuing with default setup!" 0 0
sleep 1.5
fi
if ( $CHANGE_FS_P5 ); then
echo -en "\n\nConverting the ROMS partition filesystem to ${P5_FS_TYPE} type.\n\n" | tee -a ${LOG}
echo -en "This can take a few minutes, be patient!"
sleep 3
mkdir "${HOME}"/backup
rsync -a --info=nonreg0 --info=progress2 "${ROMS}" "${HOME}"/backup
umount /dev/mmcblk0p5 | tee -a ${LOG}
clear
echo -en "\n\n"
if test "${P5_FS_TYPE}" == "FAT32"; then
mkfs.vfat -n ROMS -v -F32 /dev/mmcblk0p5 | tee -a ${LOG}
sleep 2
fsck.fat -y /dev/mmcblk0p5 | tee -a ${LOG}
mount /dev/mmcblk0p5 "${ROMS}" -t vfat -o rw,utf8 | tee -a ${LOG}
rsync -rvt --modify-window=1 --exclude "lost+found" --info=nonreg0 --info=progress2 "${HOME}"/backup"${ROMS}" /
elif test "${P5_FS_TYPE}" == "BTRFS"; then
mkfs.btrfs -r "${HOME}"/backup"${ROMS}" -v -f -L ROMS /dev/mmcblk0p5 | tee -a ${LOG}
sleep 2
btrfsck -y /dev/mmcblk0p5 | tee -a ${LOG}
mount /dev/mmcblk0p5 "${ROMS}" -o commit=5,flushoncommit,noatime,nodiratime | tee -a ${LOG}
fi
rm -r "${HOME}"/backup
## Correct inittab for new p5 filesystem type
mount -o remount,rw / /
if test "${P5_FS_TYPE}" == "FAT32"; then
sed -i "s|\(::sysinit:/bin/mount /dev/mmcblk0p5\).*|\1 "${ROMS}" -t vfat -o rw,utf8|" /etc/inittab
elif test "${P5_FS_TYPE}" == "BTRFS"; then
sed -i "s|\(::sysinit:/bin/mount /dev/mmcblk0p5\).*|\1 "${ROMS}" -o commit=5,flushoncommit,noatime,nodiratime|" /etc/inittab
fi
mount -o remount,ro / /
fi
# Expand_ROMS_Partition-prompt for the p5 (ROMS) partition if requested
RESIZE_COMMENCED=false
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
--colors --pause "\n\n \Z5Expand ROMS partition?\Zn\n\n Select an option & press START
\n\n \ZbWARNING:\Zn\n After 30min auto-resize\n of ${P5_FS_TYPE} partition will begin." 15 60 1800); 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
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)
P5_SIZE_IN_GB=$(echo "scale=1; ${P5_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 ".")
P5_SIZE_IN_GBx10=$(echo "$P5_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}
RESIZE_ABORT=false
if (test "$P5_SIZE_IN_GBx10" -ge "$SD_MAX_AVAIL_SIZE_IN_GBx10" || test "$SD_MAX_UNALL_SIZE_IN_MiB" -le 15); then
echo "Your ROMS partition is greater than available space for resizing or you lack unallocated sectors space" | tee -a ${LOG}
sleep 1.5
RESIZE_ABORT=true
fi
if test "${P5_FS_TYPE}" == "FAT32" ; then
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
fi
if ! $RESIZE_ABORT; then
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}
echo "Resizing the MAIN partition to ${SD_MAX_AVAIL_SIZE_IN_GiB}GB." | tee -a ${LOG}
echo "Resizing the ROMS (${P5_FS_TYPE}) partition to ${SD_MAX_AVAIL_SIZE_IN_GiB}GB." | tee -a ${LOG}
umount /dev/mmcblk0p5 | tee -a ${LOG}
if test "${P5_FS_TYPE}" == "FAT32"; then
echo "This can take a minute, so be patient!" | tee -a ${LOG}
#TODO: fix outputting logs from fatresize stdout
fatresize --size="${SD_MAX_AVAIL_SIZE_IN_KiB}"ki -v -p /dev/mmcblk0p5 -n5 | tee -a ${LOG}
fsck.fat -y /dev/mmcblk0p5 | tee -a ${LOG}
#echo -n -e \\xEB\\x58\\x90 > /dev/mmcblk0p5
sync
mount -t vfat -o rw,utf8 /dev/mmcblk0p5 "${ROMS}" | tee -a ${LOG}
else
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}
P5_START_POINT=` parted --script /dev/mmcblk0 unit MB print | grep '5' | tail -n1 | awk '{print $2}'`
parted -a optimal /dev/mmcblk0 --script rm '5' | tee -a ${LOG}
parted -a optimal /dev/mmcblk0 --script mkpart roms $P5_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}
if test "${P5_FS_TYPE}" == "BTRFS"; then
mount /dev/mmcblk0p5 "${ROMS}" -o rw,noatime | tee -a ${LOG}
btrfs filesystem resize max ${ROMS} | tee -a ${LOG}
else #EXT4
resize2fs /dev/mmcblk0p5 | tee -a ${LOG}
e2fsck -y /dev/mmcblk0p5 | tee -a ${LOG}
mount /dev/mmcblk0p5 "${ROMS}" -o rw,noatime,nodiratime | tee -a ${LOG}
fi
partprobe
fi
RESIZE_COMMENCED=true
else
echo "ROMS partition resizing was aborted!" | tee -a ${LOG}
sleep 2
fi
fi
if ! $RESIZE_COMMENCED && test "${P5_FS_TYPE}" == "FAT32" ; then
sgdisk --typecode=5:0700 /dev/mmcblk0 # Microsoft basic data - partition type
partprobe
fi
# output FS table with type
df -Th >> ${LOG}
# Cleanup - delete the temporary file storing variable value
rm $TEMP
# disable this script
mount -o remount,rw "${MOUNTDIR}" | tee -a ${LOG}
mount -o remount,rw "${BOOTDIR}" | tee -a ${LOG}
echo "Disabling the firstboot script." | tee -a ${LOG}
mv "${MOUNTDIR}/firstboot" "${MOUNTDIR}/firstboot.done" | tee -a ${LOG}
mv "${BOOTDIR}/firstboot" "${BOOTDIR}/firstboot.done" | tee -a ${LOG}
mount -o remount,ro "${BOOTDIR}" | tee -a ${LOG}
# copy over the config files
echo "Copying default configuration files into place..." | tee -a ${LOG}
@@ -574,7 +708,6 @@ if $BITTBOY_CONFIG; then
elif $MIYOO_CONFIG; then
cp "${HOME}/gmenu2x/input_miyoo.conf" "${HOME}/gmenu2x/input.conf"
fi
mount -o remount,ro "${MOUNTDIR}" | tee -a ${LOG}
sync
echo "firstboot script finished." | tee -a ${LOG}
@@ -582,14 +715,12 @@ 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
echo "starting ipk install manager..." | tee -a ${LOG}
${BOOTDIR}/ipk_install.sh | tee -a ${LOG}
# Reboot device if CONSOLE_VARIANT was overwritten from $CHOICE so that it could be applied in u-boot by readID
## or found firstboot custom script
if ($CONSOLE_OVERWRITE || test -r "${BASEDIR}/firstboot.custom.sh"); then
if ($CONSOLE_OVERWRITE || test -r "${BOOTDIR}/firstboot.custom.sh"); then
safe_reboot_func
else
#just grep logs from temp directory before continuing

View File

@@ -21,37 +21,47 @@ image bootfs.vfat {
}
image ${IMAGE_NAME:-miyoo-cfw-2.0.0.img} {
hdimage {}
hdimage {
# for root=PARTLABEL support
partition-table-type = gpt
# default GPT location conflicts with bootloaders, move it after
gpt-location = 1M
}
partition u-boot {
in-partition-table = "no"
in-partition-table = false
image = "u-boot-sunxi-with-spl.bin"
offset = 0x2000
offset = 0x2000 # 8192 bytes
size = 1016K # 1MB - 8192
}
partition boot {
partition-type = 0xB
bootable = "true"
partition-type-uuid = F
bootable = true
image = "bootfs.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.btrfs"
partition-type-uuid = L
image = "rootfs.ext4"
}
partition swap {
partition-type = 0x82
bootable = "false"
partition-type-uuid = S
bootable = false
size = 256M
}
partition main {
partition-type = 0x83
bootable = "false"
partition-type-uuid = L
bootable = false
image = "main.img"
}
partition roms {
partition-type-uuid = L
bootable = false
image = "roms.img"
}
}

View File

@@ -1,5 +1,5 @@
MODULES_CUSTOM=0
FAT_CHECK=1
FS_CHECK=1
BOOT_LOGO=1
FLIP= (put 0 or 1 to overwrite)
INVERT= (put 0 or 1 to overwrite)

View File

@@ -0,0 +1,26 @@
From defe2787bb485ab91d97c81f503955f01d738c3d Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Sun, 11 May 2025 14:36:22 +0200
Subject: [PATCH] image-hd: reduce number of GPT entries
to fit in bootloader in first sectors
---
image-hd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/image-hd.c b/image-hd.c
index 5e3a3b4..fc46e89 100644
--- a/image-hd.c
+++ b/image-hd.c
@@ -98,7 +98,7 @@ struct gpt_partition_entry {
} __attribute__((packed));
ct_assert(sizeof(struct gpt_partition_entry) == 128);
-#define GPT_ENTRIES 128
+#define GPT_ENTRIES 56
#define GPT_SECTORS (1 + GPT_ENTRIES * sizeof(struct gpt_partition_entry) / 512)
#define GPT_REVISION_1_0 0x00010000
--
2.45.2.windows.1

View File

@@ -0,0 +1,2 @@
[autorun]
icon=roms.ico

BIN
board/miyoo/roms/roms.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@@ -15,12 +15,14 @@
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,ro /
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/hostname -F /etc/hostname
::sysinit:/bin/mount /dev/mmcblk0p4 /mnt -o commit=5,flushoncommit,noatime,nodiratime,exec
::sysinit:/bin/mount /dev/mmcblk0p1 /boot -t vfat -o ro,exec,sync,utf8
::sysinit:/bin/mount /dev/mmcblk0p5 /roms -o rw,noatime
::sysinit:/bin/mount /dev/mmcblk0p1 /boot -t vfat -o ro,exec,utf8
::sysinit:/sbin/swapon /dev/mmcblk0p3
# now run any rc scripts

View File

@@ -2,10 +2,11 @@
BOOTLOGO="boot-logo"
export HOME=/mnt
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"
BOOTDIR=/boot # we expect /dev/mmcblk0p1 has been mounted here read only, from inittab
LOGS=/dev/null
# check if it's first boot and turn on messages if yes
@@ -95,14 +96,37 @@ elif test -r "${HOME}/firstboot.completed"; then
rm "${HOME}/firstboot.completed"
fi
if !(grep -q FAT_CHECK\=\0 "${HOME}/options.cfg"); then
##Check if FAT16 is flagged as "dirty", and if so unmount, repair, remount
if !(grep -q FS_CHECK\=\0 "${HOME}/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"
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
mount /dev/mmcblk0p1 "${BOOTDIR}" -t vfat -o ro,exec,utf8
echo -e "\e[32mCheck complete.\e[0m"
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"
echo -e "\e[32mChecking MAIN(EXT4) partition...\e[0m"
umount /dev/mmcblk0p4
e2fsck -y /dev/mmcblk0p4 > /dev/null;
mount /dev/mmcblk0p4 "${HOME}" -o rw,sync,exec
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"
echo -e "\e[32mChecking ROMS(EXT4) partition...\e[0m"
umount /dev/mmcblk0p5
e2fsck -y /dev/mmcblk0p5 > /dev/null;
mount /dev/mmcblk0p5 "${ROMS}" -o rw,noatime
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"
echo -e "\e[32mChecking&Repairing ROMS(FAT32) partition...\e[0m"
umount /dev/mmcblk0p5
fsck.vfat -y /dev/mmcblk0p5 > /dev/null;
mount /dev/mmcblk0p5 "${ROMS}" -t vfat -o rw,utf8
echo -e "\e[32mCheck complete.\e[0m"
fi
fi

View File

@@ -11,9 +11,10 @@ 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"
storage "/" "ROOTFS" "ro"
storage "/mnt" "MAIN" "rw"
storage "/roms" "ROMS" "rw"
storage "/boot" "BOOT" "ro"
#
# Uncomment the following line if you want to

View File

@@ -60,6 +60,7 @@ export IMAGE_NAME="${BR2_VENDOR}-${CFW_TYPE}-${CFW_RELEASE}-${CFW_HASH}_${LIBC}-
# Relocate board files for genimage-sdcard config to read (see last cmd)
cp -r board/miyoo/boot "${BINARIES_DIR}"
cp -r board/miyoo/main "${BINARIES_DIR}"
cp -r board/miyoo/roms "${BINARIES_DIR}"
# Write CFW version to splash image
convert board/miyoo/miyoo-splash.png -pointsize 12 -fill white -annotate +10+230 "v${CFW_RELEASE} ${CFW_VERSION} (${LIBC}) ${STATUS}${APPEND_VERSION}" -type Palette -colors 224 -depth 8 -compress none -verbose BMP3:"${BINARIES_DIR}"/boot/miyoo-splash.bmp
@@ -93,6 +94,12 @@ fi
# Generate MAIN BTRFS partition
image="${BINARIES_DIR}/main.img"
label="MAIN"
mkfs.btrfs -r "${BINARIES_DIR}/main/" --shrink -v -f -L ${label} ${image}
mkfs.btrfs -r "${BINARIES_DIR}/main/" -b 1500M -v -f -L ${label} ${image} # hardcoded value and should be enough for extra exec/libs 1G def + 500MB extra in MAIN
# Generate ROMS EXT4 partition (dir at mount point is created at prebuild script)
image_roms="${BINARIES_DIR}/roms.img"
label_roms="ROMS"
dd if=/dev/zero of=${image_roms} bs=1G count=1 # for fatresize we need part. size bigger than 256M, but for backup space at least 1G is need in ROMS (copy of main)
mkfs.ext4 -d "${BINARIES_DIR}/roms/" -v -L ${label_roms} ${image_roms}
support/scripts/genimage.sh ${1} -c board/miyoo/genimage-sdcard.cfg

View File

@@ -26,3 +26,6 @@ Architecture: arm\n" >> ${VAR_OPKG}/status
done
sleep 2
# create mount point for ROMS p5 partition
mkdir -p ${ROOTFS_PATH}/roms

View File

@@ -30,6 +30,7 @@ BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/MiyooCFW/kernel.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="origin/master"
BR2_LINUX_KERNEL_PATCH="board/miyoo/kernel"
BR2_LINUX_KERNEL_DEFCONFIG="miyoo"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="suniv-f1c100s-miyoo suniv-f1c100s-miyoo-4bit"
@@ -67,11 +68,12 @@ 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
BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
BR2_PACKAGE_E2TOOLS=y
BR2_PACKAGE_FATRESIZE=y
BR2_PACKAGE_DEJAVU=y
BR2_PACKAGE_LIBERATION=y
@@ -110,6 +112,9 @@ BR2_PACKAGE_SDL2_TTF=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_MUPDF=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_GDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_LINUXCONSOLETOOLS=y
BR2_PACKAGE_LINUXCONSOLETOOLS_JOYSTICK=y
BR2_PACKAGE_PARTED=y
@@ -134,6 +139,7 @@ BR2_PACKAGE_SPEEX=y
BR2_PACKAGE_TREMOR=y
BR2_PACKAGE_LIBZIP=y
BR2_PACKAGE_LZ4=y
BR2_PACKAGE_LZO=y
BR2_PACKAGE_LIBSHA1=y
BR2_PACKAGE_SQLITE=y
BR2_PACKAGE_LIBCONFUSE=y
@@ -276,6 +282,7 @@ BR2_PACKAGE_DHCP_CLIENT=y
BR2_PACKAGE_DROPBEAR=y
BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS=y
BR2_PACKAGE_PURE_FTPD=y
BR2_PACKAGE_RSYNC=y
BR2_PACKAGE_OPKG=y
BR2_PACKAGE_OPKG_UTILS=y
BR2_PACKAGE_DIALOG=y
@@ -283,9 +290,10 @@ BR2_PACKAGE_SCREEN=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_BTRFS=y
BR2_TARGET_ROOTFS_BTRFS_LABEL="rootfs"
BR2_TARGET_ROOTFS_BTRFS_SIZE="256M"
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_LABEL="ROOTFS"
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
@@ -296,8 +304,8 @@ BR2_TARGET_UBOOT_BOARD_DEFCONFIG="miyoo"
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_BTRFS_PROGS=y
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

View File

@@ -29,6 +29,7 @@ BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/MiyooCFW/kernel.git"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="origin/master"
BR2_LINUX_KERNEL_PATCH="board/miyoo/kernel"
BR2_LINUX_KERNEL_DEFCONFIG="miyoo"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="suniv-f1c100s-miyoo suniv-f1c100s-miyoo-4bit"
@@ -70,6 +71,8 @@ BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FATLABEL=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
BR2_PACKAGE_E2TOOLS=y
BR2_PACKAGE_FATRESIZE=y
BR2_PACKAGE_DEJAVU=y
BR2_PACKAGE_LIBERATION=y
@@ -109,6 +112,9 @@ BR2_PACKAGE_SDL2_TTF=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_MUPDF=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_GDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_LINUXCONSOLETOOLS=y
BR2_PACKAGE_LINUXCONSOLETOOLS_JOYSTICK=y
BR2_PACKAGE_PARTED=y
@@ -253,6 +259,7 @@ BR2_PACKAGE_DHCP_CLIENT=y
BR2_PACKAGE_DROPBEAR=y
BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS=y
BR2_PACKAGE_PURE_FTPD=y
BR2_PACKAGE_RSYNC=y
BR2_PACKAGE_OPKG=y
BR2_PACKAGE_OPKG_UTILS=y
BR2_PACKAGE_DIALOG=y
@@ -260,9 +267,10 @@ BR2_PACKAGE_SCREEN=y
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_BTRFS=y
BR2_TARGET_ROOTFS_BTRFS_LABEL="rootfs"
BR2_TARGET_ROOTFS_BTRFS_SIZE="256M"
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_LABEL="ROOTFS"
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
@@ -273,8 +281,8 @@ BR2_TARGET_UBOOT_BOARD_DEFCONFIG="miyoo"
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_BTRFS_PROGS=y
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 411 KiB