Sweets / hummingbird

Hummingbird init system for Linux based operating systems.
MIT License
250 stars 7 forks source link

Hummingbird resets upon trying to init #21

Closed IkaSek closed 3 years ago

IkaSek commented 3 years ago

It does not go past the first stage, fs.

Sweets commented 3 years ago

If it doesn't get past the filesystem stage, then there could be a block in the fs file itself, which is user error since fs is entirely user defined.

That is, assuming it gets to the fs stage to begin with. What does your filesystem stage file look like? Also, how did you install hummingbird? Did your means of installation have files included from dist/?

If it's resetting though then that means that it could be a problem with your shell. https://github.com/Sweets/hummingbird/blob/master/src/hummingbird.c#L31 After the signal handler is installed and the system is (attempted to be) booted, hummingbird will drop the user into an emergency shell (in the normal boot process it will never get to this point).

Given that it resets, it means you're not even getting to the emergency shell, i.e. there's no shell it can drop you into located at /bin/sh. Or the permissions are incorrect.

IkaSek commented 3 years ago

We use a obscure distro called Alnux so no dist files. Probably ash is fucked i'll look into it, also worth noting: it displays this message (recreated from mem.) Mounted EXT4 opts: (null)

IkaSek commented 3 years ago

Oh also, um, it's the default installation fs

Sweets commented 3 years ago

The message it displays is just showing there's no options for mounting. It's still mounting. This seems to be either caused by the mount command remounting the root filesystem which is ext4, or alternatively, if root isn't ext4 or it's an additional partition specified by /etc/fstab which is being mounted by mount -a. So it seems to me that it is getting past the fs stage.

A test you can do is put sleep 5 at the end of the filesystem stage file and see if it makes the boot hang. If it does, that means it is in fact getting you past fs, and could then be down to either interlude or tty.

If interlude is empty or doesn't exist, then it would be tty. In that case, it would mean that there's no TTYs being created, either because getty or agetty aren't available on the system, or are not executable. Failure of the tty stage would cause the init to fall through.

Still though, even falling through, you should be dropped to emergency shell. Which is a deeper rooted problem that's unrelated to the init.

Every call made to execute checks for execution permission, and the existence of a file. If either fails, then execute will fail silently. Ideally, it probably shouldn't be silent though, in the case of something like this. So I'll fix that when I get home from work.

Check to verify that either commands to start tty are present on the system, are accessible, and executable as well. Also check the integrity or for the existence (or lack thereof) of interlude.

IkaSek commented 3 years ago

Ok i'll try

IkaSek commented 3 years ago

Tried and it's the fs' fault since it does not sleep o 5 seconds. interlude exists and is aok.

Sweets commented 3 years ago

If you comment out the command that mounts all partitions from the fstab file, then what?

This way we’ll be able to determine if it’s the mounting from fstab or the remounting.

IkaSek commented 3 years ago

Yes it was being remounted from fstab.

Sweets commented 3 years ago

Right, so did the problem still occur?

IkaSek commented 3 years ago

Ok, so are those lib scripts meant to be bzip2 and also no.

Sweets commented 3 years ago

No, the scripts are shell scripts.

IkaSek commented 3 years ago

Well then i somehow ran bzip2 on all of them and interlude broke and i reinstalled it and it is fixed.