penguins-eggs 25.10.30 → 25.11.12
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/.oclif.manifest.json +4 -4
- package/README.md +3 -3
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
- package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
- package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
- package/addons/eggs/theme/applications/install-system.desktop +0 -0
- package/assets/calamares/install-system.sh +0 -0
- package/assets/penguins-eggs.desktop +0 -0
- package/assets/penguins-krill.desktop +0 -0
- package/assets/penguins-links-add.desktop +0 -0
- package/assets/penguins-live-installer.desktop +0 -0
- package/bin/dev.js +0 -0
- package/conf/distros/alpine/calamares/calamares-modules/machineid-openrc/machineid-openrc.sh +0 -0
- package/conf/distros/alpine/calamares/modules/packages.mustache +1 -0
- package/conf/distros/alpine/calamares/modules/removeuser.mustache +2 -14
- package/conf/distros/alpine/calamares/modules/unpackfs.mustache +2 -2
- package/conf/distros/archlinux/calamares/modules/bootloader.yml +1 -1
- package/conf/distros/archlinux/calamares/modules/partition.yml +385 -8
- package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/buster/calamares/modules/shellprocess@boot_deploy.yml +1 -16
- package/conf/distros/fedora/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
- package/conf/distros/noble/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/noble/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-aptsources.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-l10n-helper.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-logs-helper.sh +1 -1
- package/conf/distros/noble/calamares/libexec/calamares-nomodeset.sh +0 -0
- package/conf/distros/noble/calamares/modules/shellprocess@boot_deploy.yml +1 -11
- package/conf/distros/noble/calamares/modules/shellprocess@logs.yml +1 -1
- package/conf/distros/opensuse/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
- package/conf/distros/opensuse/calamares/settings.yml +0 -0
- package/conf/distros/opensuse/calamares/zstd2lzo.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/trixie/calamares/modules/shellprocess@boot_deploy.yml +2 -10
- package/conf/init/unattended.sh +0 -0
- package/dist/classes/cli-autologin.d.ts +1 -39
- package/dist/classes/cli-autologin.js +85 -110
- package/dist/classes/daddy.d.ts +30 -12
- package/dist/classes/daddy.js +166 -137
- package/dist/classes/distro.js +11 -27
- package/dist/classes/diversions.d.ts +3 -37
- package/dist/classes/diversions.js +72 -103
- package/dist/classes/incubation/customize/customize-partitions.js +8 -1
- package/dist/classes/incubation/fisherman-helper/packages.js +1 -1
- package/dist/classes/incubation/fisherman.d.ts +5 -0
- package/dist/classes/incubation/fisherman.js +21 -1
- package/dist/classes/incubation/incubator.d/noble.js +6 -2
- package/dist/classes/incubation/incubator.js +4 -5
- package/dist/classes/keyboards.d.ts +11 -30
- package/dist/classes/keyboards.js +100 -251
- package/dist/classes/ovary.d/initrd.js +2 -7
- package/dist/classes/pacman.d/archlinux.js +5 -5
- package/dist/classes/pacman.d/debian.js +0 -2
- package/dist/classes/pacman.d/opensuse.js +2 -2
- package/dist/classes/pacman.js +7 -9
- package/dist/commands/tools/repo.js +198 -31
- package/dist/krill/classes/sequence.d/unpackfs.js +3 -2
- package/dracut/create-symlink +0 -0
- package/dracut/export +0 -0
- package/dracut/export-dracut-analysis +0 -0
- package/dracut/export-dracut-log +0 -0
- package/dracut/mkisofs +0 -0
- package/dracut/modules.d/00debug-shell/debug-hook.sh +0 -0
- package/dracut/modules.d/00debug-shell/module-setup.sh +0 -0
- package/dracut/modules.d/90block/block-cmdline.sh +0 -0
- package/dracut/modules.d/90block/module-setup.sh +0 -0
- package/dracut/modules.d/95iso-scan/iso-scan-fallback.sh +0 -0
- package/dracut/modules.d/95iso-scan/iso-scan.sh +0 -0
- package/dracut/modules.d/95iso-scan/module-setup.sh +0 -0
- package/dracut/modules.d/95luks-loop/luks-loop.sh +0 -0
- package/dracut/modules.d/95luks-loop/module-setup.sh +0 -0
- package/dracut/renew-initramfs +0 -0
- package/dracut/sbin2bin +0 -0
- package/dracut/update-dracut-conf-d +0 -0
- package/dracut/update-dracut-modules +0 -0
- package/eui/eui-autostart-cinnamon.desktop +0 -0
- package/eui/eui-autostart-xfce.desktop +0 -0
- package/eui/eui-create-image.sh +0 -0
- package/eui/eui-start.sh +0 -0
- package/package.json +130 -124
- package/perrisbrewery/scripts/postinst +0 -0
- package/perrisbrewery/scripts/postrm +0 -0
- package/perrisbrewery/scripts/preinst +0 -0
- package/perrisbrewery/scripts/prerm +0 -0
- package/perrisbrewery/template/dependencies.yaml +7 -6
- package/scripts/99clean +0 -0
- package/scripts/adapt.sh +0 -0
- package/scripts/boot-encrypted-root.sh +0 -0
- package/scripts/bros/waydroid-helper.sh +0 -0
- package/scripts/lsb_release +0 -0
- package/scripts/mom.sh +0 -0
- package/scripts/mount-encrypted-home.sh +0 -0
- package/scripts/pve-live.service +0 -0
- package/scripts/pve-live.sh +0 -0
- package/scripts/resy +0 -0
- package/conf/distros/focal/calamares/calamares-modules/.keepit +0 -0
- package/conf/distros/focal/calamares/calamares-modules/cleanup/cleanup.sh +0 -20
- package/conf/distros/focal/calamares/calamares-modules/cleanup/module.yml +0 -9
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk/module.yml +0 -8
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -50
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk-undo/module.yml +0 -8
- package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +0 -19
- package/conf/distros/focal/calamares/modules/automirror.yml +0 -6
- package/conf/distros/focal/calamares/modules/before_bootloader_context.yml +0 -19
- package/conf/distros/focal/calamares/modules/before_bootloader_mkdirs_context.yml +0 -11
- package/conf/distros/focal/calamares/modules/bootloader.yml +0 -34
- package/conf/distros/focal/calamares/modules/displaymanager.yml +0 -12
- package/conf/distros/focal/calamares/modules/finished.yml +0 -4
- package/conf/distros/focal/calamares/modules/fstab.yml +0 -13
- package/conf/distros/focal/calamares/modules/grubcfg.yml +0 -5
- package/conf/distros/focal/calamares/modules/locale.yml +0 -9
- package/conf/distros/focal/calamares/modules/machineid.yml +0 -9
- package/conf/distros/focal/calamares/modules/mount.yml +0 -41
- package/conf/distros/focal/calamares/modules/packages.mustache +0 -5
- package/conf/distros/focal/calamares/modules/partition.yml +0 -10
- package/conf/distros/focal/calamares/modules/removeuser.mustache +0 -3
- package/conf/distros/focal/calamares/modules/shellprocess_add386arch.yml +0 -6
- package/conf/distros/focal/calamares/modules/shellprocess_bug-LP#1829805.yml +0 -5
- package/conf/distros/focal/calamares/modules/shellprocess_logs.yml +0 -6
- package/conf/distros/focal/calamares/modules/unpackfs.mustache +0 -6
- package/conf/distros/focal/calamares/modules/users.yml +0 -19
- package/conf/distros/focal/calamares/modules/welcome.yml +0 -26
- package/conf/distros/focal/calamares/settings.yml +0 -72
- package/dist/classes/incubation/incubator.d/bionic.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/bionic.js +0 -83
- package/dist/classes/incubation/incubator.d/focal.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/focal.js +0 -85
|
@@ -1,287 +1,136 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ./src/classes/keyboards.ts
|
|
3
3
|
* penguins-eggs v.25.7.x / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
4
|
+
* author: Piero Proietti (modified)
|
|
5
5
|
* email: piero.proietti@gmail.com
|
|
6
6
|
* license: MIT
|
|
7
7
|
*/
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import { exec } from '../lib/utils.js';
|
|
10
|
-
// XkbModel - name of the model of your keyboard type
|
|
11
|
-
// XkbLayout - layout(s) you intend to use
|
|
12
|
-
// XkbVariant - variant(s) of the layout you intend to use
|
|
13
|
-
// XkbOptions - extra xkb configuration options
|
|
14
10
|
/**
|
|
15
|
-
*
|
|
11
|
+
* Keyboard class - reads and manages X11 keyboard configuration
|
|
16
12
|
*/
|
|
17
13
|
export default class Keyboard {
|
|
18
|
-
layouts = [];
|
|
19
|
-
models = [];
|
|
20
|
-
options = [];
|
|
21
|
-
variants = [];
|
|
14
|
+
layouts = []; // New change #1: store typed objects instead of raw strings
|
|
15
|
+
models = []; // New change #1
|
|
16
|
+
options = []; // New change #1
|
|
17
|
+
variants = []; // New change #1
|
|
18
|
+
defaultKeyboardFile = '/etc/default/keyboard'; // New change #2: store default keyboard file path
|
|
19
|
+
xorgLstFile = '/usr/share/X11/xkb/rules/xorg.lst';
|
|
22
20
|
constructor() {
|
|
23
|
-
|
|
24
|
-
if (fs.existsSync(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
let isModel = false;
|
|
28
|
-
let isLayout = false;
|
|
29
|
-
let isVariant = false;
|
|
30
|
-
let isOption = false;
|
|
31
|
-
for (let i = 0; i < lenght; i++) {
|
|
32
|
-
if (lines[i].slice(0, 1) === '!') {
|
|
33
|
-
switch (lines[i]) {
|
|
34
|
-
case '! model': {
|
|
35
|
-
isModel = true;
|
|
36
|
-
isLayout = false;
|
|
37
|
-
isVariant = false;
|
|
38
|
-
isOption = false;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
case '! layout': {
|
|
42
|
-
isModel = false;
|
|
43
|
-
isLayout = true;
|
|
44
|
-
isVariant = false;
|
|
45
|
-
isOption = false;
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case '! variant': {
|
|
49
|
-
isModel = false;
|
|
50
|
-
isLayout = false;
|
|
51
|
-
isVariant = true;
|
|
52
|
-
isOption = false;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case '! option': {
|
|
56
|
-
isModel = false;
|
|
57
|
-
isLayout = false;
|
|
58
|
-
isVariant = false;
|
|
59
|
-
isOption = true;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
// No default
|
|
63
|
-
}
|
|
64
|
-
i++;
|
|
65
|
-
}
|
|
66
|
-
if (isModel) {
|
|
67
|
-
this.models.push(lines[i].trim());
|
|
68
|
-
}
|
|
69
|
-
else if (isLayout) {
|
|
70
|
-
this.layouts.push(lines[i].trim());
|
|
71
|
-
}
|
|
72
|
-
else if (isVariant) {
|
|
73
|
-
this.variants.push(lines[i].trim());
|
|
74
|
-
}
|
|
75
|
-
else if (isOption) {
|
|
76
|
-
this.options.push(lines[i].trim());
|
|
77
|
-
}
|
|
78
|
-
}
|
|
21
|
+
// New change #3: Use a safer approach to read xorg.lst
|
|
22
|
+
if (fs.existsSync(this.xorgLstFile)) {
|
|
23
|
+
const content = fs.readFileSync(this.xorgLstFile, 'utf8');
|
|
24
|
+
this.parseXorgLst(content);
|
|
79
25
|
}
|
|
80
26
|
else {
|
|
81
|
-
this.
|
|
82
|
-
this.layouts = [
|
|
83
|
-
'af',
|
|
84
|
-
'al',
|
|
85
|
-
'am',
|
|
86
|
-
'ara',
|
|
87
|
-
'at',
|
|
88
|
-
'az',
|
|
89
|
-
'ba',
|
|
90
|
-
'bd',
|
|
91
|
-
'be',
|
|
92
|
-
'bg',
|
|
93
|
-
'br',
|
|
94
|
-
'brai',
|
|
95
|
-
'by',
|
|
96
|
-
'ca',
|
|
97
|
-
'ch',
|
|
98
|
-
'cm',
|
|
99
|
-
'cn',
|
|
100
|
-
'cz',
|
|
101
|
-
'de',
|
|
102
|
-
'dk',
|
|
103
|
-
'dz',
|
|
104
|
-
'ee',
|
|
105
|
-
'epo',
|
|
106
|
-
'fr',
|
|
107
|
-
'gb',
|
|
108
|
-
'ge',
|
|
109
|
-
'gh',
|
|
110
|
-
'gr',
|
|
111
|
-
'hr',
|
|
112
|
-
'hu',
|
|
113
|
-
'id',
|
|
114
|
-
'ie',
|
|
115
|
-
'il',
|
|
116
|
-
'in',
|
|
117
|
-
'iq',
|
|
118
|
-
'ir',
|
|
119
|
-
'is',
|
|
120
|
-
'it',
|
|
121
|
-
'jp',
|
|
122
|
-
'ke',
|
|
123
|
-
'kg',
|
|
124
|
-
'kr',
|
|
125
|
-
'kz',
|
|
126
|
-
'la',
|
|
127
|
-
'latam',
|
|
128
|
-
'lk',
|
|
129
|
-
'lt',
|
|
130
|
-
'lv',
|
|
131
|
-
'ma',
|
|
132
|
-
'md',
|
|
133
|
-
'me',
|
|
134
|
-
'mk',
|
|
135
|
-
'ml',
|
|
136
|
-
'mm',
|
|
137
|
-
'mt',
|
|
138
|
-
'my',
|
|
139
|
-
'ng',
|
|
140
|
-
'nl',
|
|
141
|
-
'no',
|
|
142
|
-
'nz',
|
|
143
|
-
'ph',
|
|
144
|
-
'pk',
|
|
145
|
-
'pl',
|
|
146
|
-
'pt',
|
|
147
|
-
'ro',
|
|
148
|
-
'rs',
|
|
149
|
-
'ru',
|
|
150
|
-
'se',
|
|
151
|
-
'si',
|
|
152
|
-
'sk',
|
|
153
|
-
'sy',
|
|
154
|
-
'th',
|
|
155
|
-
'tj',
|
|
156
|
-
'tw',
|
|
157
|
-
'ua',
|
|
158
|
-
'us',
|
|
159
|
-
'uz',
|
|
160
|
-
'vn'
|
|
161
|
-
];
|
|
162
|
-
this.variants.push('none');
|
|
163
|
-
this.options.push('none');
|
|
27
|
+
this.setDefaults();
|
|
164
28
|
}
|
|
165
29
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
30
|
+
// New change #4: parse xorg.lst with regex instead of fixed slicing
|
|
31
|
+
parseXorgLst(content) {
|
|
32
|
+
const sections = ['model', 'layout', 'variant', 'option'];
|
|
33
|
+
let currentSection = null;
|
|
34
|
+
content.split('\n').forEach(line => {
|
|
35
|
+
line = line.trim();
|
|
36
|
+
if (!line)
|
|
37
|
+
return;
|
|
38
|
+
if (line.startsWith('!')) {
|
|
39
|
+
const sectionName = line.slice(2).toLowerCase();
|
|
40
|
+
if (sections.includes(sectionName)) {
|
|
41
|
+
currentSection = sectionName;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
currentSection = null;
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!currentSection)
|
|
49
|
+
return;
|
|
50
|
+
// Separate code and description with regex
|
|
51
|
+
const match = line.match(/^(\S+)\s+(.*)$/);
|
|
52
|
+
if (!match)
|
|
53
|
+
return;
|
|
54
|
+
const [_, code, description] = match;
|
|
55
|
+
const desc = description || '';
|
|
56
|
+
switch (currentSection) {
|
|
57
|
+
case 'model':
|
|
58
|
+
this.models.push({ code, description: desc });
|
|
59
|
+
break;
|
|
60
|
+
case 'layout':
|
|
61
|
+
this.layouts.push({ code, description: desc });
|
|
62
|
+
break;
|
|
63
|
+
case 'variant':
|
|
64
|
+
// Extract language if possible
|
|
65
|
+
const langMatch = desc.match(/^(\S+):\s*(.*)$/);
|
|
66
|
+
this.variants.push({
|
|
67
|
+
code,
|
|
68
|
+
lang: langMatch ? langMatch[1] : '',
|
|
69
|
+
description: langMatch ? langMatch[2] : desc
|
|
70
|
+
});
|
|
71
|
+
break;
|
|
72
|
+
case 'option':
|
|
73
|
+
this.options.push({ code, description: desc });
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// New change #5: set default keyboard data if xorg.lst not found
|
|
79
|
+
setDefaults() {
|
|
80
|
+
this.models.push({ code: 'pc105', description: 'Generic 105-key PC' });
|
|
81
|
+
const defaultLayouts = ['us', 'fr', 'de', 'gb', 'es', 'it', 'ru', 'jp']; // shortened for example
|
|
82
|
+
defaultLayouts.forEach(l => this.layouts.push({ code: l, description: '' }));
|
|
83
|
+
this.variants.push({ code: 'none', lang: '', description: 'none' });
|
|
84
|
+
this.options.push({ code: 'none', description: 'none' });
|
|
85
|
+
}
|
|
86
|
+
// New change #6: read keyboard configuration from file safely
|
|
87
|
+
async readKeyboardConfig(variable) {
|
|
88
|
+
if (!fs.existsSync(this.defaultKeyboardFile))
|
|
89
|
+
return '';
|
|
90
|
+
try {
|
|
91
|
+
const cmd = `grep ^${variable}= ${this.defaultKeyboardFile} | cut -d= -f2 | tr -d '"'`;
|
|
174
92
|
const result = await exec(cmd, { capture: true, echo: false, ignore: false });
|
|
175
93
|
if (result.code === 0) {
|
|
176
|
-
|
|
94
|
+
return result.data.trim();
|
|
177
95
|
}
|
|
96
|
+
return '';
|
|
178
97
|
}
|
|
179
|
-
|
|
98
|
+
catch {
|
|
99
|
+
return '';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Get current layout
|
|
103
|
+
async getLayout() {
|
|
104
|
+
const layout = await this.readKeyboardConfig('XKBLAYOUT');
|
|
105
|
+
return layout || 'us';
|
|
180
106
|
}
|
|
181
|
-
|
|
182
|
-
* XKBLAYOUT=[]
|
|
183
|
-
*/
|
|
107
|
+
// Get all layouts
|
|
184
108
|
getLayouts() {
|
|
185
|
-
|
|
186
|
-
for (const layout of this.layouts) {
|
|
187
|
-
const l = {};
|
|
188
|
-
l.code = layout.slice(0, 15).trim();
|
|
189
|
-
l.description = layout.slice(16);
|
|
190
|
-
oLayouts.push(l);
|
|
191
|
-
}
|
|
192
|
-
return oLayouts;
|
|
109
|
+
return this.layouts;
|
|
193
110
|
}
|
|
194
|
-
|
|
195
|
-
* XKBMODEL='pc105'
|
|
196
|
-
*/
|
|
111
|
+
// Get current model
|
|
197
112
|
async getModel() {
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
let keyboardModel = 'pc105';
|
|
201
|
-
if (fs.existsSync(file)) {
|
|
202
|
-
const result = await exec(cmd, { capture: true, echo: false, ignore: false });
|
|
203
|
-
if (result.code === 0) {
|
|
204
|
-
keyboardModel = result.data.trim();
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return keyboardModel;
|
|
113
|
+
const model = await this.readKeyboardConfig('XKBMODEL');
|
|
114
|
+
return model || 'pc105';
|
|
208
115
|
}
|
|
209
|
-
|
|
210
|
-
* XKBMODEL[]
|
|
211
|
-
*/
|
|
116
|
+
// Get all models
|
|
212
117
|
getModels() {
|
|
213
|
-
|
|
214
|
-
// pc101 Generic 101-key PC
|
|
215
|
-
const oModels = [];
|
|
216
|
-
for (const model of this.models) {
|
|
217
|
-
const m = {};
|
|
218
|
-
m.code = model.slice(0, 15).trim();
|
|
219
|
-
m.description = model.slice(16);
|
|
220
|
-
oModels.push(m);
|
|
221
|
-
}
|
|
222
|
-
return oModels;
|
|
118
|
+
return this.models;
|
|
223
119
|
}
|
|
224
|
-
|
|
225
|
-
* XKBOPTIONS=''
|
|
226
|
-
*/
|
|
120
|
+
// Get current option
|
|
227
121
|
async getOption() {
|
|
228
|
-
|
|
229
|
-
const cmd = `grep XKBOPTIONS < ${file} | cut -f2 -d= | cut -f2 "-d\\""`;
|
|
230
|
-
let keyboardOption = '';
|
|
231
|
-
if (fs.existsSync(file)) {
|
|
232
|
-
const result = await exec(cmd, { capture: true, echo: false, ignore: false });
|
|
233
|
-
if (result.code === 0) {
|
|
234
|
-
keyboardOption = result.data.trim();
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return keyboardOption;
|
|
122
|
+
return await this.readKeyboardConfig('XKBOPTIONS');
|
|
238
123
|
}
|
|
239
|
-
|
|
240
|
-
* XKBOPTIONS[]
|
|
241
|
-
*/
|
|
124
|
+
// Get all options
|
|
242
125
|
getOptions() {
|
|
243
|
-
|
|
244
|
-
// grp:switch Right Alt (while pressed)
|
|
245
|
-
const aoOptions = [];
|
|
246
|
-
for (const option of this.options) {
|
|
247
|
-
const o = {};
|
|
248
|
-
o.code = option.slice(0, 15).trim();
|
|
249
|
-
o.description = option.slice(21);
|
|
250
|
-
aoOptions.push(o);
|
|
251
|
-
}
|
|
252
|
-
return aoOptions;
|
|
126
|
+
return this.options;
|
|
253
127
|
}
|
|
254
|
-
|
|
255
|
-
* XKBVARIANT=''
|
|
256
|
-
*/
|
|
128
|
+
// Get current variant
|
|
257
129
|
async getVariant() {
|
|
258
|
-
|
|
259
|
-
const cmd = `grep XKBVARIANT < ${file} | cut -f2 -d=|cut -f2 "-d\\""`;
|
|
260
|
-
let keyboardVariant = '';
|
|
261
|
-
if (fs.existsSync(file)) {
|
|
262
|
-
const result = await exec(cmd, { capture: true, echo: false, ignore: false });
|
|
263
|
-
if (result.code === 0) {
|
|
264
|
-
keyboardVariant = result.data.trim();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return keyboardVariant;
|
|
130
|
+
return await this.readKeyboardConfig('XKBVARIANT');
|
|
268
131
|
}
|
|
269
|
-
|
|
270
|
-
* IXkbVariant[]
|
|
271
|
-
*/
|
|
132
|
+
// Get variants for a specific layout
|
|
272
133
|
getVariants(layout) {
|
|
273
|
-
|
|
274
|
-
// chr us: Cherokee
|
|
275
|
-
const aoVariants = [];
|
|
276
|
-
for (const variant of this.variants) {
|
|
277
|
-
const v = {};
|
|
278
|
-
v.code = variant.slice(0, 15).trim();
|
|
279
|
-
v.lang = variant.substring(16, variant.indexOf(':')).trim();
|
|
280
|
-
v.description = variant.slice(Math.max(0, variant.indexOf(':')));
|
|
281
|
-
if (v.lang === layout) {
|
|
282
|
-
aoVariants.push(v);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return aoVariants;
|
|
134
|
+
return this.variants.filter(v => v.lang === layout);
|
|
286
135
|
}
|
|
287
136
|
}
|
|
@@ -73,7 +73,6 @@ export async function initrdDebian(verbose = false) {
|
|
|
73
73
|
const prefix = this.settings.config.snapshot_prefix;
|
|
74
74
|
const destFinal = `${this.settings.iso_work}live/${path.basename(this.initrd)}`;
|
|
75
75
|
const log = `> ${this.settings.iso_work}${prefix}mkinitramfs.log.txt 2>&1`;
|
|
76
|
-
const target = path.join(this.dotMnt, 'filesystem.squashfs');
|
|
77
76
|
const cmd = `mkinitramfs -v -o ${destFinal} ${this.kernel} ${log}`;
|
|
78
77
|
await exec(cmd, this.echo);
|
|
79
78
|
}
|
|
@@ -83,14 +82,10 @@ export async function initrdDebian(verbose = false) {
|
|
|
83
82
|
export async function initrdDracut() {
|
|
84
83
|
Utils.warning(`creating ${path.basename(this.initrd)} using dracut on (ISO)/live`);
|
|
85
84
|
const prefix = this.settings.config.snapshot_prefix;
|
|
85
|
+
const destFinal = `${this.settings.iso_work}live/${path.basename(this.initrd)}`;
|
|
86
86
|
const log = `> ${this.settings.iso_work}${prefix}dracut.log.txt 2>&1`;
|
|
87
87
|
const confdir = '--confdir ' + path.resolve(__dirname, `../../../dracut/dracut.conf.d`);
|
|
88
88
|
const kmoddir = `--kmoddir /lib/modules/${this.kernel}`;
|
|
89
|
-
const
|
|
90
|
-
const cmd = `dracut --force ${confdir} ${kmoddir} ${initramfs} ${this.kernel} ${log}`;
|
|
91
|
-
console.log(cmd);
|
|
89
|
+
const cmd = `dracut --force -v ${confdir} ${kmoddir} ${destFinal} ${this.kernel} ${log}`;
|
|
92
90
|
await exec(cmd, this.echo);
|
|
93
|
-
// clean per btrfs
|
|
94
|
-
let clean = `../../../scripts/99clean ${this.kernel}`;
|
|
95
|
-
await exec(clean, this.echo);
|
|
96
91
|
}
|
|
@@ -14,19 +14,19 @@ import Utils from '../utils.js';
|
|
|
14
14
|
* @remarks all the utilities
|
|
15
15
|
*/
|
|
16
16
|
export default class Archlinux {
|
|
17
|
-
static packs4calamares = ['calamares
|
|
17
|
+
static packs4calamares = ['calamares']; // , 'calamares']
|
|
18
18
|
/**
|
|
19
19
|
* Archlinux: calamaresInstall
|
|
20
20
|
*/
|
|
21
21
|
static async calamaresInstall(verbose = false) {
|
|
22
22
|
verbose = true; // serve per pacman
|
|
23
23
|
const echo = Utils.setEcho(verbose);
|
|
24
|
-
let cmd = `pacman -S calamares
|
|
24
|
+
let cmd = `pacman -S calamares --noconfirm`;
|
|
25
25
|
try {
|
|
26
26
|
await exec(cmd, echo);
|
|
27
27
|
}
|
|
28
28
|
catch {
|
|
29
|
-
Utils.error(`Cannot install calamares
|
|
29
|
+
Utils.error(`Cannot install calamares`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -44,11 +44,11 @@ export default class Archlinux {
|
|
|
44
44
|
let success = false;
|
|
45
45
|
const echo = Utils.setEcho(verbose);
|
|
46
46
|
try {
|
|
47
|
-
await exec('pacman -R calamares calamares
|
|
47
|
+
await exec('pacman -R calamares calamares --noconfirm', echo);
|
|
48
48
|
success = true;
|
|
49
49
|
}
|
|
50
50
|
catch {
|
|
51
|
-
Utils.error(`Cannot remove calamares
|
|
51
|
+
Utils.error(`Cannot remove calamares`);
|
|
52
52
|
}
|
|
53
53
|
if (success && fs.existsSync('/etc/calamares')) {
|
|
54
54
|
await exec('rm /etc/calamares -rf', echo);
|
|
@@ -34,8 +34,6 @@ export default class Debian {
|
|
|
34
34
|
Utils.error(`Debian.calamaresInstall() apt-get install --yes ${array2spaced(this.debs4calamares)}`); // + e.error)
|
|
35
35
|
}
|
|
36
36
|
// remove others calamares links
|
|
37
|
-
await exec('rm -f /usr/share/applications/calamares-eggs-debugging.desktop');
|
|
38
|
-
await exec('rm -f /usr/share/applications/calamares-eggs.desktop');
|
|
39
37
|
await exec('rm -f /usr/share/applications/calamares.desktop');
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
@@ -42,11 +42,11 @@ export default class Opensuse {
|
|
|
42
42
|
let success = false;
|
|
43
43
|
const echo = Utils.setEcho(verbose);
|
|
44
44
|
try {
|
|
45
|
-
await exec('zypper remove -y calamares calamares
|
|
45
|
+
await exec('zypper remove -y calamares calamares', echo);
|
|
46
46
|
success = true;
|
|
47
47
|
}
|
|
48
48
|
catch {
|
|
49
|
-
Utils.error(`Cannot remove calamares
|
|
49
|
+
Utils.error(`Cannot remove calamares`);
|
|
50
50
|
}
|
|
51
51
|
if (success && fs.existsSync('/etc/calamares')) {
|
|
52
52
|
await exec('rm /etc/calamares -rf', echo);
|
package/dist/classes/pacman.js
CHANGED
|
@@ -417,23 +417,21 @@ export default class Pacman {
|
|
|
417
417
|
* Ubuntu
|
|
418
418
|
**********************************************************************************/
|
|
419
419
|
/**
|
|
420
|
-
* Ubuntu focal: eredita da
|
|
420
|
+
* Ubuntu focal: eredita da noble
|
|
421
421
|
*/
|
|
422
422
|
}
|
|
423
423
|
else if (distroUniqueId === 'focal') {
|
|
424
424
|
const dest = '/etc/penguins-eggs.d/distros/focal';
|
|
425
|
-
const
|
|
426
|
-
await exec(`cp -r ${
|
|
427
|
-
await exec(`cp ${focal}/calamares/modules/focal-jammy/* ${dest}/calamares/modules/`, echo);
|
|
425
|
+
const noble = `${rootPen}/conf/distros/noble`;
|
|
426
|
+
await exec(`cp -r ${noble}/* ${dest}`, echo);
|
|
428
427
|
/**
|
|
429
|
-
* Ubuntu 22.04 jammy: eredita da
|
|
428
|
+
* Ubuntu 22.04 jammy: eredita da noble
|
|
430
429
|
*/
|
|
431
430
|
}
|
|
432
431
|
else if (distroUniqueId === 'jammy') {
|
|
433
432
|
const dest = '/etc/penguins-eggs.d/distros/jammy';
|
|
434
|
-
const
|
|
435
|
-
await exec(`cp -r ${
|
|
436
|
-
await exec(`cp ${focal}/calamares/modules/focal-jammy/* ${dest}/calamares/modules/`, echo);
|
|
433
|
+
const noble = `${rootPen}/conf/distros/noble`;
|
|
434
|
+
await exec(`cp -r ${noble}/* ${dest}`, echo);
|
|
437
435
|
/**
|
|
438
436
|
* Ubuntu noble: e la nuova baseline per ubuntu
|
|
439
437
|
*
|
|
@@ -444,7 +442,7 @@ export default class Pacman {
|
|
|
444
442
|
const noble = `${rootPen}/conf/distros/noble`;
|
|
445
443
|
await exec(`cp -r ${noble}/* ${dest}`, echo);
|
|
446
444
|
/**
|
|
447
|
-
* Ubuntu rhino:
|
|
445
|
+
* Ubuntu rhino: devel
|
|
448
446
|
*
|
|
449
447
|
*/
|
|
450
448
|
}
|