You are not logged in.

#1 2016-03-28 18:43:51

bodolsog
Member
Registered: 2016-03-28
Posts: 2

Where to publish path for mkinitcpio-openswap AUR package?

I have encrypted SWAP partition and keyfile for it on my root LVM logical volume. I was going throught Arch wiki - mkinitcpio_hook solution and use AUR package mkinitcpio-openswap 0.0.0-2.

I have hooks like:

HOOKS="base udev autodetect modconf block keymap encrypt lvm2  openswap resume filesystems keyboard fsck shutdown"

In my case I had race conditions. While resume hook was executed, lvm2 is not finish, that openswap task can't read keyfile.

So, I writed solution for that (as 5 lines added to original mkinitcpio-openswap):

run_hook ()
{
    ## read openswap configurations
    source openswap.conf

    if [ -z "$keyfile_device" ] || [ -z "$keyfile_filename" ]
    then
      ## case when no keyfile provided in configurations
      cryptsetup open "$swap_device" "$crypt_swap_name"
    else
      ## case when keyfile is provided in configurations
     
      ### these five lines are added by me to beat race conditions 
      x=0;
      while [ ! -b "$keyfile_device" ] && [ $x -le 10 ]; do
         x=$((x+1))
         sleep .2
      done

      mkdir openswap_keymount
      mount "$keyfile_device" openswap_keymount
      cryptsetup open $miscellaneous  --key-file "openswap_keymount/$keyfile_filename" "$swap_device" "$crypt_swap_name"
      umount openswap_keymount
    fi
}

Can someone tell me where I should that publish?

Last edited by bodolsog (2016-03-28 18:45:07)

Offline

#2 2016-03-28 23:14:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Where to publish path for mkinitcpio-openswap AUR package?

Given that it's a pretty short script, it's not really suitable for the AUR. Adding it to the wiki is probably best unless you intend to expand and maintain it in which case publishing to GitHub (or similar), then writing a PKGBUILD would be appropriate.

Offline

Board footer

Powered by FluxBB