ayufan-pine64 / android-7.0

DEPRECATED: Main repository with Android 7.0 releases
28 stars 3 forks source link

Suggestion: automatic partition resize on 1st boot... #1

Closed ThomasKaiser closed 8 years ago

ThomasKaiser commented 8 years ago

...maybe triggered by the existence of a special file that will be removed afterwards. Disclaimer: I don't know anything about Android but with our (Armbian's) Linux images this works pretty well in the meantime (leaving some unpartitioned space free to allow cloning/backing up more easily): https://github.com/igorpecovnik/lib/blob/master/scripts/firstrun#L132-L238

ayufan commented 8 years ago

It's possible.

On first run data partition is zeroed. We format it during first boot. So it's possible to create extra partition at the end, reload partition table and format it during mount.

ThomasKaiser commented 8 years ago

Would be a great enhancement for the average Android user I would assume. In case you implement it please just be sure to leave some space unpartitioned since this will help people move their installation to different SD cards 'of the same size' :)

ThomasKaiser commented 8 years ago

Sorry, closed accidentally. Up to you to close it immediately again or leave it open. Maybe volunteers want to look into?

ayufan commented 8 years ago

By doing that in terminal before partitions are formatted it's possible to have auto fill:

echo "d
4
d
3
n
p
3
67777
92352
p
n
p
92353

w
p
" | busybox fdisk /dev/block/mmcblk0

blockdev --rereadpt /dev/block/mmcblk0
ThomasKaiser commented 8 years ago

Sounds great. I hope you share my concerns to always leave some spare area on the SD cards so that maybe 98 percent is used max? Makes cloning/backing up the cards more easy (or let's better say it eases the restore if the new SD card bought later is 2 few sectors less in size)

DJFliX commented 8 years ago

@ayufan you mention running this in a terminal before partitions are formatted (which I assume happens on first boot of the SD card on the Pine64). Is the script above assumed to be run on a linux host other than the Pine64? Or am I completely missing something here? (I'm running macOS but I'll consider spinning up a VM if this means I can expand my SD card to ~16GB usage instead of the current usage).

ayufan commented 8 years ago

Done: https://github.com/ayufan-pine64/device-softwinner/commit/fb075b42912a2f66e5292867ac871363fd7a4161

ThomasKaiser commented 8 years ago

Worked like a charme (burned the most recent image using Etcher and all the magic happened at first boot):

/dev/block/mmcblk0p1  49M   27M   22M  55% /bootloader
/dev/block/mmcblk0p2 1.9G  1.6G  328M  84% /system
/dev/block/mmcblk0p3 740M  812K  685M   1% /cache
/dev/block/mmcblk0p4 4.4G  146M  4.0G   4% /data

Thanks!

nedqlkosivkov commented 5 years ago

20190908_110201 What's wrong? That is Orange Pi Win tv release. All times when i burn image, low disk space is allowed. I cannot install large app. I try with 32gb U3 sd card and 64gb u3 sd card and results was the same.