|
From: Erich T. <eri...@th...> - 2025-08-27 13:56:30
|
Hi Marko
Am 27.08.2025 um 06:06 schrieb marko via leaf-user:
> Hi all,
>
> does anyone know where the default sizes of the partitons are set for the
> install to disk option?
>
> Current sizes are a fraction too small to for my liking.
> Ideally I'd like partiton 2 to be 295MB and Part 3 to be 300MB. Having the
> slightly different sizes makes them much easier to identify on disk.
Mhhh.... being the culprit and having it written quite a few years ago I
had to reread my code and try to understand what it does.
look into /sbin/hdsupp_functions there is quite some code that
calculates possible disk partition sizes, I have no hardware with me
that I could use it on so cannot verify. The stuff you want is
################################################################################
# By default we build a disk layout with one bootloader partition
# and one LEAF partition
LAYOUT_TYPE=2 ; # default to a 2 partition layout
BOOT_PART_OFFSET=2048 ; # standard offset for partition 1 in 512
byte blocks
BOOT_PART_SIZE=2048 ; # size of the boot partition in 512 byte
blocks
PART_MAX=400000 ; # maximum partition size in 512 byte blocks
NEED_FORMAT=YES ;
CONSOLE=serial ;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
AND
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
build_disk_part_table() {
local layout=$(mktemp)
local hd_raw_size=$(get_device_blocks $HD_RAW_SELECTED)
build_part_prefix ;
local partition_space=$(( ($hd_raw_size - $BOOT_PART_OFFSET -
$BOOT_PART_SIZE) / 2 ))
[ $partition_space -gt $PART_MAX ] && partition_space=$PART_MAX
PART2_OFFSET=$(( $BOOT_PART_OFFSET + $BOOT_PART_SIZE )) ;
PART3_OFFSET=$(( $PART2_OFFSET + partition_space )) ;
# install a single partition for ARM based architecture
#
check_for_arm_architecture && \
cp /usr/share/single_part.tmpl $layout || \
cp /usr/share/disk.tmpl $layout;
[ $LAYOUT_TYPE -eq 2 ] && sed -i '$d' $layout;
sed -i "s!_DEVICE_!$HD_RAW_SELECTED!; \
s/_PART_/$PART_PREFIX/; \
s/_SIZE_P1_/$BOOT_PART_SIZE/; \
s/_OFFSET_P2_/$PART2_OFFSET/; \
s/_SIZE_P2_/$partition_space/; \
s/_OFFSET_P3_/$PART3_OFFSET/; \
s/_SIZE_P3_/$partition_space/" \
$layout;
/sbin/fdisk /dev/$HD_RAW_SELECTED 1>/dev/null 2>&1 << EOF
I
$layout
w
EOF
rm -f $layout ;
collect_partition_data ;
NEED_FORMAT=YES ;
}
>
> I currently make a new stick with the install script, manually move and resize
> and then re-install with the install script.
I am not sure if you cannot change partition sizes by rejecting the
suggested values. Integrating it into leafinstall if needed does not
seem too complicated. You will have to pass some parameters to the
supporting functions.
I believe if you have a reasonable partitioned disk you can use this layout.
After all this fundction was meant for the NOOB user which would not
care about any layout :-(
cheera
ET
--
„Wer von seinem Tag nicht zwei Drittel für sich hat, ist ein Sklave.“
―Friedrich Nietzsche
|