Commit Graph

80 Commits

Author SHA1 Message Date
d3affffb67 Fix typo 2021-06-05 12:05:35 +12:00
8b30d758e4 Add pre_check for Katello
Missed adding the function call in previous commit.
2021-06-05 11:55:09 +12:00
d3070e9493 Bail on Katello systems.
Katello breaks EL systems to the point where migrate2rocky can't properly
migrate them and any attempt to do so causes major corruption.  This prevents
migrate2rocky from running on Katello systems.
2021-06-05 11:51:02 +12:00
3dbad4d658 Merge branch 'main' of github.com:pajamian/rocky-tools into main 2021-06-05 11:33:09 +12:00
aafffd330d Fix Typo 2021-06-05 11:32:23 +12:00
4fc1c1db1a Merge branch 'rocky-linux:main' into main 2021-06-05 11:31:32 +12:00
c38eeaecba Add note to README about katello systems 2021-06-05 11:30:45 +12:00
7d8e7ae627
Merge pull request #27 from pajamian/main
Fix various issues found by shellcheck + Fix issues when migrating from CentOS 8.3 after 8.4 dropped
2021-06-04 07:35:35 -04:00
844896ad6b Fix rpm and dnf package spec issues
When attempting to check if a package exists for a particular provide string
what happened is if an older version of the package was on the system but a
newer version in the repositories then the older (system) version would be
returned by dnf provides, but this could not be translated into a package name
with dnf repoquery because that specific version could not be found in the
repos.  The solution was to check rpm first to translate the package name on the
system and then dnf repoquery if rpm doesn't find it.

This brought to light issues when passing arrays of package names to rpm and dnf
which might happen to contain an empty element.  In this case rpm and dnf would
consider the empty arg an indicator that it should match all packages on the
system, or all available packages.  While we should try to avoid passing arrays
with empty elements, this highlighed a need to make rpm and dnf safer in this
regard, and so there are now saferpm and sfednf functions which simply strip any
empty args before calling the appropriate command with the rest of the args
untouched.

This commit also fixes an issue with output column formatting.
2021-06-04 22:11:15 +12:00
ef1cfd1fb9 Fix various issues found by shellcheck
Shellcheck found various issues that have cropped up over time.  This commit
fixes those issues.
2021-06-04 02:16:43 +12:00
Louis Abel
f2da5e4a8c
Merge pull request #25 from electroniceel/gpg-signature-validation
Do GPG signature checking for the whole migration process
2021-06-02 09:24:41 -07:00
Louis Abel
f88440e889
Merge pull request #24 from pajamian/main
Add MIT license.
2021-06-02 09:24:26 -07:00
Electronic Eel
3ed1aec1bd Do GPG signature checking for the whole migration process
Before this commit, the Rocky system packages like rocky-repos,
rocky-release and similar, were not checked for their gpg signature,
while the rest of the packages were signature checked.
While the system packages were downloaded from https://dl.rockylinux.org,
this still created the risk that someone could attack the CDN infrastructure
behind dl.rockylinux.org and place malicous files there.

With this patch the GPG key is downloaded separately and then compared
against a checksum contained in the script. This adds an extra layer of
security.
2021-06-02 15:16:56 +02:00
e27f9759cb Add MIT license. 2021-06-01 17:11:37 +12:00
Neil Hanlon
de8c952285
Merge pull request #22 from electroniceel/efi-secure-boot
Check if EFI secure boot is enabled
2021-05-31 20:30:52 -04:00
773b2c0d6f
Merge pull request #21 from pajamian/main
Add a "Known Issues" section to README file
2021-05-31 20:30:34 -04:00
932e19384d
Merge branch 'main' into main 2021-05-31 20:30:27 -04:00
Neil Hanlon
6312ce9d19
Merge pull request #23 from electroniceel/upstream-url
Add the repo URL to the comments and documentation.
2021-05-31 20:26:14 -04:00
Electronic Eel
50dac4a735 Check if EFI secure boot is enabled and notify user to disable it in this case. 2021-05-31 17:30:23 +02:00
Electronic Eel
55b70e0913 Add the repo URL to the comments and documentation.
In case the script gets copied around and mirrored, the end user should see
where to get the latest version.
2021-05-31 17:13:33 +02:00
1500f7ec4e Tweak code for known RHEL issue 2021-05-31 21:15:15 +12:00
98fd78e2b6 Add a "known issues" section to the README
Add a section to the README file for known issues so that we don't have to
repeatedly answer questions about them in sujpport channels.
2021-05-31 21:12:32 +12:00
Louis Abel
2c95485314
Merge pull request #20 from pajamian/main
remove centos2rocky.sh and update README
2021-05-30 19:56:31 -07:00
8f1cb96cbc Remove pastebin.com link
Remove link to pastebin.com
2021-05-31 14:44:38 +12:00
f68a73605a centos2rocky to migrate2rocky
Missed this change in previous commit.
2021-05-31 14:37:49 +12:00
6ae66c4fb7 Remove centos2rocky.sh
Remove centos2rocky.sh as it has now been replace by migrate2rocky.sh.
2021-05-31 14:36:03 +12:00
dea9f855db Merge branch 'main' of github.com:pajamian/rocky-tools into main 2021-05-31 14:31:46 +12:00
517cdcd41f Update README
Update README file to reference migrate2rocky instead of centos2rocky.
2021-05-31 14:30:32 +12:00
385270b537
Merge pull request #19 from electroniceel/fix-uefi
Fix migrate2rocky on EFI systems
2021-05-30 21:31:50 -04:00
Electronic Eel
47c7ab35c0 Automatically run EFI conversion steps
Before this commit the user was supposed to give the -e cmdline parameter
to run the EFI conversion when necessary. But it was missing in the getopts
parameter list, so it didn't work.

Instead of fixing it, I opted to remove the -e parameter alltogether and
automatically detect if the system is running on EFI or not. Because if the
user should forget to give -e on an EFI system, it would result in an unbootable
system without any bootmanager installed. Fixing this situation takes time and
requires some sysadmin skills, so we should take steps to avoid this situation.

Detecting if the system runs on EFI or not can reliably done by checking for
/sys/firmware/efi/.
2021-05-30 15:28:20 +02:00
Electronic Eel
656ca6227e fix typo in efibootmgr cmdline options 2021-05-30 13:47:25 +02:00
Louis Abel
69de45d490
Merge pull request #18 from pajamian/main
Various fixes based on feedback
2021-05-29 18:55:04 -07:00
629abc3134 Merge branch 'rocky-linux:main' into main 2021-05-29 21:24:25 +12:00
40dc4b53b1 Change log file name to migrate2rocky.log
It was left as centos2rocky.log from the old script.
2021-05-29 21:22:01 +12:00
b2d0c000d4 Turn off colors
This is for two reaons:

1.  There have been a number of complaints about the color blue.  For now I
can't get reasonable agreement on which color to make informative messages and
it will differ depending on what the background color is of a person's terminal.

2.  Currently the log is generated simply by splitting stdout and stderr.  That
means that color codes go to the log, which is less than ideal.  We need
separate logging routines that don't send the color codes but for now turning
off color will suffice.

This has been accomplished simply by commenting out the tput assignments at the
beginning of the script.  It is likely that osme form of color support will go
back in at some point so we'll keep the old code around for now.
2021-05-29 21:17:10 +12:00
800cf77a38 Add support for EFI
You can now pass the -e switch to update EFI boot settings at the end of the
migration.
2021-05-29 18:33:57 +12:00
7aa8c84ce2 Add dnf version check
EL 8.0 had a dnf that was not compatible with this script (output changed
causing parsing errors).  Make sure that e ahve a recent enough dnf for this
script to run properly and recommend updating otherwise.
2021-05-29 14:17:06 +12:00
Louis Abel
c83b38f784
Merge pull request #17 from pajamian/main
Import migrate2rocky.sh
2021-05-26 12:17:07 -07:00
3941878e51 Get rid of placeholder code for features we likely will never implment. 2021-05-19 00:05:01 +12:00
4dc791a7cc Don't migrate problematic modules.
Exclude known problematic modules from migration.
2021-05-18 23:43:58 +12:00
e01ac3ebee Springdale fixes
- Remove devel repo (can be put back when it becomes a thing with rocky).
- Fix filtering of header lines when parsing module list.
2021-05-16 14:05:42 +12:00
6534aaa584 Various additional RHEL fixes.
Additional RHEL fixes:
- Don't remove subscription-manager because baseos is subscription managed.
- Disable any remaining subscription managed repos that are replaced by
  RockyLinux repos.
- Hide digest messages from rpm.
2021-05-14 15:18:43 +12:00
17d50090fd Remove stray debugging line 2021-05-14 02:33:59 +12:00
1c25367f8b Various RHEL fixes
Various fixes to allow RHEL conversions to work:
- adding additional commands to bin_check
- Fixed awk command to parse out the gpgkey for a repo.
- provides_pkg() which returns a package name for a given provides.
- allow additional packages to be removed without replacing them with rocky
  equivalents.
- Don't bother checkign the exit status of dnf shell, it doesn't return a valid
  fail status anyways.
- Instead check to make sure that the appropriate packages have been removed and
  installed.  If not attempt to fix with rpm.
2021-05-14 02:26:20 +12:00
49fa13494e Account for no modules.
It is possible that we may get a system with no modules enabled.  Test and
account for this by skipping the enable modules step if necessary.
2021-05-12 13:44:41 +12:00
fdadcac23d os-release should be run in a subshell.
os-release should be run in a subshell to avoid the settings corrupting the main
script.
2021-05-12 11:11:36 +12:00
7f08a2b696 Import migrate2rocky.sh
This script, based on centos2rocky.sh is designed to be able to migrate to Rocky
Linux from any EL8 distribution.
2021-05-12 10:55:56 +12:00
nazunalika
d975bbe41a
remove unneeded option 2021-05-07 17:16:32 -07:00
Louis Abel
4c2a01eb86
Merge pull request #14 from pajamian/main
Various improvements
2021-05-07 17:14:25 -07:00
dae927baeb Add missing format string to printf. 2021-05-07 18:06:22 +12:00