summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-07-21 14:59:54 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-07-21 14:59:54 +0200
commit05058308aef0d776320589f8dbe32e80c90fc1aa (patch)
tree4f9547c52d41db0b2cc1535374c120656efaf340
parent0e2f910fa72ed801720618eff2fb5f9862c6ba04 (diff)
fix mkinitcpio.conf and grub menu.lst in lvm/crypt configs + also encryt swap
-rw-r--r--examples/fancy-install-on-sda18
-rw-r--r--examples/test-on-sda20
2 files changed, 30 insertions, 8 deletions
diff --git a/examples/fancy-install-on-sda b/examples/fancy-install-on-sda
index 3365f57..2f2d4e1 100644
--- a/examples/fancy-install-on-sda
+++ b/examples/fancy-install-on-sda
@@ -1,5 +1,7 @@
# this config is like generic-install-on-sda (check out that file first), but more fancy
+phase_finish=(msg_report grub_hack)
+
SOURCE=cd
FILE_URL=file:///src/core/pkg
SYNC_URL=
@@ -18,16 +20,24 @@ worker_intro () {
sleep 10
}
+worker_configure_system () {
+ sed -i 's/filesystems/encrypt lvm2 filesystems/' $var_TARGET_DIR/etc/mkinitcpio.conf
+}
+
+# aif code doesn't nicely update grub config automatically for lvm/dm_crypt systems yet, so we have to do it with this hack
+worker_grub_hack () {
+ sed -i 's#root=/dev/sda.*#root=/dev/mapper/cryptpool-cryptroot cryptdevice=/dev/sda2:cryptpool ro#' $var_TARGET_DIR/boot/grub/menu.lst
+}
# These variables are mandatory
GRUB_DEVICE=/dev/sda
-PARTITIONS='/dev/sda 100:ext2:+ 512:swap *:ext4'
+PARTITIONS='/dev/sda 100:ext2:+ *:ext4'
BLOCKDATA='/dev/sda1 raw no_label ext2;yes;/boot;target;no_opts;no_label;no_params
-/dev/sda2 raw no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
-/dev/sda3 raw no_label dm_crypt;yes;no_mountpoint;target;no_opts;sda3crypt;-c_aes-xts-plain_-y_-s_512
+/dev/sda2 raw no_label dm_crypt;yes;no_mountpoint;target;no_opts;sda3crypt;-c_aes-xts-plain_-y_-s_512
/dev/mapper/sda3crypt dm_crypt no_label lvm-pv;yes;no_mountpoint;target;no_opts;no_label;no_params
/dev/mapper/sda3crypt+ lvm-pv no_label lvm-vg;yes;no_mountpoint;target;no_opts;cryptpool;/dev/mapper/sda3crypt
-/dev/mapper/cryptpool lvm-vg cryptpool lvm-lv;yes;no_mountpoint;target;no_opts;cryptroot;5G|lvm-lv;yes;no_mountpoint;target;no_opts;crypthome;5G
+/dev/mapper/cryptpool lvm-vg cryptpool lvm-lv;yes;no_mountpoint;target;no_opts;cryptswap;1G|lvm-lv;yes;no_mountpoint;target;no_opts;cryptroot;5G|lvm-lv;yes;no_mountpoint;target;no_opts;crypthome;5G
+/dev/mapper/cryptpool-cryptswap lvm-lv no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
/dev/mapper/cryptpool-cryptroot lvm-lv no_label xfs;yes;/;target;no_opts;no_label;no_params
/dev/mapper/cryptpool-crypthome lvm-lv no_label xfs;yes;/home;target;no_opts;no_label;no_params'
diff --git a/examples/test-on-sda b/examples/test-on-sda
index 7f5529d..604f310 100644
--- a/examples/test-on-sda
+++ b/examples/test-on-sda
@@ -1,6 +1,10 @@
# this config is like fancy-install-on-sda but with small filesystems. very usefull for quickly testing in VM's
# this config is meant for testing AIF and is not very suited for end users.
+
+phase_finish=(msg_report grub_hack)
+
+
SOURCE=cd
FILE_URL=file:///src/core/pkg
SYNC_URL=
@@ -19,16 +23,24 @@ worker_intro () {
sleep 10
}
+worker_configure_system () {
+ sed -i 's/filesystems/encrypt lvm2 filesystems/' $var_TARGET_DIR/etc/mkinitcpio.conf
+}
+
+# aif code doesn't nicely update grub config automatically for lvm/dm_crypt systems yet, so we have to do it with this hack
+worker_grub_hack () {
+ sed -i 's#root=/dev/sda.*#root=/dev/mapper/cryptpool-cryptroot cryptdevice=/dev/sda2:cryptpool ro#' $var_TARGET_DIR/boot/grub/menu.lst
+}
# These variables are mandatory
GRUB_DEVICE=/dev/sda
-PARTITIONS='/dev/sda 40:ext2:+ 20:swap *:ext4'
+PARTITIONS='/dev/sda 40:ext2:+ *:ext4'
BLOCKDATA='/dev/sda1 raw no_label ext2;yes;/boot;target;no_opts;no_label;no_params
-/dev/sda2 raw no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
-/dev/sda3 raw no_label dm_crypt;yes;no_mountpoint;target;no_opts;sda3crypt;-c_aes-xts-plain_-y_-s_512
+/dev/sda2 raw no_label dm_crypt;yes;no_mountpoint;target;no_opts;sda3crypt;-c_aes-xts-plain_-y_-s_512
/dev/mapper/sda3crypt dm_crypt no_label lvm-pv;yes;no_mountpoint;target;no_opts;no_label;no_params
/dev/mapper/sda3crypt+ lvm-pv no_label lvm-vg;yes;no_mountpoint;target;no_opts;cryptpool;/dev/mapper/sda3crypt
-/dev/mapper/cryptpool lvm-vg cryptpool lvm-lv;yes;no_mountpoint;target;no_opts;cryptroot;800M|lvm-lv;yes;no_mountpoint;target;no_opts;crypthome;50M
+/dev/mapper/cryptpool lvm-vg cryptpool lvm-lv;yes;no_mountpoint;target;no_opts;cryptswap;20M|lvm-lv;yes;no_mountpoint;target;no_opts;cryptroot;800M|lvm-lv;yes;no_mountpoint;target;no_opts;crypthome;50M
+/dev/mapper/cryptpool-cryptswap lvm-lv no-label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
/dev/mapper/cryptpool-cryptroot lvm-lv no_label xfs;yes;/;target;no_opts;no_label;no_params
/dev/mapper/cryptpool-crypthome lvm-lv no_label xfs;yes;/home;target;no_opts;no_label;no_params'