You are not logged in.

#1 2015-02-26 06:52:14

pethead
Member
From: RU
Registered: 2015-02-25
Posts: 48

Notebook does not reboot technically

After reboot command it stops on this state, see picture. It is not going to restarting.
But by poweroff command it is shutting down correctly.


Sfy93O9DMTU.jpg

I've heard there is difference between reboot and systemctl poweroff reboot commands. Surely? smile

Any suggestions?

Last edited by pethead (2015-02-26 07:20:08)


This Must Be The Place I Waited Years To Leave

Offline

#2 2015-02-26 07:45:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Notebook does not reboot technically

$ which reboot
/usr/bin/reboot
$ ls -l /usr/bin/reboot
lrwxrwxrwx 1 root root 9 Feb 21 17:31 /usr/bin/reboot -> systemctl

Offline

#3 2015-02-28 14:36:00

biergaizi
Member
Registered: 2015-02-19
Posts: 13

Re: Notebook does not reboot technically

From Ubuntu Wiki: https://wiki.ubuntu.com/BIOSandUbuntu

Reboot Methods

A PC can be rebooted by Linux using several different strategies, selectable by the kernel reboot= boot option. These strategies are:

* Putting the processor back into real mode and jumping to the BIOS reset address (reboot=b)
* Keyboard controller reset by writing 0xfe to port 0x64 (reboot=k)
* Forcing the processor to triple fault (reboot=t)
* By forcing a Intel PCI reset by writing 0x2 and then 0x04 to port 0xCF9 (reboot=p)
* By writing a magic value to a port/register, as specified by ACPI FACP values RESET_VALUE and RESET_REG (an "ACPI reset") (reboot=a)

The last method ("ACPI reset") has shown to be problematic with one particular BIOS, as the RESET_VALUE and RESET_REG were values 0x06 and 0xCF9 which tries to do a Intel PCI style reset but only worked in 90% of reboots. This is because the reset should be performed in two stages (a write of 0x2, a port delay, and then a write of 0x04) rather than just one write of (0x02 | 0x04).

(i) For debugging purpose it is possible to add "reboot=<letter>" to the kernel command line in order to enforce a particular reboot method)

Offline

#4 2015-02-28 14:56:46

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: Notebook does not reboot technically

But Arch is not Ubuntu and Ubuntu doesn't use systemd (yet) so that is actually useless info. Looking at http://www.freedesktop.org/software/sys … -line.html there doesn't seem to be support in systemd for different reboot-strategies using the kernel-cmdline.

However `man systemctl` will tell you:

reboot [arg]
           Shut down and reboot the system. This is mostly equivalent to start
           reboot.target --irreversible, but also prints a wall message to all
           users. If combined with --force, shutdown of all running services
           is skipped, however all processes are killed and all file systems
           are unmounted or mounted read-only, immediately followed by the
           reboot. If --force is specified twice, the operation is immediately
           executed without terminating any processes or unmounting any file
           systems. This may result in data loss.

           If the optional argument arg is given, it will be passed as the
           optional argument to the reboot(2) system call. The value is
           architecture and firmware specific. As an example, "recovery" might
           be used to trigger system recovery, and "fota" might be used to
           trigger a “firmware over the air” update.

You could try different arguments suggested in `man 2 reboot`

Last edited by Spider.007 (2015-02-28 14:57:13)

Offline

#5 2015-02-28 15:03:11

biergaizi
Member
Registered: 2015-02-19
Posts: 13

Re: Notebook does not reboot technically

Spider.007 wrote:

But Arch is not Ubuntu and Ubuntu doesn't use systemd (yet) so that is actually useless info. Looking at http://www.freedesktop.org/software/sys … -line.html there doesn't seem to be support in systemd for different reboot-strategies using the kernel-cmdline.

However `man systemctl` will tell you:

reboot [arg]
           Shut down and reboot the system. This is mostly equivalent to start
           reboot.target --irreversible, but also prints a wall message to all
           users. If combined with --force, shutdown of all running services
           is skipped, however all processes are killed and all file systems
           are unmounted or mounted read-only, immediately followed by the
           reboot. If --force is specified twice, the operation is immediately
           executed without terminating any processes or unmounting any file
           systems. This may result in data loss.

           If the optional argument arg is given, it will be passed as the
           optional argument to the reboot(2) system call. The value is
           architecture and firmware specific. As an example, "recovery" might
           be used to trigger system recovery, and "fota" might be used to
           trigger a “firmware over the air” update.

You could try different arguments suggested in `man 2 reboot`

Yes, Arch is not Ubuntu, but it is Linux. "reboot=" is a kernel option, it is read by Linux kernel itself, and let kernel to use specific underlying reboot strategy. It is independent from userspace. In other words, it controls the implementation of "reboot" system call.

So, you meant Systemd can reboot the system without using system calls? Interesting smile

From /usr/src/linux/Documentation/kernel-parameters.txt

reboot=        [KNL]
            Format (x86 or x86_64):
                [w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \
                [[,]s[mp]#### \
                [[,]b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \
                [[,]f[orce]
            Where reboot_mode is one of warm (soft) or cold (hard) or gpio,
                  reboot_type is one of bios, acpi, kbd, triple, efi, or pci,
                  reboot_force is either force or not specified,
                  reboot_cpu is s[mp]#### with #### being the processor
                    to be used for rebooting.

Last edited by biergaizi (2015-02-28 15:08:02)

Offline

#6 2015-02-28 15:16:54

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: Notebook does not reboot technically

Oops, you're right, the kernel interpret those parameters when it receives the systemcall, from whatever application calls it.

biergaizi wrote:

So, you meant Systemd can reboot the system without using system calls? Interesting smile

If it were up to the systemd guys; I think they'd like that wink

Offline

#7 2015-02-28 15:25:24

biergaizi
Member
Registered: 2015-02-19
Posts: 13

Re: Notebook does not reboot technically

Spider.007 wrote:

But Arch is not Ubuntu and Ubuntu doesn't use systemd (yet) so that is actually useless info.

Read The F**king Source Code - Linus Torvalds

/usr/src/linux/kernel/reboot.c

static int __init reboot_setup(char *str)
{
	for (;;) {
		/*
		 * Having anything passed on the command line via
		 * reboot= will cause us to disable DMI checking
		 * below.
		 */
		reboot_default = 0;

		switch (*str) {
		case 'w':
			reboot_mode = REBOOT_WARM;
			break;

		case 'c':
			reboot_mode = REBOOT_COLD;
			break;

		case 'h':
			reboot_mode = REBOOT_HARD;
			break;

		case 's':
		{
			int rc;

			if (isdigit(*(str+1))) {
				rc = kstrtoint(str+1, 0, &reboot_cpu);
				if (rc)
					return rc;
			} else if (str[1] == 'm' && str[2] == 'p' &&
				   isdigit(*(str+3))) {
				rc = kstrtoint(str+3, 0, &reboot_cpu);
				if (rc)
					return rc;
			} else
				reboot_mode = REBOOT_SOFT;
			break;
		}
		case 'g':
			reboot_mode = REBOOT_GPIO;
			break;

		case 'b':
		case 'a':
		case 'k':
		case 't':
		case 'e':
		case 'p':
			reboot_type = *str;
			break;

		case 'f':
			reboot_force = 1;
			break;
		}

		str = strchr(str, ',');
		if (str)
			str++;
		else
			break;
	}
	return 1;
}

=============

If it were up to the systemd guys; I think they'd like that

Another funny joke on Systemd I've heard lol, I would like to share it on Twitter smile

Last edited by biergaizi (2015-02-28 15:40:53)

Offline

Board footer

Powered by FluxBB