Re: [lfs-support] Booting LFS with systemd

2018-06-25 Thread Michael Shell
On Mon, 25 Jun 2018 09:19:35 +0200
Frans de Boer  wrote:

> I have a strong reason to believe that it is systemd, since up-to 
> version 237 all worked well, but with version 237 and 238 - and nothing 
> else changed - it does not boot anymore.


  Frans,

Yes, I too believe that it is systemd. However, why you can't get
init=/bin/bash to boot is something that needs to be answered even if
systemd was booting OK. If you are using an initramfs, then that would
explain it because, as I understand it, in that case, systemd is still
required to start the init= line. This certainly is not a good thing,
IMHO, because init= is needed for such emergencies and there is a lot
that can go wrong with systemd, much, much more so than bash.

The systemd changelog can be seen here:

https://github.com/systemd/systemd/blob/master/NEWS

There are lot of changes to 238. Those that stand out to me are:

 1. The MemoryAccounting= unit property now defaults to on.

 2. Non-service units are now started with KeyringMode=shared
by default.

 3.  /sys/fs/bpf is now mounted automatically.


So, you can try adding to the kernel command line:

MemoryAccounting=false

For #3, in the kernel config, make sure "Enable bpf() system call"
(CONFIG_BPF_SYSCALL) is enabled in the General Setup.

For #2, the unit files could be changed to use
KeyringMode=inherit
or some such.

I would also try using version 239 to see if that works (they may have
fixed a known bug).


  Cheers,

  Mike
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Cannot build first pass GCC in temporary toolchain

2018-06-25 Thread Michele Bucca
Il lun 25 giu 2018, 12:02 Xi Ruoyao  ha scritto:

> On 2018-06-25 11:19 +0200, Michele Bucca wrote:
> > Hello, I'm trying to build a temporary toolchain using the LFS 8.2
> > book. I'm not a first time user The only deviation from the book that
> > I'm doing is that instead of installing inside everything in /tools
> > I'm installing it inside /mikeos.
> >
> > the LFS_TGT variable is set to i686-mikeos-linux-gnu
> > the LFS variable is set to /mnt/lfs
>
> /* snip */
>
> > linux.h.txt is the file gcc/config/linux.h
>
> The book said:
>
> > Next, we add our define statements which alter the default
> > prefix to the end of the file. Note that the trailing “/”
> > in “/tools/lib/” is required.
>
> Apparently "/mikeos/lib" in linux.h should be "/mikeos/lib/".
>

Thank you! That solved the problem! ;)

>
> > i386_linux.h.txt is the file gcc/config/i386/linux.h
> > i386_linux64.h.txt is the file gcc/config/i386/linux64.h
> --
> Xi Ruoyao 
> School of Aerospace Science and Technology, Xidian University
> --
> http://lists.linuxfromscratch.org/listinfo/lfs-support
> FAQ: http://www.linuxfromscratch.org/blfs/faq.html
> Unsubscribe: See the above information page
>
> Do not top post on this list.
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>
> http://en.wikipedia.org/wiki/Posting_style
>
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Cannot build first pass GCC in temporary toolchain

2018-06-25 Thread Xi Ruoyao
On 2018-06-25 11:19 +0200, Michele Bucca wrote:
> Hello, I'm trying to build a temporary toolchain using the LFS 8.2
> book. I'm not a first time user The only deviation from the book that
> I'm doing is that instead of installing inside everything in /tools
> I'm installing it inside /mikeos.
> 
> the LFS_TGT variable is set to i686-mikeos-linux-gnu
> the LFS variable is set to /mnt/lfs

/* snip */

> linux.h.txt is the file gcc/config/linux.h

The book said:

> Next, we add our define statements which alter the default 
> prefix to the end of the file. Note that the trailing “/”
> in “/tools/lib/” is required.

Apparently "/mikeos/lib" in linux.h should be "/mikeos/lib/".

> i386_linux.h.txt is the file gcc/config/i386/linux.h
> i386_linux64.h.txt is the file gcc/config/i386/linux64.h
-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


[lfs-support] Cannot build first pass GCC in temporary toolchain

2018-06-25 Thread Michele Bucca
Hello, I'm trying to build a temporary toolchain using the LFS 8.2
book. I'm not a first time user The only deviation from the book that
I'm doing is that instead of installing inside everything in /tools
I'm installing it inside /mikeos.

the LFS_TGT variable is set to i686-mikeos-linux-gnu
the LFS variable is set to /mnt/lfs

Now I will post the configure commands:

Binutils-2.30

../configure --prefix=/mikeos --target=i686-mikeos-linux-gnu
--with-lib-path=/mikeos/lib --with-sysroot=/mnt/lfs --disable-nls
--disable-werror

GCC 7.3.0 - Pass 1

(GCC was patched using the instructions from the book, replacing
/tools with /mikeos. I'm attaching the patched files.)

../configure --target=i686-mikeos-linux-gnu --prefix=/mikeos
--with-glibc-version=2.11 --with-sysroot=/mnt/lfs --with-newlib
--without-headers --with-local-prefix=/mikeos
--with-native-system-header-dir=/mikeos/include --disable-nls
--disable-shared --disable-multilib --disable-decimal-float
--disable-threads --disable-libatomic --disable-libgomp
--disable-libmpx --disable-libquadmath --disable-libssp
--disable-libvtv --disable-libstdcxx --enable-languages=c,c++

Glibc 2.27

../configure --prefix=/mikeos --host=i686-mikeos-linux-gnu
--build=i686-pc-linux-gnu --enable-kernel=2.6.32
--with-headers=/mikeos/include libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes

i686-pc-linux-gnu is the output of $(../scripts/config.guess)

everything builds smoothly but when I try to compile dummy.c using

$LFS_TGT-gcc dummy.c it outputs this error and I can't continue.

/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld:
cannot find crt1.o: No such file or directory
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld:
cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status

the file that it's looking is inside /mikeos/lib
Here's the verbose output:

Using built-in specs.
COLLECT_GCC=i686-mikeos-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/lto-wrapper
Target: i686-mikeos-linux-gnu
Configured with: ../configure --target=i686-mikeos-linux-gnu
--prefix=/mikeos --with-glibc-version=2.11 --with-sysroot=/mnt/lfs
--with-newlib --without-headers --with-local-prefix=/mikeos
--with-native-system-header-dir=/mikeos/include --disable-nls
--disable-shared --disable-multilib --disable-decimal-float
--disable-threads --disable-libatomic --disable-libgomp
--disable-libmpx --disable-libquadmath --disable-libssp
--disable-libvtv --disable-libstdcxx --enable-languages=c,c++
Thread model: single
gcc version 7.3.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
 /mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/cc1
-quiet -v -iprefix
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/ dummy.c
-quiet -dumpbase dummy.c -mtune=generic -march=pentiumpro -auxbase
dummy -version -o /tmp/ccLt7dlq.s
GNU C11 (GCC) version 7.3.0 (i686-mikeos-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/include"
ignoring duplicate directory
"/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include"
ignoring duplicate directory
"/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include-fixed"
ignoring nonexistent directory
"/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/include"
ignoring duplicate directory "/mnt/lfs/mikeos/include"
#include "..." search starts here:
#include <...> search starts herecd ..:
 /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include
 /mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include-fixed
 /mnt/lfs/mikeos/include
End of search list.
GNU C11 (GCC) version 7.3.0 (i686-mikeos-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c1d3a69e3cae498aec5e9863f3833dd4
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
 
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/as
-v --32 -o /tmp/ccyJDQbI.o /tmp/ccLt7dlq.s
GNU assembler version 2.30 (i686-mikeos-linux-gnu) using BFD version
(GNU Binutils) 2.30
COMPILER_PATH=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/:/mnt/lfs/mikeos/bin/../libexec/gcc/:/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/

Re: [lfs-support] Booting LFS with systemd

2018-06-25 Thread Xi Ruoyao
On 2018-06-25 09:19 +0200, Frans de Boer wrote:
> I have a strong reason to believe that it is systemd, since up-to 
> version 237 all worked well, but with version 237 and 238 - and nothing 
> else changed - it does not boot anymore.
> 
> Regards, Frans.

See .

Try the Early Debug Shell.
-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Booting LFS with systemd

2018-06-25 Thread Frans de Boer

On 06/25/2018 03:51 AM, Michael Shell wrote:

On Sun, 24 Jun 2018 10:01:48 +0200
Frans de Boer  wrote:


Same story, nothing happens.
I do notice, however, that on the listing by systemd capabilities the
text -ELFUTILS is used. I do compile the elfutils, but somehow systemd
does not use them. Is that a likely source of the problem?


Frans,

I don't know, but how do you know that systemd is not using them?

In anycase, I think that if init=/bin/bash can't bring up a shell
prompt, then that indicates a serious issue and one that should
be independent of systemd (unless you are using an initramfs/initrd,
see below).

When trying init=/bin/bash, what exactly does your kernel command
line look like?

Here is how someone approaches that in grub:

https://linuxconfig.org/how-to-reset-lost-root-password-on-ubuntu-16-04-xenial-xerus-linux

Their grub boot was changed to something like:

linux /boot/vmlinuz-4-4.0-22-generic root=UUID=43ad24d3-e\
c5b-44ee-a099-a88eb9520989 rw init=/bin/bash

But, without an initramfs, a PARTUUID should be used instead
(issue a blkid as root to see the list of drive names/IDs).

Now, with an initramfs/initrd it is my understanding that systemd still
starts first and then systemd calls the init= line:

https://lists.freedesktop.org/archives/systemd-devel/2014-June/020016.html

Are you using an initrd? If so, can you build any needed drivers into
the kernel, specifiy your root filesystem via PARTUUID and then
try init=/bin/bash again without the use of any initrd?

Another possibility is that the terminal you get does see your
commands, its just that you can't see the response due to some
type of console setup issue. You could try seeing if issuing
some command, e.g., ls, does cause the hard drive access light
to flash.

I would also try booting the same filesystem, but with another,
known good, kernel to see if that helps.


Cheers,

Mike




Mike thanks for your replies. I shall follow your suggestions this week 
and shall be back when I have more answers.


I have a strong reason to believe that it is systemd, since up-to 
version 237 all worked well, but with version 237 and 238 - and nothing 
else changed - it does not boot anymore.


Regards, Frans.

--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style