[elbe-devel] [PATCH 6/6] init preseed.cfg.mako: support swap partition
Torben Hohn
torben.hohn at linutronix.de
Mon May 7 15:51:15 CEST 2018
big qt pbuilder builds need swap, because they need more than 3GB of memory.
obey new swap-size field, and make partman generate a swap partition.
infos on partman-auto/expert_recipe syntax obtained from:
https://www.bishnet.net/tim/blog/2015/01/29/understanding-partman-autoexpert_recipe/
we want to specify the minimum size of the swap paritition. the rest of
the HD is allocated to the RFS.
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/init/preseed.cfg.mako | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/elbepack/init/preseed.cfg.mako b/elbepack/init/preseed.cfg.mako
index 1751fc1f..efa55b07 100644
--- a/elbepack/init/preseed.cfg.mako
+++ b/elbepack/init/preseed.cfg.mako
@@ -5,6 +5,9 @@
##
## SPDX-License-Identifier: GPL-3.0-or-later
##
+<%
+swap = int(prj.text('swap-size', defaults=defs, key='swap-size'))
+%>
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/xkb-keymap select us
@@ -30,7 +33,11 @@ d-i clock-setup/utc boolean true
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select buildenv
d-i partman-auto/disk string /dev/vda
-d-i partman-auto/expert_recipe string buildenv :: 256 1000000 -1 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / } .
+d-i partman-auto/expert_recipe string buildenv :: \
+%if swap != 0:
+ ${swap} ${swap} ${swap} linux-swap $primary{ } method{ swap } format{ } . \
+%endif
+256 1000000 -1 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / } .
d-i partman/partitioning/confirm_write_new_label boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish partitioning and write changes to disk
--
2.11.0
More information about the elbe-devel
mailing list