ch.8.4 continue in chroot environment? and hwo to change GRUB conf
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ch.8.4 continue in chroot environment? and hwo to change GRUB conf
I'm not quiet sure whether to continue in chroot or if I shall logout and start with the GRUB stuff in the host system, including installing libisoburn
Second question is: how to change the existing GRUB configuration?
I didn't understand. May be the chroot is not clear to me. But I thought, when Grub is done then I can boot the LFS System and I don't need the chroot there anymore.
But coming back to the question I have originally - On my PC there is a grub configuration already existing. It came with the installation of the host system automatically. Thats the one I have to change I believe. So I should logout of the chroot and add the new OS to the existing grub configuration. Am I right?
Yes you need to update grub on the host it should find your LFS install and add it,
Regards chroot yes you can login into your LFS but it is a minimal system (command line only) You can re chroot in and build more of the system in chroot while using the host desktop as you are doing now, The choice is yours.
Agreeing with everything above, I just wanted to add a couple of comments. If you choose to update your main GRUB config to boot your new LFS system and begin working on BLFS in it (instead of via chroot in your host system), that's a fine idea and one that many people here do. But...remember that at first you will be staring only at a terminal screen command prompt. There will be no way to read the book (except with another computer) and no mouse pointer to copy and paste commands. To continue on with BLFS packages in that situation, you should install a text-based browser like Lynx and the GPM mouse daemon (both are simple installs). Then you can use Lynx in your LFS system to open the BLFS book (either online or downloaded), read the instructions for packages, highlight commands with the mouse pointer, and in another terminal (F2, F3, and so on) paste them into the command prompt to run them. If your LFS system is connected to the Internet, Lynx can download tarballs, too. I used to do all that a lot (now I build entirely with unattended scripts). WARNING: Text-based browsers like Lynx are not exactly intuitive to use and take some time to get used to. But like anything else new and different, it is easy once you learn.
P.S.: After installing the browser and mouse daemon, I recommend first doing the chapter three stuff to create a non-root user, startup files, and config files. Then install iptables and configure a firewall if your LFS system is connected to the Internet. Sudo also will be very handy. After that, go to it.
well - I don't got it. I expected after ch. 8.3 in ch. 8.4 to change the grub menu to be able to boot the new LFS the first time. Just to see if it works or not. In Ch. 8.4.1. Introduction I did the steps on the host system - not in chroot environment.
Now in ch. 8.4.3 it says, it is recommended to have a separate partition for /boot - thats the case an here is the content (in chroot)
Quote:
root:/boot# ls
System.map-4.5 config-4.5 lost+found vmlinuz-4.5-lfs-7.9-systemd
root:/boot#
the /boot partition is mounted via fstab (for the LFS system not the host system)
Quote:
# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
Install the GRUB files into /boot/grub and set up the boot track: ...
The LFS Book gives a warning to "... overwrite the current boot loader..." I don't want that because I have
a grub.cfg file on the host system already and thought I have to change this in order to get a new menu entry.
I says
Quote:
grub-install /dev/sda
My LFS system is on sda4 the boot partition is sda7
what needs to be done to the add the sda4 to the existing grub.cfg or am I totally wrong? The existing grub.cfg file say at the beginning not to change the file manually but using grub-mkconfig
Quote:
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
But the LFS book says not to use grub-mkconfig. I have no idea what to do next.
If you want your Ubuntu GRUB to boot your new LFS system, then you don't really have to do anything in section 8.4.
Quote:
Originally Posted by LFS Book Section 8.4.1
Warning
Configuring GRUB incorrectly can render your system inoperable without an alternate boot device such as a CD-ROM. This section is not required to boot your LFS system. You may just want to modify your current boot loader, e.g. Grub-Legacy, GRUB2, or LILO.
So try doing whatever Ubuntu does to update its GRUB configuration (I have no idea). Theoretically, it is supposed to find your new LFS boot partition and update the Ubuntu GRUB config to boot the LFS system. If it doesn't, there is a way to add a custom entry manually to the Ubuntu GRUB config. Ubuntu people need to comment now.
Quote:
Originally Posted by lfs_novice
I don't understand the next steps:
Quote:
Install the GRUB files into /boot/grub and set up the boot track: ...
The LFS Book gives a warning to "... overwrite the current boot loader..." I don't want that because I have
a grub.cfg file on the host system already and thought I have to change this in order to get a new menu entry.
I says
Quote:
grub-install /dev/sda
That right there will bust your Ubuntu GRUB boot loader. You're right not to desire that at this time.
Last edited by stoat; 04-10-2016 at 09:39 AM.
Reason: I originally said chapter 8 was optional when I meant only section 8.4 of chapter 8!
I'm not sure what made me think your host is Ubuntu. You didn't mention Ubuntu here. Sorry. Whatever your host system is, it almost certainly uses GRUB2 and has a way to add LFS to its boot menu, either automatically or manually.
Yes - stoat - you are right the host system is Ubuntu
the command
Quote:
grub-mkconfig -o /home/user/test.cfg
returns a very complex file with an "unknown linux distribution" on /dev/sda4
If I got you right I should do nothing right now and just skip Ch. 8.4. But how can I check whether the new LFS- system is working or not?
I tried to run just the grub-mkconfig. It realized the unknown linux distribution as well but there is no menuitem in the boot menu for it - not in the boot menu an not in /boot/grub/grub.cfg.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.