Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 760866

Summary: sys-fs/growpart: lacks init script
Product: Gentoo Linux Reporter: ShorTie <shortie8>
Component: Current packagesAssignee: Matthew Thode ( prometheanfire ) <prometheanfire>
Status: CONFIRMED ---    
Severity: normal CC: jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description ShorTie 2020-12-20 11:17:21 UTC
Growpart lacks a init script.
I started playing with growpart in my Devuan imager.
Having switch to Gentoo, I had to port over my init script.
While still using the version of growpart I had/have.
Then I found sys-fs/growpart.
Still have actually not tried it as it pulls in a bunch of stuff.
Is sys-apps/gptfdisk really really needed ??

But anyways, here is my init script that works for me.
It is kinda basic and just does mmcblkp02 and sda2.

Might need some tweeking as I see that other bug talking about /dev/vda.
Not sure what that is to be honest.
But might be as easy to just add a
"elif fdisk -l | grep vda >/dev/null; then" ... in
arm keywording might be nice too...


#!/sbin/openrc-run
# Dream up by ShorTie, enjoy .. :)~
# BeerWare By ShorTie	<idiot@dot.com> 
#
# This work is too trival to have any copyright, I hereby wave any copyright
# and release it into the public domain.
#rc-update add growpart boot

name="growpart"
description="AutoMagically expand the root partition to fill the device upon 1st boot"

depend()
{
	need localmount
}

start () {
    ebegin "Starting growpart"
    if fdisk -l | grep mmcblk >/dev/null; then
        ebegin "  growing part /dev/mmcblk0p2"
        bash growpart /dev/mmcblk0 2
        sleep 1s
        ebegin "    resize2fs /dev/mmcblk0p2"
        resize2fs /dev/mmcblk0p2
    else
        ebegin "  growing part /dev/sda2"
        bash growpart /dev/sda 2
        sleep 1s
        ebegin "    resize2fs /dev/sda2"
        resize2fs /dev/sda2
    fi
    rc-update -v del growpart
}
Comment 1 ShorTie 2020-12-24 22:47:26 UTC
I've updated to using emerge sys-fs/growpart --nodeps
Along with my init and all seems fine.