penguins-eggs 10.0.46 → 10.0.49
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 +1 -1
- package/README.md +27 -27
- package/conf/distros/alpine/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +13 -0
- package/conf/distros/alpine/calamares/calamares-modules/dpkg-unsafe-io/module.yml +6 -0
- package/conf/distros/alpine/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +6 -0
- package/conf/distros/alpine/calamares/calamares-modules/sources-yolk/module.yml +8 -0
- package/conf/distros/alpine/calamares/calamares-modules/sources-yolk/sources-yolk.sh +50 -0
- package/conf/distros/alpine/calamares/calamares-modules/sources-yolk-undo/module.yml +8 -0
- package/conf/distros/alpine/calamares/modules/bootloader.yml +1 -1
- package/conf/distros/alpine/calamares/modules/displaymanager.yml +2 -3
- package/conf/distros/alpine/calamares/modules/finished.yml +2 -2
- package/conf/distros/alpine/calamares/modules/fstab.yml +1 -1
- package/conf/distros/alpine/calamares/modules/locale.yml +0 -1
- package/conf/distros/alpine/calamares/modules/luksopenswaphookcfg.yml +1 -1
- package/conf/distros/alpine/calamares/modules/machineid.yml +1 -1
- package/conf/distros/alpine/calamares/modules/mount.yml +1 -1
- package/conf/distros/alpine/calamares/modules/packages.yml +2 -2
- package/conf/distros/alpine/calamares/modules/partition.yml +1 -1
- package/conf/distros/alpine/calamares/modules/removeuser.yml +2 -2
- package/conf/distros/alpine/calamares/modules/unpackfs.yml +1 -1
- package/conf/distros/alpine/calamares/modules/users.yml +1 -0
- package/conf/distros/alpine/calamares/modules/welcome.yml +1 -1
- package/conf/distros/alpine/calamares/settings.yml +81 -8
- package/conf/distros/fedora/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +13 -0
- package/conf/distros/fedora/calamares/calamares-modules/dpkg-unsafe-io/module.yml +6 -0
- package/conf/distros/fedora/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +6 -0
- package/conf/distros/fedora/calamares/calamares-modules/sources-yolk/module.yml +8 -0
- package/conf/distros/fedora/calamares/calamares-modules/sources-yolk/sources-yolk.sh +50 -0
- package/conf/distros/fedora/calamares/calamares-modules/sources-yolk-undo/module.yml +8 -0
- package/conf/distros/fedora/calamares/modules/bootloader.yml +1 -1
- package/conf/distros/fedora/calamares/modules/displaymanager.yml +2 -3
- package/conf/distros/fedora/calamares/modules/finished.yml +2 -2
- package/conf/distros/fedora/calamares/modules/fstab.yml +1 -1
- package/conf/distros/fedora/calamares/modules/locale.yml +0 -1
- package/conf/distros/fedora/calamares/modules/luksopenswaphookcfg.yml +1 -1
- package/conf/distros/fedora/calamares/modules/machineid.yml +1 -1
- package/conf/distros/fedora/calamares/modules/mount.yml +1 -1
- package/conf/distros/fedora/calamares/modules/packages.yml +2 -2
- package/conf/distros/fedora/calamares/modules/partition.yml +1 -1
- package/conf/distros/fedora/calamares/modules/removeuser.yml +2 -2
- package/conf/distros/fedora/calamares/modules/unpackfs.yml +1 -1
- package/conf/distros/fedora/calamares/modules/users.yml +1 -0
- package/conf/distros/fedora/calamares/modules/welcome.yml +1 -1
- package/conf/distros/fedora/calamares/settings.yml +81 -8
- package/conf/distros/opensuse/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +13 -0
- package/conf/distros/opensuse/calamares/calamares-modules/dpkg-unsafe-io/module.yml +6 -0
- package/conf/distros/opensuse/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +6 -0
- package/conf/distros/opensuse/calamares/calamares-modules/sources-yolk/module.yml +8 -0
- package/conf/distros/opensuse/calamares/calamares-modules/sources-yolk/sources-yolk.sh +50 -0
- package/conf/distros/opensuse/calamares/calamares-modules/sources-yolk-undo/module.yml +8 -0
- package/conf/distros/opensuse/calamares/modules/bootloader.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/displaymanager.yml +2 -3
- package/conf/distros/opensuse/calamares/modules/finished.yml +2 -2
- package/conf/distros/opensuse/calamares/modules/fstab.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/locale.yml +0 -1
- package/conf/distros/opensuse/calamares/modules/luksopenswaphookcfg.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/machineid.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/mount.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/packages.yml +2 -2
- package/conf/distros/opensuse/calamares/modules/partition.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/removeuser.yml +2 -2
- package/conf/distros/opensuse/calamares/modules/unpackfs.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/users.yml +1 -0
- package/conf/distros/opensuse/calamares/modules/welcome.yml +1 -1
- package/conf/distros/opensuse/calamares/settings.yml +81 -8
- package/conf/distros/rolling/calamares/modules/finished.yml +1 -1
- package/dist/classes/distro.js +6 -5
- package/dist/classes/incubation/fisherman.js +9 -11
- package/dist/classes/incubation/incubator.d.ts +1 -1
- package/dist/classes/incubation/incubator.js +7 -6
- package/dist/classes/ovary.js +43 -24
- package/dist/classes/tailor.d.ts +7 -0
- package/dist/classes/tailor.js +18 -18
- package/dist/classes/utils.js +1 -2
- package/dist/commands/calamares.js +5 -3
- package/dist/commands/export/pkg.js +4 -4
- package/dist/components/information.js +4 -3
- package/dist/krill/modules/bootloader.js +60 -0
- package/dist/krill/modules/machine-id.js +11 -5
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +4 -4
- package/package.json +4 -4
- package/scripts/lsb_release +97 -0
- package/syslinux/isohdpfx.bin +0 -0
|
@@ -37,7 +37,7 @@ restartNowChecked: true
|
|
|
37
37
|
# If the checkbox is shown, and the checkbox is checked, then when
|
|
38
38
|
# Calamares exits from the finished-page it will run this command.
|
|
39
39
|
# If not set, falls back to "shutdown -r now".
|
|
40
|
-
restartNowCommand:
|
|
40
|
+
restartNowCommand: none
|
|
41
41
|
|
|
42
42
|
# When the last page is (successfully) reached, send a DBus notification
|
|
43
43
|
# to the desktop that the installation is done. This works only if the
|
package/dist/classes/distro.js
CHANGED
|
@@ -55,9 +55,9 @@ class Distro {
|
|
|
55
55
|
* lsb_release -is per distribuzione
|
|
56
56
|
* lsb_release -rs per release
|
|
57
57
|
*/
|
|
58
|
-
this.codenameId = shell.exec(
|
|
59
|
-
this.releaseId = shell.exec(
|
|
60
|
-
this.distroId = shell.exec(
|
|
58
|
+
this.codenameId = shell.exec(`lsb_release -cs`, { silent: true }).stdout.toString().trim();
|
|
59
|
+
this.releaseId = shell.exec(`lsb_release -rs`, { silent: true }).stdout.toString().trim();
|
|
60
|
+
this.distroId = shell.exec(`lsb_release -is`, { silent: true }).stdout.toString().trim();
|
|
61
61
|
if (this.distroId === 'Debian' && this.codenameId === 'sid') {
|
|
62
62
|
this.codenameId = 'trixie';
|
|
63
63
|
}
|
|
@@ -85,10 +85,11 @@ class Distro {
|
|
|
85
85
|
/**
|
|
86
86
|
* Fedora compatible
|
|
87
87
|
*/
|
|
88
|
-
case '
|
|
88
|
+
case 'AlmaLinux':
|
|
89
|
+
case 'RockyLinux':
|
|
89
90
|
case 'Fedora': {
|
|
90
91
|
this.familyId = 'fedora';
|
|
91
|
-
this.distroLike =
|
|
92
|
+
this.distroLike = 'Fedora';
|
|
92
93
|
this.codenameId = 'rolling'; // viene rimosso dal nome
|
|
93
94
|
this.codenameLikeId = this.familyId; // per krill
|
|
94
95
|
this.liveMediumPath = '/run/initramfs/live/';
|
|
@@ -19,9 +19,6 @@ const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
|
19
19
|
import { createRequire } from 'node:module';
|
|
20
20
|
const require = createRequire(import.meta.url);
|
|
21
21
|
const pjson = require('../../../package.json');
|
|
22
|
-
/**
|
|
23
|
-
* vecchi require che vanno sostituiti con import
|
|
24
|
-
*/
|
|
25
22
|
import { displaymanager } from './fisherman-helper/displaymanager.js';
|
|
26
23
|
import { remove as removePackages, tryInstall } from './fisherman-helper/packages.js';
|
|
27
24
|
export default class Fisherman {
|
|
@@ -207,13 +204,13 @@ export default class Fisherman {
|
|
|
207
204
|
const name = 'displaymanager';
|
|
208
205
|
// const displaymanager = require('./fisherman-helper/displaymanager').displaymanager
|
|
209
206
|
this.buildModule(name);
|
|
210
|
-
let file =
|
|
207
|
+
let file = this.installer.modules + name + '.conf';
|
|
211
208
|
let fileContent = fs.readFileSync(file, 'utf8');
|
|
212
|
-
let
|
|
213
|
-
|
|
209
|
+
let values = yaml.load(fileContent);
|
|
210
|
+
values.displaymanagers = displaymanager();
|
|
214
211
|
let destContent = `# ${name}.conf, created by penguins-eggs ${pjson.version}\n`;
|
|
215
212
|
destContent += '---\n';
|
|
216
|
-
destContent += yaml.dump(
|
|
213
|
+
destContent += yaml.dump(values);
|
|
217
214
|
fs.writeFileSync(file, destContent, 'utf8');
|
|
218
215
|
}
|
|
219
216
|
/**
|
|
@@ -222,13 +219,14 @@ export default class Fisherman {
|
|
|
222
219
|
async moduleFinished() {
|
|
223
220
|
const name = 'finished';
|
|
224
221
|
await this.buildModule(name);
|
|
225
|
-
let file =
|
|
222
|
+
let file = this.installer.modules + name + '.conf';
|
|
226
223
|
let fileContent = fs.readFileSync(file, 'utf8');
|
|
227
|
-
let
|
|
228
|
-
|
|
224
|
+
let values = yaml.load(fileContent);
|
|
225
|
+
values.restartNowCommand = 'reboot';
|
|
229
226
|
let destContent = `# ${name}.conf, created by penguins-eggs ${pjson.version}\n`;
|
|
230
227
|
destContent += '---\n';
|
|
231
|
-
destContent += yaml.dump(
|
|
228
|
+
destContent += yaml.dump(values);
|
|
229
|
+
fs.writeFileSync(file, destContent, 'utf8');
|
|
232
230
|
}
|
|
233
231
|
/**
|
|
234
232
|
* Al momento rimane con la vecchia configurazione
|
|
@@ -63,6 +63,7 @@ export default class Incubator {
|
|
|
63
63
|
async config(release = false) {
|
|
64
64
|
const verbose = true;
|
|
65
65
|
const echo = Utils.setEcho(verbose);
|
|
66
|
+
Utils.warning(`creating ${installer().name} configuration files on ${installer().configRoot}`);
|
|
66
67
|
this.createInstallerDirs();
|
|
67
68
|
this.createBranding();
|
|
68
69
|
// DEBIAN
|
|
@@ -184,18 +185,18 @@ export default class Incubator {
|
|
|
184
185
|
}
|
|
185
186
|
if (Pacman.calamaresExists()) {
|
|
186
187
|
await partitionCustomize();
|
|
187
|
-
await this.compact();
|
|
188
188
|
}
|
|
189
|
+
Utils.warning(`cleanup ${installer().name} configuration files`);
|
|
190
|
+
await this.cleanup();
|
|
189
191
|
}
|
|
190
192
|
/**
|
|
191
193
|
*
|
|
192
194
|
*/
|
|
193
|
-
async
|
|
195
|
+
async cleanup() {
|
|
194
196
|
// modules
|
|
195
|
-
|
|
196
|
-
const elements = fs.readdirSync(path);
|
|
197
|
+
const elements = fs.readdirSync(this.installer.modules);
|
|
197
198
|
for (const elem of elements) {
|
|
198
|
-
let file =
|
|
199
|
+
let file = this.installer.modules + elem;
|
|
199
200
|
let fileContent = fs.readFileSync(file, 'utf8');
|
|
200
201
|
let yamlContent = yaml.load(fileContent);
|
|
201
202
|
let destContent = `# ${elem}, created by penguins-eggs ${pjson.version}\n`;
|
|
@@ -204,7 +205,7 @@ export default class Incubator {
|
|
|
204
205
|
fs.writeFileSync(file, destContent, 'utf8');
|
|
205
206
|
}
|
|
206
207
|
// settings
|
|
207
|
-
let file = '/
|
|
208
|
+
let file = this.installer.configRoot + '/settings.conf';
|
|
208
209
|
let fileContent = fs.readFileSync(file, 'utf8');
|
|
209
210
|
let yamlContent = yaml.load(fileContent);
|
|
210
211
|
let destContent = `# settings.conf, created by penguins-eggs ${pjson.version}\n`;
|
package/dist/classes/ovary.js
CHANGED
|
@@ -86,9 +86,7 @@ export default class Ovary {
|
|
|
86
86
|
console.log('Ovary: bindLiveFs');
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
90
|
-
* fs.readdirSync('/', { withFileTypes: true })
|
|
91
|
-
* viene ignorato da Node8, ma da problemi da Node10 in poi
|
|
89
|
+
* dirs = readdirsync /
|
|
92
90
|
*/
|
|
93
91
|
const dirs = fs.readdirSync('/');
|
|
94
92
|
const startLine = '#############################################################';
|
|
@@ -101,7 +99,27 @@ export default class Ovary {
|
|
|
101
99
|
cmds.push(`# host: ${os.hostname()} user: ${await Utils.getPrimaryUser()}\n`);
|
|
102
100
|
for (const dir of dirs) {
|
|
103
101
|
cmds.push(startLine);
|
|
104
|
-
|
|
102
|
+
let statDir = fs.lstatSync(`/${dir}`);
|
|
103
|
+
/**
|
|
104
|
+
* Link
|
|
105
|
+
*/
|
|
106
|
+
if (statDir.isSymbolicLink()) {
|
|
107
|
+
lnkDest = fs.readlinkSync(`/${dir}`);
|
|
108
|
+
cmds.push(`# /${dir} is a symbolic link to /${lnkDest} in the system`, '# we need just to recreate it', `# ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`, "# but we don't know if the destination exist, and I'm too lazy today. So, for now: ", titleLine);
|
|
109
|
+
if (fs.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
110
|
+
cmds.push('# SymbolicLink exist... skip');
|
|
111
|
+
}
|
|
112
|
+
else if (fs.existsSync(lnkDest)) {
|
|
113
|
+
cmds.push(`ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
cmds.push(await rexec(`cp -r /${dir} ${this.settings.work_dir.merged}`, this.verbose));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Directory
|
|
120
|
+
*/
|
|
121
|
+
}
|
|
122
|
+
else if (statDir.isDirectory()) {
|
|
105
123
|
if (dir === 'boot') {
|
|
106
124
|
cmds.push(`# /boot is copied actually`);
|
|
107
125
|
cmds.push(await rexec(`cp -r /boot ${this.settings.config.snapshot_mnt}filesystem.squashfs`, this.verbose));
|
|
@@ -112,7 +130,7 @@ export default class Ovary {
|
|
|
112
130
|
/**
|
|
113
131
|
* mergedAndOverlay creazione directory, overlay e mount rw
|
|
114
132
|
*/
|
|
115
|
-
cmds.push(`${cmd} need to be
|
|
133
|
+
cmds.push(`${cmd} need to be present, and rw`, titleLine, '# create mountpoint lower');
|
|
116
134
|
cmds.push(await makeIfNotExist(`${this.settings.work_dir.lowerdir}/${dir}`), `# first: mount /${dir} rw in ${this.settings.work_dir.lowerdir}/${dir}`);
|
|
117
135
|
cmds.push(await rexec(`mount --bind --make-slave /${dir} ${this.settings.work_dir.lowerdir}/${dir}`, this.verbose), '# now remount it ro');
|
|
118
136
|
cmds.push(await rexec(`mount -o remount,bind,ro ${this.settings.work_dir.lowerdir}/${dir}`, this.verbose), `\n# second: create mountpoint upper, work and ${this.settings.work_dir.merged} and mount ${dir}`);
|
|
@@ -138,8 +156,11 @@ export default class Ovary {
|
|
|
138
156
|
cmds.push(await makeIfNotExist(`${this.settings.work_dir.merged}/${dir}`, this.verbose), `# mount -o bind /${dir} ${this.settings.work_dir.merged}/${dir}`);
|
|
139
157
|
}
|
|
140
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* File
|
|
161
|
+
*/
|
|
141
162
|
}
|
|
142
|
-
else if (
|
|
163
|
+
else if (statDir.isFile()) {
|
|
143
164
|
cmds.push(`# /${dir} is just a file`, titleLine);
|
|
144
165
|
if (fs.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
145
166
|
cmds.push('# file exist... skip');
|
|
@@ -148,19 +169,6 @@ export default class Ovary {
|
|
|
148
169
|
cmds.push(await rexec(`cp /${dir} ${this.settings.work_dir.merged}`, this.verbose));
|
|
149
170
|
}
|
|
150
171
|
}
|
|
151
|
-
else if (fs.statSync(`/${dir}`).isSymbolicLink()) {
|
|
152
|
-
lnkDest = fs.readlinkSync(`/${dir}`);
|
|
153
|
-
cmds.push(`# /${dir} is a symbolic link to /${lnkDest} in the system`, '# we need just to recreate it', `# ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`, "# but we don't know if the destination exist, and I'm too lazy today. So, for now: ", titleLine);
|
|
154
|
-
if (fs.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
155
|
-
cmds.push('# SymbolicLink exist... skip');
|
|
156
|
-
}
|
|
157
|
-
else if (fs.existsSync(lnkDest)) {
|
|
158
|
-
cmds.push(`ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
cmds.push(await rexec(`cp -r /${dir} ${this.settings.work_dir.merged}`, this.verbose));
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
172
|
cmds.push(endLine);
|
|
165
173
|
}
|
|
166
174
|
// Utils.writeXs(`${this.settings.config.snapshot_dir}bind`, cmds)
|
|
@@ -219,7 +227,7 @@ export default class Ovary {
|
|
|
219
227
|
cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' mkdir /home/' + this.settings.config.user_opt, this.verbose));
|
|
220
228
|
// Create user using useradd
|
|
221
229
|
cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' useradd ' + this.settings.config.user_opt + ' --home-dir /home/' + this.settings.config.user_opt + ' --shell /bin/bash ', this.verbose));
|
|
222
|
-
// live password
|
|
230
|
+
// live password don't work with SELINUX
|
|
223
231
|
cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' echo ' + this.settings.config.user_opt + ':' + this.settings.config.user_opt_passwd + ' | chroot ' + this.settings.work_dir.merged + ' chpasswd', this.verbose));
|
|
224
232
|
// root password Don't work with SELINUX
|
|
225
233
|
cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' echo root:' + this.settings.config.root_passwd + ' | chroot ' + this.settings.work_dir.merged + ' chpasswd', this.verbose));
|
|
@@ -766,11 +774,13 @@ export default class Ovary {
|
|
|
766
774
|
async syslinux(theme = 'eggs') {
|
|
767
775
|
let syspath = path.resolve(__dirname, `../../syslinux`);
|
|
768
776
|
await exec(`cp ${syspath}/chain.c32 ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
777
|
+
await exec(`cp ${syspath}/isohdpfx.bin ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
778
|
+
// just fo x64 arch
|
|
779
|
+
await exec(`cp ${syspath}/isolinux.bin ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
769
780
|
await exec(`cp ${syspath}/ldlinux.c32 ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
770
781
|
await exec(`cp ${syspath}/libcom32.c32 ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
771
782
|
await exec(`cp ${syspath}/libutil.c32 ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
772
783
|
await exec(`cp ${syspath}/vesamenu.c32 ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
773
|
-
await exec(`cp ${syspath}/isolinux.bin ${this.settings.iso_work}/isolinux/`, this.echo);
|
|
774
784
|
const isolinuxThemeDest = this.settings.iso_work + 'isolinux/isolinux.theme.cfg';
|
|
775
785
|
let isolinuxThemeSrc = path.resolve(__dirname, `../../addons/${theme}/theme/livecd/isolinux.theme.cfg`);
|
|
776
786
|
if (this.theme.includes('/')) {
|
|
@@ -1298,8 +1308,17 @@ export default class Ovary {
|
|
|
1298
1308
|
if (this.verbose) {
|
|
1299
1309
|
console.log('Ovary: mergedAndOverlay');
|
|
1300
1310
|
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1311
|
+
/**
|
|
1312
|
+
* Debian: usrmerged
|
|
1313
|
+
* bin -> usr/bin
|
|
1314
|
+
* lib -> usr/lib
|
|
1315
|
+
* lib64 -> usr/lib64
|
|
1316
|
+
* sbin -> usr/sbin
|
|
1317
|
+
*
|
|
1318
|
+
* 'bin' rimossa da overlay
|
|
1319
|
+
*/
|
|
1320
|
+
// aggiunto bin per autologin su Alpine
|
|
1321
|
+
const mountDirs = ['etc', 'usr', 'var'];
|
|
1303
1322
|
let mountDir = '';
|
|
1304
1323
|
let overlay = false;
|
|
1305
1324
|
for (mountDir of mountDirs) {
|
|
@@ -1714,7 +1733,7 @@ export default class Ovary {
|
|
|
1714
1733
|
// const preparer = '-preparer "prepared by eggs <https://penguins-eggs.net>" '
|
|
1715
1734
|
let isoHybridMbr = '';
|
|
1716
1735
|
if (this.settings.config.make_isohybrid) {
|
|
1717
|
-
const isolinuxFile = this.settings.distro.syslinuxPath + 'isohdpfx.bin';
|
|
1736
|
+
const isolinuxFile = this.settings.distro.syslinuxPath + '/isohdpfx.bin';
|
|
1718
1737
|
if (fs.existsSync(isolinuxFile)) {
|
|
1719
1738
|
isoHybridMbr = `-isohybrid-mbr ${isolinuxFile}`;
|
|
1720
1739
|
}
|
package/dist/classes/tailor.d.ts
CHANGED
|
@@ -40,4 +40,11 @@ export default class Tailor {
|
|
|
40
40
|
* - if find any packages to install, install it
|
|
41
41
|
*/
|
|
42
42
|
packagesInstall(packages: string[], comment?: string, cmd?: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param cmd
|
|
46
|
+
* @param echo
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
tryCheckSuccess(cmd: string, echo: {}): Promise<boolean>;
|
|
43
50
|
}
|
package/dist/classes/tailor.js
CHANGED
|
@@ -433,7 +433,7 @@ export default class Tailor {
|
|
|
433
433
|
cmd = `apk search | awk -F'-[0-9]' '{print $1}' | sort -u`;
|
|
434
434
|
}
|
|
435
435
|
else if (distro.familyId === 'fedora') {
|
|
436
|
-
cmd = `dnf list available | awk '{print $1}' | sed 's/\.[^.]*$//'`;
|
|
436
|
+
cmd = `dnf list --available | awk '{print $1}' | sed 's/\.[^.]*$//'`;
|
|
437
437
|
}
|
|
438
438
|
//available = (await exec(cmd, { capture: true, echo: false, ignore: false })).data.split('\n')
|
|
439
439
|
let available = [];
|
|
@@ -487,30 +487,30 @@ export default class Tailor {
|
|
|
487
487
|
for (let tempts = 1; tempts < limit; tempts++) {
|
|
488
488
|
Utils.titles(step);
|
|
489
489
|
Utils.warning(`tempts ${tempts} of ${limit}`);
|
|
490
|
-
if (await tryCheckSuccess(cmd, this.echo)) {
|
|
490
|
+
if (await this.tryCheckSuccess(cmd, this.echo)) {
|
|
491
491
|
break;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
497
|
+
/**
|
|
498
|
+
*
|
|
499
|
+
* @param cmd
|
|
500
|
+
* @param echo
|
|
501
|
+
* @returns
|
|
502
|
+
*/
|
|
503
|
+
async tryCheckSuccess(cmd, echo) {
|
|
504
|
+
let success = false;
|
|
505
|
+
try {
|
|
506
|
+
await exec(cmd, echo);
|
|
507
|
+
success = true;
|
|
508
|
+
}
|
|
509
|
+
catch {
|
|
510
|
+
success = false;
|
|
511
|
+
}
|
|
512
|
+
return success;
|
|
512
513
|
}
|
|
513
|
-
return success;
|
|
514
514
|
}
|
|
515
515
|
/**
|
|
516
516
|
*
|
package/dist/classes/utils.js
CHANGED
|
@@ -67,9 +67,8 @@ export default class Utils {
|
|
|
67
67
|
let result = '';
|
|
68
68
|
if (codenameId === 'rolling' || codenameId === '') {
|
|
69
69
|
result = 'egg-of_' + distroId.toLowerCase() + '-';
|
|
70
|
-
if (distroId === 'Alpine') {
|
|
70
|
+
if (distroId === 'Alpine' || distroId === 'Fedora') {
|
|
71
71
|
const releaseId = shx.exec('lsb_release -rs', { silent: true }).stdout.toString().trim();
|
|
72
|
-
//result = 'egg-of_' + distroId.toLowerCase() + '-' +releaseId.substring(0, 4) + '-'
|
|
73
72
|
result = 'egg-of_' + distroId.toLowerCase() + '-' + releaseId.trim() + '-';
|
|
74
73
|
}
|
|
75
74
|
}
|
|
@@ -78,7 +78,7 @@ export default class Calamares extends Command {
|
|
|
78
78
|
* Install
|
|
79
79
|
*/
|
|
80
80
|
if (install) {
|
|
81
|
-
Utils.warning('
|
|
81
|
+
Utils.warning('installing package calamares');
|
|
82
82
|
await Pacman.calamaresInstall();
|
|
83
83
|
if (await this.settings.load()) {
|
|
84
84
|
this.settings.config.force_installer = true;
|
|
@@ -92,19 +92,21 @@ export default class Calamares extends Command {
|
|
|
92
92
|
* policies
|
|
93
93
|
*/
|
|
94
94
|
if (policies) {
|
|
95
|
-
Utils.warning('calamares
|
|
95
|
+
Utils.warning('configuring calamares policies');
|
|
96
96
|
await Pacman.calamaresPolicies();
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* configure
|
|
100
100
|
*/
|
|
101
101
|
if (await this.settings.load()) {
|
|
102
|
-
Utils.warning(`${installer}: creating configuration files`);
|
|
103
102
|
await this.settings.loadRemix(theme);
|
|
104
103
|
const isClone = false;
|
|
105
104
|
this.incubator = new Incubator(this.settings.remix, this.settings.distro, this.settings.config.user_opt, theme, isClone, verbose);
|
|
106
105
|
await this.incubator.config(release);
|
|
107
106
|
}
|
|
108
107
|
}
|
|
108
|
+
else {
|
|
109
|
+
Utils.useRoot(this.id);
|
|
110
|
+
}
|
|
109
111
|
}
|
|
110
112
|
}
|
|
@@ -55,17 +55,17 @@ export default class ExportPkg extends Command {
|
|
|
55
55
|
else if (distro.familyId === "archlinux") {
|
|
56
56
|
if (distro.distroId === "ManjaroLinux" || distro.distroId === "BigLinux") {
|
|
57
57
|
Utils.warning("manjaro packages");
|
|
58
|
-
this.manjaro();
|
|
58
|
+
await this.manjaro();
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
Utils.warning("arch packages");
|
|
62
|
-
this.aur();
|
|
62
|
+
await this.aur();
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
else if (distro.familyId === "alpine") {
|
|
66
|
+
Utils.warning("alpine packages");
|
|
66
67
|
if (Utils.isRoot()) {
|
|
67
|
-
|
|
68
|
-
this.alpine();
|
|
68
|
+
await this.alpine();
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
Utils.useRoot(this.id);
|
|
@@ -53,9 +53,10 @@ export default async function information(verbose = false) {
|
|
|
53
53
|
React.createElement(Text, null,
|
|
54
54
|
"root passwd: ",
|
|
55
55
|
React.createElement(Text, { color: "cyan" }, settings.config.root_passwd)))));
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
const
|
|
56
|
+
//let lsb_release = path.resolve(__dirname, '../../script/lsb_release')
|
|
57
|
+
const codenameId = shx.exec(`lsb_release -cs`, { silent: true }).stdout.toString().trim();
|
|
58
|
+
const releaseId = shx.exec(`lsb_release -rs`, { silent: true }).stdout.toString().trim();
|
|
59
|
+
const distroId = shx.exec(`lsb_release -is`, { silent: true }).stdout.toString().trim();
|
|
59
60
|
const Distro = () => (React.createElement(Box, { flexDirection: 'column' },
|
|
60
61
|
React.createElement(Box, { borderStyle: "round", marginRight: 2, flexDirection: 'row' },
|
|
61
62
|
React.createElement(Box, { marginRight: 2 },
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import Utils from '../../classes/utils.js';
|
|
10
10
|
import { exec } from '../../lib/utils.js';
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import path from 'node:path';
|
|
11
13
|
/**
|
|
12
14
|
*
|
|
13
15
|
* @param this
|
|
@@ -34,4 +36,62 @@ export default async function bootloader() {
|
|
|
34
36
|
catch {
|
|
35
37
|
await Utils.pressKeyToExit(cmd);
|
|
36
38
|
}
|
|
39
|
+
// update boot/loader/entries/
|
|
40
|
+
const pathEntries = path.join(this.installTarget, '/boot/loader/entries/');
|
|
41
|
+
if (fs.existsSync(pathEntries)) {
|
|
42
|
+
const uuid = Utils.uuid(this.devices.root.name);
|
|
43
|
+
const machineId = fs.readFileSync(path.join(this.installTarget, '/etc/machine-id'), 'utf-8').trim();
|
|
44
|
+
await renameLoaderEntries(pathEntries, machineId);
|
|
45
|
+
await updateLoaderEntries(pathEntries, uuid);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param directoryPath
|
|
51
|
+
* @param machineId
|
|
52
|
+
*/
|
|
53
|
+
async function renameLoaderEntries(directoryPath, machineId) {
|
|
54
|
+
const files = fs.readdirSync(directoryPath);
|
|
55
|
+
if (files.length > 0) {
|
|
56
|
+
for (const file of files) {
|
|
57
|
+
const oldPath = path.join(directoryPath, file);
|
|
58
|
+
let current = file.substring(32);
|
|
59
|
+
current = machineId + current;
|
|
60
|
+
const newPath = path.join(directoryPath, current);
|
|
61
|
+
await exec(`mv ${oldPath} ${newPath}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param directoryPath
|
|
68
|
+
* @param newUUID
|
|
69
|
+
*/
|
|
70
|
+
async function updateLoaderEntries(directoryPath, newUUID) {
|
|
71
|
+
const files = fs.readdirSync(directoryPath);
|
|
72
|
+
if (files.length > 0) {
|
|
73
|
+
for (const file of files) {
|
|
74
|
+
console.log(file);
|
|
75
|
+
const filePath = path.join(directoryPath, file);
|
|
76
|
+
console.log(`entry: ${filePath}`);
|
|
77
|
+
let source = fs.readFileSync(filePath, 'utf8');
|
|
78
|
+
let lines = source.split('\n');
|
|
79
|
+
let content = '';
|
|
80
|
+
for (let line of lines) {
|
|
81
|
+
if (line.includes('UUID=')) {
|
|
82
|
+
const at = line.indexOf('UUID=');
|
|
83
|
+
const p1 = line.substring(0, at + 5);
|
|
84
|
+
const p2 = newUUID;
|
|
85
|
+
const p3 = line.substring(at + 5 + 36);
|
|
86
|
+
console.log("Orig: " + line);
|
|
87
|
+
console.log("p1: " + p1);
|
|
88
|
+
console.log("p2: " + p2);
|
|
89
|
+
console.log("p3: " + p3);
|
|
90
|
+
line = p1 + p2 + p3;
|
|
91
|
+
}
|
|
92
|
+
content += line + '\n';
|
|
93
|
+
}
|
|
94
|
+
fs.writeFileSync(filePath, content);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
37
97
|
}
|
|
@@ -19,12 +19,18 @@ export default async function machineId() {
|
|
|
19
19
|
if (fs.existsSync(file)) {
|
|
20
20
|
await exec(`rm ${file} ${this.toNull}`, this.echo);
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* machine/id always new now
|
|
24
|
+
*/
|
|
25
|
+
await exec(`dbus-uuidgen --ensure=${this.installTarget}/var/lib/dbus/machine-id ${this.toNull}`);
|
|
26
|
+
await exec(`cp ${this.installTarget}/var/lib/dbus/machine-id ${this.installTarget}/etc/machine-id`);
|
|
27
|
+
/*
|
|
22
28
|
// On Alpine, we need to create the machine-id file
|
|
23
29
|
if (this.distro.familyId === 'alpine') {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
await exec(`touch ${file} ${this.toNull}`);
|
|
30
|
+
await exec(`dbus-uuidgen --ensure=${this.installTarget}/var/lib/dbus/machine-id ${this.toNull}`)
|
|
31
|
+
await exec(`cp ${this.installTarget}/var/lib/dbus/machine-id ${this.installTarget}/etc/machine-id`)
|
|
32
|
+
} else {
|
|
33
|
+
await exec(`touch ${file} ${this.toNull}`)
|
|
29
34
|
}
|
|
35
|
+
*/
|
|
30
36
|
}
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
|
-
<h1>eggs(1) -- the reproductive system of penguins: eggs v10.0.
|
|
9
|
+
<h1>eggs(1) -- the reproductive system of penguins: eggs v10.0.48</h1>
|
|
10
10
|
<h1>SYNOPSIS</h1>
|
|
11
11
|
<p>eggs is a console utility, in active development, who let you to remaster your system and redistribuite it as live ISO image.</p>
|
|
12
12
|
<h1>INSTALL</h1>
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
</code></pre>
|
|
16
16
|
<p>Arch</p>
|
|
17
17
|
<pre><code>$ sudo pacman -S penguins-eggs
|
|
18
|
-
$ sudo pacman -U penguins-eggs_10.0.
|
|
18
|
+
$ sudo pacman -U penguins-eggs_10.0.48-1_amd64-1-x86_64.pkg.tar.zst
|
|
19
19
|
</code></pre>
|
|
20
20
|
<p>Debian/Devuan/Ubuntu</p>
|
|
21
21
|
<pre><code>$ sudo apt install penguins-eggs
|
|
22
|
-
$ sudo dpkg -i penguins-eggs_10.0.
|
|
22
|
+
$ sudo dpkg -i penguins-eggs_10.0.48-1_amd64.deb
|
|
23
23
|
</code></pre>
|
|
24
24
|
<p>Manjaro</p>
|
|
25
25
|
<pre><code>$ sudo pamac install penguins-eggs
|
|
@@ -27,7 +27,7 @@ $ sudo dpkg -i penguins-eggs_10.0.45-bionic-1_amd64.deb
|
|
|
27
27
|
<h1>USAGE</h1>
|
|
28
28
|
<pre><code>$ eggs (-v|--version|version)
|
|
29
29
|
|
|
30
|
-
penguins-eggs/10.0.
|
|
30
|
+
penguins-eggs/10.0.48
|
|
31
31
|
$ eggs --help [COMMAND]
|
|
32
32
|
|
|
33
33
|
USAGE
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "penguins-eggs",
|
|
3
3
|
"shortName": "eggs",
|
|
4
4
|
"description": "A remaster system tool, compatible with Arch, Debian, Devuan, Ubuntu and others",
|
|
5
|
-
"version": "10.0.
|
|
5
|
+
"version": "10.0.49",
|
|
6
6
|
"author": "Piero Proietti",
|
|
7
7
|
"bin": {
|
|
8
8
|
"eggs": "./bin/run.js"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"bugs": "https://github.com/pieroproietti/penguins-eggs/issues",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@oclif/core": "^4.0.30",
|
|
13
|
-
"@oclif/plugin-autocomplete": "^3.2.
|
|
13
|
+
"@oclif/plugin-autocomplete": "^3.2.7",
|
|
14
14
|
"@oclif/plugin-help": "^6.2.16",
|
|
15
15
|
"@oclif/plugin-version": "^2.2.15",
|
|
16
16
|
"ansis": "^3.3.2",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"eslint-config-oclif": "^5.2.1",
|
|
52
52
|
"eslint-config-oclif-typescript": "^3.1.12",
|
|
53
53
|
"eslint-config-prettier": "^9.1.0",
|
|
54
|
-
"mocha": "^10.
|
|
55
|
-
"oclif": "^4.15.
|
|
54
|
+
"mocha": "^10.8.1",
|
|
55
|
+
"oclif": "^4.15.20",
|
|
56
56
|
"perrisbrewery": "^10.0.2",
|
|
57
57
|
"prettier": "^3.3.3",
|
|
58
58
|
"shx": "^0.3.4",
|