RIP Notes: Difference between revisions
Brian Wilson (talk | contribs) m →Q & A |
Brian Wilson (talk | contribs) |
||
Line 1: | Line 1: | ||
RIP is based on [http://slackware.org Slackware]. | |||
[http://slackware.mirrors.tds.net/pub/slackware/slackware-10.2-iso/ archive] | |||
== Customizing RIP == | == Customizing RIP == | ||
Revision as of 06:18, 29 June 2006
RIP is based on Slackware.
Customizing RIP
The kernel and programs on the system are compressed with UPX v2.00. So, if you do this 'file /usr/bin/lynx', you get this. /usr/bin/lynx: ELF 32-bit LSB executable, Intel 80386, version 1, statically linked, corrupted section header size
You can ignore that!
Also, 'ldd' will say a program is statically linked, even if it's not.
If you want, you can uncompress a program like this 'upx -d program'. You can't uncompress the kernel!
You can get UPX here http://upx.sourceforge.net; I installed it from the Ubuntu package.
Unpacking
gzip root.cpz | cpio -i
Packing
find . -depth -exec cpio -o \; | gzip > root.cpz
Q & A
Q. Is it possible to change something, or add shell scripts and/or packages to the system?
A. To remaster RIPLinuX and install an add-on package.
The add-on package must have a '.tgz' (tar/gzip) extension, and be packed for extraction/installation from '/' on the Linux system.
It can be a self-made, third-party, or Slackware package.
# mkdir /rip1 /rip2 # mount -o loop RIPLinuX-1.8.iso /rip1 # cp -a /rip1/* /rip2 # umount /rip1 ; rmdir /rip1 # mkdir /rip2/boot/1 # cd /rip2/boot/1 /rip2/boot/1# gzip -dc ../rootfs.cgz | cpio -iumdv /rip2/boot/1# sbin/installpkg -root . /path-to-package/package.tgz
Remove the old system.
/rip2/boot/1# rm ../rootfs.cgz
Then cpio/gzip the new system.
/rip2/boot/1# find . | bin/cpio -v -o -H newc | gzip -9 >../rootfs.cgz ^^^
"Use the RIPLinuX cpio 'bin/cpio' here!"
# rm -rf /rip2/boot/1 # mkdir /rip-iso # cd /rip2 /rip2# sh boot/mkiso.sh . /rip-iso rip.iso
Write /rip-iso/rip.iso to a CD!
You can now delete the /rip2 directory.
# rm -rf /rip2
Note: You can also have the add-on package(s) on any media and install it after the system boots. This is probably the best way to do it, because 'rootfs.cgz' is loaded into memory (which is freed after it's extracted), so it's best to keep it small.
You could put the add-on package(s) in /boot/pkg on the RIPLinuX CD, or any media.
If you pass this to the kernel 'rip_pkg=/dev/hdc,/boot/pkg', when the system boots it will mount /dev/hdc and prompt you to install any *.tgz packages it finds in /boot/pkg.
If you pass this to the kernel 'rip_pkg=/dev/hdc,/boot/pkg,noprompt', you won't be prompted.
You can pass that to the kernel in /boot/isolinux/isolinux.cfg.
Q. Is it possible to replace the kernel?
The replacement kernel must have this support builtin.
CONFIG_SHMEM=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_INITRD=y CONFIG_ISO9660_FS=y CONFIG_EXT2_FS=y CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y "MSDOS and/or VFAT for USB Flash drive access!" CONFIG_VFAT_FS=y CONFIG_PROC_FS=y CONFIG_TMPFS=y
A. # mkdir /rip1 /rip2
# mount -o loop RIPLinuX-1.8.iso /rip1 # cp -a /rip1/* /rip2 # umount /rip1 ; rmdir /rip1
Replace the kernel in the /rip2/boot directory.
Create and write /rip-iso/rip.iso to a CD as described above!
NOTE: If you want *initramfs* to use TMPFS instead of RAMFS, apply the patch "inittmpfs.diff" to the kernel source. http://www.tux.org/pub/people/kent-robotti/looplinux/rip
Q. Is it possible to install the system on my hard drive?
A. You need to create a Linux partition using 'fdisk' etc., the you need to put a ext3 etc. filesystem on it, then you need to mount the partition and extract 'rootfs.cgz' to it.
This example assumes you created a Linux partition on /dev/hda2, with a ext3 filesystem.
You can resize a Windows XP NTFS partition, using 'ntfsresize'.
If you resize Windows you'll have room on your hard drive for Linux.
For example, you have a 120 GB Windows partition on /dev/hda1 and you want to resize it to 80 GB.
# ntfsresize -n -s 80000M /dev/hda1 "Resize to 80 GB! (test run)" # ntfsresize -s 80000M /dev/hda1 "Resize to 80 GB! (for real)"
# fdisk /dev/hda Command: d Command: n p "Primary partition!" Partition number: 1 First cylinder: "Press enter for default!" Last cylinder: +80000M Command: t Hex code: 7 Command: a Partition number: 1 Command: n p "Primary partition!" Partition number: 2 First cylinder: "Press enter for default!" Last cylinder: "Press enter for default!" Command: p Command: w "Write table to disk and exit, or q to Quit!"
You can use the shell script 'shrinkntfs' on RIPLinuX to do the above.
# shrinkntfs 80000 /dev/hda1
The above example would shrink an NTFS filesystem on /dev/hda1 to 80000 MegaBytes (80GB)!
After the NTFS filesystem is strunk by ntfsresize, fdisk is used to rewrite the partition table.
The shrinkntfs script is specifically for the case where you have an NTFS system using the whole hard drive, and you want to free up space for another operating system etc.
NOTE: The next time you boot Windows it will run 'chkdsk'!
NOTE: The script won't run if you have more than 3 partitions on
the specified hard drive!
Then you can use the 'mkpart' script to create a Linux partition.
# mkpart 83 20000 /dev/hda
The above example would create a type 83 (Linux) 20000 MegaBytes (20GB) primary partition on /dev/hda!
It will use the next available partition!
If you want it made active, add '-a' at the end!
# mkpart 83 20000 /dev/hda -a
You probably don't want the Linux partition to be made active!
To get a listing of partition types, do this!
# mkpart -t /dev/hda
NOTE: The script won't run if you have more than 2 partitions on the specified hard drive!
# mke2fs -j /dev/hda2 "Create ext3 filesystem on /dev/hda2, if that's the Linux partition!"
Mount the RIPLinux CD or ISO image that has /boot/rootfs.cgz on it.
# mount -rt iso9660 /dev/hdd /mnt/cdrom "Mount CD!" # mount -o loop RIPLinuX-1.8.iso /mnt/cdrom "Mount ISO image!" # mount -t ext3 /dev/hda2 /mnt/linux # cd /mnt/linux /mnt/linux# gzip -dc /mnt/cdrom/boot/rootfs.cgz | cpio -iumdv # cp /mnt/cdrom/boot/kernel /mnt/linux/boot
Add this line to the top of the /mnt/linux/etc/fstab file.
/dev/hda2 / ext3 defaults 1 1
# rm /mnt/linux/init "Remove /init link!!!"
You'll need to use GRUB etc. to boot it.
From the RIPLinuX CD ISOLinux menu, you could do this to boot the Linux partition on /dev/hda2.
Choose GRUB from the menu.
Press the `c' key to get a command prompt.
grub> root (hd0,1) grub> kernel /boot/kernel root=/dev/hda2 ro grub> boot
NOTE: You can use the Linux system on the RIPLinuX CD to create the Linux partition, and extract rootfs.cgz to it.
NOTE: RIPLinuX is based on Slackware and you can install packages from Slackware 10.2 or later. Only use /sbin/installpkg on RIPLinuX to install Slackware packages 'installpkg package_name.tgz'.
------------------------------------------------------------------
You can install a Slackware Linux distribution on a ext2, ext3, jfs, reiserfs, reiser4, or xfs formatted partition.
# setup "Read HELP!"
You need the Slackware ISO images 'slackware-10.2-install-d1.iso and slackware-10.2-install-d2.iso' on CD or DVD! You need at least 'slackware-10.2-install-d1.iso'!
You can also install Slackware from a partition on your hard drive that has the directories (a, ap, etc.) with the Slackware tgz packages, or over NFS. It's basically the same as standard Slackware setup!
The filesystem on the partition can be any the kernel supports, at least read-only!
Slackware doesn't currently support reiser4, if you want to install Slackware on a reiser4 partition you'll have to use the RIPLinuX kernel to boot it. When asked by setup for a kernel to install choose "rip_cdrom (Use the kernel from the RIPLinuX CD)".