Skip to content

Commit

Permalink
Install as coreos-installer.legacy
Browse files Browse the repository at this point in the history
For openshift/enhancements#210 I think
we will need at least some transitional period where RHCOS
ships both.  Even ignoring customers, the way our CI works
strongly encourages "ratcheting" changes in a compatible way,
i.e.:

- Introduce new thing, ship it
- Port consumers to new thing
- Remove old thing

And honestly I think this is a good model, because it forces
us to experience some of the pain that customers might feel here.

The basic idea here is:

- Install as `/usr/libexec/coreos-installer.legacy` so there's
  no chance of conflict with the real one
- Test for the presence of the "stamp file' we drop in our legacy initramfs
  so we know to defer to the real root's coreos-installer; see
  coreos/coreos-assembler#1389
  • Loading branch information
cgwalters committed Apr 23, 2020
1 parent cb2bffc commit 189335a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ all:
@echo "(Nothing to do)"

install:
install -D -t $(DESTDIR)/usr/libexec -m 0755 coreos-installer
install -D $(DESTDIR)/usr/libexec/coreos-installer.legacy -m 0755 coreos-installer
for x in dracut/*; do install -D -t $(DESTDIR)/usr/lib/dracut/modules.d/$$(basename $$x) $$x/*; done
5 changes: 5 additions & 0 deletions dracut/30coreos-installer/coreos-installer-generator
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

set -e

# Verify we are in the legacy installer initramfs.
if ! [ -f /etc/coreos-legacy-installer-initramfs ]; then
exit 0
fi

UNIT_DIR="${1:-/tmp}"

cmdline=( $(</proc/cmdline) )
Expand Down
2 changes: 1 addition & 1 deletion dracut/30coreos-installer/coreos-installer.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OnFailureJobMode=isolate

[Service]
Type=simple
ExecStart=/usr/libexec/coreos-installer
ExecStart=/usr/libexec/coreos-installer.legacy
# Perform reboot after install unless asked not to.
ExecStop=/bin/sh -c 'test -f /tmp/skip_reboot || sleep 5 && reboot'
#StandardInput=tty-force
Expand Down
2 changes: 1 addition & 1 deletion dracut/30coreos-installer/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install() {
inst_multiple -o /lib/s390-tools/stage3.bin
fi

inst_simple /usr/libexec/coreos-installer
inst_simple /usr/libexec/coreos-installer.legacy

inst_simple "$moddir/coreos-installer-generator" \
"$systemdutildir/system-generators/coreos-installer-generator"
Expand Down

0 comments on commit 189335a

Please sign in to comment.