User Tools

Site Tools


64bit-migration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
64bit-migration [2021/10/20 17:21] snarg64bit-migration [2023/06/21 12:02] (current) snarg
Line 3: Line 3:
 This is my method - letting portage track every file and package except glibc and ld-linux.so.2 loader. System and all services can remain running. If this is done correctly only 2 reboots will be required. This is my method - letting portage track every file and package except glibc and ld-linux.so.2 loader. System and all services can remain running. If this is done correctly only 2 reboots will be required.
  
 +  * Keep in mind that pre profile 17.1 and post profile 17.1 will be slightly different as /lib and /usr/lib are not symlinks. These differences are noted in the relevant steps.
   * make sure system is completely up to date and has been depcleaned, preserved-rebuilt and revdep-rebuild - to clean up old 32bit libraries else lots of work later   * make sure system is completely up to date and has been depcleaned, preserved-rebuilt and revdep-rebuild - to clean up old 32bit libraries else lots of work later
   * a full up to date backup of the system is a good idea and has saved me in the past.   * a full up to date backup of the system is a good idea and has saved me in the past.
   * make sure you have an *identically* up to date 64bit multilib profile VM to create binary packages on. Ensure CFLAGS is going to be identical, or compatible ("-mtune=generic -O2 -pipe" is safe). Make sure USE flags are the same between the systems as this makes live easier when doing emerge -k binarypackage  on the other side. If changes are required to CFLAGS then emerge -e world.   * make sure you have an *identically* up to date 64bit multilib profile VM to create binary packages on. Ensure CFLAGS is going to be identical, or compatible ("-mtune=generic -O2 -pipe" is safe). Make sure USE flags are the same between the systems as this makes live easier when doing emerge -k binarypackage  on the other side. If changes are required to CFLAGS then emerge -e world.
 +  * You can use a portage tree from git (on both target system and migration VM) using something like:
 +<code>cd /usr
 +git clone https://github.com/gentoo/gentoo.git ./gentoo-git
 +cd gentoo-git
 +git checkout `git rev-list -n 1 --first-parent --before="2020-09-01" master`
 +#note backticks</code>
 +  * keep in mind if using a portage git snapshot like the above, you will need to read this for crossdev, particularly the bit regarding "masked by corruption" (search for that). The crossdev overlay will need thin-manifests = true : https://wiki.gentoo.org/wiki/Crossdev 
   * read ahead a few points (or the whole page) when starting a step - several problems may be solved in subsequent notes   * read ahead a few points (or the whole page) when starting a step - several problems may be solved in subsequent notes
   * if problems arise with libraries and mismatched ABI binaries, scp them over from the donor VM as needed. subsequent emerge will overwrite them later.   * if problems arise with libraries and mismatched ABI binaries, scp them over from the donor VM as needed. subsequent emerge will overwrite them later.
Line 59: Line 66:
   * change make.profile symlink to point to a multilib amd64 profile. choose 17.0 or 17.1 based on Donor VM profile. be aware of the difference.   * change make.profile symlink to point to a multilib amd64 profile. choose 17.0 or 17.1 based on Donor VM profile. be aware of the difference.
  
-  * on donor pc or VM:+  * on donor pc or VM (take note of wildcards, adjust if required):
  
-  quickpkg glibc gcc zlib ncurses gmp mpfr util-linux acl attr sandbox coreutils procps binutils libcap mpc cracklib flex =db-5* glib pam pambase =python-3.8* bash readline findutils install-xattr bzip2 tar xz-utils make grep patch gawk sed libpcre dev-libs/libffi gettext libxml2+  quickpkg glibc gcc zlib ncurses gmp mpfr util-linux acl attr sandbox coreutils procps binutils libcap libxcrypt mpc cracklib flex =db-5* glib pam pambase =python-3* bash readline findutils install-xattr bzip2 tar xz-utils make grep patch gawk sed libpcre dev-libs/libffi gettext libxml2
  
   * on source VM, scp -r /var/cache/binpkgs to target PC   * on source VM, scp -r /var/cache/binpkgs to target PC
Line 93: Line 100:
   * continue to deploy initial binary packages using this method (except with collision detection) donated from prebuilt VM from /usr/portage/packages or /var/cache/binpkgs. Of these, mpc, zlib, glibc needs to come first, then everything else will come good. In the process of deploying glibc, /lib needs to be a symlink to /lib64 which will break 32bit programs. see ld-linux.so.2 trick above. ldconfig is your friend here with the above 99migration env file.   * continue to deploy initial binary packages using this method (except with collision detection) donated from prebuilt VM from /usr/portage/packages or /var/cache/binpkgs. Of these, mpc, zlib, glibc needs to come first, then everything else will come good. In the process of deploying glibc, /lib needs to be a symlink to /lib64 which will break 32bit programs. see ld-linux.so.2 trick above. ldconfig is your friend here with the above 99migration env file.
  
 +  * 202112 notes: had to remove the following files to get glibc binary package to emerge:
 +<code>/usr/bin/cal
 +/bin/date
 +/usr/bin/env
 +/usr/bin/free
 +/bin/ls
 +/usr/bin/uname
 +/usr/bin/uptime</code>
 +These can be restored from these binary packages immediately after getting glibc working:
 +<code>emerge -1kav util-linux coreutils procps</code>
 +To emerge coreutils, working mv command is required. libattr.so.1 and libacl.so.1 (symlinks.. copy the actual libraries) were copied over from donor VM lib64 directories and appropriate symlinks made. These belong to packages acl and attr binary packages which can then be emerged to account for those files.
   * If you get into trouble getting 64bit loader working, do this (only if needed):   * If you get into trouble getting 64bit loader working, do this (only if needed):
   ** backup these: /etc/env.d/99glibc /etc/gai.conf /etc/host.conf /etc/locale.gen /etc/nsswitch.conf /etc/rpc   ** backup these: /etc/env.d/99glibc /etc/gai.conf /etc/host.conf /etc/locale.gen /etc/nsswitch.conf /etc/rpc
Line 98: Line 116:
   ** restore etc files from above backup   ** restore etc files from above backup
  
-  * This might not be needed. Fix 32bit toolchain and python in wrong directory by running:+  * Now is the right time to remove crossdev versions of the toolchain, as they are now conflicts with our native amd64 versions.  Take a look in the repo directory and unmerge any crossdev packages like gcc glibc binutils etc (fixme: put actual commands here) 
 + 
 +  * This will be needed for fixing things after removing crossdev versions. Fix 32bit toolchain and python in wrong directory by running:
  
 <code>PKGDIR=/var/cache/binpkgs emerge -1kav sys-devel/gcc mpfr mpc binutils  <code>PKGDIR=/var/cache/binpkgs emerge -1kav sys-devel/gcc mpfr mpc binutils 
Line 111: Line 131:
 Double check /etc/nsswitch.conf and other files backed up above, this may have overwritten them again. Double check /etc/nsswitch.conf and other files backed up above, this may have overwritten them again.
          
-<code>mv /migration-backup/lib/modules /lib64n</code>  (or to /lib if 17.1 profile)+<code>mv /migration-backup/lib/modules /lib64</code>  (or to /lib if 17.1 profile)
  
   * Emerging gcc needs to be done now, but also acts as a sanity check to see what we've missed. Repeat the quickpkg / emerge -1k steps for missing things   * Emerging gcc needs to be done now, but also acts as a sanity check to see what we've missed. Repeat the quickpkg / emerge -1k steps for missing things
Line 138: Line 158:
   * take out /etc/env.d/99migration   * take out /etc/env.d/99migration
   * remove /migration-backup   * remove /migration-backup
-  * erase /usr/portage/packages (whole dir)+  * erase /usr/portage/packages (whole dir) - modern version is /var/cache/binpkgs
   * remove abi_x86_32 from package.use and profiles/use.mask, then emerge --newuse   * remove abi_x86_32 from package.use and profiles/use.mask, then emerge --newuse
   * clean up /lib.old and /usr/lib.old   * clean up /lib.old and /usr/lib.old
 +  * check for packages that own files in 32bit directories:
 +<code>emerge -1av /lib32 /usr/lib32</code>
  
   * check for orphans in /usr/lib and all the other places. (bin sbin /usr/bin /usr/sbin). For finding orphan files after migration in /lib32, /usr/lib32, /usr/lib64   * check for orphans in /usr/lib and all the other places. (bin sbin /usr/bin /usr/sbin). For finding orphan files after migration in /lib32, /usr/lib32, /usr/lib64
 <code>cd /lib32 ; find  -xdev -type f -exec qfile -o {} + |less</code> <code>cd /lib32 ; find  -xdev -type f -exec qfile -o {} + |less</code>
  
64bit-migration.1634721671.txt.gz · Last modified: 2021/10/20 17:21 by snarg