From 2f1e0f5ab0605725c6952d171439a48c14fa9e18 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 31 Mar 2020 13:00:21 +0200 Subject: iso2usb.sh: allow custom parition sizing Some people asked if it could be possible to reserve space on the USB stick for a custom additional 4th partition, to be used freely and which will not get touched by liveslak. So, there is a new parameter to the script now, here is the help text: -y|--layout Specify partition layout and sizes (in MB). Default values: '$DEF_LAYOUT' for 3 partitions, the '-1' value for partition 3 meaning 'use all remaining space', and an empty 4th value means 'do not reserve free space for a custom 4th partition'. The default layout of the USB stick remains: partition 1 (1MB), partition 2 (100 MB) partition 3 (claim all free space - specified as 0 MB). The script allows for an amount of free space to be left at the end (partition 4, unused by liveslak) in case you need this: This translates to the following DEF_LAYOUT variable value: DEF_LAYOUT="1,100,-1," --- iso2usb.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/iso2usb.sh b/iso2usb.sh index ed9be53..23ecd32 100644 --- a/iso2usb.sh +++ b/iso2usb.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2015, 2016, 2017, 2019 Eric Hameleers, Eindhoven, NL +# Copyright 2015, 2016, 2017, 2019, 2020 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -29,6 +29,14 @@ export PATH="/usr/sbin:/sbin:/usr/bin:/bin" # Set to '1' if you want to ignore all warnings: FORCE=0 +# The default layout of the USB stick is: +# partition 1 (1MB), +# partition 2 (100 MB) +# partition 3 (claim all free space - specified as 0 MB). +# The script allows for an amount of free space to be left at the end +# (partition 4, unused by liveslak) in case you need this: +DEF_LAYOUT="1,100,-1," + # By default, we use 'slhome.img' as the name of the LUKS home containerfile. DEF_SLHOME="slhome" SLHOME="${DEF_SLHOME}" @@ -165,7 +173,13 @@ cat < Add seconds wait time to initialize USB. +# -w|--wait Add seconds wait time to initialize USB. +# -y|--layout Specify partition layout and sizes (in MB). +# Default values: '$DEF_LAYOUT' for 3 partitions, +# the '-1' value for partition 3 meaning +# 'use all remaining space', +# and an empty 4th value means 'do not reserve +# free space for a custom 4th partition'. # -C|--cryptpersistfile size|perc # Use a LUKS-encrypted 'persistence' file instead # of a directory (for use on FAT filesystem). @@ -176,6 +190,7 @@ cat <