libdevuansdk

common library for devuan's simple distro kits
git clone https://git.parazyd.org/libdevuansdk
Log | Files | Refs | Submodules | README | LICENSE

commit 55637ebfb49f0fd7c9c96d9f011e18723b442650
parent 60f168677b163cfbbab1e8c0f97c5a8eafdef0fe
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 12 Oct 2016 13:58:06 +0200

add gpt checks

Diffstat:
Mzlibs/helpers | 7++++++-
Mzlibs/imaging | 18+++++++++++-------
Mzlibs/rsync | 4+++-
3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/zlibs/helpers b/zlibs/helpers @@ -21,7 +21,12 @@ build_image_dist() { fn build_image_dist - req=(arch size parted_boot parted_root parted_type) + req=(arch size parted_type) + if [[ $parted_type = gpt ]]; then + req+=(gpt_boot gpt_root) + elif [[ $parted_type = dos ]]; then + req+=(parted_root parted_boot) + fi req+=(workdir strapdir image_name) ckreq || return 1 diff --git a/zlibs/imaging b/zlibs/imaging @@ -64,13 +64,17 @@ image_partition_raw_gpt() { notice "partitioning raw gpt image..." - parted $workdir/${image_name}.img --script -- mklabel gpt - cgpt create -z ${image_name}.img - cgpt create ${image_name}.img - cgpt add -i 1 -t kernel -b ${gpt_boot[1]} -s ${gpt_boot[2]} \ - -l kernel -S 1 -T 5 -P 10 ${image_name}.img - cgpt add -i 2 -t data -b ${gpt_root[1]} -s $(expr $(cgpt show ${image_name}.img \ - | awk '/Sec GPT table/ {print \$1}') - ${gpt_root[1]}) -l Root ${image_name}.img + parted $workdir/${image_name}.img --script -- mklabel gpt || zerr + cgpt create -z $workdir/${image_name}.img || zerr + cgpt create $workdir/${image_name}.img || zerr + + cgpt add -i 1 -t kernel -b ${gpt_boot[1]} \ + -s ${gpt_boot[2]} \ + -l kernel -S 1 -T 5 -P 10 $workdir/${image_name}.img + + cgpt add -i 2 -t data -b ${gpt_root[1]} \ + -s $(expr $(cgpt show $workdir/${image_name}.img | awk '/Sec GPT table/ {print $1}') - ${gpt_root[1]}) \ + -l Root $workdir/${image_name}.img findloopmapp diff --git a/zlibs/rsync b/zlibs/rsync @@ -30,7 +30,9 @@ rsync_to_raw_image() { pushd $strapdir sudo rm -f .done sudo rsync -HPavz -q --exclude={./boot} ./* $workdir/root - sudo rsync -HPavz -q ./boot/* $workdir/boot + if [[ $parted_type = dos ]]; then + sudo rsync -HPavz -q ./boot/* $workdir/boot + fi popd image_raw_umount