penguins-eggs 10.0.21 → 10.0.24

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.
Files changed (87) hide show
  1. package/.oclif.manifest.json +1 -1
  2. package/README.md +33 -29
  3. package/addons/eggs/theme/livecd/grub.main.cfg +11 -5
  4. package/addons/eggs/theme/livecd/isolinux.main.cfg +10 -12
  5. package/conf/derivatives.yaml +1 -0
  6. package/conf/distros/alpine/README.md +3 -0
  7. package/conf/distros/devel/README.md +3 -0
  8. package/conf/distros/focal/README.md +3 -0
  9. package/conf/distros/jammy/README.md +1 -1
  10. package/conf/distros/noble/calamares/calamares-modules/.keepit +0 -0
  11. package/conf/distros/noble/calamares/modules/_automirror.yml +6 -0
  12. package/conf/distros/noble/calamares/modules/_before_bootloader_context.yml +18 -0
  13. package/conf/distros/noble/calamares/modules/_oemid.yml +2 -0
  14. package/conf/distros/noble/calamares/modules/_pkgselect_context.yml +19 -0
  15. package/conf/distros/noble/calamares/modules/_pkgselect_snap_context.yml +9 -0
  16. package/conf/distros/noble/calamares/modules/_users.conf.oem +30 -0
  17. package/conf/distros/{focal/calamares/modules → noble/calamares/modules/focal-jammy}/fstab.yml +2 -2
  18. package/conf/distros/{focal/calamares/modules → noble/calamares/modules/focal-jammy}/mount.yml +2 -2
  19. package/conf/distros/{focal/calamares/modules → noble/calamares/modules/focal-jammy}/users.yml +2 -2
  20. package/conf/distros/{devel → noble}/calamares/modules/mount.yml +1 -0
  21. package/conf/distros/{devel/calamares/modules/_packages.yml → noble/calamares/modules/packages.yml} +1 -0
  22. package/conf/distros/noble/calamares/modules/partition.yml +21 -0
  23. package/conf/distros/noble/calamares/modules/shellprocess_fixconkeys_part1.yml +5 -0
  24. package/conf/distros/noble/calamares/modules/shellprocess_fixconkeys_part2.yml +5 -0
  25. package/conf/distros/noble/calamares/modules/shellprocess_oemprep.yml +5 -0
  26. package/conf/distros/noble/calamares/modules/umount.yml +4 -0
  27. package/conf/distros/{devel → noble}/calamares/modules/users.yml +3 -3
  28. package/conf/distros/{devel → noble}/calamares/modules/welcome.yml +3 -1
  29. package/conf/distros/noble/calamares/settings.yml +87 -0
  30. package/dist/classes/distro.js +4 -3
  31. package/dist/classes/incubation/distros/{focal.d.ts → noble.d.ts} +1 -1
  32. package/dist/classes/incubation/distros/{focal.js → noble.js} +1 -1
  33. package/dist/classes/incubation/incubator.js +14 -5
  34. package/dist/classes/keyboards.d.ts +1 -1
  35. package/dist/classes/keyboards.js +1 -1
  36. package/dist/classes/locales.js +9 -2
  37. package/dist/classes/ovary.js +19 -18
  38. package/dist/classes/pacman.js +27 -21
  39. package/dist/classes/utils.d.ts +1 -0
  40. package/dist/classes/utils.js +44 -7
  41. package/dist/classes/xdg.js +0 -3
  42. package/dist/components/information.js +5 -2
  43. package/dist/krill/modules/add-user.js +10 -6
  44. package/dist/krill/modules/machine-id.js +9 -1
  45. package/dist/krill/sequence.js +21 -17
  46. package/manpages/doc/man/eggs.1.gz +0 -0
  47. package/manpages/doc/man/eggs.html +587 -3
  48. package/package.json +7 -7
  49. package/conf/distros/devel/calamares/calamares-modules/automirror/automirror.yml +0 -17
  50. package/conf/distros/devel/calamares/calamares-modules/automirror/main.py +0 -168
  51. package/conf/distros/devel/calamares/calamares-modules/automirror/module.yml +0 -7
  52. package/conf/distros/devel/calamares/modules/after_bootloader_context.yml +0 -18
  53. package/conf/distros/devel/calamares/modules/automirror.yml +0 -16
  54. package/conf/distros/devel/calamares/modules/before_bootloader_context.yml +0 -24
  55. package/conf/distros/devel/calamares/modules/partition.yml +0 -8
  56. package/conf/distros/devel/calamares/settings.yml +0 -72
  57. package/conf/distros/focal/calamares/calamares-modules/automirror/automirror.yml +0 -17
  58. package/conf/distros/focal/calamares/calamares-modules/automirror/main.py +0 -168
  59. package/conf/distros/focal/calamares/calamares-modules/automirror/module.yml +0 -7
  60. package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +0 -19
  61. package/conf/distros/focal/calamares/modules/automirror.yml +0 -6
  62. package/conf/distros/focal/calamares/modules/before_bootloader_context.yml +0 -19
  63. package/conf/distros/focal/calamares/modules/before_bootloader_mkdirs_context.yml +0 -11
  64. package/conf/distros/focal/calamares/modules/bootloader.yml +0 -34
  65. package/conf/distros/focal/calamares/modules/finished.yml +0 -4
  66. package/conf/distros/focal/calamares/modules/grubcfg.yml +0 -5
  67. package/conf/distros/focal/calamares/modules/locale.yml +0 -9
  68. package/conf/distros/focal/calamares/modules/machineid.yml +0 -9
  69. package/conf/distros/focal/calamares/modules/partition.yml +0 -10
  70. package/conf/distros/focal/calamares/modules/shellprocess_add386arch.yml +0 -6
  71. package/conf/distros/focal/calamares/modules/shellprocess_bug-LP#1829805.yml +0 -5
  72. package/conf/distros/focal/calamares/modules/shellprocess_logs.yml +0 -6
  73. package/conf/distros/focal/calamares/modules/unpackfs.yml +0 -7
  74. package/conf/distros/focal/calamares/modules/welcome.yml +0 -26
  75. package/conf/distros/focal/calamares/settings.yml +0 -72
  76. /package/conf/distros/{devel/calamares/modules/before_bootloader_mkdirs_context.yml → noble/calamares/modules/_before_bootloader_mkdirs_context.yml} +0 -0
  77. /package/conf/distros/{devel → noble}/calamares/modules/_displaymanager.yml +0 -0
  78. /package/conf/distros/{devel/calamares/modules/shellprocess_logs.yml → noble/calamares/modules/_shellprocess_logs.yml} +0 -0
  79. /package/conf/distros/{devel → noble}/calamares/modules/bootloader.yml +0 -0
  80. /package/conf/distros/{devel → noble}/calamares/modules/finished.yml +0 -0
  81. /package/conf/distros/{devel → noble}/calamares/modules/fstab.yml +0 -0
  82. /package/conf/distros/{devel → noble}/calamares/modules/grubcfg.yml +0 -0
  83. /package/conf/distros/{devel → noble}/calamares/modules/locale.yml +0 -0
  84. /package/conf/distros/{devel → noble}/calamares/modules/machineid.yml +0 -0
  85. /package/conf/distros/{devel → noble}/calamares/modules/shellprocess_add386arch.yml +0 -0
  86. /package/conf/distros/{devel → noble}/calamares/modules/shellprocess_bug-LP#1829805.yml +0 -0
  87. /package/conf/distros/{devel → noble}/calamares/modules/unpackfs.yml +0 -0
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.21",
5
+ "version": "10.0.24",
6
6
  "author": "Piero Proietti",
7
7
  "bin": {
8
8
  "eggs": "./bin/run.js"
@@ -12,8 +12,8 @@
12
12
  "@oclif/core": "^4.0.17",
13
13
  "@oclif/plugin-autocomplete": "^3.1.11",
14
14
  "@oclif/plugin-help": "^6.2.7",
15
- "@oclif/plugin-version": "^2.2.9",
16
- "axios": "^1.7.2",
15
+ "@oclif/plugin-version": "^2.2.10",
16
+ "axios": "^1.7.3",
17
17
  "chalk": "^5.3.0",
18
18
  "cli-cursor": "^4.0.0",
19
19
  "ink": "^5.0.1",
@@ -31,7 +31,7 @@
31
31
  "devDependencies": {
32
32
  "@oclif/prettier-config": "^0.2.1",
33
33
  "@oclif/test": "^4.0.7",
34
- "@types/chai": "^4.3.16",
34
+ "@types/chai": "^4.3.17",
35
35
  "@types/inquirer": "^9.0.7",
36
36
  "@types/js-yaml": "^4.0.9",
37
37
  "@types/mocha": "^10.0.6",
@@ -43,11 +43,11 @@
43
43
  "@types/shelljs": "^0.8.15",
44
44
  "chai": "^5.1.1",
45
45
  "eslint": "^8.57.0",
46
- "eslint-config-oclif": "^5.2.0",
47
- "eslint-config-oclif-typescript": "^3.1.8",
46
+ "eslint-config-oclif": "^5.2.1",
47
+ "eslint-config-oclif-typescript": "^3.1.9",
48
48
  "eslint-config-prettier": "^9.1.0",
49
49
  "mocha": "^10.6.0",
50
- "oclif": "^4.14.12",
50
+ "oclif": "^4.14.13",
51
51
  "perrisbrewery": "^10.0.1",
52
52
  "prettier": "^3.3.3",
53
53
  "shx": "^0.3.4",
@@ -1,17 +0,0 @@
1
- # Ubuntu Focal
2
- # automirror
3
- ---
4
- # Which base URL to use for the archive.
5
- #
6
- # This assumes that your mirror URLs are under XX.baseURL
7
- baseUrl: archive.ubuntu.com
8
-
9
- # URL used for IP address lookup
10
- geoip:
11
- style: "json"
12
- url: "https://ipapi.co/json"
13
-
14
- # Distribution that this is based off of.
15
- # This is so we can make safe assumptions for the contents of
16
- # sources.list-like files.
17
- distribution: Ubuntu
@@ -1,168 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # Copyright (C) 2018 Simon Quigley <tsimonq2@ubuntu.com>
4
- #
5
- # This program is free software: you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or
8
- # (at your option) any later version.
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
-
18
- import json
19
- import libcalamares
20
- from time import strftime
21
- import urllib.request
22
- from urllib.error import HTTPError
23
- from urllib.error import URLError
24
- import socket
25
- import logging
26
- from lsb_release import get_distro_information
27
-
28
- global sources
29
- sources = """# Automatically generated by Calamares on DATE.
30
- # Lines starting with "deb" are mandatory, while lines starting with "deb-src"
31
- # are for more detailed package information.
32
-
33
- ## See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
34
- ## newer versions of DISTRIBUTION.
35
- deb URL/ubuntu/ CODENAME main restricted
36
- # deb-src URL/ubuntu/ CODENAME main restricted
37
-
38
- ## Major bug fix updates produced after the final release of DISTRIBUTION.
39
- ## Have you noticed a regression? Please report it!
40
- ## https://wiki.ubuntu.com/StableReleaseUpdates#Regressions
41
- deb URL/ubuntu/ CODENAME-updates main restricted
42
- # deb-src URL/ubuntu/ CODENAME-updates main restricted
43
-
44
- ## Software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team.
45
- ## Also, please note that software in Universe WILL NOT receive any review or
46
- ## updates from the Ubuntu security team directly. Updates in this repository
47
- ## are provided by volunteers, but most come from Debian.
48
- deb URL/ubuntu/ CODENAME universe
49
- # deb-src URL/ubuntu/ CODENAME universe
50
- deb URL/ubuntu/ CODENAME-updates universe
51
- # deb-src URL/ubuntu/ CODENAME-updates universe
52
-
53
- ## Software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team,
54
- ## and may not be under a free licence. Please satisfy yourself as your rights
55
- ## to use the software. Also, please note that software in Multiverse WILL NOT
56
- ## receive any review or updates from the Ubuntu security team directly.
57
- deb URL/ubuntu/ CODENAME multiverse
58
- # deb-src URL/ubuntu/ CODENAME multiverse
59
- deb URL/ubuntu/ CODENAME-updates multiverse
60
- # deb-src URL/ubuntu/ CODENAME-updates multiverse
61
-
62
- ## Software from this repository contains tested security updates from the
63
- ## Ubuntu security team.
64
- deb http://security.ubuntu.com/ubuntu CODENAME-security main restricted
65
- # deb-src http://security.ubuntu.com/ubuntu CODENAME-security main restricted
66
- deb http://security.ubuntu.com/ubuntu CODENAME-security universe
67
- # deb-src http://security.ubuntu.com/ubuntu CODENAME-security universe
68
- deb http://security.ubuntu.com/ubuntu CODENAME-security multiverse
69
- # deb-src http://security.ubuntu.com/ubuntu CODENAME-security multiverse
70
-
71
- ## Software from this repository may not have been tested as extensively as
72
- ## software contained in the main release, although it includes newer versions
73
- ## of some applications which may provide useful features. Also, please note
74
- ## that software in Backports WILL NOT receive any review or updates from the
75
- ## Ubuntu security team.
76
- deb URL/ubuntu/ CODENAME-backports main restricted universe multiverse
77
- # deb-src URL/ubuntu/ CODENAME-backports main restricted universe multiverse
78
-
79
- ## Uncomment the following two lines to add software from Canonical's
80
- ## "partner" repository.
81
- ## This software is not part of Ubuntu, but is offered by Canonical and the
82
- ## respective vendors as a service to Ubuntu users.
83
- # deb http://archive.canonical.com/ubuntu CODENAME partner
84
- # deb-src http://archive.canonical.com/ubuntu CODENAME partner"""
85
-
86
- SUBDOMAINS_BY_COUNTRY_CODE = {"US": "us.",
87
- "AU": "au.",
88
- "SE": "no.",
89
- "NO": "no.",
90
- "NZ": "nz.",
91
- "NL": "nl.",
92
- "KR": "kr.",
93
- "DE": "de.",
94
- "GE": "ge.",
95
- "PF": "pf.",
96
- "CZ": "cz.",
97
- "HR": "hr."}
98
-
99
-
100
- def getcountrycode():
101
- """
102
- Return the two-letter country code or an empty string.
103
-
104
- Tries to determine the country code based on the public IP address,
105
- if the device is connected to the Internet. Otherwise it returns
106
- an empty string.
107
- """
108
- if libcalamares.globalstorage.value("hasInternet"):
109
- geoipurl = libcalamares.job.configuration["geoip"]["url"]
110
- try:
111
- with urllib.request.urlopen(geoipurl, timeout=75) as http_response:
112
- localedata = json.loads(http_response.read().decode())
113
- except HTTPError as http_error:
114
- logging.error("Data not retrieved because %s - URL: %s",
115
- http_error, geoipurl)
116
- except URLError as url_error:
117
- if isinstance(url_error.reason, socket.timeout):
118
- logging.error("Socket timed out - URL %s", geoipurl)
119
- else:
120
- logging.error("Non-timeout protocol error.")
121
- else:
122
- logging.info("Country successfully determined.")
123
- return localedata["country"]
124
- else:
125
- return ""
126
-
127
-
128
- def get_subdomain_by_country(countrycode):
129
- """Return the subdomain for the given countrycode
130
- or an empty string.
131
- """
132
- if countrycode in SUBDOMAINS_BY_COUNTRY_CODE.keys():
133
- return SUBDOMAINS_BY_COUNTRY_CODE[countrycode]
134
- else:
135
- return ""
136
-
137
-
138
- def getcodename():
139
- """Return the codename of the distribution, similar to lsb_release -cs"""
140
- return get_distro_information()["CODENAME"]
141
-
142
-
143
- def changesources(subdomain):
144
- """Replace the placeholders and then create the sources.list"""
145
- distro = libcalamares.job.configuration["distribution"]
146
- url = "http://{}{}".format(subdomain,
147
- libcalamares.job.configuration["baseUrl"])
148
-
149
- global sources
150
- sources = sources.replace("DISTRIBUTION", distro)
151
- sources = sources.replace("CODENAME", getcodename())
152
- sources = sources.replace("URL", url)
153
- sources = sources.replace("DATE", strftime("%Y-%m-%d"))
154
-
155
- filepath = libcalamares.globalstorage.value("rootMountPoint")
156
- filepath += "/etc/apt/sources.list"
157
- with open(filepath, "r+") as sourcesfile:
158
- sourcesfile.seek(0)
159
- sourcesfile.write(sources)
160
- sourcesfile.truncate()
161
-
162
-
163
- def run():
164
- """Autoselect a mirror and create the sources.list file."""
165
- countrycode = getcountrycode()
166
- subdomain = get_subdomain_by_country(countrycode)
167
-
168
- changesources(subdomain)
@@ -1,7 +0,0 @@
1
- # Ubuntu Focal
2
- # automirror
3
- ---
4
- type: "job"
5
- name: "automirror"
6
- interface: "python"
7
- script: "main.py"
@@ -1,18 +0,0 @@
1
- ---
2
- dontChroot: false
3
- timeout: 120
4
- firmwareType:
5
- "*":
6
- - "-rm /usr/share/applications/calamares.desktop"
7
- - command: "-ln -s /usr/local/share/applications/org.rhinolinux.RhinoSetup.desktop /home/$USER/.config/autostart/setup.desktop"
8
- - command: "-wget https://ThiagoLcioBittencourt.gallery.vsassets.io/_apis/public/gallery/publisher/ThiagoLcioBittencourt/extension/omni-dracula-theme/1.0.7/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"
9
- - command: "-mv Microsoft.VisualStudio.Services.VSIXPackage omni-dracula.vsix"
10
- - command: "-mkdir /home/$USER/.config/VSCodium/"
11
- - command: "-mkdir /home/$USER/.config/VSCodium/User/"
12
- - command: "-chown -cR $USER /home/$USER/.config/VSCodium/"
13
- - command: "-HOME=/home/$USER runuser -m -u $USER -- sh -c 'codium --install-extension omni-dracula.vsix'"
14
- - command: "-rm omni-dracula.vsix"
15
- - command: "-chown -cR $USER /home/$USER/.config"
16
- - command: "-HOME=/home/$USER runuser -l $USER -c 'DISPLAY=:0 XAUTHORITY=/home/$USER/.Xauthority DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus gsettings set org.gnome.desktop.interface gtk-theme Yaru-purple'"
17
- - command: "-HOME=/home/$USER runuser -l $USER -c 'DISPLAY=:0 XAUTHORITY=/home/$USER/.Xauthority DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus xfconf-query -c xsettings -p /Net/IconThemeName -s Papirus-Dark'"
18
- - command: "-HOME=/home/$USER runuser -l $USER -c 'DISPLAY=:0 XAUTHORITY=/home/$USER/.Xauthority DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus xfconf-query -c xsettings -p /Gtk/CursorThemeName -s Quintom_Ink'"
@@ -1,16 +0,0 @@
1
- ---
2
- # Which base URL to use for the archive.
3
- #
4
- # This assumes that your mirror URLs are under XX.baseURL
5
- baseUrl: archive.ubuntu.com
6
-
7
- # URL used for IP address lookup
8
- geoip:
9
- style: "json"
10
- url: "https://ipapi.co/json"
11
-
12
- # Distribution that this is based off of.
13
- # This is so we can make safe assumptions for the contents of
14
- # sources.list-like files.
15
- distribution: Ubuntu Rhino Linux
16
-
@@ -1,24 +0,0 @@
1
- # Make sure the correct bootloader package is installed for EFI.
2
- # Also pull in shim so secureboot has a chance at working.
3
- # Because of edge cases, we ignore BIOS, and do the same
4
- # procedure for all EFI types.
5
- ---
6
- firmwareType:
7
- bios:
8
- - command: sed -i 's/ cdrom/ [trusted=yes] cdrom/g' /etc/apt/sources.list
9
- - timeout: 10
10
- - command: apt-get update --allow-releaseinfo-change
11
- timeout: 120
12
- - command: apt install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict grub-pc
13
- timeout: 300
14
- - command: apt install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict shim-signed
15
- timeout: 300'
16
- "*":
17
- - command: sed -i 's/ cdrom/ [trusted=yes] cdrom/g' /etc/apt/sources.list
18
- - timeout: 10
19
- - command: apt-get update --allow-releaseinfo-change
20
- timeout: 120
21
- - command: apt install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict grub-efi-$(dpkg --print-architecture)-signed
22
- timeout: 300
23
- - command: apt install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict shim-signed
24
- timeout: 300'
@@ -1,8 +0,0 @@
1
- efiSystemPartition: "/boot/efi"
2
- enableLuksAutomatedPartitioning: true
3
- userSwapChoices:
4
- - none
5
- - file
6
- initialSwapChoice: file
7
- drawNestedPartitions: true
8
- defaultFileSystemType: "ext4"
@@ -1,72 +0,0 @@
1
- # Ubuntu 22.04 jammy
2
- ---
3
- modules-search: [ local ]
4
-
5
- instances:
6
- - id: before_bootloader_mkdirs
7
- module: contextualprocess
8
- config: before_bootloader_mkdirs_context.conf
9
- - id: before_bootloader
10
- module: contextualprocess
11
- config: before_bootloader_context.conf
12
- - id: after_bootloader
13
- module: contextualprocess
14
- config: after_bootloader_context.conf
15
- - id: logs
16
- module: shellprocess
17
- config: shellprocess_logs.conf
18
- - id: bug-LP#1829805
19
- module: shellprocess
20
- config: shellprocess_bug-LP#1829805.conf
21
- - id: add386arch
22
- module: shellprocess
23
- config: shellprocess_add386arch.conf
24
-
25
- sequence:
26
- - show:
27
- - welcome
28
- - locale
29
- - keyboard
30
- - partition
31
- {{createUsers}}users
32
- - summary
33
- - exec:
34
- - partition
35
- - mount
36
- - unpackfs
37
- - sources-yolk
38
- {{hasSystemd}}machineid
39
- - fstab
40
- - locale
41
- - keyboard
42
- - localecfg
43
- - luksbootkeyfile
44
- {{createUsers}}users
45
- {{hasDisplaymanager}}displaymanager
46
- - networkcfg
47
- - hwclock
48
- - contextualprocess@before_bootloader_mkdirs
49
- - shellprocess@bug-LP#1829805
50
- - initramfscfg
51
- - initramfs
52
- - grubcfg
53
- - contextualprocess@before_bootloader
54
- - bootloader
55
- - contextualprocess@after_bootloader
56
- # automirror
57
- - shellprocess@add386arch
58
- - packages
59
- - removeuser
60
- # - shellprocess@logs
61
- - cleanup
62
- - sources-yolk-undo
63
- - umount
64
- - show:
65
- - finished
66
-
67
- branding: {{branding}}
68
- prompt-install: true
69
- dont-chroot: false
70
- oem-setup: false
71
- disable-cancel: false
72
- disable-cancel-during-exec: false
@@ -1,17 +0,0 @@
1
- # Ubuntu Focal
2
- # automirror
3
- ---
4
- # Which base URL to use for the archive.
5
- #
6
- # This assumes that your mirror URLs are under XX.baseURL
7
- baseUrl: archive.ubuntu.com
8
-
9
- # URL used for IP address lookup
10
- geoip:
11
- style: "json"
12
- url: "https://ipapi.co/json"
13
-
14
- # Distribution that this is based off of.
15
- # This is so we can make safe assumptions for the contents of
16
- # sources.list-like files.
17
- distribution: Ubuntu
@@ -1,168 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # Copyright (C) 2018 Simon Quigley <tsimonq2@ubuntu.com>
4
- #
5
- # This program is free software: you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or
8
- # (at your option) any later version.
9
- #
10
- # This program is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
-
18
- import json
19
- import libcalamares
20
- from time import strftime
21
- import urllib.request
22
- from urllib.error import HTTPError
23
- from urllib.error import URLError
24
- import socket
25
- import logging
26
- from lsb_release import get_distro_information
27
-
28
- global sources
29
- sources = """# Automatically generated by Calamares on DATE.
30
- # Lines starting with "deb" are mandatory, while lines starting with "deb-src"
31
- # are for more detailed package information.
32
-
33
- ## See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
34
- ## newer versions of DISTRIBUTION.
35
- deb URL/ubuntu/ CODENAME main restricted
36
- # deb-src URL/ubuntu/ CODENAME main restricted
37
-
38
- ## Major bug fix updates produced after the final release of DISTRIBUTION.
39
- ## Have you noticed a regression? Please report it!
40
- ## https://wiki.ubuntu.com/StableReleaseUpdates#Regressions
41
- deb URL/ubuntu/ CODENAME-updates main restricted
42
- # deb-src URL/ubuntu/ CODENAME-updates main restricted
43
-
44
- ## Software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team.
45
- ## Also, please note that software in Universe WILL NOT receive any review or
46
- ## updates from the Ubuntu security team directly. Updates in this repository
47
- ## are provided by volunteers, but most come from Debian.
48
- deb URL/ubuntu/ CODENAME universe
49
- # deb-src URL/ubuntu/ CODENAME universe
50
- deb URL/ubuntu/ CODENAME-updates universe
51
- # deb-src URL/ubuntu/ CODENAME-updates universe
52
-
53
- ## Software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team,
54
- ## and may not be under a free licence. Please satisfy yourself as your rights
55
- ## to use the software. Also, please note that software in Multiverse WILL NOT
56
- ## receive any review or updates from the Ubuntu security team directly.
57
- deb URL/ubuntu/ CODENAME multiverse
58
- # deb-src URL/ubuntu/ CODENAME multiverse
59
- deb URL/ubuntu/ CODENAME-updates multiverse
60
- # deb-src URL/ubuntu/ CODENAME-updates multiverse
61
-
62
- ## Software from this repository contains tested security updates from the
63
- ## Ubuntu security team.
64
- deb http://security.ubuntu.com/ubuntu CODENAME-security main restricted
65
- # deb-src http://security.ubuntu.com/ubuntu CODENAME-security main restricted
66
- deb http://security.ubuntu.com/ubuntu CODENAME-security universe
67
- # deb-src http://security.ubuntu.com/ubuntu CODENAME-security universe
68
- deb http://security.ubuntu.com/ubuntu CODENAME-security multiverse
69
- # deb-src http://security.ubuntu.com/ubuntu CODENAME-security multiverse
70
-
71
- ## Software from this repository may not have been tested as extensively as
72
- ## software contained in the main release, although it includes newer versions
73
- ## of some applications which may provide useful features. Also, please note
74
- ## that software in Backports WILL NOT receive any review or updates from the
75
- ## Ubuntu security team.
76
- deb URL/ubuntu/ CODENAME-backports main restricted universe multiverse
77
- # deb-src URL/ubuntu/ CODENAME-backports main restricted universe multiverse
78
-
79
- ## Uncomment the following two lines to add software from Canonical's
80
- ## "partner" repository.
81
- ## This software is not part of Ubuntu, but is offered by Canonical and the
82
- ## respective vendors as a service to Ubuntu users.
83
- # deb http://archive.canonical.com/ubuntu CODENAME partner
84
- # deb-src http://archive.canonical.com/ubuntu CODENAME partner"""
85
-
86
- SUBDOMAINS_BY_COUNTRY_CODE = {"US": "us.",
87
- "AU": "au.",
88
- "SE": "no.",
89
- "NO": "no.",
90
- "NZ": "nz.",
91
- "NL": "nl.",
92
- "KR": "kr.",
93
- "DE": "de.",
94
- "GE": "ge.",
95
- "PF": "pf.",
96
- "CZ": "cz.",
97
- "HR": "hr."}
98
-
99
-
100
- def getcountrycode():
101
- """
102
- Return the two-letter country code or an empty string.
103
-
104
- Tries to determine the country code based on the public IP address,
105
- if the device is connected to the Internet. Otherwise it returns
106
- an empty string.
107
- """
108
- if libcalamares.globalstorage.value("hasInternet"):
109
- geoipurl = libcalamares.job.configuration["geoip"]["url"]
110
- try:
111
- with urllib.request.urlopen(geoipurl, timeout=75) as http_response:
112
- localedata = json.loads(http_response.read().decode())
113
- except HTTPError as http_error:
114
- logging.error("Data not retrieved because %s - URL: %s",
115
- http_error, geoipurl)
116
- except URLError as url_error:
117
- if isinstance(url_error.reason, socket.timeout):
118
- logging.error("Socket timed out - URL %s", geoipurl)
119
- else:
120
- logging.error("Non-timeout protocol error.")
121
- else:
122
- logging.info("Country successfully determined.")
123
- return localedata["country"]
124
- else:
125
- return ""
126
-
127
-
128
- def get_subdomain_by_country(countrycode):
129
- """Return the subdomain for the given countrycode
130
- or an empty string.
131
- """
132
- if countrycode in SUBDOMAINS_BY_COUNTRY_CODE.keys():
133
- return SUBDOMAINS_BY_COUNTRY_CODE[countrycode]
134
- else:
135
- return ""
136
-
137
-
138
- def getcodename():
139
- """Return the codename of the distribution, similar to lsb_release -cs"""
140
- return get_distro_information()["CODENAME"]
141
-
142
-
143
- def changesources(subdomain):
144
- """Replace the placeholders and then create the sources.list"""
145
- distro = libcalamares.job.configuration["distribution"]
146
- url = "http://{}{}".format(subdomain,
147
- libcalamares.job.configuration["baseUrl"])
148
-
149
- global sources
150
- sources = sources.replace("DISTRIBUTION", distro)
151
- sources = sources.replace("CODENAME", getcodename())
152
- sources = sources.replace("URL", url)
153
- sources = sources.replace("DATE", strftime("%Y-%m-%d"))
154
-
155
- filepath = libcalamares.globalstorage.value("rootMountPoint")
156
- filepath += "/etc/apt/sources.list"
157
- with open(filepath, "r+") as sourcesfile:
158
- sourcesfile.seek(0)
159
- sourcesfile.write(sources)
160
- sourcesfile.truncate()
161
-
162
-
163
- def run():
164
- """Autoselect a mirror and create the sources.list file."""
165
- countrycode = getcountrycode()
166
- subdomain = get_subdomain_by_country(countrycode)
167
-
168
- changesources(subdomain)
@@ -1,7 +0,0 @@
1
- # Ubuntu Focal
2
- # automirror
3
- ---
4
- type: "job"
5
- name: "automirror"
6
- interface: "python"
7
- script: "main.py"
@@ -1,19 +0,0 @@
1
- # Ubuntu jammy 22.04
2
- # Workaround from ubiquity. Ubuntu's grub will want to look in EFI/ubuntu, so
3
- # let's make sure it can find something there.
4
- # This only copies the cfg and doesn't overwrite, this is specifically so
5
- # this doesn't interfere with an Ubuntu installed on the system already.
6
- ---
7
- dontChroot: false
8
- timeout: 120
9
- firmwareType:
10
- efi:
11
- # grub hack
12
- - -mkdir /boot/efi/EFI/ubuntu
13
- - -cp /boot/efi/EFI/neon/grub.cfg /boot/efi/EFI/ubuntu/
14
- - command: -apt-get update
15
- timeout: 60
16
-
17
- bios:
18
- - command: -apt-get update
19
- timeout: 60
@@ -1,6 +0,0 @@
1
- ---
2
- baseUrl: archive.ubuntu.com
3
- distribution: Lubuntu
4
- geoip:
5
- style: "json"
6
- url: "https://ipapi.co/json"
@@ -1,19 +0,0 @@
1
- # Ubuntu jammy 22.04
2
- # Make sure the correct bootloader package is installed for EFI.
3
- # Also pull in shim so secureboot has a chance at working.
4
- # Because of edge cases, we ignore BIOS, and do the same
5
- # procedure for all EFI types.
6
- ---
7
- firmwareType:
8
- bios: "-/bin/true"
9
- "*":
10
- #- command: apt-cdrom add -m -d=/media/cdrom/
11
- # timeout: 10
12
- #- command: sed -i '/deb http/d' /etc/apt/sources.list
13
- # timeout: 10
14
- - command: apt-get update
15
- timeout: 120
16
- - command: apt-get install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict grub-efi-$(if grep -q 64 /sys/firmware/efi/fw_platform_size; then echo amd64-signed; else echo ia32; fi)
17
- timeout: 300
18
- - command: apt-get install -y --no-upgrade -o Acquire::gpgv::Options::=--ignore-time-conflict shim-signed
19
- timeout: 300
@@ -1,11 +0,0 @@
1
- # Ubuntu jammy 22.04
2
- ---
3
- dontChroot: true
4
- timeout: 10
5
- firmwareType:
6
- efi:
7
- - -cp /cdrom/casper/vmlinuz ${ROOT}/boot/vmlinuz-$(uname -r)
8
- - -mkdir -pv ${ROOT}/media/cdrom
9
- - -mount --bind /cdrom ${ROOT}/media/cdrom
10
- bios:
11
- - -cp /cdrom/casper/vmlinuz ${ROOT}/boot/vmlinuz-$(uname -r)