From 6d66c7d40ee45bf3faa67166e4dccab5fbb7b650 Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Aug 30 2017 19:36:47 +0000 Subject: [PATCH 1/5] Import installation instructions inside an existing system Copy documentation from installing inside an existing system from https://pagure.io/fork/walters/workstation-ostree-config/branch/f24-continuous --- diff --git a/README.md b/README.md index 523e938..935a754 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,74 @@ Important issues: - [Anaconda autopartitoning](https://github.com/rhinstaller/anaconda/issues/800) - be sure to use `/var/home` instead of `/home` - [flatpak system repo](https://github.com/flatpak/flatpak/issues/113#issuecomment-247022006) - + +Installing *inside* an existing system +--------------------------------------- + +A really neat feature of OSTree is that you can +*parallel install* inside your existing OS. Let's try that, we +first make sure we have the ostree packages: + +``` +yum -y install ostree ostree-grub2 +``` + +Next, we add `/ostree/repo` to the filesystem: +``` +ostree admin init-fs / +``` + +Add a remote which points to the CentOS CI content: +``` +ostree remote add --set=gpg-verify=false fedora-ws-centosci https://ci.centos.org/artifacts/sig-atomic/rdgo/fedora-workstation/ostree/repo/ +``` + +Pull down the content (you can interrupt and restart this): +``` +ostree --repo=/ostree/repo pull fedora-ws-centosci:fedora/24/x86_64/desktop/continuous +``` + +Initialize an "os" for this, which acts as a state root. +``` +ostree admin os-init fedora +``` + +**For EFI systems**: currently ostree uses the presence of /boot/grub2/grub.cfg to detect a BIOS system, +but that can be present on systems booted with EFI as well. If you boot with EFI +(/sys/firmware/efi exists), then you need to move /boot/grub2/grub.cfg aside: +``` +mv /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak +``` +Since this file is not used on a EFI system, this won't break the operation of your current system. While you are at it, back up your existing grub config: +``` +cp /boot/efi/EFI/fedora/grub.cfg /boot/efi/EFI/fedora/grub.cfg.bak +``` + +Deploy; we use `enforcing=0` to avoid SELinux issues for now. +``` +ostree admin deploy --os=fedora --karg-proc-cmdline --karg=enforcing=0 fedora-ws-centosci:fedora/24/x86_64/desktop/continuous +``` + +To initialize this root, you'll need to copy over your `/etc/fstab`, `/etc/default/grub` at least, along with the ostree remote that we added: +``` +for i in /etc/fstab /etc/default/grub /etc/ostree/remotes.d/fedora-ws-centosci.conf ; do cp $i /ostree/deploy/fedora/deploy/$checksum.0/$i; done +``` +If you have a separate `/home` mount point, you'll need to change +that `fstab` copy to refer to `/var/home`. + +You'll also need to copy your user entry from `/etc/passwd`, `/etc/group`, +and `/etc/shadow` into the new `/etc/`, and add yourself to the wheel group +in `/etc/group`. Don't copy just copy these files literally, however, since +the system users and groups won't be the same. + +**For BIOS systems**: while ostree regenerated the bootloader configuration, +it writes config into `/boot/loader/grub.cfg`. On a current `grubby` +system, you'll need to copy that version over: + +``` +cp /boot/loader/grub.cfg /boot/grub2/grub.cfg +``` + Migrating between OSTree repos ------------------------------------- From 9bc42fadf76866c8d4325767eaa9fb124cf0c40b Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Aug 30 2017 19:37:46 +0000 Subject: [PATCH 2/5] Repoint instructions to Fedora Rawhide Update the instructions for installing inside an existing system to reference the Fedora rawhide tree, rather than a f24 build on CentOS CI. --- diff --git a/README.md b/README.md index 935a754..bc8da24 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,14 @@ Next, we add `/ostree/repo` to the filesystem: ostree admin init-fs / ``` -Add a remote which points to the CentOS CI content: +Add a remote which points to the Fedora Rawhide content: ``` -ostree remote add --set=gpg-verify=false fedora-ws-centosci https://ci.centos.org/artifacts/sig-atomic/rdgo/fedora-workstation/ostree/repo/ +ostree remote add --set=gpg-verify=false fedora-ws-rawhide https://kojipkgs.fedoraproject.org/compose/ostree/rawhide/ ``` Pull down the content (you can interrupt and restart this): ``` -ostree --repo=/ostree/repo pull fedora-ws-centosci:fedora/24/x86_64/desktop/continuous +ostree --repo=/ostree/repo pull fedora-ws-rawhide:fedora/rawhide/x86_64/workstation ``` Initialize an "os" for this, which acts as a state root. @@ -89,12 +89,12 @@ cp /boot/efi/EFI/fedora/grub.cfg /boot/efi/EFI/fedora/grub.cfg.bak Deploy; we use `enforcing=0` to avoid SELinux issues for now. ``` -ostree admin deploy --os=fedora --karg-proc-cmdline --karg=enforcing=0 fedora-ws-centosci:fedora/24/x86_64/desktop/continuous +ostree admin deploy --os=fedora --karg-proc-cmdline --karg=enforcing=0 fedora-ws-rawhide:fedora/rawhide/x86_64/workstation ``` To initialize this root, you'll need to copy over your `/etc/fstab`, `/etc/default/grub` at least, along with the ostree remote that we added: ``` -for i in /etc/fstab /etc/default/grub /etc/ostree/remotes.d/fedora-ws-centosci.conf ; do cp $i /ostree/deploy/fedora/deploy/$checksum.0/$i; done +for i in /etc/fstab /etc/default/grub /etc/ostree/remotes.d/fedora-ws-rawhide.conf ; do cp $i /ostree/deploy/fedora/deploy/$checksum.0/$i; done ``` If you have a separate `/home` mount point, you'll need to change that `fstab` copy to refer to `/var/home`. From 4fca679717d9c47c3f1ca469ac4e0f023a3351b8 Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Aug 30 2017 19:38:21 +0000 Subject: [PATCH 3/5] Existing install: document copying over locale.conf /etc/locale.conf also needs to be copied over into the generated root or the resulting system ends up with LANG unset, which keeps, for example, gnome-terminal from working. --- diff --git a/README.md b/README.md index bc8da24..1735a52 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,9 @@ Deploy; we use `enforcing=0` to avoid SELinux issues for now. ostree admin deploy --os=fedora --karg-proc-cmdline --karg=enforcing=0 fedora-ws-rawhide:fedora/rawhide/x86_64/workstation ``` -To initialize this root, you'll need to copy over your `/etc/fstab`, `/etc/default/grub` at least, along with the ostree remote that we added: +To initialize this root, you'll need to copy over your `/etc/fstab`, `/etc/locale.conf`, `/etc/default/grub` at least, along with the ostree remote that we added: ``` -for i in /etc/fstab /etc/default/grub /etc/ostree/remotes.d/fedora-ws-rawhide.conf ; do cp $i /ostree/deploy/fedora/deploy/$checksum.0/$i; done +for i in /etc/fstab /etc/default/grub /etc/locale.conf /etc/ostree/remotes.d/fedora-ws-rawhide.conf ; do cp $i /ostree/deploy/fedora/deploy/$checksum.0/$i; done ``` If you have a separate `/home` mount point, you'll need to change that `fstab` copy to refer to `/var/home`. From abc06774586f7870b1c9b07eab87bbc3967cfa92 Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Aug 30 2017 19:59:25 +0000 Subject: [PATCH 4/5] Existing install: add information about a non-separate home When /home isn't a separate partition, it's necessary to create a symlink from /var/home to /sysroot/home. --- diff --git a/README.md b/README.md index 1735a52..fa8e4e8 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,11 @@ To initialize this root, you'll need to copy over your `/etc/fstab`, `/etc/local for i in /etc/fstab /etc/default/grub /etc/locale.conf /etc/ostree/remotes.d/fedora-ws-rawhide.conf ; do cp $i /ostree/deploy/fedora/deploy/$checksum.0/$i; done ``` If you have a separate `/home` mount point, you'll need to change -that `fstab` copy to refer to `/var/home`. +that `fstab` copy to refer to `/var/home`. If you *don't* have a separate /home mount +point, then you need to make sure that a symlink will be created: +``` +echo 'L /var/home - - - - ../sysroot/home' > /ostree/deploy/fedora/deploy/$checksum.0/$i/etc/tmpfiles.d/00rpm-ostree.conf +``` You'll also need to copy your user entry from `/etc/passwd`, `/etc/group`, and `/etc/shadow` into the new `/etc/`, and add yourself to the wheel group From 5cb5c6e7426f7373502072b0758470daef2e0b9d Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Aug 30 2017 19:59:25 +0000 Subject: [PATCH 5/5] Existing system: Document turning off Plymouth Currently with Fedora Rawhide, Plymouth is hanging on boot for unknown reasons - so turn it off when deploying. --- diff --git a/README.md b/README.md index fa8e4e8..f634ec4 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ Since this file is not used on a EFI system, this won't break the operation of y cp /boot/efi/EFI/fedora/grub.cfg /boot/efi/EFI/fedora/grub.cfg.bak ``` -Deploy; we use `enforcing=0` to avoid SELinux issues for now. +Deploy; we use `enforcing=0` to avoid SELinux issues for now, and --karg=rghb=0 to avoid a hang with Plymouth. ``` -ostree admin deploy --os=fedora --karg-proc-cmdline --karg=enforcing=0 fedora-ws-rawhide:fedora/rawhide/x86_64/workstation +ostree admin deploy --os=fedora --karg-proc-cmdline --karg=enforcing=0 --karg=rhgb=0 fedora-ws-rawhide:fedora/rawhide/x86_64/workstation ``` To initialize this root, you'll need to copy over your `/etc/fstab`, `/etc/locale.conf`, `/etc/default/grub` at least, along with the ostree remote that we added: