Date: Thu, 2 Dec 2004 00:07:29 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [Ux2bs_Archive] No. 371 ************************************************** Wednesday 01 December 2004 Number 371 ************************************************** Subjects for today 1 Re: ux2bs revisited : Anton Monroe 2 Problems with pdksh : Anton Monroe **= Email 1 ==========================** Date: Tue, 30 Nov 2004 11:30:57 -0600 From: Anton Monroe Subject: Re: ux2bs revisited John, Below are some patches to ux2_bootstrap.cmd and ux2_inst.cmd for you to consider. Other people may have comments. The idea is to add a few hooks that I think could be useful to testers like me. I've added two new variables called %ux2local% and %ux2pause%. If %ux2pause is set, the installer will pause at certain points so the user can abort the install, switch to another session to see what has happened, or perhaps change something. If %ux2local% is set, the installer will stop at certain points to run an optional, user-provided, script in the %ux2local% directory. Neither is set by default. Without them, the normal, unattended install routine will run just as it always has, with three minor exceptions: 1) There was already one pause at the bottom of ux2_bootstrap.cmd. I made it dependent on %ux2pause% like the ones I added, so the user has a choice of no pauses or all of them. 2) I rewrote the initial "check these settings" pause to display %repository% and the optional settings. I had to condense it a little to get it to fit within 25 lines. 3) I added a couple of setlocal/endlocal pairs in ux2_inst.cmd to keep the installer's initial settings from being wiped out. My justifications for the proposed %ux2pause% addition: When the UX2BS installer works right, it's beautiful to watch. When it doesn't, it's a little like watching a runaway train. I can press Ctrl-C a dozen times and get it stopped, but it's aggravating. Then my attention deficit takes over and I find something else to do. And one time Ctrl-C managed to lock up OS/2 and I had to reboot. Being able to pause once in a while keeps me happier. My justification for the proposed %ux2local% scripts: The most common use for local install scripts is for setting the initial variables, so I don't have to re-edit ux2_bootstrap.cmd every time. That alone doesn't justify %ux2local%. But I also need the postbase.cmd because I use Warp 3 and have to modify my DPATH. It has to be done within the install routine so the installer can go on to build pdksh, perl, etc. The other scripts, preinst.cmd and postinst.cmd, have been handy while developing my additions. They might encourage other people to help improve the installer. I think it makes sense to provide a consistent way of providing those hooks, but I'd like to hear from other people. One of the reasons for allowing the installer to call local scripts is so I can set the initial variables in a script and not have to re-edit ux2_bootstrap.cmd each time I start over. A simpler way to do that is to hard-code ux2_bootstrap.cmd to call ux2_init.cmd, which sets all the initial variables like %osrt%, %uxrt%, %ux2pause%, etc. That's what I have been doing up to this week. But now I've added some other hooks for local scripts. We could require that they all be in %bldrt%\, but that seems unaesthetic and possibly confusing. Also, when I decide to do a clean install I sometimes get over-zealous about deleting files. I would like to keep all my local configuration scripts neatly and safely together on another drive. What I went with was to put all local scripts in another directory and tell the installer where to look for them with %ux2local%. The only downside to that is that I have to remember to set %ux2local% from the command line before running ux2_bootstrap.cmd. On the other hand, you might not want local scripts to be too easy to use anyway-- I don't want to encourage people to interfere with the installer unless they really have to, or for it to be calling scripts that the user has forgotten about. Opinions, anyone? Anton --- ux2_bootstrap.cmd.orig Sun Nov 14 10:20:00 2004 +++ ux2_bootstrap.cmd Tue Nov 30 09:08:42 2004 at at -1,32 +1,135 at at at echo off -echo: -echo: Please set variables to suit your own environment before -echo: running this script for the first time. -echo: + +rem You must edit the variables below to suit your own environment +rem before running this script. + set osrt=c: -set bldrt=c: set uxrt=c: -echo: * osrt is where OS/2 boots from. -echo: -echo: - currently %osrt% -echo: -echo: * bldrt is where the build environment will reside. -echo: -echo: - currently %bldrt% -echo: -echo: * uxrt is where the Unix-like environment will be installed. -echo: -echo: - currently %uxrt% -echo: -echo: If these variables are not set correctly, press ctrl-break otherwise -echo: press any other key to install the UnixOS/2 baseline build -echo: which should include building Perl 5.8.5. This may take a couple -echo: of hours... -echo: -pause +set bldrt=c: set bld_home=unixos2 -rem set host=os2ports.com +set repository=%bldrt%\%bld_home%\repository set host=213.152.37.92 + +rem %osrt% must be the drive that OS/2 boots from. +rem +rem %uxrt% is the drive where the Unix-like environment will be +rem installed. It can be any drive, but if you have an empty +rem drive that you can dedicate to the purpose, it is +rem probably a good idea. This is because the build system +rem will create some of the standard Unix directories under +rem the root directory of %uxrt%, like /etc, /home, /bin, +rem /usr, and /tmp. If you already have directories with +rem those names, files in them could be overwritten. +rem +rem %bldrt% is a drive +rem %bld_home% is the directory on drive %bldrt% in which the UX2BS +rem build environment will reside. +rem +rem %repository% is a directory where UX2BS will store the files +rem that it downloads. +rem +rem Note that directory names should not have a trailing backslash. +rem +rem %host% is the UX2BS server where the build system will get its +rem files. Do not change %host% unless you really know what +rem you are doing. +rem +rem -------------------------------------------------------------------- + +rem %ux2pause% and %ux2local% are optional variables. They are +rem mostly for the convenience of people testing UX2BS who will be +rem running the install script repeatedly. These features require +rem some familiarity with the installation and baseline build +rem process. +rem +rem %ux2pause% +rem +rem If you set ux2pause=ON the installer will pause at certain points +rem so you can inspect what has been done or change something +rem before continuing. +rem +rem %ux2local% is the name of a directory. It can be on any drive. +rem The installer will look there for supplementary +rem installation scripts. That can make it easier for you to +rem configure the installation for peculiarities of your own +rem system that the installer doesn't know about. +rem +rem At the beginning of the install, ux2_bootstrap.cmd (the +rem script you are reading) looks in %ux2local% for a file +rem called ux2_init.cmd. If that file exists, it will be run. +rem If you will be trying out future versions of UX2BS, you +rem will probably want to use ux2_init.cmd to set the initial +rem variables like %osrt%, %uxrt%, %bldrt%, etc. That way you +rem won't have to re-edit ux2_bootstrap.cmd each time it +rem changes. +rem +rem There is one catch-- the only variable you can't set in +rem your local script is %ux2local% itself. You will need to +rem set %ux2local% from the command line before starting +rem ux2_bootstrap.cmd, or use a wrapper script. +rem +rem At the end of the baseline binary installation, a minimal +rem build system is present. The installer will use the build +rem system itself to compile the rest of the components. But +rem first it will check the %ux2local% directory for a script +rem called base_end.cmd. That lets you make any changes to +rem the build system that you need before it is used for the +rem first time. +rem +rem Some clarification might be needed to prevent confusion. +rem %ux2local% is not related to the ux2_local.cmd. +rem ux2_env.cmd contains environment variables used by the +rem build system. ux2_local.cmd is where you can make your +rem own changes to to the environment. Both scripts are +rem created during the installation. Each time you use the +rem build system those scripts are run, for instance when you +rem type "build foo". +rem +rem %ux2local% is used only by the installer. You can, of +rem course, use a %ux2local% script to automatically create a +rem customized ux2_local.cmd during installation. +rem +rem If you do need to add a base_end.cmd script, keep a few +rem things in mind: It isn't intended for anything complex, +rem mostly just fixing the build environment so the +rem installation can continue. Variables are sometimes +rem redefined part way through the installation, like +rem %repository% and %bld_home%. Be sure you really know what +rem they mean. Variables sometimes store paths in Unix style, +rem so "%bld_home%\lib" might expand to "c:/unixos2\lib". +rem OS/2 apps don't usually handle forward slashes well, so +rem try to use the available Unix commands, like 'cp' instead +rem of 'copy'. +rem +rem -------------------------------------------------------------------- + +if not %ux2local%. == . if exist %ux2local%\ux2_init.cmd call %ux2local%\ux2_init.cmd + +echo: +echo: If these settings are not correct, press Ctrl-Break now. +echo: Then edit this file to change them and start again. +echo: +echo: * OS/2 boots from drive %osrt% +echo: +echo: * the Unix-like environment will be installed on %uxrt% +echo: +echo: * the UX2BS build environment will reside under +echo: +echo: %bldrt%\%bld_home% +echo: +echo: * the repository for downloaded files will be +echo: +echo: %repository% +echo: +if not %ux2local%. == . echo: * ux2local = %ux2local% +if not %ux2pause%. == . echo: * Pause option is ON +echo: +echo: If everything is correct, press a key to start the baseline +echo: build. It includes building Perl 5.8.5 and may take a couple +echo: of hours... +echo: +pause + if exist rsync.exe goto fetch echo open %host% >ux2_ftp echo user unixos2 "" >>ux2_ftp at at -37,15 +140,35 at at echo bye >>ux2_ftp echo:>>ux2_ftp type ux2_ftp | ftp -nv + :fetch -rsync -av %host%::build %bldrt%/%bld_home% 2>nul +rsync -av %host%::build %bldrt%/%bld_home% + %bldrt% cd \%bld_home%\lib -echo you may check and adjust the newly installed build scripts if you wish, -echo otherwise press any key to continue the installation with the defaults. -echo. -pause +if %ux2pause%. == . goto callux2_inst +echo: +echo: ----------------------------------------------------------------- +echo: If rsync ended with an 'unexplained error' message, ignore it. +echo: +echo: %bldrt%/%bld_home%/lib/ now contains scripts that will do the +echo: next stage of the installation. This pause gives you a chance +echo: to check and adjust them. +echo: +echo: The next step is to run ux2_inst.cmd. It will record its actions +echo: in %bldrt%\%bld_home%\lib\ux2bs_install.log. It starts by +echo: downloading the binary baseline packages to the repository. +echo: If your repository already has those packages, rsync will just +echo: make sure they are up to date. +echo: ----------------------------------------------------------------- +echo: +pause +:callux2_inst +if not %ux2local%. == . if exist %ux2local%\preinst.cmd call %ux2local%\preinst.cmd ux2_inst %1 %2 %3 %4 %5 %6 %7 %8 %9 2>&1 | tee ux2bs_install.log +echo back in ux2_bootstrap.cmd +if not %ux2local%. == . if exist %ux2local%\postinst.cmd call %ux2local%\postinst.cmd + --- ux2_inst.cmd.orig Tue Mar 30 03:51:38 2004 +++ ux2_inst.cmd Tue Nov 30 09:08:18 2004 at at -5,17 +5,37 at at md %uxrt%\home md %uxrt%\home\root md %uxrt%\tmp + set tmp=%uxrt%\tmp set bld_home=%bldrt%/%bld_home% set path=%uxrt%\usr\bin;%bld_home%\emx\bin;%osrt%\os2;%bld_home%\bin; set beginlibpath=%uxrt%\usr\lib;%bld_home%\dll; if %repository%. == . set repository=%bld_home%/archives + rsync -av %host%::baseline %repository% 2>nul -setlocal + +if %ux2pause%. == . goto baseline_inst +echo: ----------------------------------------------------------------- +echo: Rsync has now downloaded/updated the binary baseline packages +echo: to %repository%. Again, if rsync ended with an +echo: 'unexplained error' message, ignore it. +echo: +echo: The next step is to unpack and install the binary packages by +echo: calling baseline_inst.cmd and emx_inst.cmd. +echo: Unzip may display 'filename not matched' errors, which cause +echo: a 'n archives had fatal errors' message. Ignore those. +echo: Then the installer will create some configuration files under +echo: %uxrt%\etc\ and %bldrt%\%bld_home%\lib\ +echo: ----------------------------------------------------------------- +pause + +:baseline_inst +setlocal set repository=%repository%/baseline call baseline_inst call emx_inst endlocal + cp -p %ETC%\protocol %uxrt%\etc cp -p %ETC%\services %uxrt%\etc cp -p %ETC%\resolv* %uxrt%\etc at at -29,7 +49,6 at at echo set osrt=%osrt%>>ux2_env.cmd echo set uxrt=%uxrt%>>ux2_env.cmd echo set bldrt=%bldrt%>>ux2_env.cmd - echo set bld_home=%bld_home%>>ux2_env.cmd echo set repository=%repository%/source>>ux2_env.cmd echo set workdir=%bld_home%/workdir>>ux2_env.cmd at at -38,7 +57,6 at at echo set C_INCLUDE_PATH=%uxrt%/usr/include;%bld_home%/emx/include>>ux2_env.cmd echo set CPLUS_INCLUDE_PATH=%uxrt%/usr/include/cpp;%uxrt%/usr/include;%bld_home%/emx/include/cpp;%bld_home%/emx/include>>ux2_env.cmd echo set LIBRARY_PATH=%uxrt%/usr/lib;%bld_home%/emx/lib>>ux2_env.cmd - echo set beginlibpath=%uxrt%\usr\lib;%bld_home%\dll; | sed "s at / at \\ at g">>ux2_env.cmd echo set PATH=%uxrt%\usr\bin;%bld_home%\emx\bin;%uxrt%\usr\local\bin;%bld_home%\bin;%osrt%\os2; | sed "s at / at \\ at g">>ux2_env.cmd echo set DPATH=%osrt%\os2\system>>ux2_env.cmd at at -50,6 +68,7 at at echo set COMSPEC=%osrt%\os2\cmd.exe>>ux2_env.cmd echo set PAGER=less>>ux2_env.cmd echo set HOSTNAME=localhost>>ux2_env.cmd + echo rem >ux2_local.cmd echo rem Make any adjustments required for your local environment here>>ux2_local.cmd echo rem >>ux2_local.cmd at at -58,20 +77,60 at at echo http_proxy = http://192.168.0.1:3128>>%uxrt%\etc\wgetrc echo ftp_proxy = http://192.168.0.1:3128>>%uxrt%\etc\wgetrc +if not %ux2local%. == . if exist %ux2local%\postbase.cmd call %ux2local%\postbase.cmd -echo Baseline UX2BS has now been installed echo: -echo Commencing build of apps in Build.lst... +echo: The baseline UX2BS has now been installed +echo: +if %ux2pause%. == . goto startbuildlst +echo: ------------------------------------------------------------------- +echo: The build system has been created and we are ready to build +echo: things. %bld_home%/lib/ux2_env.cmd and ux2_local.cmd have been +echo: created. They set the environment in which applications will +echo: be built. If you know you need to add something to ux2_local.cmd, +echo: now is the time to do it. +echo: +echo: The next step is to build some basic build applications. That is, +echo: things like pdksh, awk, and perl. You need them in order to build +echo: anything else. They are listed in %bld_home%/lib%/build.lst. +echo: +echo: You normally will not need to do anything here. +echo: If unsure, just continue. +echo: ------------------------------------------------------------------- +echo: +pause +:startbuildlst +setlocal +echo: +echo Commencing build of apps in Build.lst... sed "s/^/call build /" build.lst | cmd /q echo end - +endlocal echo Build.lst now complete. echo: -echo Updating baseline apps +if %ux2pause%. == . goto updatebase +echo: ----------------------------------------------------------------- +echo: The apps that were just built are vital. If any of them did not +echo: build correctly, there is probably little point in continuing. You +echo: might want to read the log files in %bldrt%\%bld_home%\logs +echo: +echo: The next step is to update/rebuild the baseline apps. Some of them +echo: were downloaded and installed as binaries in the beginning and used +echo: to build the build.lst apps. Now we have the tools to build them +echo: from source packages. +echo: +echo: You can see exactly what will be done by looking at +echo: %bld_home%/update_base.cmd. +echo: ----------------------------------------------------------------- +pause +:updatebase +setlocal +echo Updating baseline apps call update_base +endlocal echo Pheww!! _______________________________________________ UX2BS mailing list UX2BS at os2ports.com http://os2ports.com/mailman/listinfo/ux2bs **= Email 2 ==========================** Date: Tue, 30 Nov 2004 15:02:56 -0600 From: Anton Monroe Subject: Problems with pdksh My machine doesn't like the recent changes in pdksh. It compiles sh.exe, but then mkinstalldirs fails. I can post the entire pdksh.log if it will help, but here's the part at the end: gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 version.c In file included from o:\unixos2\posix2\include\machine/types.h:1, from o:\unixos2\posix2\include\sys/types.h:15, from sh.h:19, from version.c:5: o:\unixos2\posix2\include\i386/types.h:92: warning: empty declaration gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 vi.c gcc -O -s -o sh.exe os2.o alloc.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o emacs.o eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o main.o misc.o missing.o path.o shf.o sigact.o syn.o table.o trap.o tree.o tty.o var.o version.o vi.o -los2 ../mkman sh ./ksh.Man > tmpksh.1 mv tmpksh.1 sh.1 makefile:158: warning: overriding commands for target `TAGS' makefile:155: warning: ignoring old commands for target `TAGS' ../mkinstalldirs o:/usr/bin o:/usr/share/man/man1 mkdir o: mkdir: cannot make directory `o:': No such file or directory mkdir o: mkdir: cannot make directory `o:': No such file or directory mkdir o:/usr/share mkdir o:/usr/share/man mkdir o:/usr/share/man/man1 make: *** [installdirs] Error 1 ln: o:/usr/bin/sh.exe: No such file or directory What? Nothing in mkinstalldirs is new; why is it suddenly doing this? The explanation is probably obvious to someone, but it took me hours to figure it out-- The shell is sh.exe, and mkinstalldirs is trying to use the new sh.exe that was just created in the current directory. The problem comes where mkinstalldirs has this, when "$pathcomp" = "o:" if test ! -d "$pathcomp" -a ! -d "$pathcomp/"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? It looks like the new sh.exe's 'test' function is broken. Is anyone else seeing this? Anton _______________________________________________ UX2BS mailing list UX2BS at os2ports.com http://os2ports.com/mailman/listinfo/ux2bs