penguins-eggs 9.1.31 → 9.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -18
- package/conf/distros/buster/calamares/modules/locale.yml +3 -3
- package/conf/eggs.yaml +2 -2
- package/lib/classes/compressors.d.ts +7 -0
- package/lib/classes/compressors.js +38 -1
- package/lib/classes/daddy.js +6 -29
- package/lib/classes/distro.js +12 -4
- package/lib/classes/incubation/fisherman-helper/packages.js +6 -3
- package/lib/classes/keyboards.d.ts +10 -12
- package/lib/classes/keyboards.js +19 -23
- package/lib/classes/locales.js +15 -10
- package/lib/classes/ovary.js +9 -4
- package/lib/classes/utils.js +19 -6
- package/lib/commands/{install.d.ts → krill.d.ts} +1 -0
- package/lib/commands/{install.js → krill.js} +2 -2
- package/lib/commands/produce.js +8 -30
- package/lib/{classes/krill_prepare.d.ts → krill/krill-prepare.d.ts} +9 -2
- package/lib/{classes/krill_prepare.js → krill/krill-prepare.js} +62 -12
- package/lib/krill/krill-sequence.d.ts +148 -0
- package/lib/krill/krill-sequence.js +533 -0
- package/lib/krill/modules/add-user.d.ts +15 -0
- package/lib/krill/modules/add-user.js +41 -0
- package/lib/krill/modules/bootloader-config-arch.d.ts +9 -0
- package/lib/krill/modules/bootloader-config-arch.js +13 -0
- package/lib/krill/modules/bootloader-config-ubuntu.d.ts +9 -0
- package/lib/krill/modules/bootloader-config-ubuntu.js +93 -0
- package/lib/krill/modules/bootloader-config.d.ts +9 -0
- package/lib/krill/modules/bootloader-config.js +23 -0
- package/lib/krill/modules/bootloader.d.ts +10 -0
- package/lib/krill/modules/bootloader.js +17 -0
- package/lib/krill/modules/change-password.d.ts +10 -0
- package/lib/krill/modules/change-password.js +16 -0
- package/lib/krill/modules/del-live-user.d.ts +9 -0
- package/lib/krill/modules/del-live-user.js +37 -0
- package/lib/krill/modules/fstab.d.ts +9 -0
- package/lib/krill/modules/fstab.js +93 -0
- package/lib/krill/modules/grubcfg.d.ts +12 -0
- package/lib/krill/modules/grubcfg.js +33 -0
- package/lib/krill/modules/hostname.d.ts +8 -0
- package/lib/krill/modules/hostname.js +13 -0
- package/lib/krill/modules/hosts.d.ts +9 -0
- package/lib/krill/modules/hosts.js +30 -0
- package/lib/krill/modules/initramfs-cfg.d.ts +9 -0
- package/lib/krill/modules/initramfs-cfg.js +29 -0
- package/lib/krill/modules/initramfs.d.ts +8 -0
- package/lib/krill/modules/initramfs.js +30 -0
- package/lib/krill/modules/locale.d.ts +8 -0
- package/lib/krill/modules/locale.js +47 -0
- package/lib/krill/modules/l/303/262cale-cfg.d.ts +5 -0
- package/lib/krill/modules/l/303/262cale-cfg.js +58 -0
- package/lib/krill/modules/machine-id.d.ts +10 -0
- package/lib/krill/modules/machine-id.js +21 -0
- package/lib/krill/modules/mkfs.d.ts +8 -0
- package/lib/krill/modules/mkfs.js +33 -0
- package/lib/krill/modules/mount-fs.d.ts +12 -0
- package/lib/krill/modules/mount-fs.js +63 -0
- package/lib/krill/modules/mount-vfs.d.ts +12 -0
- package/lib/krill/modules/mount-vfs.js +40 -0
- package/lib/krill/modules/network-cfg.d.ts +14 -0
- package/lib/krill/modules/network-cfg.js +49 -0
- package/lib/krill/modules/partitions.d.ts +15 -0
- package/lib/krill/modules/partitions.js +307 -0
- package/lib/krill/modules/remove-installer-link.d.ts +8 -0
- package/lib/krill/modules/remove-installer-link.js +34 -0
- package/lib/krill/modules/set-keyboard.d.ts +5 -0
- package/lib/krill/modules/set-keyboard.js +50 -0
- package/lib/krill/modules/set-timezone.d.ts +9 -0
- package/lib/krill/modules/set-timezone.js +21 -0
- package/lib/krill/modules/umount.d.ts +9 -0
- package/lib/krill/modules/umount.js +26 -0
- package/lib/krill/modules/unpackfs.d.ts +8 -0
- package/lib/krill/modules/unpackfs.js +17 -0
- package/lib/lib/cli-autologin.js +3 -3
- package/lib/lib/select_keyboard_variant.js +1 -0
- package/manpages/doc/man/eggs.html +122 -90
- package/mkinitcpio/README.md +8 -1
- package/mkinitcpio/archlinux/mkinitcpio-install.conf +5 -0
- package/mkinitcpio/archlinux/mkinitcpio-produce.conf +13 -0
- package/mkinitcpio/manjaro/README.md +27 -11
- package/mkinitcpio/manjaro/mkinitcpio-install.conf +7 -0
- package/mkinitcpio/manjaro/{mkinitcpio.conf → mkinitcpio-produce.conf} +1 -1
- package/package.json +1 -1
- package/scripts/_eggs +8 -8
- package/scripts/eggs.bash +1 -1
- package/scripts/mom-cli.sh +8 -8
- package/lib/classes/i18n.d.ts +0 -34
- package/lib/classes/i18n.js +0 -126
- package/lib/classes/krill_install.d.ts +0 -227
- package/lib/classes/krill_install.js +0 -1370
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = require("../../lib/utils");
|
|
8
|
+
const utils_2 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param this
|
|
12
|
+
*/
|
|
13
|
+
async function bootloaderConfigUbuntu() {
|
|
14
|
+
let cmd = '';
|
|
15
|
+
try {
|
|
16
|
+
cmd = `chroot ${this.installTarget} apt-get update -y ${this.toNull}`;
|
|
17
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.log(error);
|
|
21
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
cmd = `chroot ${this.installTarget} sleep 1 ${this.toNull}`;
|
|
25
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.log(error);
|
|
29
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
30
|
+
}
|
|
31
|
+
let aptInstallOptions = ' apt install -y --no-upgrade --allow-unauthenticated -o Acquire::gpgv::Options::=--ignore-time-conflict ';
|
|
32
|
+
if (this.efi) {
|
|
33
|
+
try {
|
|
34
|
+
cmd = `chroot ${this.installTarget} ${aptInstallOptions} grub-efi-${utils_2.default.machineArch()} --allow-unauthenticated ${this.toNull}`;
|
|
35
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.log(error);
|
|
39
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
try {
|
|
44
|
+
cmd = `chroot ${this.installTarget} ${aptInstallOptions} grub-pc ${this.toNull}`;
|
|
45
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.log(error);
|
|
49
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
cmd = `chroot ${this.installTarget} sleep 1 ${this.toNull}`;
|
|
54
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.log(error);
|
|
58
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
cmd = `chroot ${this.installTarget} grub-install ${this.partitions.installationDevice} ${this.toNull}`;
|
|
62
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.log(error);
|
|
66
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
cmd = `chroot ${this.installTarget} grub-mkconfig -o /boot/grub/grub.cfg ${this.toNull}`;
|
|
70
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
console.log(error);
|
|
74
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
cmd = `chroot ${this.installTarget} update-grub ${this.toNull}`;
|
|
78
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.log(error);
|
|
82
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
cmd = `chroot ${this.installTarget} sleep 1 ${this.toNull}`;
|
|
86
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.log(error);
|
|
90
|
+
await utils_2.default.pressKeyToExit(cmd, true);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.default = bootloaderConfigUbuntu;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
*/
|
|
10
|
+
async function bootloaderConfig() {
|
|
11
|
+
if (this.distro.familyId === 'debian') {
|
|
12
|
+
if (this.distro.distroLike === 'ubuntu') {
|
|
13
|
+
this.bootloaderConfigUbuntu();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.execCalamaresModule('bootloader-config');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else if (this.distro.familyId === 'archlinux') {
|
|
20
|
+
this.bootloaderConfigArch();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = bootloaderConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
* bootloader
|
|
7
|
+
* @param target
|
|
8
|
+
* @param options
|
|
9
|
+
*/
|
|
10
|
+
export default function bootloader(this: Sequence): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../lib/utils");
|
|
7
|
+
/**
|
|
8
|
+
* bootloader
|
|
9
|
+
* @param target
|
|
10
|
+
* @param options
|
|
11
|
+
*/
|
|
12
|
+
async function bootloader() {
|
|
13
|
+
await (0, utils_1.exec)(`chroot ${this.installTarget} grub-install ${this.partitions.installationDevice} ${this.toNull}`, this.echo);
|
|
14
|
+
await (0, utils_1.exec)(`chroot ${this.installTarget} update-grub ${this.toNull}`, this.echo);
|
|
15
|
+
await (0, utils_1.exec)(`sleep 1 ${this.toNull}`, this.echo);
|
|
16
|
+
}
|
|
17
|
+
exports.default = bootloader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
* changePassword
|
|
7
|
+
* @param name
|
|
8
|
+
* @param newPassword
|
|
9
|
+
*/
|
|
10
|
+
export default function changePassword(this: Sequence, name?: string, newPassword?: string): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../lib/utils");
|
|
7
|
+
/**
|
|
8
|
+
* changePassword
|
|
9
|
+
* @param name
|
|
10
|
+
* @param newPassword
|
|
11
|
+
*/
|
|
12
|
+
async function changePassword(name = 'live', newPassword = 'evolution') {
|
|
13
|
+
const cmd = `echo ${name}:${newPassword} | chroot ${this.installTarget} chpasswd ${this.toNull}`;
|
|
14
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
15
|
+
}
|
|
16
|
+
exports.default = changePassword;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
* delUser
|
|
7
|
+
* va corretto con users.conf di calamares
|
|
8
|
+
*/
|
|
9
|
+
export default function delLiveUser(this: Sequence): Promise<void>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = require("../../lib/utils");
|
|
8
|
+
const utils_2 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
9
|
+
/**
|
|
10
|
+
* delUser
|
|
11
|
+
* va corretto con users.conf di calamares
|
|
12
|
+
*/
|
|
13
|
+
async function delLiveUser() {
|
|
14
|
+
if (utils_2.default.isLive()) {
|
|
15
|
+
const user = this.settings.config.user_opt;
|
|
16
|
+
let userExists = false;
|
|
17
|
+
try {
|
|
18
|
+
const cmd = `#!/bin/sh\ngetent passwd "${user}" > /dev/null`;
|
|
19
|
+
await (0, utils_1.exec)(cmd, utils_2.default.setEcho(this.verbose));
|
|
20
|
+
userExists = true;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.log(error);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
if (userExists) {
|
|
27
|
+
// debian family
|
|
28
|
+
let cmd = `chroot ${this.installTarget} deluser --remove-home ${user} ${this.toNull}`;
|
|
29
|
+
if (this.distro.familyId === 'archlinux') {
|
|
30
|
+
cmd = `chroot ${this.installTarget} sudo userdel -r ${user} ${this.toNull}`;
|
|
31
|
+
}
|
|
32
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = delLiveUser;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
* fstab()
|
|
7
|
+
* @param devices
|
|
8
|
+
*/
|
|
9
|
+
export default function fstab(this: Sequence, installDevice: string, crypted?: boolean): Promise<void>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
8
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
9
|
+
/**
|
|
10
|
+
* fstab()
|
|
11
|
+
* @param devices
|
|
12
|
+
*/
|
|
13
|
+
async function fstab(installDevice, crypted = false) {
|
|
14
|
+
let text = '';
|
|
15
|
+
/**
|
|
16
|
+
* crypttab
|
|
17
|
+
*/
|
|
18
|
+
if (this.partitions.installationMode === 'full-encrypted') {
|
|
19
|
+
const crypttab = this.installTarget + '/etc/crypttab';
|
|
20
|
+
text = ``;
|
|
21
|
+
text += `# /etc/crypttab: mappings for encrypted partitions.\n`;
|
|
22
|
+
text += `#\n`;
|
|
23
|
+
text += `# Each mapped device will be created in /dev/mapper, so your /etc/fstab\n`;
|
|
24
|
+
text += `# should use the /dev/mapper/<name> paths for encrypted devices.\n`;
|
|
25
|
+
text += `#\n`;
|
|
26
|
+
text += `# See crypttab(5) for the supported syntax.\n`;
|
|
27
|
+
text += `#\n`;
|
|
28
|
+
text += `# NOTE: You need not list your root (/) partition here, but it must be set up\n`;
|
|
29
|
+
text += `# beforehand by the initramfs (/etc/mkinitcpio.conf). The same applies\n`;
|
|
30
|
+
text += `# to encrypted swap, which should be set up with mkinitcpio-openswap\n`;
|
|
31
|
+
text += `# for resume support.\n`;
|
|
32
|
+
text += `#\n`;
|
|
33
|
+
text += `# <name> <device> <password> <options>\n`;
|
|
34
|
+
text += `#swap_crypted was ${this.devices.swap.cryptedFrom}\n`;
|
|
35
|
+
text += `swap_crypted UUID=${utils_1.default.uuid(this.devices.swap.cryptedFrom)} none luks,discard\n`;
|
|
36
|
+
text += `#root_crypted was ${this.devices.root.cryptedFrom}\n`;
|
|
37
|
+
text += `root_crypted UUID=${utils_1.default.uuid(this.devices.root.cryptedFrom)} none luks,swap\n`;
|
|
38
|
+
utils_1.default.write(crypttab, text);
|
|
39
|
+
}
|
|
40
|
+
const fstab = this.installTarget + '/etc/fstab';
|
|
41
|
+
let mountOptsRoot = '';
|
|
42
|
+
let mountOptsBoot = '';
|
|
43
|
+
let mountOptsData = ``;
|
|
44
|
+
let mountOptsEfi = '';
|
|
45
|
+
let mountOptsSwap = '';
|
|
46
|
+
if (await isRotational(installDevice)) {
|
|
47
|
+
mountOptsRoot = 'defaults,relatime 0 1';
|
|
48
|
+
mountOptsBoot = 'defaults,relatime 0 1';
|
|
49
|
+
mountOptsData = 'defaults,relatime 0 1';
|
|
50
|
+
mountOptsEfi = 'defaults,relatime 0 2';
|
|
51
|
+
mountOptsSwap = 'defaults,relatime 0 2';
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
mountOptsRoot = 'defaults,noatime 0 1';
|
|
55
|
+
mountOptsBoot = 'defaults,noatime 0 1';
|
|
56
|
+
mountOptsData = 'defaults,noatime 0 1';
|
|
57
|
+
mountOptsEfi = 'defaults,noatime 0 2';
|
|
58
|
+
mountOptsSwap = 'defaults,noatime 0 2';
|
|
59
|
+
}
|
|
60
|
+
text = ``;
|
|
61
|
+
text += `# ${this.devices.root.name} ${this.devices.root.mountPoint} ${this.devices.root.fsType} ${mountOptsRoot}\n`;
|
|
62
|
+
text += `UUID=${utils_1.default.uuid(this.devices.root.name)} ${this.devices.root.mountPoint} ${this.devices.root.fsType} ${mountOptsRoot}\n`;
|
|
63
|
+
if (this.devices.boot.name !== `none`) {
|
|
64
|
+
text += `# ${this.devices.boot.name} ${this.devices.boot.mountPoint} ${this.devices.boot.fsType} ${mountOptsBoot}\n`;
|
|
65
|
+
text += `UUID=${utils_1.default.uuid(this.devices.boot.name)} ${this.devices.boot.mountPoint} ${this.devices.root.fsType} ${mountOptsBoot}\n`;
|
|
66
|
+
}
|
|
67
|
+
if (this.devices.data.name !== `none`) {
|
|
68
|
+
text += `# ${this.devices.data.name} ${this.devices.data.mountPoint} ${this.devices.data.fsType} ${mountOptsData}\n`;
|
|
69
|
+
text += `UUID=${utils_1.default.uuid(this.devices.data.name)} ${this.devices.data.mountPoint} ${this.devices.data.fsType} ${mountOptsData}\n`;
|
|
70
|
+
}
|
|
71
|
+
if (this.efi) {
|
|
72
|
+
text += `# ${this.devices.efi.name} ${this.devices.efi.mountPoint} vfat ${mountOptsEfi}\n`;
|
|
73
|
+
text += `UUID=${utils_1.default.uuid(this.devices.efi.name)} ${this.devices.efi.mountPoint} vfat ${mountOptsEfi}\n`;
|
|
74
|
+
}
|
|
75
|
+
text += `# ${this.devices.swap.name} ${this.devices.swap.mountPoint} ${this.devices.swap.fsType} ${mountOptsSwap}\n`;
|
|
76
|
+
text += `UUID=${utils_1.default.uuid(this.devices.swap.name)} ${this.devices.swap.mountPoint} ${this.devices.swap.fsType} ${mountOptsSwap}\n`;
|
|
77
|
+
utils_1.default.write(fstab, text);
|
|
78
|
+
}
|
|
79
|
+
exports.default = fstab;
|
|
80
|
+
/**
|
|
81
|
+
* isRotational
|
|
82
|
+
* @param device
|
|
83
|
+
*/
|
|
84
|
+
async function isRotational(device) {
|
|
85
|
+
device = device.substring(4);
|
|
86
|
+
let response;
|
|
87
|
+
let retVal = false;
|
|
88
|
+
response = shelljs_1.default.exec(`cat /sys/block/${device}/queue/rotational`, { silent: true }).stdout.trim();
|
|
89
|
+
if (response === '1') {
|
|
90
|
+
retVal = true;
|
|
91
|
+
}
|
|
92
|
+
return retVal;
|
|
93
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
* grubcfg
|
|
7
|
+
* - open /etc/default/grub
|
|
8
|
+
* - find GRUB_CMDLINE_LINUX_DEFAULT=
|
|
9
|
+
* - replace with GRUB_CMDLINE_LINUX_DEFAULT=
|
|
10
|
+
* 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=/g'
|
|
11
|
+
*/
|
|
12
|
+
export default function grubcfg(this: Sequence): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
8
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
9
|
+
/**
|
|
10
|
+
* grubcfg
|
|
11
|
+
* - open /etc/default/grub
|
|
12
|
+
* - find GRUB_CMDLINE_LINUX_DEFAULT=
|
|
13
|
+
* - replace with GRUB_CMDLINE_LINUX_DEFAULT=
|
|
14
|
+
* 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=/g'
|
|
15
|
+
*/
|
|
16
|
+
async function grubcfg() {
|
|
17
|
+
let file = `${this.installTarget}/etc/default/grub`;
|
|
18
|
+
let content = '';
|
|
19
|
+
const grubs = fs_1.default.readFileSync(file, 'utf-8').split('\n');
|
|
20
|
+
for (let i = 0; i < grubs.length; i++) {
|
|
21
|
+
if (grubs[i].includes('GRUB_CMDLINE_LINUX_DEFAULT=')) {
|
|
22
|
+
if (this.partitions.installationMode === 'full-encrypted') {
|
|
23
|
+
grubs[i] = `GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=${utils_1.default.uuid(this.devices.swap.name)}"`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
grubs[i] = `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=${utils_1.default.uuid(this.devices.swap.name)}"`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
content += grubs[i] + '\n';
|
|
30
|
+
}
|
|
31
|
+
fs_1.default.writeFileSync(file, content, 'utf-8');
|
|
32
|
+
}
|
|
33
|
+
exports.default = grubcfg;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../lib/utils");
|
|
7
|
+
/**
|
|
8
|
+
* hostname
|
|
9
|
+
*/
|
|
10
|
+
async function hostname() {
|
|
11
|
+
await (0, utils_1.exec)(`echo ${this.installTarget + '/etc/hostname'} > ${this.users.hostname} `, this.echo);
|
|
12
|
+
}
|
|
13
|
+
exports.default = hostname;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
/**
|
|
9
|
+
* hosts
|
|
10
|
+
* @param this
|
|
11
|
+
*/
|
|
12
|
+
async function hosts() {
|
|
13
|
+
const file = this.installTarget + '/etc/hosts';
|
|
14
|
+
let text = '127.0.0.1 localhost localhost.localdomain\n';
|
|
15
|
+
if (this.network.addressType === 'static') {
|
|
16
|
+
text += `${this.network.address} ${this.users.hostname} pvelocalhost\n`;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
text += `127.0.1.1 ${this.users.hostname} \n`;
|
|
20
|
+
}
|
|
21
|
+
text += `# The following lines are desirable for IPv6 capable hosts\n`;
|
|
22
|
+
text += `:: 1 ip6 - localhost ip6 - loopback\n`;
|
|
23
|
+
text += `fe00:: 0 ip6 - localnet\n`;
|
|
24
|
+
text += `ff00:: 0 ip6 - mcastprefix\n`;
|
|
25
|
+
text += `ff02:: 1 ip6 - allnodes\n`;
|
|
26
|
+
text += `ff02:: 2 ip6 - allrouters\n`;
|
|
27
|
+
text += `ff02:: 3 ip6 - allhosts\n`;
|
|
28
|
+
fs_1.default.writeFileSync(file, text);
|
|
29
|
+
}
|
|
30
|
+
exports.default = hosts;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
*/
|
|
9
|
+
export default function initramfsCfg(this: Sequence, installDevice: string): Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param this
|
|
11
|
+
*/
|
|
12
|
+
async function initramfsCfg(installDevice) {
|
|
13
|
+
if (this.distro.familyId === 'debian') {
|
|
14
|
+
// userSwapChoices = ['none', 'small', 'suspend', 'file']
|
|
15
|
+
const file = this.installTarget + '/etc/initramfs-tools/conf.d/resume';
|
|
16
|
+
let text = '';
|
|
17
|
+
if (this.partitions.userSwapChoice === 'none' || this.partitions.userSwapChoice === 'file') {
|
|
18
|
+
text += '#RESUME=none\n';
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
text += 'RESUME=UUID=' + utils_1.default.uuid(this.devices.swap.name);
|
|
22
|
+
}
|
|
23
|
+
utils_1.default.write(file, text);
|
|
24
|
+
}
|
|
25
|
+
else if (this.distro.familyId === 'archlinux') {
|
|
26
|
+
console.log('initramfsCfg skipped');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = initramfsCfg;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = require("../../lib/utils");
|
|
8
|
+
const utils_2 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
9
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
|
+
/**
|
|
11
|
+
* initramfs()
|
|
12
|
+
*/
|
|
13
|
+
async function initramfs() {
|
|
14
|
+
if (this.distro.familyId === 'debian') {
|
|
15
|
+
await (0, utils_1.exec)(`chroot ${this.installTarget} mkinitramfs -o ~/initrd.img-$(uname -r) ${this.toNull}`, this.echo);
|
|
16
|
+
await (0, utils_1.exec)(`chroot ${this.installTarget} mv ~/initrd.img-$(uname -r) /boot ${this.toNull}`, this.echo);
|
|
17
|
+
}
|
|
18
|
+
else if (this.distro.familyId === 'archlinux') {
|
|
19
|
+
let initrdImg = utils_2.default.initrdImg();
|
|
20
|
+
initrdImg = initrdImg.substring(initrdImg.lastIndexOf('/') + 1);
|
|
21
|
+
const cmd = `mkinitcpio -c ${path_1.default.resolve(__dirname, '../../../mkinitcpio/manjaro/mkinitcpio-install.conf')} -g ${this.installTarget}/boot/${initrdImg}`; // ${this.toNull}
|
|
22
|
+
try {
|
|
23
|
+
await (0, utils_1.exec)(cmd, utils_2.default.setEcho(true));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
await utils_2.default.pressKeyToExit(cmd);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = initramfs;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
8
|
+
/**
|
|
9
|
+
* locale
|
|
10
|
+
*/
|
|
11
|
+
async function locale() {
|
|
12
|
+
/**
|
|
13
|
+
* influcence: - /etc/default/locale
|
|
14
|
+
* - /etc/locale.conf
|
|
15
|
+
* - /etc/timezone
|
|
16
|
+
*/
|
|
17
|
+
let defaultLocale = 'en_US.UTF-8';
|
|
18
|
+
// /etc/default/locale
|
|
19
|
+
let file = this.installTarget + '/etc/default/locale';
|
|
20
|
+
let content = ``;
|
|
21
|
+
content += `LANG=${defaultLocale}\n`;
|
|
22
|
+
content += `LC_CTYPE=${defaultLocale}\n`;
|
|
23
|
+
content += `LC_NUMERIC=${defaultLocale}\n`;
|
|
24
|
+
content += `LC_TIME=${defaultLocale}\n`;
|
|
25
|
+
content += `LC_COLLATE=${defaultLocale}\n`;
|
|
26
|
+
content += `LC_MONETARY=${defaultLocale}\n`;
|
|
27
|
+
content += `LC_MESSAGES=${defaultLocale}\n`;
|
|
28
|
+
content += `LC_PAPER=${defaultLocale}\n`;
|
|
29
|
+
content += `LC_NAME=${defaultLocale}\n`;
|
|
30
|
+
content += `LC_ADDRESS=${defaultLocale}\n`;
|
|
31
|
+
content += `LC_TELEPHONE=${defaultLocale}\n`;
|
|
32
|
+
content += `LC_MEASUREMENT=${defaultLocale}\n`;
|
|
33
|
+
content += `LC_IDENTIFICATION=${defaultLocale}\n`;
|
|
34
|
+
content += `LC_ALL=${defaultLocale}\n`;
|
|
35
|
+
utils_1.default.write(file, content);
|
|
36
|
+
// /etc/locale.conf
|
|
37
|
+
file = this.installTarget + '/etc/locale.conf';
|
|
38
|
+
utils_1.default.write(file, content);
|
|
39
|
+
// timezone
|
|
40
|
+
try {
|
|
41
|
+
await this.setTimezone();
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = locale;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
/* localeCfg
|
|
9
|
+
* Enable the configured locales (those set by the user on the
|
|
10
|
+
* user page) in /etc/locale.gen, if they are available in the
|
|
11
|
+
* target system.
|
|
12
|
+
*/
|
|
13
|
+
async function localeCfg() {
|
|
14
|
+
/**
|
|
15
|
+
* influence: - locale-gen
|
|
16
|
+
*/
|
|
17
|
+
let supporteds = [];
|
|
18
|
+
if (this.distro.familyId === 'debian') {
|
|
19
|
+
// Format: en_US.UTF-8 UTF-8
|
|
20
|
+
supporteds = fs_1.default.readFileSync('/usr/share/i18n/SUPPORTED', 'utf-8').split('\n');
|
|
21
|
+
}
|
|
22
|
+
else if (this.distro.familyId === 'archlinux') {
|
|
23
|
+
// shx.exec('localectl list-locales > /tmp/SUPPORTED') // with await exec don't work!
|
|
24
|
+
const supportedsSource = fs_1.default.readFileSync('/etc/locale.gen', 'utf-8').split('\n');
|
|
25
|
+
// Original Format: #en_US.UTF-8 UTF-8
|
|
26
|
+
for (let line of supportedsSource) {
|
|
27
|
+
if (line.substring(0, 2) !== "# ") { // se non è un commento
|
|
28
|
+
line = line.substring(1); // Rimuove #
|
|
29
|
+
}
|
|
30
|
+
supporteds.push(line);
|
|
31
|
+
}
|
|
32
|
+
// Format: en_US.UTF-8 UTF-8
|
|
33
|
+
}
|
|
34
|
+
const localeGenSource = fs_1.default.readFileSync(`${this.installTarget}/etc/locale.gen`, 'utf-8').split('\n');
|
|
35
|
+
let localeGenDest = '';
|
|
36
|
+
const krillBookmark = '# Locales enabled by krill\n';
|
|
37
|
+
for (let line of localeGenSource) {
|
|
38
|
+
if (line.includes(krillBookmark)) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
localeGenDest += line + '\n';
|
|
42
|
+
}
|
|
43
|
+
localeGenDest += '\n';
|
|
44
|
+
localeGenDest += krillBookmark;
|
|
45
|
+
const locales = [this.language];
|
|
46
|
+
if (this.language !== 'en_US.UTF-8') {
|
|
47
|
+
locales.push('en_US.UTF-8');
|
|
48
|
+
}
|
|
49
|
+
for (const supported of supporteds) {
|
|
50
|
+
for (const locale of locales) {
|
|
51
|
+
if (supported.includes(locale)) {
|
|
52
|
+
localeGenDest += `${supported}\n`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
fs_1.default.writeFileSync(`${this.installTarget}/etc/locale.gen`, localeGenDest);
|
|
57
|
+
}
|
|
58
|
+
exports.default = localeCfg;
|