summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbcollins <tailor@grayson>2006-06-01 13:19:17 -0400
committerBen Collins <bcollins@ubuntu.com>2006-06-01 13:19:17 -0400
commitd7fd2b8180aa58d0a7cfb29a946de91ca9744d20 (patch)
tree0a5f739b5a50bfd5bbcaac214143680586b206a6
parentdbccdeb8947b3d0415fcfde8046cb7a5f4d57c00 (diff)
downloadsilo-d7fd2b8180aa58d0a7cfb29a946de91ca9744d20.tar.gz
[silo @ 121]
Make it so we see the rotating status when loading even when not using inflate.#
-rw-r--r--common/inflate.c11
-rw-r--r--second/file.c20
-rw-r--r--second/main.c10
3 files changed, 23 insertions, 18 deletions
diff --git a/common/inflate.c b/common/inflate.c
index 1c75b94..d6ea57f 100644
--- a/common/inflate.c
+++ b/common/inflate.c
@@ -825,16 +825,6 @@ int *e; /* last block flag */
return 2;
}
-static void rotate (void)
-{
- static int i = 0;
- static char rot[] = "\\|/-";
-
- printf ("%c\b", rot[i % 4]);
-
- i++;
-}
-
STATIC int inflate ()
/* decompress an inflated entry */
{
@@ -852,7 +842,6 @@ STATIC int inflate ()
/* decompress until the last block */
h = 0;
do {
- rotate();
hufts = 0;
gzip_mark (&ptr);
if ((r = inflate_block (&e)) != 0) {
diff --git a/second/file.c b/second/file.c
index 840d4e3..1ec3a6f 100644
--- a/second/file.c
+++ b/second/file.c
@@ -145,6 +145,20 @@ static void unget_gzip_input (void)
}
static int gunzipped_len = 0;
+static int do_rotate = 0;
+
+static void rotate (void)
+{
+ static int i = 0;
+ static char rot[] = "\\|/-";
+
+ if (!do_rotate)
+ return;
+
+ printf ("%c\b", rot[i % 4]);
+
+ i++;
+}
int dump_block (blk_t * blocknr, int blockcnt)
{
@@ -198,6 +212,7 @@ int dump_block (blk_t * blocknr, int blockcnt)
block_cnt = 0;
return 0;
}
+ rotate();
filebuffer += block_cnt * bs;
if (*blocknr && blockcnt && blockcnt != last_blockcnt + 1) {
memset (filebuffer, 0, (blockcnt - last_blockcnt - 1) * bs);
@@ -333,6 +348,11 @@ int load_file (char *device, int partno, char *filename, char *buffer,
goto done_2;
do_gunzip = cmd & LOADFILE_GZIP;
+ if (cmd & ~LOADFILE_GZIP)
+ do_rotate = 0;
+ else
+ do_rotate = 1;
+
filebuffer = buffer;
filelimit = limit;
diff --git a/second/main.c b/second/main.c
index 2c19ea9..f543463 100644
--- a/second/main.c
+++ b/second/main.c
@@ -1160,10 +1160,8 @@ try_again:
} else {
char *image_end = (char *)&_start;
- image_base = (char *)0x4000;
-
/* See if we can use some extra memory for the kernel */
- if (!load_cmd) {
+ if (!load_cmd && image_base == (char *)0x4000) {
unsigned int size;
char *mem;
@@ -1187,9 +1185,6 @@ try_again:
&image_len, load_cmd == CMD_LS ? LOADFILE_LS : LOADFILE_GZIP, 0)) {
printf ("\nImage not found.... try again\n");
- if (!load_cmd)
- image_memory_release();
-
continue;
}
@@ -1378,7 +1373,8 @@ try_again:
*(unsigned int *)(p + 16) = ((unsigned int)initrd_start | 0xf0000000);
*(unsigned int *)(p + 20) = initrd_size;
}
- }
+ } else
+ printf ("Error: initial ramdisk loading failed. No initrd will be used.\n");
}
}
}