integ/filesystem/parted/files/resizepart.sh
Scott Little 02c9baa147 Relocate parted to stx-integ/filesystem/parted
Move content from stx-gplv3 into stx-integ

Packages will be relocated to

stx-integ:
    base/
        anaconda
        crontabs
        dnsmasq
        rsync

    database/
        python-psycopg2

    filesystem/
        parted

    grub/
        grub2

    security/
        python-keyring

Change-Id: I567380cf4f84d31c2bd07f0b89b77a452f7cbc90
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 15:39:30 -04:00

25 lines
680 B
Bash

#!/bin/bash
################################################################################
# Copyright (c) 2015 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
################################################################################
DEVICE=$1
PARTITION=$2
SIZE=$(blockdev --getsize64 ${DEVICE})
SIZE_MB=$((SIZE / (1024*1024)))
## This is a workaround to allow cloud-init to invoke parted without needing to
## handle command prompts interactively. Support for non-interactive parted
## commands are not supported on mounted partitions.
##
/usr/sbin/parted ---pretend-input-tty ${DEVICE} resizepart ${PARTITION} << EOF
yes
${SIZE_MB}
EOF
exit $?