64bit-migration
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
64bit-migration [2019/01/15 17:48] – snarg | 64bit-migration [2022/03/30 11:58] – snarg | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | 32 to 64 migration | + | Gentoo Live 32 to 64 migration |
- | https://www.hattne.se/ | + | 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. |
- | have that web site open... the steps are here, but the explanation | + | |
- | my notes: | ||
* 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 | ||
- | * make sure you have an *identically* up to date 64bit machine | + | |
+ | | ||
+ | * 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 | ||
== Steps == | == Steps == | ||
Line 14: | Line 15: | ||
cp / | cp / | ||
- | * building cross compiler | ||
- | | + | |
- | convert / | + | |
- | crossdev | + | |
+ | < | ||
- | * compile x86_64 kernel with ia32 emulation, reboot | + | * convert / |
- | | + | < |
+ | |||
+ | | ||
+ | < | ||
+ | | ||
+ | * reboot test into the 64bit kernel | ||
* Change CHOST to x86_64-pc-linux-gnu | * Change CHOST to x86_64-pc-linux-gnu | ||
* copy lib and /usr/lib and /bin and /usr/bin and /sbin and /usr/sbin to / | * copy lib and /usr/lib and /bin and /usr/bin and /sbin and /usr/sbin to / | ||
Line 32: | Line 36: | ||
ldconfig | ldconfig | ||
- | mkdir /lib32 | + | mkdir / |
mkdir /lib64 | mkdir /lib64 | ||
- | mkdir /usr/lib32 | + | mkdir / |
mkdir /usr/lib64 | mkdir /usr/lib64 | ||
Line 41: | Line 45: | ||
rm -Rf / | rm -Rf / | ||
- | * possibly dont need to do this if using binary packages from donor VM | + | * back up these 32bit crossdev versions, they may be useful |
- | cp -ar / | + | cp -ar / |
- | cp -ar /usr/x86_64-pc-linux-gnu/ | + | cp -ar /usr/i686-pc-linux-gnu /migration-backup/usr/ |
- | | + | cp -ar /usr/libexec |
- | cp -ar /usr/include | + | cp -ar / |
- | cp -ar / | + | |
- | emerge -1 sys-kernel/ | + | |
* put -sandbox -usersandbox in features | * put -sandbox -usersandbox in features | ||
Line 55: | Line 57: | ||
< | < | ||
-abi_x86_32</ | -abi_x86_32</ | ||
- | * change make.profile symlink to point to a multilib amd64 profile | + | * 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. |
- | + | ||
- | * use quickpkg | + | |
- | Of these, glibc needs to come first, then everything else will come good. | + | |
- | in the process | + | |
* on donor pc or VM: | * on donor pc or VM: | ||
- | 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.6* bash readline findutils install-xattr bzip2 tar xz-utils make grep patch gawk sed libpcre | + | 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 |
- | * on target pc, mount or rsync /usr/portage/packages and emerge -1k to install them. If theres any differences in USE, set them in the prefix | + | * on source VM, scp -r /var/cache/binpkgs |
- | | + | |
+ | ** make sure busybox is functional. run this from busybox | ||
+ | ** have a few shells open, in case you break the one you're working from | ||
+ | ** remember.. if the source VM is profile 17.1 then this system will need to be built using 17.1, so think about making a /lib and /usr/lib folder (and no lib32 folders) rather than symlinking. | ||
- | mv /usr/lib to /usr/oldlib and symlink | + | mv /lib oldlib |
+ | ln -s lib64 lib (not on 17.1 - mkdir lib) | ||
+ | cd /usr | ||
+ | mv lib to oldlib | ||
+ | ln -s lib64 lib (not on 17.1 - mkdir lib) | ||
+ | |||
+ | * this will get overwritten by emerge at the appropriate time, but lets the 32bit loader continue to work for now | ||
+ | |||
+ | cp migration-backup/ | ||
+ | ldconfig | ||
- | * /usr/lib symlink creation will break python. The following will not create orphans as the files are in exactly the same location from portage' | + | * /usr/lib symlink creation |
cd /usr/oldlib | cd /usr/oldlib | ||
- | mv python-exec python3.6 libpython* portage gcc ../lib64 | + | mv python-exec python3.6 libpython* portage gcc ../lib/ |
+ | cp -r / | ||
- | * remove crossdev packages (and crossdev) and check gcc sanity | + | * disable collision detection |
+ | < | ||
- | | + | |
- | | + | |
+ | |||
+ | | ||
+ | ** backup these: / | ||
+ | ** extract glibc tbz2 binary package directly into root of filesystem. subsequent remerge will track the files correctly later. | ||
+ | ** restore etc files from above backup | ||
- | * fix 32bit toolchain and python in wrong directory by running: | + | * This might not be needed. Fix 32bit toolchain and python in wrong directory by running: |
- | | + | < |
+ | gcc-config 1 | ||
binutils-config 1 | binutils-config 1 | ||
- | . / | + | . / |
- | + | ||
- | emerge -1av python-exec | + | |
- | emerge -1kav =python-3.6* --binpkg-changed-deps=n | + | |
- | + | ||
- | mv /lib/modules /lib64 | + | |
- | mv /lib/gentoo /lib64 | + | |
- | *for the lib / lib64 link <-> switcheroo | + | * Finally now that theres |
- | ** make sure busybox is functional. run this from busybox | + | |
- | ** have a few shells open, in case you break the one you're working from | + | |
- | | + | |
- | mv /lib/gentoo | + | |
- | + | Double check / | |
- | cd / | + | |
- | mv lib oldlib | + | < |
- | ln -s lib64 lib | + | |
* 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 | ||
- | | + | < |
- | * remove | + | * leave / |
- | * copy over a valid /etc/ | + | |
* @system rebuild - adjust USE as needed | * @system rebuild - adjust USE as needed | ||
- | | + | < |
+ | |||
+ | * work through any problems caused by emerge ordering above. If a dependancy problem proves too hard to solve, cheat by grabbing a binary package from the donor VM prepared earier. The subsequent @world emerge will take over the package later. | ||
+ | * / | ||
* remove -sandbox and -usersandbox from features | * remove -sandbox and -usersandbox from features | ||
Line 120: | Line 131: | ||
emerge -eav --keep-going @world | emerge -eav --keep-going @world | ||
+ | * take note of failed, packages - these are usually caused by ordering/ | ||
== Things to do later == | == Things to do later == | ||
Line 129: | Line 141: | ||
* remove abi_x86_32 from package.use and profiles/ | * remove abi_x86_32 from package.use and profiles/ | ||
* clean up /lib.old and / | * clean up /lib.old and / | ||
+ | * check for packages that own files in 32bit directories: | ||
+ | < | ||
* 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 | ||
< | < | ||
64bit-migration.txt · Last modified: 2023/06/21 12:02 by snarg