LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-06-2021, 02:00 PM   #1
someguydude
LQ Newbie
 
Registered: Jul 2012
Posts: 15

Rep: Reputation: Disabled
link to App to automate the LFS build ...


Tired after so many years of manually entering commands.


... so I wrote a Linux App to create bash scripts from the HTML noChunk book 10.1.

It is not finished ... but works up to chapter 7.7.

here:
https://github.com/mikienet/LFSauto

Last edited by someguydude; 07-06-2021 at 06:17 PM.
 
Old 07-07-2021, 11:13 AM   #2
lovemeslk
Member
 
Registered: Feb 2020
Location: Rantoul IL
Distribution: Slackware
Posts: 350

Rep: Reputation: 72
Hey cool that is a wonderful tool. Thanks
please mark it solved
 
Old 07-08-2021, 09:19 PM   #3
someguydude
LQ Newbie
 
Registered: Jul 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Maybe?

As I Said I am giving up ...
... but if someone can answer my thread question ...
... I will continue work.

Problem is no one is.https://www.linuxquestions.org/quest...-a-4175697264/
 
Old 07-16-2021, 03:45 PM   #4
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by someguydude

As I Said I am giving up ...
... but if someone can answer my thread question ...
... I will continue work.
Of course do what you think is best, but I think the project is worth the effort to fix it. I compiled my executable from main.c and ran it to create my scripts. No problem. I have not downloaded the package set and tried the scripts yet, but I did read through them and have some things for you to consider.

One is that I think it is bad practice to do second passes without deleting the entire package directory from the first pass and untarring it again for the second pass. This may even be behind the Libstdc++ problems in your other thread. Anyway, the book's General Compilation Instructions say to "delete the extracted source directory unless instructed otherwise", and I cannot find any package that instructs "otherwise".

Some other little things...

1.Lines 891-895 in the step 3 script are not commands and will stop the script.

2. Line 2974 in the step 6 script needs a test to set ABI=32 or not for the configure command. Otherwise this line will stop the script as it is now.

3. Line 3652 in the step 6 script (passwd root) will stop the script for user input. In my own scripts, I install Shadow here as per the book, but I move this passwd command to the end of the script for this part of the book. Or you could omit the passwd root command in the script and simply echo a comment at the end telling the user to run the command before exiting the session.

4. Line 2672 in the step 7 script requires user input. Figure out some way to set the PAGE parameter for Groff.

5. The step 7 script effectively ends at a logout and re-entry into chroot. It probably needs some kind of echo comment regarding successful completion and what the user should do next to finish up (the configuration and kernel stuff manually).

Anyway, that's my two cents for now. BTW, did you know that a checkout of the development book at git-hub has a makefile option called dump-commands that will essentially produce what your program does. It's very handy for a script builder. And if the checkout is done right before or after a stable release, there probably will be few or no changes needed.
 
Old 07-18-2021, 02:01 PM   #5
someguydude
LQ Newbie
 
Registered: Jul 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
I missed the delete sources instruction.
I focused on making sure the build directory was removed instead.
This could be helpful advice so thanks.

NOTE 1: I usually comment these lines manually since I can't find a way to automate.
occasionally I did miss doing so, from attempt to attempt ... and while errors were thrown such as command not found ... it went forward.

notes 2 thru 5 are going to be helpful when I get this to go past Chapter 7.7
I left allot unfinished and I have been fixing things sequentially.
In any event 2 thru 6 are very helpful and I would not have known about them ... so thanks as well.

The dump-commands is a cool feature but starting with that makes it impossible to automate.
The issue is that I need the HTML no chunk book to be able to tell where I am and what hacks need to be done.
This is due to the way the author/s HTML publishing tool seems to be working against what I want to accomplish.

If you look at my code you will see a chapter.h header with all anchor tag names.
in the chapter function I detect these and perform certain functions automatically such as start a new bash script when a command would restart bash or kill the processing within a script.
I also have to perform many of the books steps at the beginning of the next script such as when chroot is performed.
This cut's of the remaining commands for ever being executed.

I would not have to do so many hacks if the author/s added additional anchor tags with sub chapter names ...
... and end a sub-chapter just after any command that would kill a bash script.

If anyone could talk them into this I could clean up a lot of issues.

as it is I have to turn on commenting for any chapter if there is one command that should not be executed.

In addition ... all actual commands are wrapped such:
<kbd class="command">./configure --prefix=/usr</kbd> (this should be run)
... which is fine ... but ...

... the problem is many non-commands are wrapped the same way such as in the Preface / Typography section:
<kbd class="command">./configure --prefix=/usr</kbd> (this should not be run !!!)

Changing the class name from command to anything else would be ideal.

... if the author/s did not use the class="command" when not appropriate ...
... all these issues could be resolved and automation of LFS would be a piece of cake.


Perhaps someone close to them could suggest the next book be published with these easy changes?

Last edited by someguydude; 07-18-2021 at 02:07 PM.
 
Old 07-19-2021, 08:27 AM   #6
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Well, I for one am happy that you might move forward with the project.

Quote:
Originally Posted by someguydude

occasionally I did miss doing so, from attempt to attempt ... and while errors were thrown such as command not found ... it went forward.
I always put set -e at the top of my bash build scripts. While it is annoying when a script stops, it's worse never to know something wrong happened. Sometimes I insert set +e in places to turn that off temporarily, such as during GCC tests which always have some errors but shouldn't stop the script.
Quote:
Originally Posted by someguydude

The dump-commands is a cool feature but starting with that makes it impossible to automate.
True. It's just a clean place to start manually fleshing out a script. Your project is beyond that.
Quote:
Originally Posted by someguydude

If anyone could talk them into this I could clean up a lot of issues.
Maybe, but as you already know, the LFS book itself is not written with script builders in mind. I think it is very unlikely for them to care about its HTML formatting for that purpose. I think the appearance of the various sections is more important for them.

Some other thoughts that I had...

One concerns the make check commands. Your scripts test all packages, and that is fine if you like it. But IMO, it is mostly a waste of time (a lot of it) to test every package. After many years of building LFS systems, I find that if a package builds okay then it most likely is okay. I only do the critical tests and sanity checks, and those I tee to log files while the script runs and look at them later. In your scripts as they are now the test results would scroll by unseen.

For these and the other things that you have to manually comment and edit, perhaps a final cleanup script with seds to add, delete, and alter that stuff in the scripts would be a practical thing to try.

Last edited by stoat; 07-19-2021 at 08:31 AM.
 
Old 08-07-2021, 04:16 PM   #7
someguydude
LQ Newbie
 
Registered: Jul 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Still no go ...

I made major changes to the LFS auto app.
I will publish in a few minutes the new code and the new bash scripts generated by the code.

I did add lines to delete the entire previous untar directory for pass two yet it still fails at the same spot in chapter 7.7

I need help with this cause I have no idea where to begin looking.
The error is not clear.
Searched and searched and there is no clear path to begin even trouble shooting.

Output from CH 7.7:
Code:
Chapter 7.7
mkdir: created directory 'build'
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-lfs-linux-gnu
checking target system type... x86_64-lfs-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-lfs-linux-gnu-strip... no
checking for strip... no
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for x86_64-lfs-linux-gnu-gcc... x86_64-lfs-linux-gnu-gcc
checking for suffix of object files... configure: error: in `/sources/gcc-10.2.0/build':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.
Chapter 7.8

... log file here:

https://app.box.com/s/t3752rb5haszlulo1ao2t5l48wkxrcm5


git here:

https://github.com/mikienet/LFSauto

Last edited by someguydude; 08-07-2021 at 08:17 PM.
 
Old 08-08-2021, 02:46 AM   #8
anak_bawang
Member
 
Registered: Jun 2015
Location: Bandung Indonesia
Distribution: Debian, LFS/BLFS
Posts: 138

Rep: Reputation: 23
Quote:
Originally Posted by someguydude View Post
Line 85 - 120 :

Code:
x86_64-lfs-linux-gnu-gcc: error: unrecognized command-line option '-V'
x86_64-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4127: $? = 1
configure:4116: x86_64-lfs-linux-gnu-gcc -qversion >&5
x86_64-lfs-linux-gnu-gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
x86_64-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4127: $? = 1
configure:4143: x86_64-lfs-linux-gnu-gcc -o conftest    conftest.c  >&5
/usr/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-linux-gnu/bin/as: error while loading shared libraries: libopcodes-2.36.1.so: cannot open shared object file: No such file or directory
configure:4146: $? = 1
configure:4359: checking for suffix of object files
configure:4381: x86_64-lfs-linux-gnu-gcc -c   conftest.c >&5
/usr/lib/gcc/x86_64-lfs-linux-gnu/10.2.0/../../../../x86_64-lfs-linux-gnu/bin/as: error while loading shared libraries: libopcodes-2.36.1.so: cannot open shared object file: No such file or directory
configure:4385: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "package-unused"
| #define PACKAGE_TARNAME "libstdc++"
| #define PACKAGE_VERSION "version-unused"
| #define PACKAGE_STRING "package-unused version-unused"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4399: error: in `/sources/gcc-10.2.0/build':
configure:4401: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details

Error loading libopcodes (binutils). Probably there is something wrong at chapter 6.17 Binutils Pass 2
 
Old 08-08-2021, 03:00 AM   #9
anak_bawang
Member
 
Registered: Jun 2015
Location: Bandung Indonesia
Distribution: Debian, LFS/BLFS
Posts: 138

Rep: Reputation: 23
IMHO, you should done it manually every steps.
If success, then put all the commands to your automate build script.

It takes a lot of time for the first time.
But for the next (ex. new LFS version) it will be much simpler.
 
  


Reply



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
VirtualBox Starter Pack - LFS as a Host For Your LFS Build basica Linux From Scratch 4 11-25-2015 12:02 PM
Updated (unofficial) LFS LiveCD link -- Builds LFS 7.x and CLFS latest bitshark Linux From Scratch 0 04-28-2015 02:44 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
Will compiling LFS on an 64 bit distro build an 64 bit LFS? Vampirite Linux From Scratch 4 08-31-2007 02:48 PM
LXer: Speaking Unix, Part 6: Automate, automate, automate! LXer Syndicated Linux News 0 01-04-2007 09:54 AM

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

All times are GMT -5. The time now is 08:21 PM.

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