← Back to team overview

ubuntu-phone team mailing list archive

Re: [PATCH] Create swap file on first boot

 

On 03/01/2013 04:09 PM, f69m wrote:
Hi everyone,

Please find attached a small patch that will create /data/swapfile on
first boot.
If you don't want a swapfile, just create an empty /data/swapfile.

Pros:

  * The swap file can be removed from the rootfs, which makes that
    significantly smaller and faster to flash.
  * Once created, the swap file persists updates and does not need to be
    recreated.

Cons:

  * Can't think of any.

Details:

  * The patch should be applied to git://phablet.ubuntu.com/ubuntu/uchroot.
  * Creates /data/swapfile, if it does not exist yet.
  * Runs swapon, if the file exists and is not empty.

Hope this patch is acceptable and can be included for everyone.

There's already a SWAP file at the ubuntu side (check /data/ubuntu/SWAP.swap).

But your solution might work better as we can remove this step from image build time.

I'd just like an extra check in case there's not enough disk space before creating the swapfile.

Will check this tomorrow.

Cheers,
--
Ricardo Salveti de Araujo


Follow ups

References