"use strict";
/**
 * penguins-eggs
 * krill modules: initramfs-cfg.ts
 * author: Piero Proietti
 * email: piero.proietti@gmail.com
 * license: MIT
 * https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
 */
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
/**
 *
 * @param this
 */
async function initramfsCfg(installDevice) {
    if (this.distro.familyId === 'debian') {
        // userSwapChoices = ['none', 'small', 'suspend', 'file']
        const file = this.installTarget + '/etc/initramfs-tools/conf.d/resume';
        let text = '';
        if (this.partitions.userSwapChoice === 'none' || this.partitions.userSwapChoice === 'file') {
            text += '#RESUME=none\n';
        }
        else {
            text += 'RESUME=UUID=' + utils_1.default.uuid(this.devices.swap.name);
        }
        utils_1.default.write(file, text);
    }
    else if (this.distro.familyId === 'archlinux') {
        console.log('initramfsCfg skipped');
    }
}
exports.default = initramfsCfg;
