summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--isys/isys.c23
-rw-r--r--loader/Makefile2
-rw-r--r--loader/lang.c7
-rw-r--r--loader/loader.c4
-rw-r--r--mouse.py6
-rw-r--r--po/Makefile4
-rw-r--r--todo.py39
-rw-r--r--xf86config.py61
-rw-r--r--xkb.c15
-rw-r--r--xserver.py21
10 files changed, 138 insertions, 44 deletions
diff --git a/isys/isys.c b/isys/isys.c
index b80945da0..05a34a14b 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -11,6 +11,7 @@
#include "isys.h"
#include "probe.h"
#include "smp.h"
+#include "../balkan/byteswap.h"
/* FIXME: this is such a hack -- moduleInfoList ought to be a proper object */
moduleInfoSet modInfoList;
@@ -32,6 +33,7 @@ static PyObject * doConfigNetDevice(PyObject * s, PyObject * args);
static PyObject * createProbedList(PyObject * s, PyObject * args);
static PyObject * doChroot(PyObject * s, PyObject * args);
static PyObject * doCheckBoot(PyObject * s, PyObject * args);
+static PyObject * doCheckUFS(PyObject * s, PyObject * args);
static PyObject * doSwapon(PyObject * s, PyObject * args);
static PyObject * doPoptParse(PyObject * s, PyObject * args);
@@ -58,6 +60,7 @@ static PyMethodDef isysModuleMethods[] = {
#endif
{ "chroot", (PyCFunction) doChroot, METH_VARARGS, NULL },
{ "checkBoot", (PyCFunction) doCheckBoot, METH_VARARGS, NULL },
+ { "checkUFS", (PyCFunction) doCheckUFS, METH_VARARGS, NULL },
{ "swapon", (PyCFunction) doSwapon, METH_VARARGS, NULL },
{ NULL }
} ;
@@ -557,6 +560,26 @@ static PyObject * doCheckBoot (PyObject * s, PyObject * args) {
return Py_BuildValue("i", magic == BOOT_SIGNATURE);
}
+#define UFS_SUPER_MAGIC 0x00011954
+
+static PyObject * doCheckUFS (PyObject * s, PyObject * args) {
+ char * path;
+ int fd, magic;
+
+ if (!PyArg_ParseTuple(args, "s", &path)) return NULL;
+
+ if ((fd = open (path, O_RDONLY)) < 0) {
+ PyErr_SetFromErrno(PyExc_SystemError);
+ return NULL;
+ }
+
+ return Py_BuildValue("i", (llseek(fd, (8192 + 0x55c), SEEK_SET) >= 0 &&
+ read(fd, &magic, 4) == 4 &&
+ (magic == UFS_SUPER_MAGIC ||
+ swab32(magic) == UFS_SUPER_MAGIC)));
+}
+
+
static PyObject * doSwapon (PyObject * s, PyObject * args) {
char * path;
diff --git a/loader/Makefile b/loader/Makefile
index fad6e76a1..3163742a1 100644
--- a/loader/Makefile
+++ b/loader/Makefile
@@ -11,7 +11,9 @@ SOURCES = $(subst .o,.c,$(OBJS) $(LOADEROBJS))
BINS = init
DIRS =
NETOBJS = net.o
+ifeq (i386, $(ARCH))
KON = 1
+endif
PCMCIAOBJS = pcmcia.o $(NETOBJS)
OPTS = -O2 -g
diff --git a/loader/lang.c b/loader/lang.c
index ba745db1a..26e4e8617 100644
--- a/loader/lang.c
+++ b/loader/lang.c
@@ -371,6 +371,7 @@ int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) {
/*if (testing) return 0;*/
#ifdef __sparc__
+#if 0
if (kickstart) {
kbdtype = KBDTYPE_SUN;
if (!ksGetCommand(KS_CMD_KBDTYPE, NULL, &argc, &argv)) {
@@ -384,7 +385,9 @@ int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) {
kbdtype = KBDTYPE_PC;
}
}
- } else {
+ } else
+#endif
+ {
char twelve = 12;
int fd;
@@ -516,8 +519,6 @@ int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) {
j++;
}
#endif
-
- logMessage("using keymap %s", infoTable[num].name);
for (i = 0; i < num; i++) {
if (gzread(f, buf, infoTable[i].size) != infoTable[i].size) {
diff --git a/loader/loader.c b/loader/loader.c
index 0e8979836..01db8938f 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -599,8 +599,6 @@ static char * mountHardDrive(struct installMethod * method,
label = newtLabel(-1, -1, _("Directory holding Red Hat:"));
- tmpDir = dir ? strdup(dir) : NULL;
-
dirEntry = newtEntry(28, 11, dir, 28, &tmpDir, NEWT_ENTRY_SCROLL);
entryGrid = newtGridHStacked(NEWT_GRID_COMPONENT, label,
@@ -633,8 +631,8 @@ static char * mountHardDrive(struct installMethod * method,
if (dir) free(dir);
if (tmpDir && *tmpDir) {
+ /* Protect from form free. */
dir = strdup(tmpDir);
- free(tmpDir);
} else {
dir = NULL;
}
diff --git a/mouse.py b/mouse.py
index 773e3ced1..23f61646c 100644
--- a/mouse.py
+++ b/mouse.py
@@ -61,6 +61,8 @@ class Mouse (SimpleConfigFile):
("MMSeries", "MMSeries", "ttyS", 1),
"MM - HitTablet (serial)" :
("MMHitTab", "MMHittab", "ttyS", 1),
+ "Sun Mouse":
+ ("sun", "sun", "sunmouse", 0),
}
# XXX fixme - externalize
@@ -92,7 +94,9 @@ class Mouse (SimpleConfigFile):
if (list):
(device, module, desc) = list[0]
- if device == "psaux":
+ if device == "sunmouse":
+ self.set("Sun Mouse", 0)
+ elif device == "psaux":
self.set("Generic - 3 Button Mouse (PS/2)", 0)
else:
self.set("Generic - 2 Button Mouse (serial)", 1)
diff --git a/po/Makefile b/po/Makefile
index 66fb16c6d..666b92fd9 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -11,8 +11,8 @@ NLSPACKAGE = anaconda
CATALOGS = $(shell ls *.po)
FMTCATALOGS = $(patsubst %.po,%.mo,$(CATALOGS))
-POTFILES = ../text.py ../gui.py ../iw/*.py ../libfdisk/*.c \
- ../loader/*.c
+POTFILES = ../text.py ../gui.py ../iw/*.py ../textw/*.py \
+ ../libfdisk/*.c ../loader/*.c
all: $(NLSPACKAGE).pot $(FMTCATALOGS)
diff --git a/todo.py b/todo.py
index 2ca118eb9..765980873 100644
--- a/todo.py
+++ b/todo.py
@@ -15,6 +15,21 @@ from xf86config import XF86Config
def _(x):
return x
+class FakeDDruid:
+ """A disk druid looking thing for upgrades"""
+ def partitionList (self):
+ return (None, self.partitions)
+
+ def append (self, name, table):
+ for i in range (len (table)):
+ (type, sector, size) = table[i]
+ if size:
+ self.partitions.append ((name + str (i)),
+ "Existing000" + len (self.partitions),
+ type)
+ def __init__ (self):
+ self.partitions = []
+
class LogFile:
def __init__ (self):
self.logFile = open("/dev/tty3", "w")
@@ -392,7 +407,10 @@ class ToDo:
self.liloImages = images
def getLiloImages(self):
- (drives, raid) = self.ddruid.partitionList()
+ if not self.ddruid:
+ raise RuntimeError, "No disk druid object"
+
+ (drives, raid) = self.ddruid.partitionList()
# rearrange the fstab so it's indexed by device
mountsByDev = {}
@@ -523,8 +541,18 @@ class ToDo:
def addMount(self, device, location, fsystem, reformat = 1):
if fsystem == "swap":
- location = "swap"
- reformat = 1
+ ufs = 0
+ try:
+ isys.makeDevInode(device, '/tmp/' + device)
+ except:
+ pass
+ try:
+ ufs = isys.checkUFS ('/tmp/' + device)
+ except:
+ pass
+ if not ufs:
+ location = "swap"
+ reformat = 1
self.mounts[location] = (device, fsystem, reformat)
def writeFstab(self):
@@ -904,6 +932,7 @@ class ToDo:
_("Searching for Red Hat Linux installations..."))
drives = self.drives.available ().keys ()
+ self.todo.ddruid = FakeDDruid ()
for drive in drives:
isys.makeDevInode(drive, '/tmp/' + drive)
@@ -912,6 +941,7 @@ class ToDo:
except SystemError:
pass
else:
+ self.todo.ddruid.append (drive, table)
for i in range (len (table)):
(type, sector, size) = table[i]
# 2 is ext2 in balkan speek
@@ -1104,6 +1134,9 @@ class ToDo:
else:
self.ddruid.save ()
self.makeFilesystems ()
+ else:
+ (drives, raid) = self.ddruid.partitionList()
+
self.mountFilesystems ()
if self.upgrade:
diff --git a/xf86config.py b/xf86config.py
index 09da12809..d9402c055 100644
--- a/xf86config.py
+++ b/xf86config.py
@@ -27,6 +27,7 @@ class XF86Config:
self.probed = 0
self.skip = 0
self.modes = { "8" : ["640x480"] }
+ self.device = None
def setMouse(self, mouse):
if mouse:
@@ -123,6 +124,8 @@ class XF86Config:
if self.vidCards:
self.devID = self.vidCards[0]["NAME"]
self.server = self.vidCards[0]["SERVER"]
+ # there are no Cards entries with a DEVICE directive
+ # self.device = self.vidCards[0]["DEVICE"]
def probe (self, probeMonitor = 1):
if self.probed:
@@ -141,40 +144,46 @@ class XF86Config:
self.vidCards.append (self.cards (server[5:]))
if len (server) > 7 and server[0:7] == "Server:":
info = { "NAME" : string.split (descr, '|')[1],
- "SERVER" : server[7:] }
+ "SERVER" : server[7:],
+ "DEVICE" : device }
self.vidCards.append (info)
if self.vidCards:
self.devID = self.vidCards[0]["NAME"]
self.server = self.vidCards[0]["SERVER"]
+ # no Cards entries with DEVICE
+ # self.device = self.vidCards[0]["DEVICE"]
# VESA probe for monitor/videoram, etc.
if probeMonitor:
- probe = string.split (iutil.execWithCapture ("/usr/sbin/ddcprobe", ['ddcprobe']), '\n')
-
- for line in probe:
- if line and line[:9] == "OEM Name:":
- self.cardMan = string.strip (line[10:])
-
- if line and line[:16] == "Memory installed":
- memory = string.split (line, '=')
- self.vidRam = string.strip (memory[2][:-2])
-
- if line and line[:8] == "EISA ID:":
- self.monEisa = line[9:]
- self.monID = line[9:]
-
- if line and line[:6] == "\tName:":
- if not self.monName or len (self.monName) < len (line[7:]):
- self.monName = line[7:]
-
- if line and line[:15] == "\tTiming ranges:":
- ranges = string.split (line, ',')
- self.monHoriz = string.strip (string.split (ranges[0], '=')[1])
- self.monVert = string.strip (string.split (ranges[1], '=')[1])
-
- if self.vidCards and self.cardMan:
- self.vidCards[0]["VENDOR"] = self.cardMan
+ try:
+ probe = string.split (iutil.execWithCapture ("/usr/sbin/ddcprobe", ['ddcprobe']), '\n')
+
+ for line in probe:
+ if line and line[:9] == "OEM Name:":
+ self.cardMan = string.strip (line[10:])
+
+ if line and line[:16] == "Memory installed":
+ memory = string.split (line, '=')
+ self.vidRam = string.strip (memory[2][:-2])
+
+ if line and line[:8] == "EISA ID:":
+ self.monEisa = line[9:]
+ self.monID = line[9:]
+
+ if line and line[:6] == "\tName:":
+ if not self.monName or len (self.monName) < len (line[7:]):
+ self.monName = line[7:]
+
+ if line and line[:15] == "\tTiming ranges:":
+ ranges = string.split (line, ',')
+ self.monHoriz = string.strip (string.split (ranges[0], '=')[1])
+ self.monVert = string.strip (string.split (ranges[1], '=')[1])
+
+ if self.vidCards and self.cardMan:
+ self.vidCards[0]["VENDOR"] = self.cardMan
+ except:
+ pass
def probeReport (self):
probe = ""
diff --git a/xkb.c b/xkb.c
index 789105588..9c2b1a2c9 100644
--- a/xkb.c
+++ b/xkb.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <fcntl.h>
#include <Python.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
@@ -9,7 +10,8 @@
#define min(a,b) ((a) < (b) ? (a) : (b))
#define MAX_COMPONENTS 400
-#define XKB_RULES "/usr/X11R6/lib/X11/xkb/rules/xfree86"
+#define XKB_XFREE86_RULES "/usr/X11R6/lib/X11/xkb/rules/xfree86"
+#define XKB_SUN_RULES "/usr/X11R6/lib/X11/xkb/rules/sun"
PyObject *list_rules ();
@@ -36,9 +38,18 @@ list_rules ()
Bool result;
int num_comp;
int i;
+ char *rulesbase = XKB_XFREE86_RULES;
+#ifdef __sparc__
+ int fd;
+
+ fd = open("/dev/kbd", O_RDONLY);
+ if (fd >= 0) {
+ rulesbase = XKB_SUN_RULES;
+ }
+#endif
list = XkbRF_Create (0,0);
- result = XkbRF_LoadDescriptionsByName (XKB_RULES, NULL, list);
+ result = XkbRF_LoadDescriptionsByName (rulesbase, NULL, list);
models = PyDict_New ();
num_comp = min (list->models.num_desc, MAX_COMPONENTS);
diff --git a/xserver.py b/xserver.py
index 23dc5251a..b4e2789a9 100644
--- a/xserver.py
+++ b/xserver.py
@@ -33,20 +33,25 @@ def startX():
f.close
except:
pass
+ elif mouseDev == 'sunmouse':
+ mousePrototol = "Sun"
+ mouseEmulate = 0
else:
mouseProtocol = "Microsoft"
mouseEmulate = 1
x = XF86Config ((mouseProtocol, mouseEmulate, mouseDev))
x.probe ()
- if x.server:
+ if x.server[0:3] == 'Sun':
+ serverPath = '/usr/X11R6/bin/Xs' + x.server[1:]
+ elif x.server:
serverPath = '/usr/X11R6/bin/XF86_' + x.server
else:
print "Unknown card, falling back to VGA16"
serverPath = '/usr/X11R6/bin/XF86_VGA16'
if not os.access (serverPath, os.X_OK):
- print serverpath, "missing. Falling back to VGA16"
+ print serverPath, "missing. Falling back to VGA16"
serverPath = '/usr/X11R6/bin/XF86_VGA16'
settings = { "mouseDev" : '/dev/' + mouseDev ,
@@ -101,8 +106,16 @@ EndSection
server = os.fork()
if (not server):
print "starting", serverPath
- os.execv(serverPath, [serverPath, ':1', '-xf86config',
- '/tmp/XF86Config', 'vt7'])
+ if serverPath[0:19] == '/usr/X11R6/bin/Xsun':
+ try:
+ os.unlink("/dev/mouse")
+ except:
+ pass
+ os.symlink(mouseDev, "/dev/mouse")
+ os.execv(serverPath, [serverPath, 'vt7', '-dev', '/dev/' + x.device])
+ else:
+ os.execv(serverPath, [serverPath, ':1', '-xf86config',
+ '/tmp/XF86Config', 'vt7'])
# give time for the server to fail (if it is going to fail...)
time.sleep (1)