LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 08-30-2019, 10:16 AM   #1
ritik8699
LQ Newbie
 
Registered: Aug 2019
Posts: 2

Rep: Reputation: Disabled
Question Shut Down System at V8.4 LFS - Chapter 6.9.1


I accidentally shut down my system at point 6.9.1 before running below code :-

Code:
CC="gcc -isystem $GCC_INCDIR -isystem /usr/include" ../configure --prefix=/usr --disable-werror --enable-kernel=3.2 --enable-stack-protector=strong libc_cv_slibdir=/lib
After restarting, I am just so confused about what to do and what not to do to resume exactly from where i left off.
Here is what I did :-

- Mounted partitions
- Chrooted using :-
Code:
chroot "$LFS" /tools/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login +h
What else do i need???
How would i know that now I am exactly where i left off??
Sorry for such newbie quetions but it's my first time building LFS.
Thanks in Advance.
 
Old 08-30-2019, 10:39 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,680
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
First thing is to mount all the necessary systems, not just the new partition but the dynamic directories it's going to need (/dev, /proc, /sys, etc.). See section 6.2 for details. Better still, put all this into a permanent script which you can run whenever you need it. For example, here's mine:
Code:
# Script to enter LFS chroot environment
#!/bin/bash

export LFS=/mnt/newlfs
mount /dev/sda9

# Dynamic filesystems 
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620 
mount -vt proc proc $LFS/proc 
mount -vt sysfs sysfs $LFS/sys 
mount -vt tmpfs tmpfs $LFS/run 

# and now chroot...
chroot "$LFS" /tools/bin/env -i  \
     HOME=/root                  \
     TERM="$TERM"                \
     PS1='(lfs chroot) \u:\w\$ ' \
     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
     /tools/bin/bash --login +h
As you can see, this defines LFS, does all the mounting and then chroots. I keep it in root's home directory so that I can run it whenever I want to do a bit of LFS building. Note that all the mounts have to be done before you chroot. They can't be done from inside the new system.

Then go to /sources and delete the directory you were working in. I assume that is glibc. Delete it completely. Then untar the package and start again. That is a universal rule. Never work in a directory that is partially filled with earlier work.

If you follow these rules, interruptions won't hurt you and you can spread your build over as many sessions as you like.
 
  


Reply

Tags
debian, lfs, linux, query



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS chapter-by-chapter complete commands with notes DrinkinHomeBrew Linux From Scratch 6 03-16-2012 01:57 AM
shut down problem - wont shut down.. UbrInKid Linux - Newbie 4 12-10-2009 06:20 AM
Xubuntu won't shut down - black screen after trying to shut down Snickar-Lasse Ubuntu 2 11-30-2009 04:33 PM
LFS 6.3, messed up somewhere prior to chapter 6.12 (gcc), how to restart chapter 6? Funkster Linux From Scratch 2 12-24-2008 06:30 AM
shut down won't shut system down taoweijia Linux - General 3 03-03-2004 06:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration