From b6ceef513888957f94f59b69d9b04eb47f5c978c Mon Sep 17 00:00:00 2001 From: drebrez Date: Sat, 19 Aug 2017 00:39:32 +0200 Subject: [PATCH] Detect and resize root partition on QEMU (#414) To increase the size of the partition you simply increase the size of the image using `truncate -s +200M /path/to/qemu.img` for example and then start QEMU. More information: https://github.com/postmarketOS/pmbootstrap/wiki/Common-Qemu-Notes#increase-partition-size --- main/postmarketos-mkinitfs/APKBUILD | 4 ++-- main/postmarketos-mkinitfs/init_functions.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main/postmarketos-mkinitfs/APKBUILD b/main/postmarketos-mkinitfs/APKBUILD index 4bf04eaa6..2b54aaf5d 100644 --- a/main/postmarketos-mkinitfs/APKBUILD +++ b/main/postmarketos-mkinitfs/APKBUILD @@ -1,5 +1,5 @@ pkgname=postmarketos-mkinitfs -pkgver=0.3.2 +pkgver=0.3.3 pkgrel=3 pkgdesc="Tool to generate initramfs images for postmarketOS" url="https://github.com/postmarketOS" @@ -26,5 +26,5 @@ package() { mkdir -p "$pkgdir/etc/postmarketos-mkinitfs/hooks/" } sha512sums="95e49eb5e7891d319543165290fb7279733e696db8c768d864d87ef36a20b04e1c4e8a1702a2927e7492ea2e9f3d4fdd83d9ea55811969689b9c2483fb3b44c4 init.sh.in -64aa05363f79a0cf2319740753b8852f5252a5b35b23fecccb131cd77d306cd4c7fe287b2d58cea456f669ff99e20f53cf609703530abf6eda7c958a9e0811d2 init_functions.sh +2331fe9a89ba58348b41fbfdeb6f4daeff3f6ef161d1b7582c3e900baba377fa9411efa0b052ea5c2ae22f75bc48f6b8f38dafad0bd836a0319906e70482898c init_functions.sh 8b61ecc989f32ed49b34463d457e8506b267af9af5a9f42639354506c27e858517a9e954a62c808bbd114fd31c9628e263bb5ed4d7b754c65d4aea33675ca0ad mkinitfs.sh" diff --git a/main/postmarketos-mkinitfs/init_functions.sh b/main/postmarketos-mkinitfs/init_functions.sh index 87910a39b..b31980b07 100644 --- a/main/postmarketos-mkinitfs/init_functions.sh +++ b/main/postmarketos-mkinitfs/init_functions.sh @@ -150,6 +150,12 @@ resize_root_partition() { kpartx -afs "$partition_dev" fi fi + # Detect and resize root partition on QEMU + if [ -z "${partition##"/dev/hda"*}" ]; then + echo "Resize root partition ($partition)" + parted -s /dev/hda resizepart 2 100% + partprobe + fi } unlock_root_partition() {