RC=/usr/etc/rc.package
CDDIR=PACKAGES
+MP=/mnt
+CDPACK=${MP}/install/packages
if [ -f "$RC" ]
then . "$RC"
cd /
if [ -n "$cddrive" ]
-then for package in `isodir "$cddrive" $CDDIR | grep -i '\.tbz'`
- do echo -n "Install $package (y/N) ? "
- read y
- if [ "$y" = y -o "$y" = Y ]
- then echo "Extracting $CDDIR/$package .."
- isoread "$cddrive" $CDDIR/$package | packit -
- fi
- done
+then pack=${cddrive}p2
+ umount $pack >/dev/null 2>&1 || true
+ if mount $pack $MP
+ then
+ cd $CDPACK
+ for package in `ls *.tar.bz`
+ do echo $package
+ grep $package List
+ echo -n "Install $package (y/N) ? "
+ read y
+ if [ "$y" = y -o "$y" = Y ]
+ then echo "Extracting $CDPACK/$package .."
+ cat $package | packit -
+ fi
+ done
+ else echo "CD mount failed - skipping CD packages."
+ fi
+else echo "Don't know where the install CD is.
fi
(cd /usr || exit 1
if [ "$nobigsource" = 1 ]
- then list="`ls | fgrep -v src.`"
- else list="`ls`"
+ then list="`ls | fgrep -v src. | fgrep -v install`"
+ else list="`ls | fgrep -v install`"
fi
for d in $list
do
}
bp->b_dirt = CLEAN;
+
+ return OK;
}
/*===========================================================================*
flags |= O_NOCTTY;
} else {
for (rfp = &fproc[0]; rfp < &fproc[NR_PROCS]; rfp++) {
+ if(rfp->fp_pid == PID_FREE) continue;
if (rfp->fp_tty == dev) flags |= O_NOCTTY;
}
}
* pairs. These lead to calls on the following routines via the dmap table.
*/
- int r, proc_e, dummy_proc;
- message local_m;
+ int r, proc_e;
proc_e = mess_ptr->IO_ENDPT;
* selection. The boot driver and the controller it handles are set at
* the boot monitor.
*/
- char driver[16];
- char *controller = "c##";
- int nr, major = -1;
- int i,s;
+ int i;
struct dmap *dp;
/* Build table with device <-> driver mappings. */
for(fd = 0; fd < OPEN_MAX; fd++) {
if(fproc[f].fp_filp[fd] && fproc[f].fp_filp[fd] == fp) {
fproc[f].fp_filp[fd] = NIL_FILP;
+ n++;
}
}
}
* writing is done.
*/
zone_t zone_size;
- off_t p;
int scale, file_type, waspipe;
dev_t dev;
if (rip->i_num == ROOT_INODE) return(EBUSY); /* can't remove 'root' */
for (rfp = &fproc[INIT_PROC_NR + 1]; rfp < &fproc[NR_PROCS]; rfp++)
- if (rfp->fp_workdir == rip || rfp->fp_rootdir == rip) return(EBUSY);
- /* can't remove anybody's working dir */
+ if (rfp->fp_pid != PID_FREE &&
+ (rfp->fp_workdir == rip || rfp->fp_rootdir == rip))
+ return(EBUSY); /* can't remove anybody's working dir */
/* Actually try to unlink the file; fails if parent is mode 0 etc. */
if ((r = unlink_file(rldirp, rip, dir_name)) != OK) return r;
struct fproc *fptr;
for (fptr = &fproc[INIT_PROC_NR + 1]; fptr < &fproc[NR_PROCS]; fptr++){
+ if(fptr->fp_pid == PID_FREE) continue;
task = -fptr->fp_task;
if (fptr->fp_suspended == SUSPENDED && task == XLOCK) {
revive(fptr->fp_endpoint, 0);
#include "super.h"
FORWARD _PROTOTYPE( void fs_init, (void) );
-FORWARD _PROTOTYPE( int igetenv, (char *var, int optional) );
FORWARD _PROTOTYPE( void get_work, (void) );
FORWARD _PROTOTYPE( void init_root, (void) );
* three major activities: getting new work, processing the work, and sending
* the reply. This loop never terminates as long as the file system runs.
*/
- sigset_t sigset;
int error;
fs_init();
* nonzero, a suspended process must be awakened.
*/
register struct fproc *rp;
- int l = 0;
if (reviving != 0) {
/* Revive a suspended process. */
for (rp = &fproc[0]; rp < &fproc[NR_PROCS]; rp++)
- if (rp->fp_revived == REVIVING) {
+ if (rp->fp_pid != PID_FREE && rp->fp_revived == REVIVING) {
who_p = (int)(rp - fproc);
who_e = rp->fp_endpoint;
call_nr = rp->fp_fd & BYTE;
* Then, stop and synchronize with the PM.
*/
do {
- int slot;
if (OK != (s=receive(PM_PROC_NR, &mess)))
panic(__FILE__,"FS couldn't receive from PM", s);
if (NONE == mess.PR_ENDPT) break;
}
}
-/*===========================================================================*
- * igetenv *
- *===========================================================================*/
-PRIVATE int igetenv(key, optional)
-char *key;
-int optional;
-{
-/* Ask kernel for an integer valued boot environment variable. */
- char value[64];
- int i;
-
- if ((i = env_get_param(key, value, sizeof(value))) != OK) {
- if (!optional)
- printf("FS: Warning, couldn't get monitor param: %d\n", i);
- return 0;
- }
- return(atoi(value));
-}
-
/*===========================================================================*
* init_root *
*===========================================================================*/
{
int bad;
register struct super_block *sp;
- register struct inode *rip;
+ register struct inode *rip = NIL_INODE;
int s;
/* Open the root device. */
#include "param.h"
#include "super.h"
+FORWARD _PROTOTYPE( int free_proc, (struct fproc *freed, int flags));
+
+#define FP_EXITING 1
+
/*===========================================================================*
* do_getsysinfo *
*===========================================================================*/
/* Only PM may make this call directly. */
if (who_e != PM_PROC_NR) return(EGENERIC);
- /* Sync any unwritten buffers, before exiting processes (drivers). */
- do_sync();
-
- /* Do exit processing for all leftover processes and servers. */
- for (i = 0; i < NR_PROCS; i++) {
+ /* Do exit processing for all leftover processes and servers,
+ * but don't actually exit them (if they were really gone, PM
+ * will tell us about it).
+ */
+ for (i = 0; i < NR_PROCS; i++)
if((m_in.endpt1 = fproc[i].fp_endpoint) != NONE)
- do_exit();
- }
+ free_proc(&fproc[i], 0);
/* The root file system is mounted onto itself, which keeps it from being
* unmounted. Pull an inode out of thin air and put the root on it.
}
}
+ /* Sync any unwritten buffers. */
+ do_sync();
+
return(OK);
}
}
/*===========================================================================*
- * do_exit *
+ * free_proc *
*===========================================================================*/
-PUBLIC int do_exit()
+PRIVATE int free_proc(struct fproc *exiter, int flags)
{
-/* Perform the file system portion of the exit(status) system call. */
-
- int i, exitee_p, exitee_e, task;
+ int i, task;
register struct fproc *rfp;
register struct filp *rfilp;
register struct inode *rip;
dev_t dev;
- /* Only PM may do the EXIT call directly. */
- if (who_e != PM_PROC_NR) return(EGENERIC);
-
- /* Nevertheless, pretend that the call came from the user. */
- exitee_e = m_in.endpt1;
- okendpt(exitee_e, &exitee_p);
- fp = &fproc[exitee_p]; /* get_filp() needs 'fp' */
+ fp = exiter; /* get_filp() needs 'fp' */
if (fp->fp_suspended == SUSPENDED) {
task = -fp->fp_task;
if (task == XPIPE || task == XPOPEN) susp_count--;
- m_in.ENDPT = exitee_e;
+ m_in.ENDPT = fp->fp_endpoint;
(void) do_unpause(); /* this always succeeds for MM */
fp->fp_suspended = NOT_SUSPENDED;
}
* (unmapping has to be done after the first step, because the
* dmap table is used in the first step.)
*/
- unsuspend_by_endpt(exitee_e);
- dmap_unmap_by_endpt(exitee_e);
+ unsuspend_by_endpt(fp->fp_endpoint);
+ /* The rest of these actions is only done when processes actually
+ * exit.
+ */
+ if(!(flags & FP_EXITING))
+ return OK;
+
+ dmap_unmap_by_endpt(fp->fp_endpoint);
/* Invalidate endpoint number for error and sanity checks. */
fp->fp_endpoint = NONE;
dev = fp->fp_tty;
for (rfp = &fproc[0]; rfp < &fproc[NR_PROCS]; rfp++) {
+ if(rfp->fp_pid == PID_FREE) continue;
if (rfp->fp_tty == dev) rfp->fp_tty = 0;
for (i = 0; i < OPEN_MAX; i++) {
/* Exit done. Mark slot as free. */
fp->fp_pid = PID_FREE;
return(OK);
+
+}
+
+/*===========================================================================*
+ * do_exit *
+ *===========================================================================*/
+PUBLIC int do_exit()
+{
+ int exitee_p, exitee_e;
+/* Perform the file system portion of the exit(status) system call. */
+
+ /* Only PM may do the EXIT call directly. */
+ if (who_e != PM_PROC_NR) return(EGENERIC);
+
+ /* Nevertheless, pretend that the call came from the user. */
+ exitee_e = m_in.endpt1;
+ okendpt(exitee_e, &exitee_p);
+ return free_proc(&fproc[exitee_p], FP_EXITING);
}
/*===========================================================================*
* disappeared with return code EAGAIN.
*/
for (rp = &fproc[0]; rp < &fproc[NR_PROCS]; rp++, client++)
- if(rp->fp_suspended == SUSPENDED && rp->fp_task == -proc_e) {
+ if(rp->fp_pid != PID_FREE &&
+ rp->fp_suspended == SUSPENDED && rp->fp_task == -proc_e) {
revive(rp->fp_endpoint, EAGAIN);
}
/* Search the proc table. */
for (rp = &fproc[0]; rp < &fproc[NR_PROCS]; rp++) {
- if (rp->fp_suspended == SUSPENDED &&
+ if (rp->fp_pid != PID_FREE && rp->fp_suspended == SUSPENDED &&
rp->fp_revived == NOT_REVIVING &&
(rp->fp_fd & BYTE) == call_nr &&
rp->fp_filp[rp->fp_fd>>8]->filp_ino == ip) {
#!/bin/sh
+set -e
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
cd /usr/src || exit 1
make etcfiles
COPYITEMS="usr/bin bin usr/lib"
RELEASEDIR=/usr/r
+RELEASEPACKAGE=${RELEASEDIR}/usr/install/packages
IMAGE=cdfdimage
ROOTIMAGE=rootimage
CDFILES=/usr/tmp/cdreleasefiles
IMGBZ=${IMG}.bz2
echo "Making $IMGBZ"
-USRMB=80
+USRMB=128
USRBLOCKS="`expr $USRMB \* 1024 \* 1024 / $BS`"
USRSECTS="`expr $USRMB \* 1024 \* 2`"
mount $TMPDISK $RELEASEDIR/usr || exit
mkdir -p $RELEASEDIR/tmp
mkdir -p $RELEASEDIR/usr/tmp
+mkdir -p $RELEASEPACKAGE
echo " * Transfering $COPYITEMS to $RELEASEDIR"
( cd / && tar cf - $COPYITEMS ) | ( cd $RELEASEDIR && tar xf - ) || exit 1
+if [ -d $PACKAGEDIR ]
+then echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
+ cp $PACKAGEDIR/* $RELEASEPACKAGE/
+ ( cd $PACKAGEDIR
+ for p in *.tar.bz
+ do descr="../`echo $p | sed 's/.tar.bz//'`/.descr"
+ if [ -f "$descr" ]
+ then printf "%-27s %s\n" "$p" "`cat $descr`"
+ fi
+ done >List
+ )
+fi
+
# Make sure compilers and libraries are bin-owned
chown -R bin $RELEASEDIR/usr/lib
chmod -R u+w $RELEASEDIR/usr/lib
cp $IMAGE $CDFILES/bootflop.img
cp release/cd/* $CDFILES
-DESTPACKAGES=$CDFILES/PACKAGES
-mkdir -p $DESTPACKAGES
-
-( cd $PACKAGEDIR
- for f in *tar*
- do
- shortname="`echo $f | sed 's/\.tar\..*//' | tr -dc '[a-z][A-z][0-9]' | sed 's/^\(........\).*/\1/' | tr '[a-z]' '[A-Z]'`.TBZ"
- cp $f $DESTPACKAGES/$shortname
- echo $shortname $f >>$DESTPACKAGES/List
- echo " * Copied $f to $shortname"
- done
-)
-
h_opt=
bootimage=$IMAGE
if [ "$HDEMU" -ne 0 ]; then