4

I have a Funtoo system now, but want to migrate (back) to Gentoo. If possible keeping a usable system during the installation (not rebuilding from scratch using a live CD). Both systems should be ~amd64.

I found an old description of someone who did it the other way round. To me it sounds as if the steps are:

  1. Replace /usr/portage/ with a gentoo portage snapshot.
  2. Regenerate the manifest of portage's ebuild.
  3. Reemerge portage and do emerge --sync
  4. Rebuild system (emerge -e @system).
  5. Rebuild the rest where necessary (emerge -uND @world)

Do I miss anything?

What about the profiles? Are there possible incompatibilities in the init scripts (e.g. network interfaces and configuration)? Should I expect problems from UEFI during boot (using grub)? Are there differences in genkernel?

  • Curiosity: why the move? (I've always been Gentoo) – lkraav Jan 13 '14 at 23:48
  • @lkraav I went to Funtoo some years ago, because the packages were newer there and portage sync was much faster (git instead of rsync). Now the Funtoo packages tend to be older and masked in a way that many ebuilds from overlays do not work. Also multilib works rather badly (ABI_X86="64 32" cannot be used, because some dependencies have those flags removed in the Funtoo versions), although I do not yet know if this is better on Gentoo it certainly is worth a try. – Tim Jan 14 '14 at 9:12
  • 1
    I will suggest just to make new clean installation and transfer only data you need there. But what you said is correct and it's complicated in the same time. It's not documented and I doubt someone can consultate you here being sure in everything. – cnd Mar 3 '14 at 18:44
  • @Heather This is what I did (after not being able to do it the way I intended). – Tim Mar 3 '14 at 20:08
  • I've had very bad experiences with migrating a Gentoo installation to a different compiler profile (from one time I fumbled profile selection and ended up installing a 32 bit system when I wanted 64 bits). It is theoretically possible, but compiler profile is the big show stopper, and that's just between different profiles of Gentoo, let alone migrating to an entirely different distro with different package assortment, organization and everything. I'd suggest installing from scratch. It's going to suck big time... but it is how it is. – RAKK Mar 10 '15 at 18:01
1

Well, first off all, what do you have to loose? If it doesn't work out, you can still do a fresh install.

Backup

It goes without saying that you need to backup important items. Maybe even do an archive of /etc, in case you want to look back.

Personally, whenever I try something radical, I rsync my root file system to a separate disk beforehand. Whenever something goes terribly wrong, I just rsync it back ;). Mount the root partition on a separate mount point, to prevent recursion to all mounted partitions. And run something like:

rsync -av --delete /mnt/root/ /mnt/backup

To restore:

rsync -av --delete /mnt/backup/ /mnt/root

Just make sure that the backup file system is a linux type (not FAT or NTFS), to transfer permissions, symlinks and file ownership correctly up and down.


Although never done personally, you could try the below options as a guideline. Some comments above suggest different compiler profiles, but most of that are just useflags to gcc and CFLAGS in make.conf, I don't see the real issue there.

Option #1

What you could try, but no personal experience, is do it the repo.conf way. Create a separate directory, like /usr/gentoo and put the vanilla Gentoo portage tree there.

File /etc/portage/repos.conf/gentoo.conf:

[DEFAULT]
main-repo = gentoo

[gentoo]
location = /usr/gentoo
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
priority 10

And something similar should exist for Funtoo, and with a lower priority. After you run emerge --sync, both trees will exist next to each other. If same version packages exist, the repo with higher priority wins (in theory). You can force package selection, by suffixing the desired repo like this:

emerge sys-devel/gcc::gentoo

Using this setup you can move to Gentoo step-by-step. The profiles from both repositories will be available for selection, so you can try out some emerge --pretend commands when selecting the Gentoo profiles, play around with useflags etc. Emerge gcc, portage from the Gentoo tree etc. If you just make sure that GCC is re-emerged with the same useflags (edit make.conf to your liking) and you keep the same CFLAGS, you probably don't even need to empty the system tree.

Maybe you want to read the GCC upgrade guide, and /usr/share/portage/config/make.conf.example.

Finally, you could drop the repo.conf entry for funtoo and do a emerge -uND --newrepo @world.

Option #2

In the past, when I was doing some big profile change, I used this method.

  1. Make sure your system is completely up-to-date (emerge -uND @world), handle the @preserved-rebuild set and depclean.
  2. Move the entries from /var/lib/portage/world into a user defined set. This can be one set, or if you want to be organized, categories of sets. For instance, I created 3 sets, usable in separate stages of the process.

/etc/portage/sets/boot

sys-boot/grub
sys-kernel/gentoo-sources
[network tools etc]

/etc/portage/sets/admin

app-editors/vim
app-portage/gentoolkit
[...]

/etc/portage/sets/desktop

 # All the rest

Make sure that /var/lib/portage/world and word_sets are both empty files after this migration.

  1. Run emerge --depclean to get rid of all packages that where pulled in by @world
  2. For now, clean out /etc/portage/package.use. (Move the file(s) somewhere if you intend using it later again.
  3. Comment out the USE= line in make.conf
  4. Drop to a simple as possible profile. In gentoo it would be something like: default/linux/amd64/17.0
  5. emerge -uND @world && emerge --depclean You will be in the smallest configuration possible for Funtoo, smallest risk on conflicts.
  6. Swap the portage tree to use Gentoo's one. (Probably in repos.conf)
  7. This should give you the simplest Gentoo profile system emerge -1 sys-apps/portage emerge -1 sys-devel/gcc emerge -e @system
  8. emerge @boot And do what you need to do to conigure the kernel, grub etc. (follow the handbook) This should give you a completely reboot-able Gentoo system. Reboot if you want to test at this point.
  9. Set your desired profile, re-enable useflags in make.conf and maybe package specific flags in package.use
  10. emerge -uND @world @admin @desktop && emerge --depclean: if this went ok, you have successfully transferred Funtoo to Gentoo!

Incompatibilities

To answer the remaining questions; During the re-intallation of packages, portage will check if file in /etc/ are the originals or modified. If they are un-modified since installation, portage will just replace them. Same goes for files in /etc/init.d. These files, in the end, all belong to a package. A package rebuild should give the right version in the end.

Modified config files are protected by config-protect. These will need to be updated using tools like etc-update.

Note

I am aware this was an old question and probably doesn't help the OP anymore. However, the subject interests me. It would be nice if someone who came across this answer will give it an actual try :).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.