++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                              +
+                                                              +
+                    Welcome to StudentOS                      +
+                                                              +
+                  Author : Ananda Kammampati                  +
+                                                              +
+  Remastered DSL-4.0 with Linux-2.4.35 kernel and LIRC-0.8.2  +
+                                                              +
+        Built on DSL, Knoppix and Debian/GNU Linux            +
+                                                              +
+  StudentOS comes with ABSOLUTELY NO WARRANTY, to the extent  +
+               permitted by applicable law.                   +
+                                                              +
+                                                              +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


PART I : Install DSL4.0 from cd to hard disk
============================================

1) Boot your system from cd drive with DSL4.0 cd in it

      boot : install

2) Select option (3) [ Install to har disk ]

3) Enter target partition : hda1 (in my case)

   Note : "hda1" is in my case. You need to enter the one that is appropriate to your system
          Make sure you got your hard disk right. This entire document is written with having
          "hda1" for hard disk.

4) Enter "y" to confirm

5) Select "y/n" for ext3 filesystem based on your system configuration. (I selected 'n')

6) Enter "y" to continue

7) Enter "y" to install boot loader

8) Enter "l" to install LILO

9) Enter "y" to reboot



PART II : Get all the source bundles
====================================

/****
*
*    "/root/source" would be the directory where we could download all neccessary source bundles
* 
*    Download the following with DSL->MyDSL->MyDSL Browser->System
* 
*      1) gnu-utils.dsl
*      2) gcc1.dsl
*      3) gcc-with-libs.dsl
*      4) dsl-dpkg.dsl
* 
****/

# mkdir /root/source

# cd /root/source

# apt-get update

# wget ftp://ibiblio.org/pub/Linux/distributions/damnsmall/current/kernel/dsl.config

# wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.35.tar.gz

# wget http://debian-knoppix.alioth.debian.org/sources/cloop_2.01-6.tar.gz

# wget http://download.filesystems.org/unionfs/unionfs-1.x/unionfs-1.0.14.tar.gz

# mkdir /usr/src

# cd /usr/src

# tar zxvf /root/source/linux-2.4.35.tar.gz

# cd linux-2.4.35

# make menuconfig

/****
*
*
*   Select "Load an alternate configuration file" 
*
*        -> Enter "/root/source/dsl.config"
*
*   Select "Loadable module support"
*
*        -> Select [*] Set version info on all module symbols
*
*   Save the selected configuration file
*
*        -> Configuration will be saved in file ".config"
*
****/

# make dep 2> ./dep-error.txt

# make clean

# make bzImage 2> ./bz-error.txt

# make modules 2> ./mod-error.txt

# make modules_install INSTALL_MOD_PATH=/home/dsl/2.4.35

# pwd
-------------------
/usr/src/linux-2.4.35
-------------------

# cp arch/i386/boot/bzImage /boot/linux24-lirc 

# cd /boot

# mkdir orig

# cp linux24 System.map-2.4.31 orig

# unlink System.map

# rm System.map-2.4.31

# cp /usr/src/linux-2.4.35/System.map ./System.map-2.4.35

# ln -s System.map-2.4.35 System.map 

# cp /usr/src/linux-2.4.35/.config ./mydsl.config

# ls -l
-------------------
lrwxrwxrwx    1 root     root           17 Nov  5 20:40 System.map -> System.map-2.4.35
-rw-r--r--    1 root     root       587730 Nov  5 20:39 System.map-2.4.35
drwxrwxr-x    2 root     root         4096 Nov  5 20:42 grub
-r--r--r--    1 root     root      1005209 Nov  4 16:58 linux24
-rw-r--r--    1 root     root      1032057 Nov  5 20:38 linux24-lirc
-rw-r--r--    1 root     root        42413 Nov  5 20:39 mydsl.config
drwxr-xr-x    2 root     root         4096 Nov  5 11:17 orig
-------------------

# vi grub/menu.lst

/***
*
*  Add these lines so that this kernel would be the first entry */
*
***/

-------------------
title DSL-LIRC
     kernel /boot/linux24-lirc root=/dev/hda1 debug vga=normal noacpi noapm nodma noscsi frugal
-------------------

# cd /lib/modules

# cp -R /home/dsl/2.4.35/lib/modules/2.4.35/ .

# ls -l
-------------------
drwxrwxr-x    7 root     root         4096 Nov  5 21:12 2.4.31
drwxr-xr-x    4 root     root         4096 Nov  5 21:09 2.4.35
-rw-r--r--    1 root     root         5002 Nov  5 11:58 modprobe.conf
-------------------

# sync ; sync ; reboot

/***
*
* Once the system boots (with your "linux24-lirc" kernel), make sure you got it right. 
*
***/

# uname -a
-------------------
Linux box 2.4.35 #1 SMP Mon Nov 5 19:18:52 EST 2007 i686 GNU/Linux
-------------------

# # depmod -a
# # lsmod
-------------------
Module                  Size  Used by    Not tainted
apm                     9516   1  (autoclean)
mousedev                3832   0  (unused)
hid                    19940   0  (unused)
input                   3328   0  [mousedev hid]
af_packet              13384   0  (autoclean)
agpgart                42884   0  (unused)
emu10k1                55532   0 
sound                  53728   0  [emu10k1]
soundcore               3716   7  [emu10k1 sound]
ac97_codec             11800   0  [emu10k1]
3c59x                  26064   1 
emu10k1-gp              1160   0  (unused)
gameport                1484   0  [emu10k1-gp]
cfi_cmdset_0001        27768   1  (autoclean)
jedec_probe            10368   0  (autoclean)
gen_probe               1680   0  (autoclean) [jedec_probe]
ich2rom                 1788   0  (unused)
mtdcore                 2468   1  [ich2rom]
chipreg                  828   0  [jedec_probe ich2rom]
hw_random               2620   0  (unused)
serial                 52516   0  (autoclean)
ieee1394              183172   0 
usb-uhci               21360   0  (unused)
usbcore                58988   1  [hid usb-uhci]
pcmcia_core            40772   0 
ide-cd                 28160   0 
ide-scsi                8976   0 
rtc                     6728   0  (autoclean)
-------------------



PART III : LIRC (Linux InfraRed Control)
========================================

# cd /home/dsl

# bunzip2 /root/source/lirc-0.8.2.tar.bz2

# tar xvf /root/source/lirc-0.8.2.tar

# cd lirc-0.8.2

# ./configure --prefix=/usr/local/lirc --with-kerneldir=/usr/src/linux-2.4.35 --with-driver=serial --with-major=61 --with-transmitter --with-x

# make 

# make install

# ls -lR /usr/local/lirc | wc -l
-------------------
   56
-------------------

# ls -l /dev/lirc*
-------------------
crw-r--r--    1 root     root      61,   0 Nov  5 21:35 /dev/lirc
prw-r--r--    1 root     root            0 Nov  5 21:35 /dev/lircd
prw-r--r--    1 root     root            0 Nov  5 21:35 /dev/lircm
-------------------

# depmod -a

# apt-get install setserial

# setserial /dev/ttyS0 uart none

# modprobe lirc_serial

# lsmod
-------------------
Module                  Size  Used by    Not tainted
lirc_serial             8224   0  (unused)
lirc_dev                9604   1  [lirc_serial]
^^^^^^^ ---------------------------------------------------->>>> "lirc" Loaded 
-------------------



PART IV : Build and install "UnionFS"
=====================================

# cd /home/dsl

# apt-get install exuberant-ctags

# tar zxvf /root/source/unionfs-1.0.14.tar.gz

# vi fistdev.mk   /* Add the following line */
-------------------
TOPINC = -I/usr/src/linux-2.4.35/include
-------------------

# make

# cp unionfs.o /lib/modules/2.4.35/kernel/fs/

# depmod -a

# modprobe unionfs.o

# lsmod
-------------------
Module                  Size  Used by    Not tainted
unionfs              1657632   0  (unused)
^^^^^^^ ---------------------------------------------------->>>> "unionfs" Loaded 
-------------------



PART V : Build and Install "cloop" driver
=========================================

# cd /home/dsl

# tar zxvf /root/source/cloop_2.01-6.tar.gz

# cd cloop_2.01

# mv /usr/include/linux /usr/include/linux_orig

# ln -s /usr/src/linux-2.4.35/include/linux /usr/include/linux

# ln -s /usr/src/linux-2.4.35 linux

# ln -s /usr/bin/gcc cc

# export PATH=.:$PATH

/****
*
* 1) Edit "compressed_loop.c". Change value of CLOOP_MAX at line (23) from 8 to 64
*
*         -->  #define CLOOP_MAX 64
*
* 2) Edit "Makefile", specifically line (9) and (12)
*
*      a) Comment out line (9) 
*
*         --> # include $(KERNEL_DIR)/conf.vars
*
*      b) In line (12), add a "-", a capitol 'O' followed by number 2 just before -D__KERNEL__
*
*         --> CKERNOPS:=-O2 -D__KERNEL__ /* leave the rest of options as they were */
*
****/

# make KERNEL_DIR=/usr/src/linux-2.4.35

# ls -l cloop.o
-------------------
-rw-r--r--    1 root     root        12407 Nov  7 01:03 cloop.o
-------------------


# cp cloop.o /lib/modules/2.4.35/kernel/drivers/block/cloop.o

# depmod -a

# modprobe cloop

# lsmod
-------------------
Module                  Size  Used by    Tainted: GF 
cloop                   9412   0  (unused)
^^^^^^^ ---------------------------------------------------->>>> "cloop" Loaded 
-------------------

# unlink /usr/include/linux

# mv /usr/include/linux_orig /usr/include/linux

# sync ; sync ; reboot



PART VI : Remastering setup
===========================

# mkdir /remaster

# cd /remaster


/****
*
* create 3 scripts "one.sh", "two.sh" and "three.sh" "respectively
*
****/


/****
*
* one.sh
*
****/

#!/bin/sh
/bin/rm -rf source master iso
mkdir source master iso
mkdir source/KNOPPIX
cp -Rp /KNOPPIX/* source/KNOPPIX
cp -Rp /cdrom/* master
/bin/rm -rf master/KNOPPIX/KNOPPIX



/****
*
* two.sh
*
****/

#!/bin/sh
if [ -f source/KNOPPIX/.bash_history ] ; then
  /bin/rm source/KNOPPIX/.bash_history
fi
if [ -f source/KNOPPIX/home/dsl/.bash_history ] ; then
  /bin/rm source/KNOPPIX/home/dsl/.bash_history
fi
if [ -d source/KNOPPIX/root/.ssh ] ; then
  /bin/rm -rf source/KNOPPIX/root/.ssh
fi
if [ ! -f source/KNOPPIX/.bash_profile ] ; then
  cp /.bash_profile source/KNOPPIX/.bash_profile
fi
cp -f release.txt source/KNOPPIX/usr/share/doc/dsl/.
mkisofs -R -U -hide-rr-moved -cache-inodes -no-bak -pad source/KNOPPIX | /usr/bin/create_compressed_fs -best - 65536 > master/KNOPPIX/KNOPPIX
sync
sync



/****
*
* three.sh - Replace "StudentOS" that is being passed to "mkisofs" with whatever you wanted to call it.
*
****/

#!/bin/sh
RELEASE=`cat release.txt`
if [ -f master/KNOPPIX/boot.img ] ; then
  /bin/rm master/KNOPPIX/boot.img
  tar -zxvf boot.isolinux.tgz
fi
mkisofs -pad -l -r -J -v -V StudentOS -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o iso/"$RELEASE".iso master
sync
sync
if [ -n "$1" ] ; then
  if [ "$1" == "cd" ] ; then
    # cdrecord -v speed=4 dev=0,1,0 -data iso/"$RELEASE".iso
    /usr/bin/cdrecord.mmap -v gracetime=2 dev=0,1,0 speed=8 driveropts=burnfree -eject -data iso/"$RELEASE".iso 
  fi
fi
cd iso
md5sum "$RELEASE".iso > "$RELEASE".iso.md5.txt
sync
md5sum -c "$RELEASE".iso.md5.txt
cd ../.



# cat release.txt   /* Replace "StudentOS" with whatever you wanted to call it */
-------------------
StudentOS
-------------------


/****
*
* Have these files as well ready in "/remaster" directory
* 
*   1) banner
*   2) motd
*   3) logo.16         --> Ref: " Book: Live Linux CDs ; Chapter 5 ; Page 145 "
*   
*   Note : You may try downloading it from the net for (3) 
*
****/


# cat banner
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+                                                              +"
echo "+                                                              +"
echo "+                    Welcome to StudentOS                      +"
echo "+                                                              +"
echo "+                  Author : Ananda Kammampati                  +"
echo "+                                                              +"
echo "+  Remastered DSL-4.0 with Linux-2.4.35 kernel and LIRC-0.8.2  +"
echo "+                                                              +"
echo "+        Built on DSL, Knoppix and Debian/GNU Linux            +"
echo "+                                                              +"
echo "+  StudentOS comes with ABSOLUTELY NO WARRANTY, to the extent  +"
echo "+               permitted by applicable law.                   +"
echo "+                                                              +"
echo "+                                                              +"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"


# cat motd  /* Note : There is a blank line in the beginning and the end */

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                              +
+                                                              +
+                    Welcome to StudentOS                      +
+                                                              +
+                  Author : Ananda Kammampati                  +
+                                                              +
+  Remastered DSL-4.0 with Linux-2.4.35 kernel and LIRC-0.8.2  +
+                                                              +
+        Built on DSL, Knoppix and Debian/GNU Linux            +
+                                                              +
+  StudentOS comes with ABSOLUTELY NO WARRANTY, to the extent  +
+               permitted by applicable law.                   +
+                                                              +
+                                                              +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


ls -l 
-rw-rw-r--    1 root     root         1080 Nov  6 00:47 banner
-rw-r--r--    1 root     root        31269 Oct 31 22:02 logo.16
-rw-r--r--    1 root     root          977 Nov  6 00:46 motd
-rwxr-xr-x    1 root     root          176 Oct 25 22:37 one.sh
-rw-rw-r--    1 root     root            9 Oct 30 22:13 release.txt
-rwxr-xr-x    1 root     root          673 Oct 31 22:12 three.sh
-rwxr-xr-x    1 root     root          592 Oct 25 22:37 two.sh

# sync ; sync ; reboot



PART VII : Boot from DSL4.0 CD with following options
=====================================================

boot: dsl 2 base norestore legacy

# mount /mnt/hda1

# cd /mnt/hda1/remaster

# ./one.sh

# cd master/boot/isolinux

# rm linux24 logo.16

# cp /mnt/hda1/boot/linux24-lirc ./linux24

# cp /mnt/hda1/remaster/logo.16 .

# mkdir mroot1 mroot2

# gunzip minirt24.gz

# mount -t ext2 minirt24 mroot1 -o loop

# dd if=/dev/zero of=./minirt24new bs=4k count=8192

# mkfs.ext2 minirt24new    /* Enter 'y' to confirm file system creation */

# mount -t ext2 minirt24new mroot2 -o loop

# cd mroot2

# rsync -av ../mroot1/* .

# vi linuxrc /* Replace the "echo DSL" banner lines with your own "/mnt/hda1/remaster/banner" file */

# cd modules

# cp /mnt/hda1/lib/modules/2.4.35/kernel/drivers/block/cloop.o .

# cd scsi

# /bin/rm -rf *

# cp -a /mnt/hda1/lib/modules/2.4.35/kernel/drivers/scsi/* .

# cd ../../..

# umount mroot1

# rmdir mroot1

# gzip -9 minirt24

# mv minirt24.gz /mnt/hda1/remaster 

# cd mroot2/boot

# unlink System.map

# cd ../..

# umount mroot2

# rmdir mroot2

# cat minirt24new | gzip > minirt24.gz

# mv minirt24new /mnt/hda1/remaster  

# cd ../../..
 
# cp -a /mnt/hda1/lib/modules/2.4.35 source/KNOPPIX/lib/modules/.

# cp /mnt/hda1/lib/modules/2.4.35/modprobe.conf source/KNOPPIX/lib/modules/

# cp /mnt/hda1/boot/System.map-2.4.35 source/KNOPPIX/boot/

# cp -a /mnt/hda1/usr/local/lirc source/KNOPPIX/usr/local/

# cp /mnt/hda1/remaster/motd source/KNOPPIX/etc

# cp /mnt/hda1/remaster/getting_started.html source/KNOPPIX/usr/share/doc/dsl/

# cp /mnt/hda1/remaster/banner.JPG source/KNOPPIX/usr/share/doc/dsl/

# chroot source/KNOPPIX

/****
*
* You'll be inside a chrooted env. with it's own shell.
*
****/

# cd /boot

# ln -s System.map-2.4.35 System.map

# rm System.map-2.4.31

# cd /lib/modules

# /bin/rm -rf 2.4.31

# exit  /* This will exit the chrooted env./ shell  */

# ./two.sh

/****
*
* My system had 1xhard disk (/dev/hda) , 1xDVD drive and 1xCDRW drive
* Look into the script "three.sh" and modify the parameter "dev=x,x,x" that 
* is being passed to "cdrecord.mmap" command according to your system config
* to burn the newly created "iso/StudentOS.iso" image.
*
****/

# ./three cd  /* Make sure to have a blank cd disk in the CDRW drive. */

# sync ; sync ; reboot

/****
*
* Boot the system with newly burnt CD.
*
* This should boot the system with "StudentOS"
*
* Good luck, Peace.
*
* - Ananda Kammampati 
*
****/