penguins-eggs 10.0.57 → 10.1.0
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 +100 -1
- package/README.md +84 -44
- package/addons/eggs/theme/calamares/modules/{_users.yml → users.yml} +3 -3
- package/addons/eggs/theme/livecd/grub.main.full.cfg +1 -7
- package/addons/eggs/theme/livecd/grub.main.simple.cfg +1 -1
- package/assets/config.cfg +30 -0
- package/conf/derivatives.yaml +1 -3
- package/conf/derivatives_fedora.yaml +6 -0
- package/conf/distros/alpine/calamares/modules/users.yml +3 -3
- package/conf/distros/bionic/calamares/calamares-modules/grubcfg/grubcfg.yml +1 -1
- package/conf/distros/bionic/calamares/modules/users.yml +3 -3
- package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +8 -1
- package/conf/distros/buster/calamares/modules/partition.yml +159 -23
- package/conf/distros/buster/calamares/modules/removeuser.yml +1 -1
- package/conf/distros/buster/calamares/modules/users.yml +3 -3
- package/conf/distros/fedora/calamares/modules/users.yml +3 -3
- package/conf/distros/noble/calamares/modules/focal-jammy/users.yml +3 -3
- package/conf/distros/opensuse/calamares/modules/users.yml +3 -3
- package/conf/distros/rolling/calamares/modules/users.yml +3 -3
- package/conf/eggs.yaml +1 -1
- package/conf/exclude.list.d/master.list +1 -0
- package/conf/krill.yaml +8 -0
- package/conf/love.yaml +4 -4
- package/package.json +33 -29
- package/perrisbrewery/scripts/postinst +98 -0
- package/perrisbrewery/scripts/postrm +82 -0
- package/perrisbrewery/scripts/preinst +40 -0
- package/perrisbrewery/scripts/prerm +47 -0
- package/perrisbrewery/template/control.template +17 -0
- package/perrisbrewery/template/dependencies-bionic.yaml +33 -0
- package/perrisbrewery/template/dependencies.yaml +37 -0
- package/perrisbrewery/template/man.template.md +110 -0
- package/pods/README.md +14 -0
- package/pods/almalinux.sh +10 -0
- package/pods/archlinux.sh +10 -0
- package/pods/ci/README.md +5 -0
- package/pods/ci/kernel-overlay-install.sh +114 -0
- package/pods/ci/minimal/almalinux-container2host.sh +165 -0
- package/pods/ci/minimal/archlinux-container2host.sh +125 -0
- package/pods/ci/minimal/debian-container2host.sh +173 -0
- package/pods/ci/minimal/fedora-container2host.sh +170 -0
- package/pods/ci/minimal/manjaro-container2host.sh +123 -0
- package/pods/ci/minimal/opensuse-container2host.sh +143 -0
- package/pods/ci/penguins-eggs-execute.sh +22 -0
- package/pods/ci/penguins-eggs-install.sh +115 -0
- package/pods/ci/run +34 -0
- package/pods/ci/run-on-almalinux.sh +50 -0
- package/pods/ci/run-on-archlinux.sh +64 -0
- package/pods/ci/run-on-debian.sh +51 -0
- package/pods/ci/run-on-devuan.sh +48 -0
- package/pods/ci/run-on-fedora.sh +51 -0
- package/pods/ci/run-on-manjaro.sh +61 -0
- package/pods/ci/run-on-opensuse.sh +58 -0
- package/pods/ci/run-on-rockylinux.sh +51 -0
- package/pods/ci/run-on-ubuntu.sh +52 -0
- package/pods/debian.sh +23 -0
- package/pods/devuan.sh +26 -0
- package/pods/fedora.sh +12 -0
- package/pods/lmde.sh +22 -0
- package/pods/manjaro.sh +10 -0
- package/pods/opensuse.sh +12 -0
- package/pods/podman.command.sh +85 -0
- package/pods/rocky.sh +12 -0
- package/pods/run-build-packages-debs.sh +45 -0
- package/pods/run-create-debs.sh +23 -0
- package/pods/ubuntu.sh +24 -0
- package/scripts/_eggs +23 -6
- package/scripts/eggs.bash +8 -6
- package/dist/classes/bleach.d.ts +0 -32
- package/dist/classes/bleach.js +0 -135
- package/dist/classes/cfs.d.ts +0 -17
- package/dist/classes/cfs.js +0 -39
- package/dist/classes/cli-autologin.d.ts +0 -52
- package/dist/classes/cli-autologin.js +0 -247
- package/dist/classes/compressors.d.ts +0 -54
- package/dist/classes/compressors.js +0 -109
- package/dist/classes/daddy.d.ts +0 -26
- package/dist/classes/daddy.js +0 -167
- package/dist/classes/distro.d.ts +0 -32
- package/dist/classes/distro.js +0 -341
- package/dist/classes/diversions.d.ts +0 -52
- package/dist/classes/diversions.js +0 -126
- package/dist/classes/incubation/branding.d.ts +0 -17
- package/dist/classes/incubation/branding.js +0 -85
- package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +0 -11
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +0 -40
- package/dist/classes/incubation/fisherman-helper/packages.d.ts +0 -20
- package/dist/classes/incubation/fisherman-helper/packages.js +0 -72
- package/dist/classes/incubation/fisherman-helper/settings.d.ts +0 -15
- package/dist/classes/incubation/fisherman-helper/settings.js +0 -83
- package/dist/classes/incubation/fisherman.d.ts +0 -70
- package/dist/classes/incubation/fisherman.js +0 -263
- package/dist/classes/incubation/incubator.d/alpine.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/alpine.js +0 -78
- 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/buster.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/buster.js +0 -85
- package/dist/classes/incubation/incubator.d/jessie.d.ts +0 -31
- package/dist/classes/incubation/incubator.d/jessie.js +0 -44
- package/dist/classes/incubation/incubator.d/noble.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/noble.js +0 -85
- package/dist/classes/incubation/incubator.d/openmamba.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/openmamba.js +0 -81
- package/dist/classes/incubation/incubator.d/opensuse.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/opensuse.js +0 -81
- package/dist/classes/incubation/incubator.d/rolling.d.ts +0 -32
- package/dist/classes/incubation/incubator.d/rolling.js +0 -80
- package/dist/classes/incubation/incubator.d.ts +0 -44
- package/dist/classes/incubation/incubator.js +0 -382
- package/dist/classes/incubation/installer.d.ts +0 -13
- package/dist/classes/incubation/installer.js +0 -52
- package/dist/classes/keyboards.d.ts +0 -50
- package/dist/classes/keyboards.js +0 -287
- package/dist/classes/locales.d.ts +0 -21
- package/dist/classes/locales.js +0 -77
- package/dist/classes/network.d.ts +0 -37
- package/dist/classes/network.js +0 -98
- package/dist/classes/ovary.d.ts +0 -198
- package/dist/classes/ovary.js +0 -1850
- package/dist/classes/pacman.d/aldos.d.ts +0 -52
- package/dist/classes/pacman.d/aldos.js +0 -100
- package/dist/classes/pacman.d/alpine.d.ts +0 -56
- package/dist/classes/pacman.d/alpine.js +0 -162
- package/dist/classes/pacman.d/archlinux.d.ts +0 -62
- package/dist/classes/pacman.d/archlinux.js +0 -139
- package/dist/classes/pacman.d/debian.d.ts +0 -65
- package/dist/classes/pacman.d/debian.js +0 -143
- package/dist/classes/pacman.d/fedora.d.ts +0 -53
- package/dist/classes/pacman.d/fedora.js +0 -101
- package/dist/classes/pacman.d/openmamba.d.ts +0 -52
- package/dist/classes/pacman.d/openmamba.js +0 -100
- package/dist/classes/pacman.d/opensuse.d.ts +0 -53
- package/dist/classes/pacman.d/opensuse.js +0 -102
- package/dist/classes/pacman.d/voidlinux.d.ts +0 -52
- package/dist/classes/pacman.d/voidlinux.js +0 -90
- package/dist/classes/pacman.d.ts +0 -139
- package/dist/classes/pacman.js +0 -775
- package/dist/classes/pve-live.d.ts +0 -17
- package/dist/classes/pve-live.js +0 -52
- package/dist/classes/pxe.d.ts +0 -74
- package/dist/classes/pxe.js +0 -410
- package/dist/classes/settings.d.ts +0 -53
- package/dist/classes/settings.js +0 -185
- package/dist/classes/sources_list.d.ts +0 -28
- package/dist/classes/sources_list.js +0 -89
- package/dist/classes/systemctl.d.ts +0 -47
- package/dist/classes/systemctl.js +0 -86
- package/dist/classes/tailor.d.ts +0 -50
- package/dist/classes/tailor.js +0 -526
- package/dist/classes/tools.d.ts +0 -26
- package/dist/classes/tools.js +0 -50
- package/dist/classes/users.d.ts +0 -28
- package/dist/classes/users.js +0 -143
- package/dist/classes/utils.d.ts +0 -326
- package/dist/classes/utils.js +0 -1025
- package/dist/classes/xdg.d.ts +0 -45
- package/dist/classes/xdg.js +0 -337
- package/dist/classes/yolk.d.ts +0 -33
- package/dist/classes/yolk.js +0 -114
- package/dist/commands/adapt.d.ts +0 -17
- package/dist/commands/adapt.js +0 -33
- package/dist/commands/analyze.d.ts +0 -26
- package/dist/commands/analyze.js +0 -95
- package/dist/commands/calamares.d.ts +0 -29
- package/dist/commands/calamares.js +0 -112
- package/dist/commands/config.d.ts +0 -35
- package/dist/commands/config.js +0 -120
- package/dist/commands/cuckoo.d.ts +0 -16
- package/dist/commands/cuckoo.js +0 -62
- package/dist/commands/dad.d.ts +0 -20
- package/dist/commands/dad.js +0 -46
- package/dist/commands/export/iso.d.ts +0 -19
- package/dist/commands/export/iso.js +0 -55
- package/dist/commands/export/pkg.d.ts +0 -29
- package/dist/commands/export/pkg.js +0 -163
- package/dist/commands/export/tarballs.d.ts +0 -27
- package/dist/commands/export/tarballs.js +0 -84
- package/dist/commands/install.d.ts +0 -37
- package/dist/commands/install.js +0 -88
- package/dist/commands/kill.d.ts +0 -24
- package/dist/commands/kill.js +0 -50
- package/dist/commands/love.d.ts +0 -20
- package/dist/commands/love.js +0 -59
- package/dist/commands/mom.d.ts +0 -16
- package/dist/commands/mom.js +0 -30
- package/dist/commands/produce.d.ts +0 -34
- package/dist/commands/produce.js +0 -201
- package/dist/commands/status.d.ts +0 -23
- package/dist/commands/status.js +0 -31
- package/dist/commands/syncfrom.d.ts +0 -45
- package/dist/commands/syncfrom.js +0 -152
- package/dist/commands/syncto.d.ts +0 -40
- package/dist/commands/syncto.js +0 -175
- package/dist/commands/tools/clean.d.ts +0 -18
- package/dist/commands/tools/clean.js +0 -37
- package/dist/commands/tools/ppa.d.ts +0 -26
- package/dist/commands/tools/ppa.js +0 -138
- package/dist/commands/tools/skel.d.ts +0 -18
- package/dist/commands/tools/skel.js +0 -44
- package/dist/commands/tools/stat.d.ts +0 -31
- package/dist/commands/tools/stat.js +0 -70
- package/dist/commands/tools/yolk.d.ts +0 -24
- package/dist/commands/tools/yolk.js +0 -45
- package/dist/commands/update.d.ts +0 -51
- package/dist/commands/update.js +0 -219
- package/dist/commands/wardrobe/get.d.ts +0 -23
- package/dist/commands/wardrobe/get.js +0 -52
- package/dist/commands/wardrobe/list.d.ts +0 -24
- package/dist/commands/wardrobe/list.js +0 -125
- package/dist/commands/wardrobe/show.d.ts +0 -25
- package/dist/commands/wardrobe/show.js +0 -97
- package/dist/commands/wardrobe/wear.d.ts +0 -26
- package/dist/commands/wardrobe/wear.js +0 -84
- package/dist/components/finished.d.ts +0 -16
- package/dist/components/finished.js +0 -56
- package/dist/components/information.d.ts +0 -8
- package/dist/components/information.js +0 -156
- package/dist/components/install.d.ts +0 -15
- package/dist/components/install.js +0 -60
- package/dist/components/keyboard.d.ts +0 -16
- package/dist/components/keyboard.js +0 -54
- package/dist/components/location.d.ts +0 -16
- package/dist/components/location.js +0 -59
- package/dist/components/network.d.ts +0 -19
- package/dist/components/network.js +0 -65
- package/dist/components/partitions.d.ts +0 -16
- package/dist/components/partitions.js +0 -73
- package/dist/components/steps.d.ts +0 -13
- package/dist/components/steps.js +0 -148
- package/dist/components/summary.d.ts +0 -24
- package/dist/components/summary.js +0 -81
- package/dist/components/title.d.ts +0 -11
- package/dist/components/title.js +0 -35
- package/dist/components/users.d.ts +0 -24
- package/dist/components/users.js +0 -80
- package/dist/components/welcome.d.ts +0 -13
- package/dist/components/welcome.js +0 -63
- package/dist/index-old.d.ts +0 -8
- package/dist/index-old.js +0 -8
- package/dist/index.d.ts +0 -54
- package/dist/index.js +0 -147
- package/dist/interfaces/i-addons.d.ts +0 -12
- package/dist/interfaces/i-addons.js +0 -8
- package/dist/interfaces/i-analyze.d.ts +0 -17
- package/dist/interfaces/i-analyze.js +0 -17
- package/dist/interfaces/i-app.d.ts +0 -14
- package/dist/interfaces/i-app.js +0 -8
- package/dist/interfaces/i-branding.d.ts +0 -36
- package/dist/interfaces/i-branding.js +0 -8
- package/dist/interfaces/i-calamares-displaymanager.d.ts +0 -17
- package/dist/interfaces/i-calamares-displaymanager.js +0 -1
- package/dist/interfaces/i-calamares-finished.d.ts +0 -12
- package/dist/interfaces/i-calamares-finished.js +0 -1
- package/dist/interfaces/i-calamares-packages.d.ts +0 -28
- package/dist/interfaces/i-calamares-packages.js +0 -1
- package/dist/interfaces/i-calamares-partition.d.ts +0 -40
- package/dist/interfaces/i-calamares-partition.js +0 -1
- package/dist/interfaces/i-config-tools.d.ts +0 -15
- package/dist/interfaces/i-config-tools.js +0 -8
- package/dist/interfaces/i-devices.d.ts +0 -20
- package/dist/interfaces/i-devices.js +0 -8
- package/dist/interfaces/i-distro.d.ts +0 -23
- package/dist/interfaces/i-distro.js +0 -8
- package/dist/interfaces/i-drive-list.d.ts +0 -33
- package/dist/interfaces/i-drive-list.js +0 -8
- package/dist/interfaces/i-eggs-config.d.ts +0 -32
- package/dist/interfaces/i-eggs-config.js +0 -8
- package/dist/interfaces/i-excludes.d.ts +0 -14
- package/dist/interfaces/i-excludes.js +0 -8
- package/dist/interfaces/i-exec.d.ts +0 -11
- package/dist/interfaces/i-exec.js +0 -8
- package/dist/interfaces/i-initrd.d.ts +0 -13
- package/dist/interfaces/i-initrd.js +0 -8
- package/dist/interfaces/i-install.d.ts +0 -16
- package/dist/interfaces/i-install.js +0 -8
- package/dist/interfaces/i-installer.d.ts +0 -17
- package/dist/interfaces/i-installer.js +0 -8
- package/dist/interfaces/i-krill-config.d.ts +0 -33
- package/dist/interfaces/i-krill-config.js +0 -8
- package/dist/interfaces/i-krill.d.ts +0 -42
- package/dist/interfaces/i-krill.js +0 -8
- package/dist/interfaces/i-materia.d.ts +0 -36
- package/dist/interfaces/i-materia.js +0 -8
- package/dist/interfaces/i-net.d.ts +0 -16
- package/dist/interfaces/i-net.js +0 -8
- package/dist/interfaces/i-os-release.d.ts +0 -5
- package/dist/interfaces/i-os-release.js +0 -1
- package/dist/interfaces/i-packages.d.ts +0 -16
- package/dist/interfaces/i-packages.js +0 -8
- package/dist/interfaces/i-partitions.d.ts +0 -16
- package/dist/interfaces/i-partitions.js +0 -8
- package/dist/interfaces/i-pxe.d.ts +0 -45
- package/dist/interfaces/i-pxe.js +0 -1
- package/dist/interfaces/i-remix.d.ts +0 -21
- package/dist/interfaces/i-remix.js +0 -8
- package/dist/interfaces/i-settings.d.ts +0 -33
- package/dist/interfaces/i-settings.js +0 -8
- package/dist/interfaces/i-user.d.ts +0 -14
- package/dist/interfaces/i-user.js +0 -8
- package/dist/interfaces/i-workdir.d.ts +0 -14
- package/dist/interfaces/i-workdir.js +0 -8
- package/dist/interfaces/i-xkb-model.d.ts +0 -24
- package/dist/interfaces/i-xkb-model.js +0 -8
- package/dist/interfaces/index.d.ts +0 -25
- package/dist/interfaces/index.js +0 -8
- package/dist/krill/modules/add-user.d.ts +0 -20
- package/dist/krill/modules/add-user.js +0 -48
- package/dist/krill/modules/bootloader-config.d.ts +0 -14
- package/dist/krill/modules/bootloader-config.js +0 -165
- package/dist/krill/modules/bootloader.d.ts +0 -14
- package/dist/krill/modules/bootloader.js +0 -95
- package/dist/krill/modules/change-password.d.ts +0 -15
- package/dist/krill/modules/change-password.js +0 -18
- package/dist/krill/modules/del-live-user.d.ts +0 -14
- package/dist/krill/modules/del-live-user.js +0 -39
- package/dist/krill/modules/fstab.d.ts +0 -14
- package/dist/krill/modules/fstab.js +0 -128
- package/dist/krill/modules/grubcfg.d.ts +0 -17
- package/dist/krill/modules/grubcfg.js +0 -29
- package/dist/krill/modules/hostname.d.ts +0 -13
- package/dist/krill/modules/hostname.js +0 -50
- package/dist/krill/modules/initramfs-cfg.d.ts +0 -14
- package/dist/krill/modules/initramfs-cfg.js +0 -22
- package/dist/krill/modules/initramfs.d.ts +0 -13
- package/dist/krill/modules/initramfs.js +0 -54
- package/dist/krill/modules/locale-cfg.d.ts +0 -10
- package/dist/krill/modules/locale-cfg.js +0 -58
- package/dist/krill/modules/locale.d.ts +0 -13
- package/dist/krill/modules/locale.js +0 -91
- package/dist/krill/modules/m-keyboard.d.ts +0 -14
- package/dist/krill/modules/m-keyboard.js +0 -58
- package/dist/krill/modules/machine-id.d.ts +0 -15
- package/dist/krill/modules/machine-id.js +0 -33
- package/dist/krill/modules/mkfs.d.ts +0 -15
- package/dist/krill/modules/mkfs.js +0 -50
- package/dist/krill/modules/mount-fs.d.ts +0 -17
- package/dist/krill/modules/mount-fs.js +0 -62
- package/dist/krill/modules/mount-vfs.d.ts +0 -17
- package/dist/krill/modules/mount-vfs.js +0 -40
- package/dist/krill/modules/network-cfg.d.ts +0 -19
- package/dist/krill/modules/network-cfg.js +0 -64
- package/dist/krill/modules/packages.d.ts +0 -14
- package/dist/krill/modules/packages.js +0 -111
- package/dist/krill/modules/partition.d.ts +0 -20
- package/dist/krill/modules/partition.js +0 -345
- package/dist/krill/modules/remove-installer-link.d.ts +0 -13
- package/dist/krill/modules/remove-installer-link.js +0 -35
- package/dist/krill/modules/umount.d.ts +0 -14
- package/dist/krill/modules/umount.js +0 -28
- package/dist/krill/modules/unpackfs.d.ts +0 -13
- package/dist/krill/modules/unpackfs.js +0 -20
- package/dist/krill/prepare.d.ts +0 -78
- package/dist/krill/prepare.js +0 -626
- package/dist/krill/sequence.d.ts +0 -154
- package/dist/krill/sequence.js +0 -652
- package/dist/lib/get_address.d.ts +0 -8
- package/dist/lib/get_address.js +0 -23
- package/dist/lib/get_dns.d.ts +0 -8
- package/dist/lib/get_dns.js +0 -23
- package/dist/lib/get_domain.d.ts +0 -8
- package/dist/lib/get_domain.js +0 -23
- package/dist/lib/get_gateway.d.ts +0 -8
- package/dist/lib/get_gateway.js +0 -23
- package/dist/lib/get_hostname.d.ts +0 -8
- package/dist/lib/get_hostname.js +0 -23
- package/dist/lib/get_netmask.d.ts +0 -8
- package/dist/lib/get_netmask.js +0 -23
- package/dist/lib/get_password.d.ts +0 -8
- package/dist/lib/get_password.js +0 -36
- package/dist/lib/get_userfullname.d.ts +0 -8
- package/dist/lib/get_userfullname.js +0 -23
- package/dist/lib/get_username.d.ts +0 -8
- package/dist/lib/get_username.js +0 -23
- package/dist/lib/kill_me_softly.d.ts +0 -11
- package/dist/lib/kill_me_softly.js +0 -61
- package/dist/lib/select_address_type.d.ts +0 -8
- package/dist/lib/select_address_type.js +0 -24
- package/dist/lib/select_filesystem_type.d.ts +0 -8
- package/dist/lib/select_filesystem_type.js +0 -46
- package/dist/lib/select_installation_device.d.ts +0 -8
- package/dist/lib/select_installation_device.js +0 -34
- package/dist/lib/select_installation_mode.d.ts +0 -8
- package/dist/lib/select_installation_mode.js +0 -24
- package/dist/lib/select_interface.d.ts +0 -8
- package/dist/lib/select_interface.js +0 -24
- package/dist/lib/select_keyboard_layout.d.ts +0 -11
- package/dist/lib/select_keyboard_layout.js +0 -36
- package/dist/lib/select_keyboard_model.d.ts +0 -11
- package/dist/lib/select_keyboard_model.js +0 -34
- package/dist/lib/select_keyboard_option.d.ts +0 -11
- package/dist/lib/select_keyboard_option.js +0 -34
- package/dist/lib/select_keyboard_variant.d.ts +0 -11
- package/dist/lib/select_keyboard_variant.js +0 -35
- package/dist/lib/select_languages.d.ts +0 -8
- package/dist/lib/select_languages.js +0 -28
- package/dist/lib/select_regions.d.ts +0 -8
- package/dist/lib/select_regions.js +0 -24
- package/dist/lib/select_user_swap_choice.d.ts +0 -8
- package/dist/lib/select_user_swap_choice.js +0 -34
- package/dist/lib/select_zones.d.ts +0 -8
- package/dist/lib/select_zones.js +0 -518
- package/dist/lib/utils.d.ts +0 -34
- package/dist/lib/utils.js +0 -79
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/lib/cli-autologin.ts
|
|
3
|
-
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* CliAutologin
|
|
10
|
-
*/
|
|
11
|
-
export default class CliAutologin {
|
|
12
|
-
/**
|
|
13
|
-
* add
|
|
14
|
-
* @param distro
|
|
15
|
-
* @param version
|
|
16
|
-
* @param user
|
|
17
|
-
* @param userPasswd
|
|
18
|
-
* @param rootPasswd
|
|
19
|
-
* @param chroot
|
|
20
|
-
*/
|
|
21
|
-
add(distro: string, version: string, user: string, userPasswd: string, rootPasswd: string, chroot?: string): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param distro
|
|
25
|
-
* @param version
|
|
26
|
-
* @param user
|
|
27
|
-
* @param userPasswd
|
|
28
|
-
* @param rootPasswd
|
|
29
|
-
* @param chroot
|
|
30
|
-
*/
|
|
31
|
-
addIssue(distro: string, version: string, user: string, userPasswd: string, rootPasswd: string, chroot?: string): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param distro
|
|
35
|
-
* @param version
|
|
36
|
-
* @param user
|
|
37
|
-
* @param userPasswd
|
|
38
|
-
* @param rootPasswd
|
|
39
|
-
* @param chroot
|
|
40
|
-
*/
|
|
41
|
-
addMotd(distro: string, version: string, user: string, userPasswd: string, rootPasswd: string, chroot?: string): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* remove
|
|
44
|
-
* @param chroot
|
|
45
|
-
*/
|
|
46
|
-
remove(chroot?: string): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param path
|
|
50
|
-
*/
|
|
51
|
-
private msgRemove;
|
|
52
|
-
}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/lib/cli-autologin.ts
|
|
3
|
-
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
import chalk from 'chalk';
|
|
9
|
-
import { execSync } from 'node:child_process';
|
|
10
|
-
import fs from 'node:fs';
|
|
11
|
-
import path from 'node:path';
|
|
12
|
-
import shx from 'shelljs';
|
|
13
|
-
// libraries
|
|
14
|
-
import { exec } from '../lib/utils.js';
|
|
15
|
-
import Pacman from './pacman.js';
|
|
16
|
-
import Utils from './utils.js';
|
|
17
|
-
const startMessage = 'eggs-start-message';
|
|
18
|
-
const stopMessage = 'eggs-stop-message';
|
|
19
|
-
/*
|
|
20
|
-
* Comando per avviare ubiquity:
|
|
21
|
-
* sudo --preserve-env DBUS_SESSION_BUS_ADDRESS, XDG_RUNTIME sh -c 'calamares'
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* CliAutologin
|
|
25
|
-
*/
|
|
26
|
-
export default class CliAutologin {
|
|
27
|
-
/**
|
|
28
|
-
* add
|
|
29
|
-
* @param distro
|
|
30
|
-
* @param version
|
|
31
|
-
* @param user
|
|
32
|
-
* @param userPasswd
|
|
33
|
-
* @param rootPasswd
|
|
34
|
-
* @param chroot
|
|
35
|
-
*/
|
|
36
|
-
async add(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
|
|
37
|
-
if (Utils.isSystemd()) {
|
|
38
|
-
/**
|
|
39
|
-
* systemd
|
|
40
|
-
*/
|
|
41
|
-
Utils.warning("creating CLI autologin systemd");
|
|
42
|
-
const fileOverride = `${chroot}/etc/systemd/system/getty@.service.d/override.conf`;
|
|
43
|
-
const dirOverride = path.dirname(fileOverride);
|
|
44
|
-
if (fs.existsSync(dirOverride)) {
|
|
45
|
-
shx.exec(`rm ${dirOverride} -rf`);
|
|
46
|
-
}
|
|
47
|
-
shx.exec(`mkdir ${dirOverride}`);
|
|
48
|
-
let content = '';
|
|
49
|
-
content += '[Service]' + '\n';
|
|
50
|
-
content += 'ExecStart=' + '\n';
|
|
51
|
-
content += 'ExecStart=-/sbin/agetty --noclear --autologin ' + user + ' %I $TERM' + '\n';
|
|
52
|
-
fs.writeFileSync(fileOverride, content);
|
|
53
|
-
shx.exec(`chmod +x ${fileOverride}`);
|
|
54
|
-
await this.addIssue(distro, version, user, userPasswd, rootPasswd, chroot);
|
|
55
|
-
await this.addMotd(distro, version, user, userPasswd, rootPasswd, chroot);
|
|
56
|
-
}
|
|
57
|
-
else if (Utils.isOpenRc()) {
|
|
58
|
-
/**
|
|
59
|
-
* openrc
|
|
60
|
-
*/
|
|
61
|
-
Utils.warning("creating CLI autologin openrc");
|
|
62
|
-
const inittab = chroot + '/etc/inittab';
|
|
63
|
-
let content = '';
|
|
64
|
-
const search = `tty1::respawn:/sbin/getty 38400 tty1`;
|
|
65
|
-
const replace = `tty1::respawn:/sbin/getty -L 38400 tty1 -n -l /bin/autologin`;
|
|
66
|
-
const lines = fs.readFileSync(inittab, 'utf8').split('\n');
|
|
67
|
-
for (let i = 0; i < lines.length; i++) {
|
|
68
|
-
if (lines[i].includes(search)) {
|
|
69
|
-
lines[i] = replace;
|
|
70
|
-
}
|
|
71
|
-
content += lines[i] + '\n';
|
|
72
|
-
}
|
|
73
|
-
fs.writeFileSync(inittab, content, 'utf-8');
|
|
74
|
-
const autologin = chroot + '/bin/autologin';
|
|
75
|
-
content = '#!/bin/sh' + '\n';
|
|
76
|
-
content += `/bin/login -f ${user}` + '\n';
|
|
77
|
-
fs.writeFileSync(autologin, content, 'utf-8');
|
|
78
|
-
execSync(`chmod +x ${autologin}`);
|
|
79
|
-
await this.addIssue(distro, version, user, userPasswd, rootPasswd, chroot);
|
|
80
|
-
await this.addMotd(distro, version, user, userPasswd, rootPasswd, chroot);
|
|
81
|
-
}
|
|
82
|
-
else if (Utils.isSysvinit()) {
|
|
83
|
-
/**
|
|
84
|
-
* sysvinit
|
|
85
|
-
*/
|
|
86
|
-
Utils.warning("creating CLI autologin sysvinit");
|
|
87
|
-
const inittab = chroot + '/etc/inittab';
|
|
88
|
-
const search = '1:2345:respawn:/sbin/getty';
|
|
89
|
-
const replace = `1:2345:respawn:/sbin/getty --autologin ${user} 38400 tty1`;
|
|
90
|
-
let content = '';
|
|
91
|
-
const lines = fs.readFileSync(inittab, 'utf8').split('\n');
|
|
92
|
-
for (let i = 0; i < lines.length; i++) {
|
|
93
|
-
if (lines[i].includes(search)) {
|
|
94
|
-
lines[i] = replace;
|
|
95
|
-
}
|
|
96
|
-
content += lines[i] + '\n';
|
|
97
|
-
}
|
|
98
|
-
fs.writeFileSync(inittab, content, 'utf-8');
|
|
99
|
-
await this.addMotd(distro, version, user, userPasswd, rootPasswd, chroot);
|
|
100
|
-
await this.addIssue(distro, version, user, userPasswd, rootPasswd, chroot);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* @param distro
|
|
106
|
-
* @param version
|
|
107
|
-
* @param user
|
|
108
|
-
* @param userPasswd
|
|
109
|
-
* @param rootPasswd
|
|
110
|
-
* @param chroot
|
|
111
|
-
*/
|
|
112
|
-
async addIssue(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
|
|
113
|
-
const fileIssue = `${chroot}/etc/issue`;
|
|
114
|
-
if (fs.existsSync(fileIssue)) {
|
|
115
|
-
if (!fs.lstatSync(fileIssue).isSymbolicLink()) {
|
|
116
|
-
this.msgRemove(fileIssue);
|
|
117
|
-
let content = fs.readFileSync(fileIssue, 'utf8');
|
|
118
|
-
content += startMessage + '\n';
|
|
119
|
-
content += `This is a ${distro}/${version} system created by Penguins' eggs.\n`;
|
|
120
|
-
content += 'You can login with user: ' + chalk.bold(user) + ' and password: ' + chalk.bold(userPasswd) + ', root password: ' + chalk.bold(rootPasswd) + '\n';
|
|
121
|
-
content += stopMessage + '\n';
|
|
122
|
-
fs.writeFileSync(fileIssue, content);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
*
|
|
128
|
-
* @param distro
|
|
129
|
-
* @param version
|
|
130
|
-
* @param user
|
|
131
|
-
* @param userPasswd
|
|
132
|
-
* @param rootPasswd
|
|
133
|
-
* @param chroot
|
|
134
|
-
*/
|
|
135
|
-
async addMotd(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
|
|
136
|
-
const fileMotd = `${chroot}/etc/motd`;
|
|
137
|
-
let installer = 'sudo eggs install';
|
|
138
|
-
if (Pacman.calamaresExists()) {
|
|
139
|
-
if (Pacman.packageIsInstalled('plasma-desktop')) {
|
|
140
|
-
installer = 'startplasma-wayland to run GUI and launch calamares';
|
|
141
|
-
}
|
|
142
|
-
else if (Pacman.packageIsInstalled('xfce4')) {
|
|
143
|
-
installer = 'startxfce4 to run GUI and launch calamares installer';
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (!fs.existsSync(fileMotd)) {
|
|
147
|
-
await exec(`touch ${fileMotd}`);
|
|
148
|
-
}
|
|
149
|
-
this.msgRemove(fileMotd);
|
|
150
|
-
let eggsMotd = fs.readFileSync(fileMotd, 'utf8');
|
|
151
|
-
eggsMotd += startMessage + '\n';
|
|
152
|
-
eggsMotd += Utils.flag() + '\n';
|
|
153
|
-
eggsMotd += 'You are logged as: ' + chalk.bold(user) + ' your password is: ' + chalk.bold(userPasswd) + ', root password: ' + chalk.bold(rootPasswd) + '\n\n';
|
|
154
|
-
eggsMotd += 'install : ' + chalk.bold(installer) + '\n';
|
|
155
|
-
eggsMotd += ' --unattended : ' + chalk.bold('sudo eggs install --unattended') + '\n';
|
|
156
|
-
eggsMotd += ' --chroot : ' + chalk.bold('sudo eggs install --chroot') + '\n';
|
|
157
|
-
eggsMotd += ' --help : ' + chalk.bold('sudo eggs install --help') + '\n';
|
|
158
|
-
eggsMotd += '\n';
|
|
159
|
-
eggsMotd += stopMessage + '\n';
|
|
160
|
-
fs.writeFileSync(fileMotd, eggsMotd);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* remove
|
|
164
|
-
* @param chroot
|
|
165
|
-
*/
|
|
166
|
-
async remove(chroot = '/') {
|
|
167
|
-
if (Utils.isSystemd()) {
|
|
168
|
-
/**
|
|
169
|
-
* Systemd
|
|
170
|
-
*/
|
|
171
|
-
const fileOverride = `${chroot}/etc/systemd/system/getty@.service.d/override.conf`;
|
|
172
|
-
const dirOverride = path.dirname(fileOverride);
|
|
173
|
-
if (fs.existsSync(dirOverride)) {
|
|
174
|
-
shx.exec(`rm ${dirOverride} -rf`);
|
|
175
|
-
}
|
|
176
|
-
this.msgRemove(`${chroot}/etc/motd`);
|
|
177
|
-
this.msgRemove(`${chroot}/etc/issue`);
|
|
178
|
-
}
|
|
179
|
-
else if (Utils.isOpenRc()) {
|
|
180
|
-
/**
|
|
181
|
-
* openrc
|
|
182
|
-
*/
|
|
183
|
-
const inittab = chroot + '/etc/inittab';
|
|
184
|
-
const search = 'autologin';
|
|
185
|
-
const replace = `tty1::respawn:/sbin/getty 38400 tty1`;
|
|
186
|
-
let content = '';
|
|
187
|
-
const lines = fs.readFileSync(inittab, 'utf8').split('\n');
|
|
188
|
-
for (let i = 0; i < lines.length; i++) {
|
|
189
|
-
if (lines[i].includes(search)) {
|
|
190
|
-
lines[i] = replace;
|
|
191
|
-
}
|
|
192
|
-
content += lines[i] + '\n';
|
|
193
|
-
}
|
|
194
|
-
fs.writeFileSync(inittab, content, 'utf-8');
|
|
195
|
-
this.msgRemove(`${chroot}/etc/motd`);
|
|
196
|
-
this.msgRemove(`${chroot}/etc/issue`);
|
|
197
|
-
const autologin = `${chroot}/bin/autologin`;
|
|
198
|
-
execSync(`rm -f ${autologin}`);
|
|
199
|
-
}
|
|
200
|
-
else if (Utils.isSysvinit()) {
|
|
201
|
-
/**
|
|
202
|
-
* sysvinit
|
|
203
|
-
*/
|
|
204
|
-
const inittab = chroot + '/etc/inittab';
|
|
205
|
-
const search = '--autologin';
|
|
206
|
-
const replace = '1:2345:respawn:/sbin/getty 38400 tty1 ';
|
|
207
|
-
let content = '';
|
|
208
|
-
const lines = fs.readFileSync(inittab, 'utf8').split('\n');
|
|
209
|
-
for (let i = 0; i < lines.length; i++) {
|
|
210
|
-
if (lines[i].includes(search)) {
|
|
211
|
-
lines[i] = replace;
|
|
212
|
-
}
|
|
213
|
-
content += lines[i] + '\n';
|
|
214
|
-
}
|
|
215
|
-
// motd
|
|
216
|
-
fs.writeFileSync(inittab, content, 'utf-8');
|
|
217
|
-
this.msgRemove(`${chroot}/etc/motd`);
|
|
218
|
-
// issue
|
|
219
|
-
this.msgRemove(`${chroot}/etc/issue`);
|
|
220
|
-
} // to add: openrc and runit for Devuan
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* @param path
|
|
225
|
-
*/
|
|
226
|
-
async msgRemove(path) {
|
|
227
|
-
if (fs.existsSync(path)) {
|
|
228
|
-
if (!fs.lstatSync(path).isSymbolicLink()) {
|
|
229
|
-
const rows = fs.readFileSync(path, 'utf8').split('\n');
|
|
230
|
-
let cleaned = '';
|
|
231
|
-
let remove = false;
|
|
232
|
-
for (const row of rows) {
|
|
233
|
-
if (row.includes(startMessage)) {
|
|
234
|
-
remove = true;
|
|
235
|
-
}
|
|
236
|
-
if (!remove && row !== '') {
|
|
237
|
-
cleaned += row + '\n';
|
|
238
|
-
}
|
|
239
|
-
if (row.includes(stopMessage)) {
|
|
240
|
-
remove = false;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
fs.writeFileSync(path, cleaned, 'utf-8');
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/classes/compressors.ts
|
|
3
|
-
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
export default class Compressors {
|
|
9
|
-
dest: string;
|
|
10
|
-
isEnabled: {
|
|
11
|
-
error: boolean;
|
|
12
|
-
gzip: boolean;
|
|
13
|
-
lz4: boolean;
|
|
14
|
-
lzma: boolean;
|
|
15
|
-
lzo: boolean;
|
|
16
|
-
xz: boolean;
|
|
17
|
-
zstd: boolean;
|
|
18
|
-
};
|
|
19
|
-
source: string;
|
|
20
|
-
/**
|
|
21
|
-
* fast compression
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
fast(): string;
|
|
25
|
-
/**
|
|
26
|
-
* max
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
max(): string;
|
|
30
|
-
pendrive(level?: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* populate
|
|
33
|
-
*/
|
|
34
|
-
populate(): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* standard
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
standard(): string;
|
|
40
|
-
/**
|
|
41
|
-
* check mksquashfs exists
|
|
42
|
-
* @param compressor
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
private check;
|
|
46
|
-
/**
|
|
47
|
-
* prepareCheck
|
|
48
|
-
*/
|
|
49
|
-
private prepareCheck;
|
|
50
|
-
/**
|
|
51
|
-
* removeCheck
|
|
52
|
-
*/
|
|
53
|
-
private removeCheck;
|
|
54
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/classes/compressors.ts
|
|
3
|
-
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
import shx from 'shelljs';
|
|
9
|
-
export default class Compressors {
|
|
10
|
-
dest = '/tmp/eggs-mksquash-dest';
|
|
11
|
-
isEnabled = {
|
|
12
|
-
error: false,
|
|
13
|
-
gzip: true,
|
|
14
|
-
lz4: false,
|
|
15
|
-
lzma: false,
|
|
16
|
-
lzo: false,
|
|
17
|
-
xz: false,
|
|
18
|
-
zstd: false
|
|
19
|
-
};
|
|
20
|
-
source = '/tmp/eggs-mksquash-test';
|
|
21
|
-
/**
|
|
22
|
-
* fast compression
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
fast() {
|
|
26
|
-
let comp = 'gzip';
|
|
27
|
-
if (this.isEnabled.zstd) {
|
|
28
|
-
comp = 'zstd -b 1M -Xcompression-level 3';
|
|
29
|
-
}
|
|
30
|
-
else if (this.isEnabled.lz4) {
|
|
31
|
-
comp = 'lz4';
|
|
32
|
-
}
|
|
33
|
-
return comp;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* max
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
max() {
|
|
40
|
-
let filter = 'x86';
|
|
41
|
-
if (process.arch === 'arm64') {
|
|
42
|
-
filter = 'arm';
|
|
43
|
-
}
|
|
44
|
-
const options = '-b 1M -no-duplicates -no-recovery -always-use-fragments';
|
|
45
|
-
if (process.arch === 'ia32') {
|
|
46
|
-
// options = '-b 1M'
|
|
47
|
-
}
|
|
48
|
-
const comp = `xz -Xbcj ${filter} ${options}`;
|
|
49
|
-
return comp;
|
|
50
|
-
}
|
|
51
|
-
pendrive(level = '15') {
|
|
52
|
-
let comp = 'gzip';
|
|
53
|
-
if (this.isEnabled.zstd) {
|
|
54
|
-
comp = `zstd -b 1M -Xcompression-level ${level}`;
|
|
55
|
-
}
|
|
56
|
-
else if (this.isEnabled.lz4) {
|
|
57
|
-
comp = 'lz4';
|
|
58
|
-
}
|
|
59
|
-
return comp;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* populate
|
|
63
|
-
*/
|
|
64
|
-
async populate() {
|
|
65
|
-
await this.prepareCheck();
|
|
66
|
-
this.isEnabled.error = await this.check('error');
|
|
67
|
-
this.isEnabled.lzma = await this.check('lzma');
|
|
68
|
-
this.isEnabled.lzo = await this.check('lzo');
|
|
69
|
-
this.isEnabled.lz4 = await this.check('lz4');
|
|
70
|
-
this.isEnabled.xz = await this.check('xz');
|
|
71
|
-
this.isEnabled.zstd = await this.check('zstd');
|
|
72
|
-
await this.removeCheck();
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* standard
|
|
76
|
-
* @returns
|
|
77
|
-
*/
|
|
78
|
-
standard() {
|
|
79
|
-
const comp = 'xz -b 1M';
|
|
80
|
-
return comp;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* check mksquashfs exists
|
|
84
|
-
* @param compressor
|
|
85
|
-
* @returns
|
|
86
|
-
*/
|
|
87
|
-
async check(compressor) {
|
|
88
|
-
let result = false;
|
|
89
|
-
const { stderr } = shx.exec('mksquashfs ' + this.source + ' ' + this.dest + ' -comp ' + compressor + ' -ef ' + this.dest, { silent: true });
|
|
90
|
-
if (stderr === '') {
|
|
91
|
-
result = true;
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* prepareCheck
|
|
97
|
-
*/
|
|
98
|
-
async prepareCheck() {
|
|
99
|
-
shx.exec('rm -rf ' + this.source, { silent: true });
|
|
100
|
-
shx.exec('mkdir ' + this.source, { silent: true });
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* removeCheck
|
|
104
|
-
*/
|
|
105
|
-
async removeCheck() {
|
|
106
|
-
shx.exec('rm -rf ' + this.source, { silent: true });
|
|
107
|
-
shx.exec('rm -f ' + this.dest, { silent: true });
|
|
108
|
-
}
|
|
109
|
-
}
|
package/dist/classes/daddy.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/classes/daddy.ts
|
|
3
|
-
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
import Settings from '../classes/settings.js';
|
|
9
|
-
import { IEggsConfig } from '../interfaces/i-eggs-config.js';
|
|
10
|
-
export default class Daddy {
|
|
11
|
-
settings: Settings;
|
|
12
|
-
/**
|
|
13
|
-
* editConfif
|
|
14
|
-
* @param c
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
editConfig(c: IEggsConfig): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param reset
|
|
21
|
-
* @param isCustom
|
|
22
|
-
* @param fileCustom
|
|
23
|
-
* @param verbose
|
|
24
|
-
*/
|
|
25
|
-
helpMe(reset?: boolean, isCustom?: boolean, fileCustom?: string, verbose?: boolean): Promise<void>;
|
|
26
|
-
}
|
package/dist/classes/daddy.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/classes/daddy.ts
|
|
3
|
-
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
import chalk from 'chalk';
|
|
9
|
-
import inquirer from 'inquirer';
|
|
10
|
-
import yaml from 'js-yaml';
|
|
11
|
-
import fs from 'node:fs';
|
|
12
|
-
// _dirname
|
|
13
|
-
import path from 'node:path';
|
|
14
|
-
// We need to remove .js extension from import
|
|
15
|
-
import Pacman from '../classes/pacman.js';
|
|
16
|
-
import Settings from '../classes/settings.js';
|
|
17
|
-
import Utils from '../classes/utils.js';
|
|
18
|
-
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
19
|
-
export default class Daddy {
|
|
20
|
-
settings = {};
|
|
21
|
-
/**
|
|
22
|
-
* editConfif
|
|
23
|
-
* @param c
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
async editConfig(c) {
|
|
27
|
-
// Utils.titles('dad')
|
|
28
|
-
console.log(chalk.cyan('Edit and save Live system parameters'));
|
|
29
|
-
console.log();
|
|
30
|
-
let compressionOpt = 0;
|
|
31
|
-
if (c.compression === 'xz') {
|
|
32
|
-
compressionOpt = 1;
|
|
33
|
-
}
|
|
34
|
-
else if (c.compression === 'xz -Xbcj x86') {
|
|
35
|
-
compressionOpt = 2;
|
|
36
|
-
}
|
|
37
|
-
if (c.snapshot_prefix === '') {
|
|
38
|
-
c.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
39
|
-
}
|
|
40
|
-
return new Promise((resolve) => {
|
|
41
|
-
const questions = [
|
|
42
|
-
{
|
|
43
|
-
default: c.snapshot_prefix,
|
|
44
|
-
message: 'LiveCD iso prefix: ',
|
|
45
|
-
name: 'snapshot_prefix',
|
|
46
|
-
type: 'input'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
default: c.snapshot_basename,
|
|
50
|
-
message: 'LiveCD iso basename: ',
|
|
51
|
-
name: 'snapshot_basename',
|
|
52
|
-
type: 'input'
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
default: c.user_opt,
|
|
56
|
-
message: 'LiveCD user:',
|
|
57
|
-
name: 'user_opt',
|
|
58
|
-
type: 'input'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
default: c.user_opt_passwd,
|
|
62
|
-
message: 'LiveCD user password: ',
|
|
63
|
-
name: 'user_opt_passwd',
|
|
64
|
-
type: 'input'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
default: c.root_passwd,
|
|
68
|
-
message: 'LiveCD root password: ',
|
|
69
|
-
name: 'root_passwd',
|
|
70
|
-
type: 'input'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
choices: ['fast', 'max'],
|
|
74
|
-
default: compressionOpt,
|
|
75
|
-
message: 'LiveCD compression: ',
|
|
76
|
-
name: 'compression',
|
|
77
|
-
type: 'list'
|
|
78
|
-
}
|
|
79
|
-
];
|
|
80
|
-
inquirer.prompt(questions).then((options) => {
|
|
81
|
-
resolve(JSON.stringify(options));
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* @param reset
|
|
88
|
-
* @param isCustom
|
|
89
|
-
* @param fileCustom
|
|
90
|
-
* @param verbose
|
|
91
|
-
*/
|
|
92
|
-
async helpMe(reset = false, isCustom = false, fileCustom = '', verbose = false) {
|
|
93
|
-
if (isCustom) {
|
|
94
|
-
console.log('using custom file:', fileCustom);
|
|
95
|
-
}
|
|
96
|
-
// Controllo configurazione
|
|
97
|
-
if (!Pacman.configurationCheck()) {
|
|
98
|
-
console.log('- creating configuration dir...');
|
|
99
|
-
await Pacman.configurationInstall(verbose);
|
|
100
|
-
}
|
|
101
|
-
// Templates
|
|
102
|
-
if (!Pacman.distroTemplateCheck()) {
|
|
103
|
-
console.log('- distro template install...');
|
|
104
|
-
await Pacman.distroTemplateInstall(verbose);
|
|
105
|
-
}
|
|
106
|
-
//Calamares
|
|
107
|
-
if (!Pacman.calamaresExists() &&
|
|
108
|
-
Pacman.isInstalledGui() &&
|
|
109
|
-
Pacman.isCalamaresAvailable()) {
|
|
110
|
-
console.log('- this is a GUI system, calamares is available, but NOT installed');
|
|
111
|
-
}
|
|
112
|
-
// show and edit configuration
|
|
113
|
-
this.settings = new Settings();
|
|
114
|
-
let config = {};
|
|
115
|
-
let jsonConf = '';
|
|
116
|
-
if (await this.settings.load()) {
|
|
117
|
-
config = this.settings.config;
|
|
118
|
-
config.compression = 'fast';
|
|
119
|
-
if (reset || isCustom) {
|
|
120
|
-
if (config.snapshot_prefix === '') {
|
|
121
|
-
config.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
122
|
-
}
|
|
123
|
-
jsonConf = JSON.stringify(config);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
jsonConf = await this.editConfig(config);
|
|
127
|
-
}
|
|
128
|
-
// Custom configuration
|
|
129
|
-
if (isCustom) {
|
|
130
|
-
const conf = fs.readFileSync(fileCustom, 'utf8');
|
|
131
|
-
const confCustom = yaml.load(conf);
|
|
132
|
-
config.snapshot_basename = confCustom.snapshot_basename;
|
|
133
|
-
config.snapshot_prefix = confCustom.snapshot_prefix;
|
|
134
|
-
config.user_opt = confCustom.user_opt;
|
|
135
|
-
config.user_opt_passwd = confCustom.user_opt_passwd;
|
|
136
|
-
config.root_passwd = confCustom.root_passwd;
|
|
137
|
-
config.theme = confCustom.theme;
|
|
138
|
-
jsonConf = JSON.stringify(config);
|
|
139
|
-
}
|
|
140
|
-
// Save new configuration
|
|
141
|
-
const confNew = JSON.parse(jsonConf);
|
|
142
|
-
config.snapshot_basename = confNew.snapshot_basename;
|
|
143
|
-
config.snapshot_prefix = confNew.snapshot_prefix;
|
|
144
|
-
config.user_opt = confNew.user_opt;
|
|
145
|
-
config.user_opt_passwd = confNew.user_opt_passwd;
|
|
146
|
-
config.root_passwd = confNew.root_passwd;
|
|
147
|
-
config.theme = confNew.theme;
|
|
148
|
-
await this.settings.save(config);
|
|
149
|
-
}
|
|
150
|
-
console.log();
|
|
151
|
-
console.log(chalk.cyan('Your configuration was saved on: /etc/penguins-eggs.d'));
|
|
152
|
-
console.log();
|
|
153
|
-
console.log(chalk.cyan(`You can create a clean ISO with: `) + chalk.white(`sudo eggs produce`));
|
|
154
|
-
console.log(chalk.cyan(`or a full personal clone: `) + chalk.white(`sudo eggs produce --clone`));
|
|
155
|
-
console.log();
|
|
156
|
-
console.log(chalk.cyan(`If you don't have enough space to remaster, you can mount`));
|
|
157
|
-
console.log(chalk.cyan(`some remote or local space. Follow the samples:`));
|
|
158
|
-
console.log(chalk.cyan(`- first, create an hidden mountpoint under the nest:`));
|
|
159
|
-
console.log(chalk.white(`sudo mkdir /home/eggs/.mnt -p`));
|
|
160
|
-
console.log(chalk.cyan(`- then, mount remote space:`));
|
|
161
|
-
console.log(chalk.white(`sudo sshfs -o allow_other root@192.168.1.2:/zfs/iso /home/eggs/.mnt`));
|
|
162
|
-
console.log(chalk.cyan('- or, mount a local partition:'));
|
|
163
|
-
console.log(chalk.white(`sudo mount /dev/sdx1 /home/eggs/.mnt`));
|
|
164
|
-
console.log();
|
|
165
|
-
console.log(chalk.cyan('More help? ') + chalk.white('eggs mom'));
|
|
166
|
-
}
|
|
167
|
-
}
|
package/dist/classes/distro.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* penguins-eggs
|
|
3
|
-
* class: distro.ts
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* email: piero.proietti@gmail.com
|
|
6
|
-
* license: MIT
|
|
7
|
-
*/
|
|
8
|
-
import { IDistro } from '../interfaces/index.js';
|
|
9
|
-
/**
|
|
10
|
-
* Classe
|
|
11
|
-
*/
|
|
12
|
-
declare class Distro implements IDistro {
|
|
13
|
-
bugReportUrl: string;
|
|
14
|
-
codenameId: string;
|
|
15
|
-
codenameLikeId: string;
|
|
16
|
-
distroId: string;
|
|
17
|
-
distroLike: string;
|
|
18
|
-
familyId: string;
|
|
19
|
-
homeUrl: string;
|
|
20
|
-
isCalamaresAvailable: boolean;
|
|
21
|
-
liveMediumPath: string;
|
|
22
|
-
releaseId: string;
|
|
23
|
-
squashfs: string;
|
|
24
|
-
supportUrl: string;
|
|
25
|
-
syslinuxPath: string;
|
|
26
|
-
usrLibPath: string;
|
|
27
|
-
/**
|
|
28
|
-
* Costruttore
|
|
29
|
-
*/
|
|
30
|
-
constructor();
|
|
31
|
-
}
|
|
32
|
-
export default Distro;
|