From 624628ed5950b48a269e41ef52cdad6219ad72b8 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 20 Nov 2017 10:21:51 -0500 Subject: [PATCH] README: Update for 27, split out install-inside --- README-install-inside.md | 70 ++++++++++++++++++++ README.md | 134 +++++++-------------------------------- 2 files changed, 92 insertions(+), 112 deletions(-) create mode 100644 README-install-inside.md diff --git a/README-install-inside.md b/README-install-inside.md new file mode 100644 index 0000000..1eab18a --- /dev/null +++ b/README-install-inside.md @@ -0,0 +1,70 @@ +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 Fedora Rawhide content: +``` +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-rawhide:fedora/rawhide/x86_64/workstation +``` + +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, and --karg=rghb=0 to avoid a hang with Plymouth (these aren't needed if deploying Fedora 26 currently). +``` +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: +``` +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`. 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/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 +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 +``` diff --git a/README.md b/README.md index 60d4392..772ff7d 100644 --- a/README.md +++ b/README.md @@ -20,120 +20,33 @@ This project is actively maintained and is ready for use by sophisticated and interested users, but not ready for widespread promotion. -Updates not currently generated for Fedora 26 --------------------------------------------------------- +Installing +------------ -If you choose Fedora 26, note that Fedora is not currently -shipping updates. For that, see [atomic-ws](https://pagure.io/atomic-ws). +There are ISOs available for [Fedora 27](https://dl.fedoraproject.org/pub/fedora/linux/releases/27/WorkstationOstree/x86_64/iso/). -Installing (do not use partitioning defaults!) ----------- - -Important! *Don't* choose auto-partitioning in the below installer ISO; you -currently can't use a separate `/home` partition, and Anaconda defaults to that. -This will be fixed in Fedora 27; see -this [known issue](https://bugzilla.redhat.com/show_bug.cgi?id=1382873) as -well as [this anaconda PR](https://github.com/rhinstaller/anaconda/pull/1124). - -There are ISOs available for [Fedora 26](https://kojipkgs.fedoraproject.org/compose/26/) -[direct link](https://kojipkgs.fedoraproject.org/compose//26/latest-Fedora-26/compose/Workstation/x86_64/iso/Fedora-Workstation-ostree-x86_64-26-1.5.iso) -and [rawhide](https://kojipkgs.fedoraproject.org/compose//rawhide/). +Alternatively, see a guide for [installing inside an existing system](README-install-inside.md). 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 Fedora Rawhide content: -``` -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-rawhide:fedora/rawhide/x86_64/workstation -``` - -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, and --karg=rghb=0 to avoid a hang with Plymouth (these aren't needed if deploying Fedora 26 currently). -``` -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: -``` -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`. 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/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 -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 -------------------------------------- - -Enable the 26/27 remotes: -``` -ostree remote add --if-not-exists --gpg-import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-primary fedora-ws-26 https://kojipkgs.fedoraproject.org/compose/ostree/26 -ostree remote add --if-not-exists --gpg-import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-primary fedora-ws-27 https://kojipkgs.fedoraproject.org/compose/ostree/rawhide -``` -Rebase to rawhide: -``` -rpm-ostree rebase fedora-ws-27:fedora/rawhide/x86_64/workstation -``` - Using the system -------------------- -First, try out `rpm-ostree install` to layer additional packages. For example, -`rpm-ostree install powerline`. +One of the first things you should do use is use a container runtime of your +choice to manage one or more "pet" containers. This is where you will use +`yum/dnf` to install utilities. + +With `docker` for example, you can use the `-v /srv:/srv` command line option so +these containers can share content with your host (such as git repositories). +Note that if you want to share content between multiple Docker containers and +the host (e.g. your desktop session), you should execute (once): + +``` +sudo chcon -R -h -t container_file_t /var/srv +``` Next, let's try flatpak. Before you do: There's a known flatpak issue on AtomicWS - run [this workaround](https://github.com/flatpak/flatpak/issues/113#issuecomment-247022006), @@ -143,15 +56,12 @@ If you are a developer for server applications, try [oc cluster up](https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md) to create a local OpenShift v3 cluster. -Finally, you'll likely want to make one or more "pet" Docker containers, -potentially privileged, and use `dnf/yum` inside these. You can use e.g. `-v -/srv:/srv` so these containers can share content with your host (such as git -repositories). Note that if you want to share content between multiple Docker -containers and the host (e.g. your desktop session), you should execute (once): - -``` -sudo chcon -R -h -t container_file_t /var/srv -``` +Finally, try out `rpm-ostree install` to layer additional packages directly on +the host. This is needed for "host extensions" - privileged software that +doesn't make sense to live in a container. For example, `rpm-ostree install +powerline` to use that software for the shell prompts of the host. Another +good example is `rpm-ostree install vagrant-libvirt` to use [Vagrant](https://www.vagrantup.com/) +to manage VMs. Future work -----------