public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* Unattended installation of the entire Cygwin build
@ 2007-04-11 17:57 Sarah Thompson
  2007-04-11 18:14 ` Dave Korn
  0 siblings, 1 reply; 3+ messages in thread
From: Sarah Thompson @ 2007-04-11 17:57 UTC (permalink / raw)
  To: cygwin-apps

Hi all,

I'm currently integrating Cygwin into an automated build environment 
where all installers need to operate entirely unattended. I appreciate 
that setup.exe doesn't yet support this fully, but in the mean time I've 
been attempting to develop a usable workaround.

I did get the sources for setup.exe and managed to build it, but my 
initial attempt to add an --all flag failed -- I got the impression that 
the code was a little unwelcoming to minor alterations. I did get 
further with the following hack:

   1. Download /setup.exe/ from the cygwin web site <http://cygwin.com/>.
   2. Run the installer conventionally, choosing the options for
      downloading to a local directory without installing anything. Make
      sure you have everything set to 'Install' in the choose packages
      page.
   3. Run the following /sed/ script over the downloaded /setup.ini/ file:

 cp setup.ini setup.ini-backup  
 sed "s/[cC]ategory:.*/Category: Base/" < setup.ini > setup.temp
 cp setup.temp setup.ini

This now leaves you with a 'canned' version of Cygwin that will install 
from the command line as follows:

 setup.exe -q --local-install --root c:\where\you\want\to\put\cygwin -l c:\path\to\installer\directory

Note that the paths you give to setup.exe need to be Windows paths, 
/not/ Cygwin paths.

The installer seems to work as expected, entirely 'hands-free' 
so-to-speak, installing the entire list of downloaded packages, but for 
some reason it fails to create a home directory for the currently logged 
in user and it fails to source the necessary profiles when Bash is 
started from the short cut, so the path is somewhat minimal and you just 
get a 'bash-3.2$' prompt rather than the usual customised version.

Any help you could give in finding a workaround for this would be 
gratefully appreciated.

Sarah Thompson
NASA Ames Research Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Unattended installation of the entire Cygwin build
  2007-04-11 17:57 Unattended installation of the entire Cygwin build Sarah Thompson
@ 2007-04-11 18:14 ` Dave Korn
  2007-04-11 19:15   ` Pierre A. Humblet
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Korn @ 2007-04-11 18:14 UTC (permalink / raw)
  To: cygwin-apps

On 11 April 2007 18:57, Sarah Thompson wrote:

> The installer seems to work as expected, entirely 'hands-free'
> so-to-speak, installing the entire list of downloaded packages, but for
> some reason it fails to create a home directory for the currently logged
> in user and it fails to source the necessary profiles when Bash is
> started from the short cut, so the path is somewhat minimal and you just
> get a 'bash-3.2$' prompt rather than the usual customised version.

  Yes, that's not part of setup's job.  It happens the first time you fire up
a bash shell: default profile scripts are copied from /etc/skel, and you are
instructed to run mkpasswd and mkgroup with the -l or -d (or both) switches to
set up the passwd and groups files.  Take a look at /etc/profile:

# If the home directory doesn't exist, create it.

and

# Check to see if mkpasswd/mkgroup needs to be run try and cut down the emails
#   about this on the lists!

> Any help you could give in finding a workaround for this would be
> gratefully appreciated.

  Well, crudely speaking, you could probably add a call to the system()
function to invoke the Cygwin.bat script in the cygwin root dir.  That would
copy the skeleton files across to the user's new $HOME, but you'd still need
to get the passwd and groups files set up somehow.  You could use system()
calls to invoke mkpasswd and mkgroup as well, or you could add a script
somewhere, and just invoke that; there's probably half-a-dozen ways of doing
it that amount to the same thing but differ in minor details.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unattended installation of the entire Cygwin build
  2007-04-11 18:14 ` Dave Korn
@ 2007-04-11 19:15   ` Pierre A. Humblet
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre A. Humblet @ 2007-04-11 19:15 UTC (permalink / raw)
  To: Dave Korn, cygwin-apps


----- Original Message ----- 
From: "Dave Korn" <>
To: <cygwin-apps>
Sent: Wednesday, April 11, 2007 2:14 PM
Subject: RE: Unattended installation of the entire Cygwin build


| On 11 April 2007 18:57, Sarah Thompson wrote:
| 
| > The installer seems to work as expected, entirely 'hands-free'
| > so-to-speak, installing the entire list of downloaded packages, but for
| > some reason it fails to create a home directory for the currently logged
| > in user and it fails to source the necessary profiles when Bash is
| > started from the short cut, so the path is somewhat minimal and you just
| > get a 'bash-3.2$' prompt rather than the usual customised version.
| 
|  Yes, that's not part of setup's job.  It happens the first time you fire up
| a bash shell: default profile scripts are copied from /etc/skel, and you are
| instructed to run mkpasswd and mkgroup with the -l or -d (or both) switches to
| set up the passwd and groups files.  Take a look at /etc/profile:
| 
| # If the home directory doesn't exist, create it.
| 
| and
| 
| # Check to see if mkpasswd/mkgroup needs to be run try and cut down the emails
| #   about this on the lists!
| 
| > Any help you could give in finding a workaround for this would be
| > gratefully appreciated.
| 
|  Well, crudely speaking, you could probably add a call to the system()
| function to invoke the Cygwin.bat script in the cygwin root dir.  That would
| copy the skeleton files across to the user's new $HOME, but you'd still need
| to get the passwd and groups files set up somehow.  You could use system()
| calls to invoke mkpasswd and mkgroup as well, or you could add a script
| somewhere, and just invoke that; there's probably half-a-dozen ways of doing
| it that amount to the same thing but differ in minor details.
| 

Actually the passwd/group files are run in the base-passwd postinstall, and it's 
all you need for local users. For domain users you need to run with -d, which
we found risky to do unattended (there are companies with thousands of users,
and also the PC may not be connected to the PDC).

Rather than running system, you could modify the bash shortcut to run with the
--login flag, which would pull the skeleton files.

By the way, /etc/profile should check if mkdir -p "${HOME}"
 succeeds before blindly trying to install the skeletons. If it fails
HOME should be / .

Pierre

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-11 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-11 17:57 Unattended installation of the entire Cygwin build Sarah Thompson
2007-04-11 18:14 ` Dave Korn
2007-04-11 19:15   ` Pierre A. Humblet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).