Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Migrating Gentoo to New Hardware
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Thu May 03, 2018 3:21 am    Post subject: [SOLVED] Migrating Gentoo to New Hardware Reply with quote

I am attempting to migrate an existing gentoo install to new hardware.

Existing hardware is: AsRock 990FX Exterme 4 (MoBo), AMD FX8350 (cpu), 32 Gigs Ram. Currently running mostly stable up to date packages and a 4.12.12-gentoo kernel.
The current make.conf
Code:

CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop"

MAKEOPTS="-j9"


The NEW hardware is: AsRock Taichi x399 (MoBo), AMD Threadripper 1950X (cpu), 128 Gigs Ram.

What CFLAGS and MAKEOPTS would be optimal for this CPU? and what KERNEL will I need to use to support the NEW hardware?

The current SystemRescueCD is able to detect most of the hardware (but not all) and loads the necessary drivers. It fails to detect my sound device which is a Realtek ALC1220.

I have prepared 2 new HDD's and used rsync to copy the root="sda3" and home="sdb1" file systems as necessary.

I am unsure how to proceed from this point.

Do I attempt to boot the system form SystemRescueCD or chroot in after loading SystemRescueCD and make the necessary changes and install a new kernel.

TIA:.... :)


Last edited by OldTango on Mon May 14, 2018 9:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
mrhe
n00b
n00b


Joined: 07 Aug 2012
Posts: 26

PostPosted: Fri May 04, 2018 7:36 am    Post subject: Reply with quote

Try this for cpu flags

Code:
emerge -1v app-portage/cpuid2cpuflags
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5137

PostPosted: Fri May 04, 2018 12:47 pm    Post subject: Reply with quote

MAKEOPTS should be -j$(nproc) on any kernel after 2.6

For C*FLAGS I've always used this so that distcc works, but march=native is fine too:
Code:
echo $(
    gcc -v -E -march=native -x c /dev/null 2>&1 \
        | grep -Eo -- ' (-m|--param )\S+' \
        | grep -Fv -- '-mno-'
)


The ALC1220 is supported in kernel 4.15, possibly earlier but you'll need hda patch loading support turned on
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5647

PostPosted: Sat May 05, 2018 6:42 am    Post subject: Reply with quote

If you're switching from march=native, you probably want to use march=znver1. GCC support for new cpus tends to lag behind a couple years.
_________________
overlay | patches
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Tue May 08, 2018 4:07 pm    Post subject: Reply with quote

For some reason I wasn't getting notified to new posts in this thread.

Ant P. wrote:
MAKEOPTS should be -j$(nproc) on any kernel after 2.6

I think the hand book says -j$(nproc+1) and I am using -j9 on the FX8350 which has worked fine for several years. Was attempting to use -j17 on the 1950x, but may set it to -j9 if I manage to actually get anything to build on the new system at all. More on that process later.

Ant P. wrote:
The ALC1220 is supported in kernel 4.15, possibly earlier but you'll need hda patch loading support turned on

The docs I have read say it was supposed to be in kernels >=4.11 however there are several reports from users that say that is not the case. At any rate I am trying to work with a 4.16.5 kernel which seems to have everything I need to support my x399 board.

At this point I have been unable to migrate or even perform a new gentoo install on this new system.

I may have to go the crossdev route.


Last edited by OldTango on Tue May 08, 2018 5:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Tue May 08, 2018 4:29 pm    Post subject: Reply with quote

bunder wrote:
If you're switching from march=native, you probably want to use march=znver1. GCC support for new cpus tends to lag behind a couple years.

Seems like the right thing to do after reading the Gentoo Wiki. At this point I would settle for zero optimization just to get gentoo installed and bootable.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Tue May 08, 2018 5:46 pm    Post subject: Reply with quote

First Attempt, Using existing 4.12.12 kernel:

1. Partition new drives as necessary.
2. Use rsync to basically clone / and /home.
3. Copy kernel to new boot(ESP) partition creating the directories as needed.
4. Made needed changes to /ect/fstab on the new drive.
5. Replaced /etc/portage/make.conf on new drive with:
Code:
CFLAGS="-march=znver1 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3"

USE="-arts -kde -ldap -qt3 -libav aac aalib acpi alsa cairo caja cdda cddb consolekit cups dbus encode exif ffmpeg flac gif gnome-keyring gnutls gstreamer gtk -gtk3 guile ipv6 java jpeg jpeg2k lame libnotify mad mate mp3 multilib ogg openal opengl oss png policykit pulseaudio python sdl spell sqlite startup-notification svg tiff truetype udev usb v4l vdpau vorbis vpx X xattr xinerama x264 xv xvid"

GENTOO_MIRRORS="ftp://gentoo.mirrors.tds.net/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linx/distributions/gentoo http://mirror.usu.edu/mirrors/gentoo ftp://ftp.gtlib.gatech.edu/pub/gentoo"

source /var/lib/layman/make.conf
#PORTDIR_OVERLAY="/usr/local/portage ${PORTDIR_OVERLAY}"

ALSA_CARDS=""
VIDEO_CARDS="nvidia"
INPUT_DEVICES="keyboard mouse evdev"
PORTAGE_ELOG_CLASSES="warn error log"
PORTAGE_ELOG_SYSTEM="save"
LINGUAS="en en_US"
ACCEPT_LICENSE="Oracle-BCLA-JavaSE PUEL Q3AEULA QUAKE4 ut2003 AdobeFlash-11.x LOKI-EULA"

MAKEOPTS="-j17"

# Set PORTDIR for backward compatibility with various tools:
#   gentoo-bashcomp - bug #478444
#   euse - bug #474574
#   euses and ufed - bug #478318
PORTDIR="/usr/portage"

6. Placed drives into new system and booted it with systemrescueCD (USB Stick).
7. Use efibootmgr to create a proper boot loader entry.
8. Rebooted the system and selected the new boot entry to boot to.
The system booted but produced a kernel panic just after (Freeing unused kernel memory:) and prior to (udevd[1828]: starting version 3.2.5). All drives appeared to be detected and loaded.

I did this twice once with the 4.12.12 kernel and once with a 4.16.5 kernel using the experimental USE configured to support all of my hardware. While I could get the system to see and attempt to boot both kernels, both would panic at exactly the same point in the boot process. I was not able to capture and record the the errors.

It appears at this point the panic is being caused by an ARCH issue. CHROOTING into the system is also not possible at this point either, every attempt to do so leads to an "illegal instruction" or "operation not permitted" when
Code:
chroot /mnt/gentoo /bin/bash
is entered. This also appears to be an ARCH issue.

Still working on the process of trying to install Gentoo on the new Hardware.................. :?
Back to top
View user's profile Send private message
Chiitoo
Moderator
Moderator


Joined: 28 Feb 2010
Posts: 1550
Location: Here and Away Again

PostPosted: Thu May 10, 2018 6:15 am    Post subject: ><)))°€ Reply with quote

The way I migrated from Phenom to Ryzen recently, as far as I remember things roughly:
  • Build everything with 'generic' CFLAGS (really should only need the critical packages I believe). That is, don't set '-march' at all ('-mtune=generic' might work as well).
  • Also build the kernel with CONFIG_GENERIC_CPU (Processor family - Generic-x86-64), and anything needed by the new hardware.
  • Set CPU_FLAGS_X86 to what both CPUs support (I don't remember if any critical packages rely on these, so it might not be too needed during the migration).
  • Move the drives to the new set-up (or rather move the new motherboard etc. into the old case with the drives).
  • Build everything with CPU-specific settings.

_________________
Kind Regards,
~ The Noob Unlimited ~

Sore wa sore, kore wa kore.
Back to top
View user's profile Send private message
figueroa
Guru
Guru


Joined: 14 Aug 2005
Posts: 351
Location: GA-USA

PostPosted: Fri May 11, 2018 2:11 am    Post subject: Reply with quote

This is what I did when moving from an X86 AMD system to an Intel X86_64 PC. I did a bare fresh install, then copied /var/lib/portage/world from the old system, pruned from that what I did not want or was not suitable for the new system, then did an emerge -uDN world. Finally, I copied my /home and /etc/ from the old PC. Had very little fine tuning to do.
_________________
Andy Figueroa
andy@andyfigueroa.net Working with Unix since 1983.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Fri May 11, 2018 7:10 pm    Post subject: Reply with quote

@Chiitoo

I have and still am considering this method. I have avoided it because the new system is an addition to my collection of computers not a replacement. I want the new system to be an exact replica of my current stable install I use exclusively every day. I know this method is possible with some serious recompile time and hardware manipulation on my part. I would rather not have my main system down for an extended period of time in the process.

@figueroa

I actually tried this method because it has always worked very well for me in the past. I've done bare fresh installs with systemrescueCD. This time I have encountered some major problems I have yet to sort out. Neither systemrescuecd-x86-4.9.5.iso or systemrescuecd-x86-5.2.2.iso from a USB Stick or a DVD will run a graphical environment. I get an Xauthority error, along with the "no screens found" error where it dumps me back to the shell. SysrescueCD acts like it just can't deal the graphics card which is a "GTX 1080-Ti SC". I can work from a command line but again would prefer not to in this case.

So I booted the latest UBuntu LiveDVD, opened the Gentoo hand book mostly for reference as some things have changed a lot sense I last needed it. I got all the way to where you would:
Code:
emerge --ask --update --deep --newuse @world
Where everything wrong. The errors I got did not make any sense. It appeared like the system was emerging several (something like 4) packages simultaneously. Before it just stopped with ncursers.

All the errors were along the lines of "ebuild-such-and-such exited without error". After ncurses were 2 large paragraphs explaining what might have gone wrong, all pointing back to something wrong in the ebuilds. The exit occurred prior to the install process.

I was using an absolute minimal make.conf just to install the base system and newer kernel before booting and completing the process.
Code:

CFLAGS="-march=znver1 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3"

USE=""

MAKEOPTS="-j17"
It is quite possible that -j17 is to excessive.

No success yet with migration or a fresh install..... :?
Back to top
View user's profile Send private message
figueroa
Guru
Guru


Joined: 14 Aug 2005
Posts: 351
Location: GA-USA

PostPosted: Fri May 11, 2018 7:29 pm    Post subject: Reply with quote

If the CPU flags are sane, you may just need to add appropriate global and package-specific USE flags to get your world to not be in a state of conflict. For what it's worth, my global USE flags are:
Quote:
USE="apache2 directfb dv gimp mplayer live mozilla oss nas scanner rtc subtitles v4l xine xscreensaver -gnome -kde -eds -libav -thin linguas_en linguas_en_US"


and my package-specific USE flags are:
Quote:
www-server/apache apache2_modules_unixd apache2_modules_authn_core apache2_modul
es_authz_core apache2_modules_socache_shmcb
dev-libs/boehm-gc threads
app-admin/conky -nvidia apcupsd
net-print/cups gnutls zeroconf -usb
dev-libs/cyrus-sasl -berkdb
dev-libs/DirectFB -xine
sys-devel/gcc gcj
media-libs/harfbuzz icu
net-print/hplip snmp fax hpijs -qt4 -X
net-misc/iputils -caps -filecaps
dev-libs/libpcre pcre16
dev-libs/libxml2 icu
x11-misc/lightdm-gtk-greeter branding
app-text/mupdf -opengl
mail-client/mutt smtp sasl smime_classic -hcache
net-misc/openssh libedit
dev-lang/php gd
app-crypt/pinentry gnome-keyring
app-text/poppler qt5
mail-mta/postfix sasl
dev-lang/python sqlite
media-gfx/sane-backends threads
sys-fs/udev extras
sys-apps/util-linux tty-helpers
media-video/vlc cdda cddb cdio stream kate libass zvbi dts flac theora matroska
bidi gnutls vlm libv4l libv4l2
app-cdr/xfburn gstreamer
media-libs/xine-lib -directfb flac jack wavpack
dev-libs/xmlsec nss
media-gfx/xsane ocr
sys-libs/zlib minizip


These were copied and tailored from my previous long-term X86 main desktop PC.

Also, you might try emerge -p instead of --ask.

I'm pulling for you.
_________________
Andy Figueroa
andy@andyfigueroa.net Working with Unix since 1983.
Back to top
View user's profile Send private message
Chiitoo
Moderator
Moderator


Joined: 28 Feb 2010
Posts: 1550
Location: Here and Away Again

PostPosted: Sun May 13, 2018 5:18 pm    Post subject: Reply with quote

Ah, I managed to miss that it's not going to be an actual replacement. While still a possible route, I'm not sure how much sense it would make, then.

Compiling times are much less of an issue to me now with the Ryzen, although I might be slightly jealous of your Threadripper...

Just a smidge. :]
_________________
Kind Regards,
~ The Noob Unlimited ~

Sore wa sore, kore wa kore.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41138
Location: 56N 3W

PostPosted: Sun May 13, 2018 6:26 pm    Post subject: Reply with quote

OldTango,

Do a new install as far as untarring the stage3.
Copy over /etc/portage and your /var/lib/portage/world file.
Tune make.conf to the new system. That's already been discussed.
When you are ready,
Code:
emerge -e @world --keep-going -av

That gets you the same software installed.

You can copy over much of /etc too but be careful with the systems identity.
You don't want to duplicate the hostname or ssh host key or any static IP setup you may have.

Copying /home works as long as you copy /etc/[shadow group passwd] too to preserve your users identity.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Sun May 13, 2018 7:35 pm    Post subject: Reply with quote

figueroa wrote:
If the CPU flags are sane, you may just need to add appropriate global and package-specific USE flags to get your world to not be in a state of conflict. For what it's worth, my global USE flags are:
Code:
USE="apache2 directfb dv gimp mplayer live mozilla oss nas scanner rtc subtitles v4l xine xscreensaver -gnome -kde -eds -libav -thin linguas_en linguas_en_US"

I was attempting to install and update a NEW raw bare bones system from a stage-3 and a booting kernel. Reboot the system to a console and if successful then import my GLOBAL USE and /etc/portage/* configs. AFAIK nothing is required in /etc/portage/make.conf USE="" at this stage and any flags you put there will pull in a lot of additional packages and there dependencies. The few packages that portage wanted to update, 10 if I remember correctly
Code:
emerge --ask --update --deep --newuse @world
either had no flags that needed to be changed or were set by the ebuilds or the default make profile already.

I never got past the update stage due to errors I have never seen in my 14 years using Gentoo and they made absolutely no sense. Various GOOGLE search's resulted in a big goose egg.

Thinking I might have some weird hardware issue. I took an extra hard drive I had laying around and installed the latest Ubuntu including all updates and proprietary drivers. Which only took like 10 mins to do. Rebooted and proceeded to test all hardware and drivers with the exception of the onboard sound even though Ubuntu did detect it and installthe drivers. No issues or errors detected.

8)
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Sun May 13, 2018 7:37 pm    Post subject: Reply with quote

Chiitoo wrote:
Ah, I managed to miss that it's not going to be an actual replacement. While still a possible route, I'm not sure how much sense it would make, then.

Compiling times are much less of an issue to me now with the Ryzen, although I might be slightly jealous of your Threadripper...

Just a smidge. :]
I am testing that route now. In the process of building a generic system that should boot on any amd64 machine. I will worry about optimizing after I can successfully boot the Threadripper system at which point compile times won't matter to me much.

I am not in any big hurry as I don't have the case for it yet, it is still on a test bench.

No reason to be jealous, yours runs mine not so much..... :D
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Sun May 13, 2018 8:19 pm    Post subject: Reply with quote

@Neddy

I did try that approach except that I did try to update the stage3 (latest snapshot) first, before I had moved any additional files over and made the necessary changes. That's when I got the errors I mentioned above. Portage was trying to update the packages and it appeared it was building them but wasn't installing them. It did 4 packages I believe spitting out all kinds of warnings before it simply stopped. The main error or warning reported was
Code:
<package-name-ver> exited without error
I have never seen anything like this happen.

It appeared the ebuilds (packages) were exiting prematurely at some point prior to the install process. I am investigating the possibility of some kind of file corruption occurring or I got a bad snapshot which would be extremely rare if it has ever happened.

Thanks your input is appreciated.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 595

PostPosted: Mon May 14, 2018 9:47 pm    Post subject: Re: ><)))°€ Reply with quote

Chiitoo wrote:
The way I migrated from Phenom to Ryzen recently, as far as I remember things roughly:
  • Build everything with 'generic' CFLAGS (really should only need the critical packages I believe). That is, don't set '-march' at all ('-mtune=generic' might work as well).
  • Also build the kernel with CONFIG_GENERIC_CPU (Processor family - Generic-x86-64), and anything needed by the new hardware.
  • Set CPU_FLAGS_X86 to what both CPUs support (I don't remember if any critical packages rely on these, so it might not be too needed during the migration).
  • Move the drives to the new set-up (or rather move the new motherboard etc. into the old case with the drives).
  • Build everything with CPU-specific settings.


With some hardware vodoo and this method I have SUCCESS.

Out of the box 4.16.x kernels panic. Something is wrong with the "Platform Security Processor (PSP)" section. I haven't had the time to investigate the reason fully yet and it may be a kernel bug or it's default setup is misconfigured. For now, I just disabled the entire stack to successfully boot the system.

I have to fix the network as device naming has changed form what it was. Now I can optimize and update the new system.

On a side note the stable "x11-drivers/nvidia-drivers" won't build or run properly with theses kernels either. I had to patch them as well.

Thanks ALL, for your help..... :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum