[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-knoppix] [PATCH] New cheatcode "toram"



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

thx to Alex Thiessen, Lex from knoppix.net-Forum, it is now possible to copy 
the whole cdrom to ram and such use it for "better" things like burning or 
similar (If that is a good idea or not, one could flame about)

I fixed my initial blind written script and he did test it and it did work.

Attached is the patch to linuxrc from 06-06er release of knoppix.

You can also download an boot.img for the 06-06er or before from:

http://debian.tu-bs.de/knoppix/RamPatch/boot.img

There are also other files like the linuxrc if you don't like patch or the 
script I use to update my boot.img ;-). (Heh, its very system specific)

Klaus, can this get into the official distribution ? Some could like it.

cu

Fabian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD4DBQE/InscI0lSH7CXz7MRAkh+AJds8SlNAdpCyKMXNjcUtLvvzKaPAJ4yL/YB
1W3GO3jhi3VoQnh9OumdbQ==
=JCDs
-----END PGP SIGNATURE-----
--- linuxrc.orig	2003-07-26 13:10:09.000000000 +0200
+++ linuxrc	2003-07-26 14:27:46.000000000 +0200
@@ -236,6 +236,31 @@
 mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX=""
 fi
 
+COPYTORAM=""
+case "$CMDLINE" in *toram*) COPYTORAM="yes"; ;; esac
+ 
+# Copy the whole cdrom to ram ?
+if  test -n "$COPYTORAM"; 
+then 
+  # Pre-test if everything succeeded. 
+  if test -n "$FOUND_KNOPPIX" 
+  then 
+    # copy library cache 
+    cat /KNOPPIX/etc/ld.so.cache > /etc/ld.so.cache 
+    echo "" 
+
+    echo "Copying /cdrom to RamDisk, this will take a while ..." # Hey, we could use some fancy dialog skript here :-)) 
+    /bin/mkdir /cdrom2
+    /bin/mount -t tmpfs -o size=800M /dev/shm /cdrom2
+    /bin/cp -a /cdrom/* /cdrom2 # Copy everything to /cdrom2; yes we need more things then only the KNOPPIX image, we don't want to produce problems we hadn't before, do we ?
+    umount /KNOPPIX # unmount it
+    rmmod cloop # release CD
+    umount /cdrom  # unmount CD
+    insmod -f /modules/cloop.o file=/cdrom2/KNOPPIX/KNOPPIX
+    mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX="" # if everything else did suceeded so far, this will hopefully succeed too
+  fi 
+fi 
+ 
 # Final test if everything succeeded.
 if test -n "$FOUND_KNOPPIX"
 then
@@ -257,6 +282,13 @@
 # From here, we should have all essential commands available.
 hash -r
 
+# Did we copy from ram ? 
+if  test -n "$COPYTORAM"; 
+then 
+  rmdir /cdrom 
+  ln -s /cdrom /cdrom2 # make a symlink and go on to normal boot 
+fi
+
 # Clean up /
 rm -rf /modules /static
 

Reply to: