[Proposal] Using install in place of mkdir/cp

Jeremy Utley jeremy at jutley.org
Wed May 12 13:10:47 PDT 2004

Tushar Teredesai wrote:

> Jeremy Utley wrote:
>> Well, what we're talking about here is one specific place, that being 
>> the initial creation of the directory structure in chapter 6.  IMHO, 
>> it's not really needed there, and it might actually make that set of 
>> commands more complex, since we'll have a couple of directories that 
>> won't be able to be included in the {} expansion.
> I was refering to using "install -d" instead of "mkdir -p" and 
> "install" instead of "cp" in all places. It would be worth researching 
> why most of the packages use install in most of the places.
> Also, did not understand what you meant by the {} expansion.
Well, in the current LFS book, we do a lot of the following:

mkdir -p /{bin,boot,dev/{pts,shm},etc/opt,home,lib,mnt,proc}
mkdir -p /{root,sbin,srv,tmp,usr/local,var,opt}

By switching to install -d for these, we have to special case /root, 
/tmp, and /var/tmp to set their proper permissions, which would then 
look something like this:

install -d /{bin,boot,dev/{pts,shm},etc/opt,home,lib,mnt,proc}
install -d /{sbin,srv,usr/local,var,opt}
install -m 0750 -d /root
install -m 1777 -d /tmp /var/tmp


More information about the lfs-dev mailing list