Commit Graph

28 Commits

Author SHA1 Message Date
bc7a35a1e7 Dump DNF cache before collecting system data and dnf update instead of after.
If there's going to be errors due to corrupted repos, etc we want to find out
right away so we can bail before we put the system in an unstable state.  To
this end we dump the dnf cache right away to make sure that dnf is forced to hit
the repos insteada of relying on cached data.
2021-07-15 21:07:34 +12:00
6ee3330480 Force en_US.UTF-8
In order to properly parse output from certain commands we must ensure that
output is in the correct locale and character set.  Previously we had just set
LANG but that doesn't force the issue and some systems may still have issues.
While this change will override a person's foreign language preferences this is
preferable to it causing a failed migration.
2021-07-13 23:09:21 +12:00
23bc5d57c8 Check for dnf-plugins-core and enable config-manager
Check to make sure that dnf-plugins-core is present, and force-enable the
config-manager plugin for those dnf commands that need it in case it has been
disabled.
2021-07-09 22:23:18 +12:00
64fd6b5f08
Fix EFI boot to work with mdadm-mirrored partitions. (#68)
* Fix EFI boot to work with mdadm-mirrored partitions.
2021-07-08 14:04:18 +12:00
f014318b79 Add system-logos-ipa to the list of system packages to swap.
system-logos-ipa -> rocky-logos-ipa
2021-07-02 20:37:44 +12:00
24054df6f4
Check to make sure that we're not already on RockyLinux. (#64)
* Check to make sure that we're not already on RockyLinux.

Trying to migrate RockyLinux to RockyLinux can cause serious problems.
2021-07-01 18:55:27 +12:00
1602af296a Rocky isn't RC anymore 2021-06-29 22:38:23 +12:00
ac6fbedc21
Attempt to run dnf update before the migration (#58)
* Attempt to run dnf update before the migration.

While a migration will generally work without first running dnf update, thera
are several advantages of attempting to run an update first:

* We catch corner cases that an update will solve.

* Since we're running a distro-sync at the end, it effectively updates anyways
  and the same things that will break a distro-sync will often times break an
  update.  By attempting to run the update first we will discover those
  breakages before we put the system into an unstable state and we can bail out
  if the update fails, preventing a potentially disastrous outcome.
2021-06-29 21:21:33 +12:00
dfce36e61a
efibootmgr needs separate disk and partition (#52)
* efibootmgr needs separate disk and partition

efibootmgr needs a separate device (/dev/xxx) and partition number.

Co-authored-by: McNutnut <mcnutnut90@gmail.com>
2021-06-27 21:53:34 +12:00
aba39dd294 Suggest to remove dnf-plugin-subscription-manager
issue 40
2021-06-25 22:54:48 +12:00
Louis Abel
062f6c44bd
Merge pull request #38 from breca/main
Continues on empty lines from repoquery
2021-06-23 21:34:17 -07:00
Louis Abel
0aafb93884
Merge pull request #35 from lumarel/main
Improve checks against modified default repositories
2021-06-23 21:29:45 -07:00
Robert Scheck
9c5c8519d3 Add mapping for rocky-logos-httpd 2021-06-22 22:50:07 +02:00
Brett C
eeff0c3b94 Refactor for more efficient evaulation 2021-06-22 19:03:18 +10:00
Brett C
078779f2e6 Continues on empty lines from repoquery 2021-06-22 18:38:20 +10:00
lumarel
17b6ad6ebb Strengten other check 2021-06-21 22:52:27 +02:00
lumarel
9a6ad7a5f2 Improve wording and always block if Katello was configured 2021-06-21 22:50:40 +02:00
lumarel
ad5f8b2e27 More checking to make sure to not get any other configurations 2021-06-21 20:58:48 +02:00
d9b0081501 Fix issue with migration from Oracle 8.4
Oracle 8.4 moved some files from their oraclelinux-release package to a new
package named redhat-release.  This update makes sure to remove redhat-release
as well as the other packages during migration to avoid conflicts with
rocky-release.
2021-06-22 03:06:16 +12:00
lumarel
00cff404c8 Improve checks against modified default repositories 2021-06-20 23:08:30 +02:00
6957c0c4dd Add shellcheck directives
Some commands trigger false positives in shellcheck.  Add directives to tell
shellcheck not to complain about them.
2021-06-21 06:54:44 +12:00
5dc03bc40d Fix subscription-manger issues.
After a RHEL conversion any attempt to run subscription-manager would result in
an error.  this was due to the RedHat certs having been replaced on the system
during the migration.  To fix this we now copy any subscription-manager certs to
a temporary directory and if they have been removed during the migration we copy
them back at the finish.  This means that subscription-manager now won't stop
working after a migration from RHEL.
2021-06-21 05:10:24 +12:00
fe473ae20b Add color back in
We previously removed color because (1) it was outputting the color codes to the
log file, which we do not want and (2) nobody could agree on what colors to use.
I've reintroduced color now fixing (1) by allowing for separate output to the
log file and the console and only sending the color codes to the console and (2)
well, I've changed the blue for info messages to cyan, hopefully everyone's
happy with that, but I'm open to suggestions on the info color.

There are now three more file descriptors for specialized output control, making a total of 5:

fd1 - This sends to stdout and to the log file.
fd2 - This sends to stderr and the log file.
fd3 - This just sends to stdout.
fd4 - This just sends to stderr.
fd5 - This just sends to the logfile.

There are also three additional functions:

msg_format - Intended to be used by infomsg and errmsg, this accepts a variable
name and one or more string args.  If there is just one string after the
variable name then it is copied to the variable verbatim.  If there is more than
one then it is taken to be a format specifier and additional args to be passed
to printf (output going to the variable).

infomsg - This will accept either a single arg which contains a verbatim string
or multiple format / args to be processed by printf.  The output of this will be
sent to the log file and also color coded and sent to stdout.

errmsg - Like infomsg but it uses the error color and sends output to stderr
instead of stdout.
2021-06-21 00:01:02 +12:00
a4faff4b22 Don't output /etc/issue
/etc/issue used to contain a nice ascii-art RockyLinux logo that we would output
when this script was finished, but it doesn't anymore so there is no longer any
value to outputting this file.
2021-06-13 15:06:49 +12:00
72927f398e Group bash tests together 2021-06-13 00:36:43 +12:00
b587a7e7a4 Move more tests to the top
Test for teh bash version and root at the top as well, to avoid errors from
commands that otherwise get run before the tests.
2021-06-13 00:30:05 +12:00
5051fc5312 Test for bash at the top.
Put a test for bash at the top to make sure that people don't try to run in
POSIX sh mode.
2021-06-12 23:58:38 +12:00
Electronic Eel
750ed26f99 Move migrate2rocky into it's own subdirectory.
Clean up the rocky-tools root dir, the mirror script has it's own subdir too.
This makes rocky-tools scale better. As this breaks existing links, we should
do it as early as possible, before GA.
2021-06-11 19:17:16 +02:00