. setup fixes
. added atnormalize commands, which resets at driver timeouts and retries to defaults . usyslogd now logs to /usr/log/messages instead of /var (on root, which is shrinking)
This commit is contained in:
		
							parent
							
								
									f902df5c5a
								
							
						
					
					
						commit
						ad9e5d2cc0
					
				@ -7,6 +7,7 @@ CCLD	= $(CC) -i $(CFLAGS)
 | 
			
		||||
MAKE	= exec make -$(MAKEFLAGS)
 | 
			
		||||
 | 
			
		||||
ALL	= \
 | 
			
		||||
	atnormalize \
 | 
			
		||||
	dosread \
 | 
			
		||||
	fdisk \
 | 
			
		||||
	format \
 | 
			
		||||
@ -30,6 +31,10 @@ dosread:	dosread.c
 | 
			
		||||
	$(CCLD) -o $@ $?
 | 
			
		||||
	install -S 16kw $@
 | 
			
		||||
 | 
			
		||||
atnormalize:	atnormalize.c
 | 
			
		||||
	$(CCLD) -o $@ $?
 | 
			
		||||
	install -S 16kw $@
 | 
			
		||||
 | 
			
		||||
fdisk:	fdisk.c
 | 
			
		||||
	$(CCLD) -o $@ $?
 | 
			
		||||
	install -S 4kw $@
 | 
			
		||||
@ -91,6 +96,7 @@ sdump:	sdump.c
 | 
			
		||||
	install -S 4kw $@
 | 
			
		||||
 | 
			
		||||
install:	\
 | 
			
		||||
	/usr/bin/atnormalize \
 | 
			
		||||
	/usr/bin/dosread \
 | 
			
		||||
		/usr/bin/dosdir \
 | 
			
		||||
		/usr/bin/doswrite \
 | 
			
		||||
@ -112,6 +118,9 @@ install:	\
 | 
			
		||||
	/bin/loadkeys \
 | 
			
		||||
	/bin/readclock \
 | 
			
		||||
 | 
			
		||||
/usr/bin/atnormalize:	atnormalize
 | 
			
		||||
	install -cs -o bin $? $@
 | 
			
		||||
 | 
			
		||||
/usr/bin/dosread:	dosread
 | 
			
		||||
	install -cs -o bin $? $@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										43
									
								
								commands/ibm/atnormalize.c
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										43
									
								
								commands/ibm/atnormalize.c
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,43 @@
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <termcap.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <signal.h>
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#include <dirent.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include <a.out.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
#include <sys/wait.h>
 | 
			
		||||
#include <sys/ioctl.h>
 | 
			
		||||
#include <minix/config.h>
 | 
			
		||||
#include <minix/const.h>
 | 
			
		||||
#include <minix/partition.h>
 | 
			
		||||
#include <minix/u64.h>
 | 
			
		||||
#include <ibm/partition.h>
 | 
			
		||||
#include <termios.h>
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
 | 
			
		||||
int main(void)
 | 
			
		||||
{
 | 
			
		||||
	int v, d;
 | 
			
		||||
	char name[20];
 | 
			
		||||
 | 
			
		||||
	for(d = 0; d < 4; d++) {
 | 
			
		||||
		int device;
 | 
			
		||||
		sprintf(name, "/dev/c0d%d", d);
 | 
			
		||||
		if((device=open(name, O_RDONLY)) >= 0) {
 | 
			
		||||
			v = 0;
 | 
			
		||||
			ioctl(device, DIOCTIMEOUT, &v);
 | 
			
		||||
			close(device);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
@ -2372,6 +2372,8 @@ select_region(void)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		printstep(5, "Select a region");
 | 
			
		||||
 | 
			
		||||
		printf("\nI've found the following region%s on this disk (%s).\n\n",
 | 
			
		||||
			SORNOT(nr_regions), prettysizeprint(table[0].size/2));
 | 
			
		||||
		printregions(regions, 0, nr_partitions, free_regions, nr_regions, 1);
 | 
			
		||||
@ -2408,9 +2410,11 @@ select_region(void)
 | 
			
		||||
				printf("That region number isn't available.\n");
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			printstep(6, "Confirm your partition choice");
 | 
			
		||||
 | 
			
		||||
			sure = is_sure(0, "\nPlease confirm you want to use disk region number %d?", rn);
 | 
			
		||||
		} else {
 | 
			
		||||
			printstep(6, "Confirm your partition choice");
 | 
			
		||||
			rn = 0;
 | 
			
		||||
			sure = is_sure(0, "\nUse this region?");
 | 
			
		||||
		}
 | 
			
		||||
@ -2419,6 +2423,14 @@ select_region(void)
 | 
			
		||||
	return(®ions[rn]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void printstep(int step, char *str)
 | 
			
		||||
{
 | 
			
		||||
	int n;
 | 
			
		||||
	n = printf("\n --- Step %d: %s ", step, str);
 | 
			
		||||
	while(n++ < 70) printf("-");
 | 
			
		||||
	printf("\n\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
device_t *
 | 
			
		||||
select_disk(void)
 | 
			
		||||
{
 | 
			
		||||
@ -2426,7 +2438,7 @@ select_disk(void)
 | 
			
		||||
	int i, choice, drives;
 | 
			
		||||
	static char line[500];
 | 
			
		||||
 | 
			
		||||
	printf("\nProbing for disks. This may take a short while. ");
 | 
			
		||||
	printf("\nProbing for disks. This may take a short while.");
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		i = 0;
 | 
			
		||||
@ -2460,6 +2472,13 @@ select_disk(void)
 | 
			
		||||
 | 
			
		||||
		printf("\nProbing done; %d drive%s found.\n", drives, SORNOT(drives));
 | 
			
		||||
 | 
			
		||||
		if(drives == 1) {
 | 
			
		||||
			sure = 1;
 | 
			
		||||
			choice = 0;
 | 
			
		||||
		} else {
 | 
			
		||||
 | 
			
		||||
			printstep(3, "Choose a disk to install MINIX 3 on");
 | 
			
		||||
 | 
			
		||||
			printf("\nI've found the following drive%s on your system.\n", SORNOT(drives));
 | 
			
		||||
 | 
			
		||||
			for(i = 0; i < drives; i++) {
 | 
			
		||||
@ -2474,7 +2493,6 @@ select_disk(void)
 | 
			
		||||
					devices[i].nr_regions, 0);
 | 
			
		||||
			}
 | 
			
		||||
	
 | 
			
		||||
		if(drives > 1) {
 | 
			
		||||
			printf("\nPlease enter disk number you want to use: ");
 | 
			
		||||
			fflush(NULL);
 | 
			
		||||
			if(!fgets(line, sizeof(line)-2, stdin))
 | 
			
		||||
@ -2484,13 +2502,9 @@ select_disk(void)
 | 
			
		||||
				printf("Number out of range.\n");
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if(!(sure = is_sure(0, "\nPlease confirm you want to use disk %d (%s)?",
 | 
			
		||||
				choice, devices[choice].dev->name)))
 | 
			
		||||
				exit(1);
 | 
			
		||||
		} else {
 | 
			
		||||
			if(!(sure = is_sure(0, "\nUse this disk?")))
 | 
			
		||||
				exit(1);
 | 
			
		||||
			choice = 0;
 | 
			
		||||
			printstep(4, "Confirm your choice");
 | 
			
		||||
			sure = is_sure(0, "\nPlease confirm you want to use disk %d (%s)?",
 | 
			
		||||
				choice, devices[choice].dev->name);
 | 
			
		||||
		}
 | 
			
		||||
	} while(!sure);
 | 
			
		||||
	return devices[choice].dev;
 | 
			
		||||
@ -2553,8 +2567,6 @@ do_autopart(int resultfd)
 | 
			
		||||
	probing = 1;
 | 
			
		||||
	autopartmode = 1;
 | 
			
		||||
 | 
			
		||||
		printf("\n\n --- Step 2.1 --- Select drive and region -----------------------------\n\n");
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		curdev = select_disk();
 | 
			
		||||
	} while(!curdev);
 | 
			
		||||
@ -2570,14 +2582,10 @@ do_autopart(int resultfd)
 | 
			
		||||
	memcpy(orig_table, table, sizeof(table));
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		printf("\n\n --- Step 2.1 --- Select drive and region -----------------------------\n\n");
 | 
			
		||||
	
 | 
			
		||||
		/* Show regions. */
 | 
			
		||||
		r = select_region();
 | 
			
		||||
	} while(!r);	/* Back to step 2. */
 | 
			
		||||
 | 
			
		||||
		printf("\n\n --- Step 2.2 --- Confirm your choice ---------------------------------\n\n");
 | 
			
		||||
 | 
			
		||||
	/* Write things. */
 | 
			
		||||
	if(scribble_region(r, &pe)) {
 | 
			
		||||
		char *name;
 | 
			
		||||
@ -2592,6 +2600,8 @@ do_autopart(int resultfd)
 | 
			
		||||
		m_dump(table);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		printstep(7, "Point of no return");
 | 
			
		||||
 | 
			
		||||
		printf("\nThis is the point of no return. You have selected to install MINIX\n");
 | 
			
		||||
		printf("into region %d of disk %d.  If you agree with this selection, your\n", (int)(r-regions), (int) (curdev-firstdev));
 | 
			
		||||
		printf("disk will be written to prepare for the rest of the installation.\n\n");
 | 
			
		||||
 | 
			
		||||
@ -107,7 +107,7 @@ then
 | 
			
		||||
	# Expert mode
 | 
			
		||||
echo -n "
 | 
			
		||||
MINIX needs one primary partition of about 250 MB for a full install.
 | 
			
		||||
The maxium fill system currently supported is 4 GB.
 | 
			
		||||
The maximum fill system currently supported is 4 GB.
 | 
			
		||||
 | 
			
		||||
If there is no free space on your disk then you have to choose an option:
 | 
			
		||||
   (1) Delete one or more partitions
 | 
			
		||||
@ -149,6 +149,10 @@ else
 | 
			
		||||
			fi 
 | 
			
		||||
		else	echo "Autopart tool failed. Trying again."
 | 
			
		||||
		fi
 | 
			
		||||
 | 
			
		||||
		# reset at retries and timeouts in case autopart left
 | 
			
		||||
		# them messy
 | 
			
		||||
		atnormalize
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
fi
 | 
			
		||||
@ -184,8 +188,9 @@ echo "1. Intel Pro/100"
 | 
			
		||||
echo "2. Realtek 8139 based card"
 | 
			
		||||
echo "3. Realtek 8029 based card (emulated by Qemu)"
 | 
			
		||||
echo "4. NE2000, 3com 503 or WD based card (NE2000 is emulated by Bochs)"
 | 
			
		||||
echo "5. A 3com 501 or 509"
 | 
			
		||||
echo "6. A different Ethernet card (no networking)"
 | 
			
		||||
echo "5. NE2000, with default settings for Bochs emulation in $LOCALRC"
 | 
			
		||||
echo "6. A 3com 501 or 509"
 | 
			
		||||
echo "7. A different Ethernet card (no networking)"
 | 
			
		||||
echo ""
 | 
			
		||||
echo "With some cards, you'll have to edit $LOCALRC "
 | 
			
		||||
echo "after installing to the proper parameters."
 | 
			
		||||
@ -196,12 +201,18 @@ echo -n "Choice? "
 | 
			
		||||
read eth
 | 
			
		||||
driver=""
 | 
			
		||||
driverargs=""
 | 
			
		||||
config_warn="Note: After installing, please edit $LOCALRC to the right configuration."
 | 
			
		||||
case "$eth" in
 | 
			
		||||
	1)	driver=fxp;      ;;
 | 
			
		||||
	2)	driver=rtl8139;  ;;
 | 
			
		||||
	3)	driver=dp8390;   driverargs="dp8390_args='DPETH0=pci'";	;;
 | 
			
		||||
	4)	driver=dp8390;   driverargs="#dp8390_args='DPETH0=port:irq:memory'"; echo "Note: After installing, please edit $LOCALRC to the right configuration."; 	;;
 | 
			
		||||
	5)	driver=dpeth;    ;;
 | 
			
		||||
	3)	driver=dp8390;   driverargs="dp8390_arg='DPETH0=pci'";	;;
 | 
			
		||||
	4)	driver=dp8390;   driverargs="#dp8390_arg='DPETH0=port:irq:memory'";
 | 
			
		||||
		echo $config_warn;
 | 
			
		||||
		;;
 | 
			
		||||
	5)	driver=dp8390;   driverargs="dp8390_arg='DPETH0=240:9'"; ;;
 | 
			
		||||
	6)	driver=dpeth;    driverargs="#dpeth_arg='DPETH0=port:irq:memory'";
 | 
			
		||||
		echo $config_warn;
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# Compute the amount of memory available to MINIX.
 | 
			
		||||
@ -226,23 +237,21 @@ i86)
 | 
			
		||||
*)  test $memsize -lt 6144 && swapadv=$(expr 6144 - $memsize)
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
blockdefault=8
 | 
			
		||||
blockdefault=2
 | 
			
		||||
echo " --- Step 9: Select a disk block size -----------------------------"
 | 
			
		||||
 | 
			
		||||
echo "The default block size on the disk is $blockdefault KB.
 | 
			
		||||
If you have a small disk or small RAM you may want less
 | 
			
		||||
than $blockdefault KB. Please type 1, 2, or 4 for a smaller
 | 
			
		||||
block size (in KB), or hit ENTER for the default of 
 | 
			
		||||
$blockdefault KB blocks, which should be fine in most cases."
 | 
			
		||||
If you have a small disk or small RAM you may want 1 KB blocks.
 | 
			
		||||
Please type 1 then, or leave it at the default.
 | 
			
		||||
 | 
			
		||||
while [ -z "$blocksize" ]
 | 
			
		||||
do	echo -n "Block size [$blockdefault KB]? "
 | 
			
		||||
do	echo -n "Block size in KB [$blockdefault]? "
 | 
			
		||||
	read blocksize
 | 
			
		||||
	if [ -z "$blocksize" ]
 | 
			
		||||
	then	blocksize=$blockdefault
 | 
			
		||||
	fi
 | 
			
		||||
	if [ "$blocksize" -ne 1 -a "$blocksize" -ne 2 -a "$blocksize" -ne 4 -a "$blocksize" -ne $blockdefault ]
 | 
			
		||||
	then	echo "$blocksize bogus block size. 1, 2, 4 or $blockdefault please."
 | 
			
		||||
	if [ "$blocksize" -ne 1 -a "$blocksize" -ne $blockdefault ]
 | 
			
		||||
	then	echo "$blocksize bogus block size. 1 or $blockdefault please."
 | 
			
		||||
		blocksize=""
 | 
			
		||||
	fi
 | 
			
		||||
done
 | 
			
		||||
@ -282,7 +291,7 @@ installboot -m /dev/$primary /usr/mdec/masterboot >/dev/null || exit
 | 
			
		||||
					# Partition the primary.
 | 
			
		||||
p3=0:0
 | 
			
		||||
test "$swapsize" -gt 0 && p3=81:`expr $swapsize \* 2`
 | 
			
		||||
partition /dev/$primary 1 81:32768* $p3 81:0+ || exit
 | 
			
		||||
partition /dev/$primary 1 81:4352* $p3 81:0+ || exit
 | 
			
		||||
 | 
			
		||||
if [ "$swapsize" -gt 0 ]
 | 
			
		||||
then
 | 
			
		||||
@ -302,7 +311,6 @@ Scanning /dev/$usr for bad blocks.  (Hit DEL to stop the scan if you are
 | 
			
		||||
absolutely sure that there can not be any bad blocks.  Otherwise just wait.)"
 | 
			
		||||
trap ': nothing' 2
 | 
			
		||||
readall -b /dev/$usr | sh
 | 
			
		||||
sleep 2
 | 
			
		||||
trap 2
 | 
			
		||||
 | 
			
		||||
echo " --- Step 13: Wait for files to be copied ------------------------------"
 | 
			
		||||
@ -345,6 +353,7 @@ Copying $fdroot to /dev/$root
 | 
			
		||||
"
 | 
			
		||||
 | 
			
		||||
mkfs -B $blocksizebytes /dev/$root || exit
 | 
			
		||||
readall -b /dev/$root | sh
 | 
			
		||||
mount /dev/$root /mnt || exit
 | 
			
		||||
# Running from the installation CD.
 | 
			
		||||
cpdir -vx / /mnt || exit
 | 
			
		||||
 | 
			
		||||
@ -79,8 +79,8 @@ main(int argc, char *argv[])
 | 
			
		||||
		return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(!(logfp = fopen("/var/log/messages", "a"))) {
 | 
			
		||||
		perror("/var/log/messages");
 | 
			
		||||
	if(!(logfp = fopen("/usr/log/messages", "a"))) {
 | 
			
		||||
		perror("/usr/log/messages");
 | 
			
		||||
		return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user