summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-11-24 15:45:00 +0000
committerErik Troan <ewt@redhat.com>2001-11-24 15:45:00 +0000
commit7cb06c2887cad4b69f1378f45c59cc66aaf81555 (patch)
tree6f5a7cd6ad9b205761e536e3a651e48fb09f3057 /loader
parentf1fb2e067c836626896ae4132687d16e725237e8 (diff)
downloadanaconda-7cb06c2887cad4b69f1378f45c59cc66aaf81555.tar.gz
anaconda-7cb06c2887cad4b69f1378f45c59cc66aaf81555.tar.xz
anaconda-7cb06c2887cad4b69f1378f45c59cc66aaf81555.zip
need to uncompress ramfs.img -- this got lost in the switch from libz
Diffstat (limited to 'loader')
-rw-r--r--loader/loader.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 5d7481f6e..66c938d43 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -61,6 +61,7 @@
#include "isys/imount.h"
#include "isys/isys.h"
#include "isys/probe.h"
+#include "isys/gzlib/gzlib.h"
#include "cdrom.h"
#include "devices.h"
@@ -153,14 +154,14 @@ void doSuspend(void) {
}
static int setupRamdisk(void) {
- int f;
+ gzFile f;
static int done = 0;
if (done) return 0;
done = 1;
- f = open("/etc/ramfs.img", 0);
+ f = gunzip_open("/etc/ramfs.img");
if (f) {
char buf[10240];
int i, j = 0;
@@ -169,16 +170,17 @@ static int setupRamdisk(void) {
fd = open("/dev/ram", O_RDWR);
logMessage("copying file to fd %d", fd);
- while ((i = read(f, buf, sizeof(buf))) > 0) {
+ while ((i = gunzip_read(f, buf, sizeof(buf))) > 0) {
j += write(fd, buf, i);
}
logMessage("wrote %d bytes", j);
close(fd);
- close(f);
+ gunzip_close(f);
}
- doPwMount("/dev/ram", "/tmp/ramfs", "ext2", 0, 0, NULL, NULL);
+ if (doPwMount("/dev/ram", "/tmp/ramfs", "ext2", 0, 0, NULL, NULL))
+ logMessage("failed to mount ramfs image");
return 0;
}