Re: [lfs-support] 6.06 Creating Essential Files and Symlinks

2012-02-15 Thread Andrew Benton
On Tue, 14 Feb 2012 18:05:09 -0800
Qrux qrux@gmail.com wrote:

 Also, did you install shadow from LFS?
 
 Because I see this in my /etc/login.defs:
 
   xlapp [/var/log] # grep tmp /etc/login.defs 
   # If defined, login failures will be logged here in a utmp format.
   # last, when invoked as lastb, will read /var/log/btmp, so...
   FTMP_FILE   /var/log/btmp
 
 And I see this in in shadow:
 
   xlapp [~/lfs/src/shadow-4.1.4.3/etc] # grep tmp login.defs
   # If defined, login failures will be logged here in a utmp format.
   # last, when invoked as lastb, will read /var/log/btmp, so...
   FTMP_FILE   /var/log/btmp
 
 I assume (perhaps tacitly) that this is being installed on your system, too, 
 if you're installing shadow.  Again, IDK if it's login that's writing to this 
 file.  But something is.  Your data differs from mine, but I don't think that 
 qualifies my data as being wrong.  LOL

The difference is I install PAM before I install shadow. If you look at
the shadow page in BLFS it has:
install -v -m644 /etc/login.defs /etc/login.defs.orig 
for FUNCTION in LASTLOG_ENAB MAIL_CHECK_ENAB \
PORTTIME_CHECKS_ENAB CONSOLE \
MOTD_FILE NOLOGINS_FILE PASS_MIN_LEN \
SU_WHEEL_ONLY MD5_CRYPT_ENAB \
CONSOLE_GROUPS ENVIRON_FILE \
ULIMIT ENV_TZ ENV_HZ ENV_SUPATH \
ENV_PATH QMAIL_DIR MAIL_DIR MAIL_FILE \
CHFN_AUTH FAILLOG_ENAB QUOTAS_ENAB FTMP_FILE \
OBSCURE_CHECKS_ENAB CRACKLIB_DICTPATH \
PASS_CHANGE_TRIES PASS_ALWAYS_WARN ISSUE_FILE
do
sed -i s/^$FUNCTION/# / /etc/login.defs
done

So shadow doesn't write to /var/log/btmp if it's installed after PAM.
Thanks for your help looking at this. I'd forgotten about modifying
/etc/login.defs when installing shadow after PAM.

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


Re: [lfs-support] automated lfs package-user

2012-02-15 Thread John Burrell


 I started one
 https://github.com/Firerat/FR-Automated-LFS_BLFS

snip

 Oh, the LFS script only does chapters 5 and 6

 but please, feel free to have a look and improve on it

 --
 Firerat
 Talented, Witty And Thoughtful .. is how most describe me.(how does your 
 Mother describe you!)

Thanks, I'll give it a try.

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


Re: [lfs-support] automated lfs package-user

2012-02-15 Thread Qrux

On Feb 14, 2012, at 8:44 AM, John Burrell wrote:

 Has anyone written a script or scripts which automate the lfs build using 
 MSB's package user system?

I have a build-system for LFS.

It builds the whole thing, chapters 5, 6, 7, 8, and--ha--9.

It does not, however, use the MSB package system.  But, I'm very interested in 
the install-as-package-user system, it would be awesome if someone wanted to 
hack that on.  Having said that, has anyone verified that it doesn't create 
security risks that might be outweighed by installation as root?  I've read the 
paper; I understand it helps alleviate issues with installs; I'd also like to 
know from the people who've tried it if there any vulnerabilities created.

 I've used a hacked version of the package user system for some time now and I 
 like it a lot. It's very easy to control what gets installed and to catch 
 Makefiles which trample all over your system. Just take a look at cups to see 
 what I mean.

I've got a project on github you can play with.  It doesn't require any user 
interaction beyond an initial script that asks for certain answers before the 
build starts.

 I've built lfs a few times and I'm not doing it again manually, so can anyone 
 help me?  If not I'll write it myself, but I don't want to reinvent the wheel.

You're welcome to look at my stuff.  I'd be happy to look at patches, if you 
want to put MSB on top of it.  Shouldn't be too hard with my setup:

https://github.com/qrux/xlapp

You'll want to note that I make assumptions about your host system:

* It uses Grub Legacy.

* /boot is a separate partition from the current root or /mnt/lfs.

* /mnt/lfs is a separate partition.

* You want a vanilla LFS install, which does not create a ramdisk.

* Your glibc is fairly current (supports $n$ password hashing).

Also, my build system is geared toward a user who ultimately wants to install 
Xen on the bare-metal, and then run the machine as a virtualized cluster.  
That's what all the additional stuff is, most of which you can completely 
ignore if you just want an LFS build.

It has two build modes; it can run a quick build, where it doesn't run most 
of the time-consuming regression checks in chapter 6.  And a full build, 
where it does run those same tests.  It has a nice feature where you can open 
another window (on host system), and run a script called 'scan' which tells you 
which packages have been built and how much total time has been taken.  The 
original window--the one you build in--doesn't generate any output, (to reduce 
CPU usage, particularly if you're SSH'ed in to the host, as I am), but instead 
writes to a log file.  In fact, scan just scans that log file every once in a 
while for an update.

My system goes on to install a few packages beyond vanilla LFS:

* bc
* openssl
* wget
* CA-certs
* tcp_wrappers
* sysstat
* openssh

These packages are just enough to allow you to SSH in (bc is needed by openssl, 
and wget is needed by CA-certs--which is needed by ssl/ssh, tcp-wrappers is 
usable by openssh--and had nice scripts to ameliorate brute-force attacks).  
Strictly speaking, sysstat isn't a necessary part of this sequence, and may be 
refactored out in the future.

In addition, the opening configuration script asks for an SSH key to install, 
so you can SSH in as root.  I realize this is outside of vanilla LFS (indeed, I 
installed these packages from the BLFS instructions).  But, I will probably 
never remove these from my core install (aside from probably sysstat).

It also installs these packages:

* which
* ntp
* cpio
* hdparm
* net-tools
* bonnie++
* xlapp-watchdog

I may refactor these out, since I'm sure some people won't want them.  The last 
one is my own...It reverts /boot/grub/menu.lst to boot the host system in the 
event that no one shuts off the watchdog within 30 seconds (the interval is 
easily changed).  For me, running this build in a dim colo setting means that 
sometimes a boot script gets borked.  It's nice to have a way to reboot the 
system.

TL;DR - Feel free to hack on it.  It's 99.9% shell-scripting, so nothing funky 
like Python, Java, etc.  I'd be quite interested to see if MSB can be grafted 
on, at which point, if it doesn't create vulnerabilities, I'd like to merge 
that in.  It's still a work-in-progress for me, and I'd quite like someone else 
to take a look!

HTH,
Q

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