summaryrefslogtreecommitdiff
path: root/pcr/mkinitcpio-openswap/openswap.install
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2017-07-02 18:45:15 -0400
committerDavid P <megver83@parabola.nu>2017-07-02 18:45:15 -0400
commitf98362f371e259fa45b089c4183a5035285beb65 (patch)
tree5195363751bef1d753590eeffd235b287f03e469 /pcr/mkinitcpio-openswap/openswap.install
parent1b1185741639651b65d2953c06a64090e9a16df6 (diff)
downloadabslibre-f98362f371e259fa45b089c4183a5035285beb65.tar.gz
abslibre-f98362f371e259fa45b089c4183a5035285beb65.tar.bz2
abslibre-f98362f371e259fa45b089c4183a5035285beb65.zip
Added pythonqt and mkinitcpio-openswap to [pcr]
Diffstat (limited to 'pcr/mkinitcpio-openswap/openswap.install')
-rw-r--r--pcr/mkinitcpio-openswap/openswap.install27
1 files changed, 27 insertions, 0 deletions
diff --git a/pcr/mkinitcpio-openswap/openswap.install b/pcr/mkinitcpio-openswap/openswap.install
new file mode 100644
index 000000000..95d59a3d6
--- /dev/null
+++ b/pcr/mkinitcpio-openswap/openswap.install
@@ -0,0 +1,27 @@
+build ()
+{
+ grep "swap_device=" /etc/openswap.conf > "$BUILDROOT/openswap.conf"
+ grep "crypt_swap_name=" /etc/openswap.conf >> "$BUILDROOT/openswap.conf"
+ grep "keyfile_device=" /etc/openswap.conf >> "$BUILDROOT/openswap.conf"
+ grep "keyfile_filename=" /etc/openswap.conf >> "$BUILDROOT/openswap.conf"
+ grep "keyfile_device_mount_options=" /etc/openswap.conf >> "$BUILDROOT/openswap.conf"
+ grep "cryptsetup_options=" /etc/openswap.conf >> "$BUILDROOT/openswap.conf"
+
+ source "$BUILDROOT/openswap.conf"
+
+ if [ -z "$swap_device" ]; then
+ warning "swap_device variable is not set"
+ fi
+
+ if [ -z "$crypt_swap_name" ]; then
+ warning "crypt_swap_name variable is not set"
+ fi
+
+ add_runscript
+}
+help ()
+{
+cat<<HELPEOF
+ This hook opens a swap at boot time
+HELPEOF
+}