# need to make new initramfs for new CPU. How to do it?

## ExecutorElassus

So, I messed up everybody! I built a new computer -- new CPU, new mobo, etc., but with old drives -- and didn't recompile the initramfs for the new CPU architecture. Now I can't boot, because it gives me a kernel panic ("bad opcode," etc. etc.), I have a laptop, so I'm downloading an ISO of SystemRescueCD to boot into. Here's my problem:

I have /use and /var both inside a RAID array on an LVM. From what I've seen, "better initramfs" (here) does not support pre-mounting /var from separate LVM. 

So once I'm booted into SystemRescueCD, what initramfs do I need to use? From what I've seen, busybox no longer works, because some of its dependencies can no longer be built with static-libs (am I wrong about that?). What other options are there?

Thanks for the help!

EE

----------

## soundrolf

You can do it with:

```

genkernel --install initramfs

```

Regards

soundrolf

----------

## ExecutorElassus

Here's the problem: I upgraded from an AMD FX chip to a Ryzen. The new machine won't boot. I've booted onto a SystemRescueCD on a USB drive, but I can't chroot into the old environment because /bin/bash doesn't work on the new machine. Is there a way to chroot into the old filesystem while still using the /bin/bash from the usb drive? I need to re-emerge … well, probably my entire system set, but I can't do that on a different machine (nor can I do it on the old machine, because the HDDs and some other parts are in the new one now).

Thanks!

EE

----------

## soundrolf

 *Quote:*   

> 
> 
> Is there a way to chroot into the old filesystem while still using the /bin/bash from the usb drive?
> 
> 

 

No. You have to use /bin/bash from new system. Only then you are in the new system.

I think it's better to setup a complete new system, with a minimal-install cd gentoo.

Because the old system with a new motherboard and cpu may wipe you out of chroot.

Regards

soundrolf

----------

## pingtoo

 *ExecutorElassus wrote:*   

> The new machine won't boot.

  Then  *ExecutorElassus wrote:*   

>  I've booted onto a SystemRescueCD on a USB drive,

 So did your new machine able to boot with SystemRescueCD? *ExectorElassus wrote:*   

> but I can't chroot into the old environment because /bin/bash doesn't work on the new machine.

 Are you saying once you booted with SystemResueCD, the /bin/bash on SystemResueCD not able to run with your new machine?

SystemResueCD have boot options to run in ram. You can try with option break in kernel boot command line, this should bring up and shell prompt and let you recover from there.

----------

## ExecutorElassus

I can boot the machine from SystemRescueCD and get to a prompt. I can mount all the drives and everything. What I can't do, at this point, is chroot into the old filesystem on the new architecture. 

what changes do I need to make to [newroot]/etc/portage/make.conf for the new architecture? What tools do I use to find this information?

Assuming I just do a fresh install: I can download the stage3 tarball and just unpack it into /mnt/gentoo, right? How much of my old config do I need to back up? Or is it enough just to unpack the tarball, and use that to emerge the system files to get it to the point where it's bootable?

Cheers,

EE

Follow-up: is this guide a reliable one? Because if that's the case, I can also just rebuild system packages on a rescue partition and copy them over. Or is it better to unpack a stage3 tarball onto my broken system?

----------

## soundrolf

 *Quote:*   

> 
> 
> What I can't do, at this point, is chroot into the old filesystem on the new architecture.
> 
> 

 

New architecture. Not the old one.

 *Quote:*   

> 
> 
> what changes do I need to make to [newroot]/etc/portage/make.conf for the new architecture? 
> 
> 

 

Copy your old make.conf onto a usbstick. Change the CPU_FLAGS to your Ryzen CPU

Install app-portage/cpuid2cpuflags to get your CPU_FLAGS from your Ryzen CPU

 *Quote:*   

> 
> 
> How much of my old config do I need to back up?
> 
> 

 

Copy your /etc/portage directory onto a usbstick and have a look what you need for your new system and edit files to your need

 *Quote:*   

> 
> 
> I can download the stage3 tarball and just unpack it into /mnt/gentoo, right? 
> 
> 

 

Yes unpack it into /mnt/gentoo

Read the handbook https://wiki.gentoo.org/wiki/Handbook:AMD64

Regards

soundrolf

----------

## ExecutorElassus

Hi sounroif,

I can't install programs (in this case, cpuid2cpuflags) until I can chroot. Should I just comment out the line for the CPU_FLAGS in make.conf? Is CFLAGS="-mtune=native -O2 -pipe" correct?

so, copy /mnt/gentoo/etc/portage somewhere safe

cd /mnt/gentoo

wget [tarball] 

'tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner'

restore /mnt/gentoo/etc/portage

and then I should be able to chroot?

Cheers,

EE

----------

## pingtoo

Boot into SystemRescueCD shell

Mount old drive's rootfs to /mnt/getoo

cp -rp /mnt/gentoo/etc/portage to /some/where/writable/

Mount rest partitions

Mount all pseudo file systems, i.e. /proc, /sys, /dev (if you use devtmpfs)

untar stage3 into /mnt/gentoo

cp -rp /some/where/writable /mnt/gentoo/etc/porage

update /mnt/gentoo/etc/portage/make.conf, set COMMON_FLAGS="-march=native -O2 -pipe"

cp /etc/resolve.conf /mnt/gentoo/etc/resolve.conf

chroot /mnt/gentoo

emerge -a @world

emerge genkernel

genkernel all --menuconfig

verify /boot got the new kernel and initramfs

configure boot loader use new kernel with initramfs

reboot

Use -march=native should give you correct CPU setting for your new CPU.

----------

## soundrolf

This is my make.conf

```

# Compiler Settings

COMMON_FLAGS="-march=native -O2 -pipe"

CFLAGS="${COMMON_FLAGS}"

CXXFLAGS="${COMMON_FLAGS}"

FCFLAGS="${COMMON_FLAGS}"

FFLAGS="${COMMON_FLAGS}"

# CPU FLAGS: AMD FX(tm)-6100 Six-Core Processor CPU Family: 21

CPU_FLAGS_X86="aes avx fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop"

CHOST="x86_64-pc-linux-gnu"

# USE flags

USE="truetype elogind -consolekit -ipv6 -kde -gnome -systemd -pulseaudio 

smp usb alsa v4l -aim -infiniband -cjk -qt4 icu -oci8 -oscar -joystick 

-libav ffmpeg dbus dvd dvb cdr nls sockets twolame usb X udev udisks 

libnotify thunar xinerama qt5 -xscreensaver vdpau ${CPU_FLAGS_X86}"

# USE_EXPAND flags

PORTDIR="/usr/portage"

PORTAGE_LOGDIR="/var/log/portage_log"

DISTDIR="${PORTDIR}/distfiles"

PKGDIR="${PORTDIR}/packages"

MAKEOPTS="-j6"

GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/ https:ftp.halifax.rwth-aachen.de/gentoo/"

ACCEPT_LICENSE="*"

ACCEPT_KEYWORDS="amd64"

LINGUAS="de"

L10N="de"

LC_MESSAGES="C"

GRUB_PLATFORMS="pc"

LLVM_TARGETS="X86-64 AMDGPU"

VIDEO_CARDS="fbdev radeon nouveau v4l vesa amdgpu"

ALSA_CARDS="hda-intel"

INPUT_DEVICES="evdev synaptics"

KDIR="/usr/src/linux"

XFCE_PLUGINS="menu clock trash"

RUBY_TARGETS="ruby26 ruby27"

# EMERGE_DEFAULT_OPTS="--quiet-build"

# EMERGE_DEFAULT_OPTS="--with-bdeps=y"

```

Do it like pingtoo wrote

Don't forget before reboot to do 

```
grub-mkconfig -o /boot/grub/grub.conf
```

Regards

soundrolf

----------

## ExecutorElassus

quick question about genkernel: can the initramfs it generates deal with /var (in addition to /usr) being on a software RAID LVM? The preamble here suggests it can, but the page for genkernel itself doesn't mention it.

I don't want genkernel to configure/build the kernel, nor configure GRUB. I do that myself manually. Can genkernel work like that?

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

You will need to rebuild most of the system set for the new hardware.

busybox is still good with static linking but. lvm is not. 

You can't chroot in with a broken system, but you can rebuild things with a parallel system to make binpkgs, then install the binaries.

You need Fix My Gentoo.

----------

## pingtoo

Yes, genkernel generated initramfs can mount /usr, /var. But you will need to create a file name /etc/initramfs.mounts in /mnt/gentoo and the content are

```
# Each line name a mountpoint for initramfs to mount

/usr

/var
```

genkernel can let you manually configure kernel. That is --menuconfig option is for.  You can add --kernel-config=/path/to/your-old-config-file option to reuse existing .config file

Edit: you also need to create matching /mnt/gentoo/etc/fstab. I mean matching /usr and /var entries for how normal /etc/fstab work.

----------

## ExecutorElassus

Hi Neddy!

is the method outlined by pingtoo and soundroif not going to work for my use-case? If I can unpack a stage3 into my mounted filesystem, shouldn't that provide me with a working bash and gcc, from which I can then emerge all the rest? (after, of course, I copy /mnt/gentoo/etc/portage back over from the backup).

Cheers,

EE

----------

## ExecutorElassus

update: I unpacked the tarball onto /mnt/gentoo, chrooted, and then tried emerging world. This failed on bzip2, which gave the error that there was an illegal instruction in libbz2.a. 

So what did I do wrong? I'm chrooted into the new system, but can't emerge anything. What next?

Thanks for the help,

EE

----------

## pingtoo

Could you please chdoot into newroot and do

```
emerge --info
```

 and post the output.

----------

## pingtoo

.a (dot a) file usually content elf object files. It is a passive archive file, so I have hard time to imagine how is illegal instruction in libbz2.a error. Is this a link produced error?

have your tried with

```
emerge bzip2
```

? and please post the build log.

----------

## NeddySeagoon

ExecutorElassus,

Unpacking a stage3 into your existing install will destroy your world file and all your settings.

You can unpack a stage3 somewhere else and quickpkg the packages you need.

Illegal instructs or symbol version error?

I've seen the latter with bzip2 because the underlying glibc was too old. It only happens with binary mix and match.

You are doing a binary mix and match. The stage3 is running on top of boot media glibc and so on.

It its really an illegal instruction, there will be more info in dmesg.

----------

## ExecutorElassus

Hi Neddy,

oh dear. well, then I've lost my world file and settings. I don't mind the world file, but it's going to be annoying trying to recover settings. 

So now I'm following the Fix My Gentoo instructions, but I don't know how much stuff I actually need to build (since I no longer have my old world file). I did preserve /etc/portage, but nothing else. 

My worry now is that I'm going to run out of space on /var before I can build enough packages to get a bootable system. What packages (or set) do I minimally need to get it bootable and able in install the rest?

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

You need the system set, kernel and initrd and a boot loader to be able to boot.

I guess that your /var/db/pkg/ has been overwritten too?

Do you still have the original /var/log/emerge.log?

That's every every emerge the box ever did.

----------

## pingtoo

@ExecutorElassus, I am sorry I miss the world file.

 *NeddySeagoon wrote:*   

> ExecutorElassus,
> 
> Unpacking a stage3 into your existing install will destroy your world file and all your settings.

 

@NeddySeagoon, What are those settings you refer to? I want to make sure I will not make same mistake in future.

----------

## ExecutorElassus

Hi Neddy,

I tried installing the kernel using the Fix My Gentoo instructions, /var filled up to 100%, and when I chrooted back to /mnt/gentoo to try `emerge -K sys-kernel/gentoo-sources` it seemed to work, but now I can't emerga anything else. I get an error that emerge can't find libffi.so.7. 

So now what do I do? Do I have to install packages with tar? What package would I need to install with tar to get emerge working again?

/var/db/pkg is still there, but I can't read /var/log.emerge.log. ls reports it has a filesize of 37585896, though. 

Thanks for the help. What should I do next?

Cheers,

EE

update: I tried using the tar command on a few files, getting "trailing garbage after EOF" notices for them. Now ls doesn't work, because it can't find glibc-2.34. So now the system is horribly broken. I can emerge binpackages on the live environment, but I can't use emerge to install them from the chrooted /mnt/gentoo. What exact order of packages do I need to install (using tar from Fix My Gentoo) to get it into a workable state?

update2: I had a binpkg of glibc, so I could use tar on that and get ls working. So now what should I do? I have a sizable number of binpkg files, but can't use emerge. should I use tar on the ones I have first, and then clear out /mnt/gentoo/var/cache/binpkgs/, and then emerge the system set on the rescue partition? Or should I proceed in some other way?

----------

## pingtoo

 *ExecutorElassus wrote:*   

> I can emerge binpackages on the live environment, but I can't use emerge to install them from the chrooted /mnt/gentoo.
> 
> update2: I had a binpkg of glibc, so I could use tar on that and get ls working. So now what should I do? I have a sizable number of binpkg files, but can't use emerge. 

 

Risk of me being ignorant again  :Embarassed:  I think you can use  *Quote:*   

> env PKGDIR=/where/binpkgs/location emerge --root=/mnt/gentoo --usepkgonly something

  from your live environment to install binpkgs into /mnt/gentoo. I am not sure if that something should be set or individual package, However please wait for NeddySeagoon to confirm, 

I been working on design my own initramfs so did more research on how Gentoo way of thingy and I have tried many time to rebuild system so I learn a few gentoo tricks however this may be yet another bad suggestion.

----------

## ExecutorElassus

well, what I think I need to do is wipe /var/cache/binpkgs/, chroot back into the rescue partition, emerge all of @system, and then libffi-compat just in case, exit back out, chroot into /mnt/gentoo, and try using tar to install all of that stuff manually. Last time I checked it was about 50 packages, so it should be possible without too much suffering. 

But I'm not sure if this is the right way to proceed. Maybe Neddy has other suggestions.

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

The idea of a the rescue install is that it uses your existing distfiles, so it does not need to download anything and your existing binary packages space.

The rescue install, its distfiles and binary packages can be anywhere you have space.

Using your original or corrected /etc/portage makes like easy as portage will reject binaries built with the wrong USE flags.

Scatter the bits of the rescue install where you have space. As long as you tell portages where they are. 

A long time ago I did  unpick the liveDVD

The relevant bit here is section 5 and what was needed to get a working chroot. That page is from 2009, so versions will have changed.

Bash just needs ...

```
$ lddtree /bin/bash

/bin/bash (interpreter => /lib64/ld-linux-x86-64.so.2)

    libreadline.so.8 => /lib64/libreadline.so.8

        libtinfow.so.6 => /lib64/libtinfow.so.6

    libtinfo.so.6 => /lib64/libtinfo.so.6

    libc.so.6 => /lib64/libc.so.6
```

if all that works, you can chroot. You may not be able to do much but you can get in and look around.

Its left as an exercise for the reader to determine the packages. bash itself, glibc and readline stand out.

Don't go overboard with fixing things with tar. Its incomplete and risky. You will set up problems with file collisions for later.

Fix bash. Chroot, then see what fails. dmesg will tell where the illegal instruction was.

FIx that, rinse and repeat.

----------

## NeddySeagoon

pingtoo,

A stage3 brings with it its own /etc, so the groups, users and passwords are overwritten.

You get the stage3 /etc/portage, so make.conf, you profile and any other /etc/portage/* files and directories back to the default stage3 state.

world is set to blank, as it was when it was new.

I think that /var/db/pkg is gone too. That's where portage keeps track of installed files, packages and so on.

Untarring a stage3 over an existing install gets you back to just a stage3.

You cant set PKGDIR and --root on the command line as you suggest. There are three or four different roots. Pick the right one.

Its something I only tend to use for building an initrd. I keep the binaries for the initrd around so I can tweak the init script and rebuild it as it was.

That avoids the uncertainty of using new system installed packages every time.

My initrds are user space tools only, s they tend to last the life of the system.

I have to look up the syntax of the command every time, so I won't comment on the command.

----------

## ExecutorElassus

Hi Neddy,

I can chroot into /mnt/gentoo. It's just that portage doesn't work. I used the rescue system to build libffi-compat, which got me past the error that it couldn't find libffi.so.7. Now, I can't use emerge on the chrooted /mnt/gentoo because it says "failed to validate a sane /dev". What could that be?

```
# emerge -pv @system

Failed to validate a sane '/dev'.

bash process substitution doesn't work; this may be an indication of a broken '/dev/fd'.

# dmesg

dmesg: error while loading shared libraries: libtinfow.so.6: cannot open shared object file: No such file or directory
```

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

Are /dev, /proc and /sys mounted inside the chroot.

I get that from time to time too :)

```
$ equery b libtinfow.so.6

 * Searching for libtinfow.so.6 ... 

sys-libs/ncurses-6.3_p20211106 (/lib64/libtinfow.so.6 -> libtinfow.so.6.3)
```

Maybe your ncurses in the chroot is broken too?

----------

## ExecutorElassus

Hi Neddy,

/dev, /proc, /sys, and /run are mounted to /mnt/gentoo, but when making the rescue partition according to Fix My Gentoo, I did mount -o bind of those directories to the rescue directory as well. Now I appear to have them mounted in both places. How do I fix that?

Also: I used tar to install the binpkg from the rescue for ncurses, so now I can use dmesg again.

ALSO also: using tar to install the binpkg of ncurses got emerge running, so I can use that. However, emerge fails with "Illegal instruction" errors. So I can't just 'emerge @system'. What order do I need to emerge the packages of the system set to get it working?

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

You need /dev, /proc and /sys mounted everywhere you want to chroot, so that's correct.

After your Illegal instruction" error, the file causing the error will be named at the bottom of dmesg.

You find the package that provides that file and do the tar thing.

```
equery b <file>
```

Depending on the problem file, its possible that emerge will work to install binaries but not source built packages..

----------

## ExecutorElassus

now I'm working my way through 'emerge @system'. Some of them fail, but it seems to be due to missing libraries, which I can find. 

One thing I'd like to know: is there a way to suppress the list of preserved libs that gets output after the emerge process closes? Because that wipes anything I want to read about a failed package off the screen.

Progress!

EE

----------

## NeddySeagoon

ExecutorElassus,

I turn on logging. Add 

```
PORTAGE_LOGDIR="/var/log/portage"
```

to have all the build logs saved to /var/log/portage.

Portage needs to be able to write there. It grows without limit so be careful.

Run emerge in screen/tmux, so you have scroll back. It was removed from the kernel console driver.

----------

## pingtoo

 *NeddySeagoon wrote:*   

> pingtoo,
> 
> A stage3 brings with it its own /etc, so the groups, users and passwords are overwritten.
> 
> You get the stage3 /etc/portage, so make.conf, you profile and any other /etc/portage/* files and directories back to the default stage3 state.
> ...

 

NeddySeagoon, Thanks for the information.

----------

## ExecutorElassus

Update: I got /dev and /dev/shm sorted. I can emerge everything in the @system set except curl, which can't find ldap for some reason. I've been going through the @preserved-rebuild set as well, but that doesn't work very well. I can't remember which package keeps failing, but in any case it doesn't clear packages off the list after a successful emerge. What might be the reason for this?

I emerged genkernel, and ran it to create an initramfs. However, I'm worried that it won't boot. I have /usr and /var specified in /etc/genkernel.mount, but running genkernel didn't give any indication that it would pre-mount them. Is there somewhere I can check this?

Also, I'm worried that the genkernel initramfs won't properly mount all the RAID filesystems, which is most of the system directories. In addition to /usr and /var, /opt, /home, /tmp, /var/tmp, /var/portage/repos and /var/portage/distfiles are all separate partitions within the lVM. Is there some way to check that the initramfs will correctly mount these? Or does that come after switching to "real" root?

After that, assuming I can get the system to boot on its own, how do I get it to rebuild everything that still needs rebuilding? Since I have my make.conf and package.use saved,whould that be enough? Should I just install the end-point packages (like say, libreoffice) to make sure all the dependencies get emerged? Should I just keep checking dmesg for illegal instruction errors and fixing them manually?

I'm making progress, but not out of the woods yet.

Cheers,

EE

----------

## pingtoo

 *ExecutorElassus wrote:*   

> I emerged genkernel, and ran it to create an initramfs. However, I'm worried that it won't boot. I have /usr and /var specified in /etc/genkernel.mount

  The file name should be initramfs.mounts

 *ExecutorElassus wrote:*   

> Is there somewhere I can check this?

 Please see /usr/share/genkernel/defaults/initrd.script function process_initramfs_mount

 *ExecutorElassus wrote:*   

> Also, I'm worried that the genkernel initramfs won't properly mount all the RAID filesystems, which is most of the system directories. In addition to /usr and /var, /opt, /home, /tmp, /var/tmp, /var/portage/repos and /var/portage/distfiles are all separate partitions within the lVM.

 when using genkernel to generate kernel/initramfs make sure you include --lvm as in 

```
chroot # genkernel --lvm ... all
```

And at boot kernel argument dolvm

 *ExecutorElassus wrote:*   

> Is there some way to check that the initramfs will correctly mount these? Or does that come after switching to "real" root?

 As long as you put them in /etc/fstab they will be mounted after boot in to /sbin/init.  As where you can find this information please see /usr/share/genkernel/defaults/linuxrc script

----------

## ExecutorElassus

hi pingtoo,

haha whoops, yes, I meant /etc/initramfs.mounts.

I passed the options --lvm and --mdadm to genkernel when I built the initramfs. Where do I put the kernel parameters? In the line of me grub.cfg right before root=UUID=…? What if the LVM is on a RAID array? Do I need any special parameter for that? Or is that the mdadm option?

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

For failed builds, you need to pastebin some build logs for us to work with.

On the initrd the initrd is a cpio archive of other cpio archives. You can unpack it and read its init script. It probably won't be easy as its a work anyway script.

It might just be faster to try it, even if it doesn't work.

----------

## pingtoo

 *ExecutorElassus wrote:*   

> hi pingtoo,
> 
> haha whoops, yes, I meant /etc/initramfs.mounts.
> 
> I passed the options --lvm and --mdadm to genkernel when I built the initramfs. Where do I put the kernel parameters? In the line of me grub.cfg right before root=UUID=…? What if the LVM is on a RAID array? Do I need any special parameter for that? Or is that the mdadm option?
> ...

 Sorry, I am not familiar with grub. But anywhere in kernel boot command should be OK, initramfs script will figure out the sequence.

You will also need domdadm in kernel boot command line if you are using linux software-RAID.

----------

## ExecutorElassus

Hi Neddy,

for pastebin I'm going to have to wait until I get a bit more of the system working. I know there's a CLI command to make them, but I can't remember it right now. 

For now, I'm working my way down the list of programs left in world, trying to emerge, checking dmesg when they fail, emerging that, etc.. If I can get to the point where I can run 'emerge @preserved-rebuild' and clear out the list of preserved libraries, then I'll try rebooting with the new initramfs. 

There are still a few packages that are just failing, and I'm not sure what would be causing it. But thatreminds me: when would be a good time to do 'emerge --sync'?

Cheers,

EE

----------

## ExecutorElassus

while we're at it: currently, one of the packages that's failing is curl. During the configure phase, it's searching for ldapsl.h, ldap_ssl.h, and "LDAP libraries". It can't find them, despite that openldap is installed. What might be causing this? build.log doesn't tell me anything more than that.

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

wgetpaste

----------

## ExecutorElassus

holy crap! The forum is back up! Hoo boy, let's not talk about that recent unpleasantness, and get right to getting my ailing computer to work!

Current State: it can boot on its own, but a bunch of services fail to start because of missing UIDs and GIDs. I had to create the one for messagebus manually, but I don't know how to get anything else created. The ebuilds don't do it themselves, it seems.

When I boot, the keyboard doesn't work, though it's powered. What might be causing this? It's a USB keyboard.

Welcome back, everybody!

EE

----------

## NeddySeagoon

ExecutorElassus,

There is a raft of acct-group/* and acct-user/* ebuilds that are supposed to do that for system accounts.

They are a bit like virtuals. Other ebuilds use them. You are not supposed to need them yourself.

----------

## ExecutorElassus

Hi Neddy,

well, for example, polkitd, avahi,dhcpcd, and a few others I can't remember don't currently have UID/GIDs, so how do I go about adding them? 

How about this: would there be a way to list all packages *already installed* from those two directories, and (re-)install them?

And the more important issue: What might be causing the USB keyboard to not work?

Cheers,

EELast edited by ExecutorElassus on Sun Nov 28, 2021 7:38 pm; edited 1 time in total

----------

## NeddySeagoon

ExecutorElassus,

As its a new motherboard for an upgrade, I'll guess that it only has USB3 ports but your kernel has no USB3 support.

That would be game over for any USB device.

----------

## ExecutorElassus

you are correct! I did not have USB3 support. Let's see if that helps.

Will update further. I installed a few of the acct-{group|user} ebuilds that were already showing as installed, to see about adding those UIDs/GIDs. Once the kernel is rebuilt (and I make a new initramfs as well), I'll try rebooting again.

Cheers,

EE

----------

## ExecutorElassus

OK, adding usb3 support to the kernel fixed it, so the keyboard works. Next problem: I can't log in, either as root or regular user. It accepts the login, but then immediately spits me back to the login prompt. What might be causing this?

Cheers,

EE

UPDATE: 'equery l' is a powerful tool. I found all the user/group ebuilds already installed, and oneshot-installed them again just or good measure. So now I need to figure out why I can't log in, even though the login is accepted.

----------

## NeddySeagoon

ExecutorElassus,

Pam is in a mess?

Root is read only?

Can you ssh in?

----------

## ExecutorElassus

pam might be a mess! How do I check?

root might be read-only! Do I need to add "rw" to every filesystem I want to be readable in fstab? What other settings my I want besides "noatime"? (they're all ext2 and ext3 filesystems)

I can't ssh in, because eth1 isn't starting.

How would I fix pam and fstab?

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

Boot live media, chroot in and fix eth1 or whatever its called for you.

If its really eth1, that implies that you have two (or more) ethernet ports.

Is the cable in the right one? 

The ordering may not be the same as with the boot media.

----------

## ExecutorElassus

Hi Neddy,

I had two ports on the old machine, because the plug on the one on the board wore out. However, here's my problem: the liveUSB names the one on the new board enp3s0, while the machine itself, apparently does not. Without being able to log in, I can't find out what it's named to add it with rc-update. Is there some config file I can use to force the name? It's not eth0, eth1, or enp3s0. 

As for logging in, elogind is failing to start. Would that prevent me from being able to log in?

UPDATE: remerging elogind fixed my problem logging in, huzzah! So ow I can log in, and see that there is no network device created at all for the ethernet adapter, despite the specific kernel module being built in. I guess i'll go about fixing that.

UPDATE2: so, 'ls /sys/class/net/' shows two items, lo and "sit0". Would the system really have named the network adapter as "sit0"? That seems … weird. But ifconfig shows no other devices. 

UPDATE3: haha, whoops, I forgot to mount /boot before doing 'make install', so the new kernel never got installed on real /boot. got internet working now.

Now I'm trying to get xorg, or rather lightdm, to start

Is there a way to tell the initramfs (I'm using the genkernel one) to run fsck on /, /usr, and /var before switching to "real" root? 

Cheers,

EE

----------

## Hu

I see that UPDATE3 solved this, but as a note: no, sit0 is not your network card.  That is a tunneling device.  You probably don't need it to exist.

----------

## pingtoo

 *ExecutorElassus wrote:*   

> Is there a way to tell the initramfs (I'm using the genkernel one) to run fsck on /, /usr, and /var before switching to "real" root?

 

Current genkernel initramfs does not support fsck on any thing.

----------

## ExecutorElassus

update: after ploughing through illegal opcode warnings, I got xorg, then my browser, also internet and audio, up and running. Now I'm working my way through the end-point programs like libreoffice, texstudio, etc.

Question about genkernel's initramfs: if it doesn't do fsck on any premounted filesystems, is there a way to do that at any stage? fsck won't check filesystems that are already mounted, so whatever does it would have to do it at the early boot stage, yes?

I'm almost home…

Cheers,

EE

----------

## NeddySeagoon

ExecutorElassus,

fsck will run on read only filesystem. That's how root is checked and why its mounted read only, then remounted rw later.

If root is rw, it passed its fsck.

You can remount /usr ro to run fsck, as long as there is nothing open for writing.

/var can only be checked when its not mounted.

Be aware that fsck cannot fix everything on a ro filesystem. It may warn you to run it again while its not mounted.

Warning: When fsck finds an inconsistency, it guesses what should be there. When it guesses incorrectly, it wakes things worse, not better and the is no undo.

Do make some backups and validate them before you start.

----------

## pingtoo

 *ExecutorElassus wrote:*   

> Question about genkernel's initramfs: if it doesn't do fsck on any premounted filesystems, is there a way to do that at any stage? fsck won't check filesystems that are already mounted, so whatever does it would have to do it at the early boot stage,

 

May I ask why you think fsck are needed?

If your shutdown are correctly executed your would not need fsck after restart. if you encounter a unexpected situation cause system unclean shutdown it would be better off by manually examine each file system at early boot sequence when init system decide fsck is required 

To answer your question about early boot stage fsck, I don't know if it possible with systemd but if you are using OpenRC it is possible.

*** Warning, Doing follow might cause even bigger problem than you expect ***

root# touch /forcefsckabove will cause /etc/init.d/fsck perform fsck with default options -A -p. The -p will cause for ext4 filesystem automatically fix filesystem where it can safely fixed without human intervention. -A will walk through the /etc/fstab file and try to check  all  filesystems in one run.

----------

## ExecutorElassus

well, previously I had problems with the machine randomly switching off when the MOSFETS overheated (the mobo was eight years old, which was why I started this whole ordeal in the first place). So I'd get a lot of orphaned inodes and similar when it rebooted. But if you and Neddy both caution that this isn't necessary/desired on /usr and /var on bootup, I can leave it. 

So now the machine is running great, with the only problem being occasionally tripping over SIGILL errors in random programs and then remerging those ebuilds. 

(on a side note, brave [the browser] keeps giving errors like this in dmesg:

```
[  312.436830] brave[5631]: segfault at 0 ip 0000557147cc4519 sp 00007fff6cb00100 error 4 in brave[557143958000+9d84000]

[  312.436839] Code: 00 48 8d 34 03 48 81 c6 00 10 00 00 0f b6 84 03 1e 10 00 00 83 e0 3f 49 89 c5 49 f7 dd 48 c1 e0 05 48 89 f7 48 29 c7 0f 18 0f <80> 3a 02 48 89 7d d0 0f 84 52 01 00 00 80 7a 02 00 0f 84 8a 01 00

```

This is obviously another illegal instruction, but is there any way to track down which specific dependency is causing it? It's not the brave binary itself, because that's brave-bin)

I think I'm almost done with this. Hoo boy, has this been a stressful week!

Cheers,

EE

----------

