View previous topic :: View next topic |
Author |
Message |
jimihieu
Joined: 05 May 2006 Posts: 51
|
Posted: Sun Aug 13, 2006 4:22 pm Post subject: HOWTO REMASTER DSL-N RC01 to build packages from HDD install |
|
|
This Howto was done on 15 MAY 06 with DSL-RC01,
Not many tests were done after the remaster but .....(USE IT WITH YOUR OWN RISK! NO RESPONSIBILITY IS TAKEN)
This Howto will be updated from time to time, so please keep an eye on it.
This Howto was combined and followed from some other Howto on DSL and DSL-N forums:
1) Boot liveCD up and install DSL-N into HDD with debian
#sudo dsl-hdinstall
2) Follow the topic below to enable apt-get:
Here is the copy of it anyway:
Copy the following from 50mb dsl and put into DSL-N
/usr/sbin/install-info
/usr/sbin/dpkg-restore
(cp -Rp ) /var/lib/apt
(cp -Rp ) /var/cache/apt
copy /etc/resolv.conf from any debian distro or add ip addresses of DNS's your self in DSL-N's /etc/resolv.conf
do:
dpkg-restore
change /etc/apt/sources.list to use "stable" instead of "oldstable"
do:
apt-get update
get the mydsl extention - gnu-utils.dsl from the mydsl repository put in in / directory
and do:
tar -zxvf gnu-utils.dsl
(ignore warnings/errors from the following they should all go away after this is done)
apt-get install debconf
apt-get install perl
apt-get install apt-utils
This should make apt work with no eronious bad stuff.
(Thanx to Keeper of the Grove)
3) Download dpkg.dsl package from DSL website and install it (ie: mydsl-load)
4) apt-get install binutils
5) apt-get install gcc (which gcc-3.4 to locate it!) [OR apt-get install gcc-3.4]
then make symbolic link gcc to it ln -sv /usr/bin/gcc-3.4 /usr/bin/gcc (OR edit ~/.bashrc and enter export CC=gcc-3.4)
6) Download kernel-source-2.6.11-custom-knoppix.deb from knoppix website
7) dpkg -i kernel-source-2.6.11-custom-knoppix.deb
Now the kernel source is there, install any packages as you wish.
9) Remastering process was adapted from DSL forum and summarized for my own need (MY METHOD PLEASE DONT FOLLOW THIS ONE BUT THE ONE BELOW):
FREE SPACE PREPARATION
Open emelfm as root, and make sure hidden files are visible in both panes.
In /mnt/hda2, create the subdirectories /cd, /mnt, and /source.
Mount /cdrom (your original DSL live CD) and copy everything except that big /cdrom/KNOPPIX/KNOPPIX file from /cdrom to /mnt/hda2/cd.
DSL HARD DRIVE INSTALLATION PREPARATION
Deleting your /home/dsl/.bash_history
Copy *everything* from /mnt/hda7 to /mnt/hda2/DSL-Remaster/source.
Delete the files, BUT NOT any subdirectories, in /mnt/hda2/DSL-Remaster/source/var/run.
Delete the files, but not any subdirectories, in /mnt/hda2/DSL-Remaster/source/etc/sysconfig.
Delete all files except those named System.map* from /mnt/hda2/DSL-Remaster/source/boot.
Delete the /mnt/hda2/DSL-Remaster/source/mnt directory,
then copy the /KNOPPIX/mnt directory to /mnt/hda2/DSL-Remaster/source/mnt.
Delete the entire contents of the /mnt/hda2/DSL-Remaster/source/etc/skel directory, then move everything that remains in the /mnt/hda2/DSL-Remaster/source/home/dsl directory into /mnt/hda2/DSL-Remaster/source/etc/skel.
DSL-KNOPPIX BOOT FILE MODIFICATION
gunzip minirt.gz
mount minirt /mnt/hda2/DSL-Remaster/mnt -o loop
modify linuxrc
gzip /mnt/hda2/DSL-Remaster/cd/boot/isolinux/minirt
open the file /mnt/hda2/DSL-Remaster/cd/boot/isolinux/isolinux.cfg with scite.
LIVE CD IMAGE CREATION
mkknoppix /mnt/hda2/DSL-Remaster/source /mnt/hda2/DSL-Remaster/cd/KNOPPIX/KNOPPIX
mkdslcd /mnt/hda2/DSL-Remaster/cd /mnt/hda2/DSL-Remaster/dsl-N.iso [date]
[b]COPY AND PASTE SCRIPTS BELOW AND NAMED THEM APPRORIATELY:[/b]
-------------------------------------------------------------------------------------------------------------------
#!/bin/bash
#mkknoppix src_dir dest_file
# Creates a compressed KNOPPIX image file
if ls "$1" >/dev/null 2>&1 ; then
mkisofs -R "$1" | create_compressed_fs - 65536 > "$2"
else
echo "Usage: mkknoppix src_dir dest_file"
echo ""
echo "Creates a compressed KNOPPIX image file"
fi
-------------------------------------------------------------------------------------------------------------------
#!/bin/bash
#mkdslcd src_dir dest_file [vol_id]
# Creates a DSL remastered ISO image file
volid=$3
if $volid="" ; then
volid="DSL"
fi
if ls "$1" >/dev/null 2>&1 ; then
if ls "$1"/KNOPPIX/boot.cat >/dev/null 2>&1 ; then
# We have DSL version 0.7.x or earlier
mkisofs -r -J -V "$volid" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o "$2" "$1"
elif ls "$1"/boot/isolinux/boot.cat >/dev/null 2>&1 ; then
# We have DSL version 0.8.x or later
mkisofs -r -J -l -no-emul-boot -no-pad -boot-load-size 4 -boot-info-table -V "$volid" -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o "$2" "$1"
else
echo "Unrecognized DSL CD directory structure"
fi
else
echo "Usage: mkdslcd src_dir dest_file [vol_id]"
echo ""
echo "Creates a DSL remastered ISO image file"
fi
************************************************************************************************************
************************************************************************************************************
[code:1]I cant remmember where is the script so i cant give the link. However, here is the FULL VERSION of the script:
REQUIREMENTS
You'll need the hard drive installation of DSL from which you wish to remaster your custom live CD (obviously), the original DSL live CD, and a separate ext2 hard drive partition with at least enough free space to hold your newly remastered CD three or four times over, depending on where you write the final ISO image. You will also need an amount of free RAM + Swap space at least as large as the compressed KNOPPIX image you will be creating, since create_compressed_fs does all its work in memory before dumping the file to disk.
A CD-R or CD-RW disk and burner will be needed as well. To be safe, you may want to burn your first remaster onto a rewriteable disk before committing to permanent CD.
I also highly recommend using the shell scripts which are provided below for two reasons: 1) You will get awfully tired of having to retype a boatload of mkisofs or sed options every time you remaster a CD, and 2) The scripts will minimize your chances of making typographical errors.
DEFINITIONS
For the purposes of this HOWTO, I shall use "hda7" to refer to the DSL hard drive partition which is being remastered, and "hda8" to refer to the ext2 free space partition. Please substitute your own partition locations as necessary. "dsl4me.iso" refers to your remastered CD image, which you can, of course, call whatever you like.
SCRIPTS
Boot your original DSL CD, then mount both hda7 and hda8. Copy and save the following scripts into files named "findfiles", "mkdslcd", and "mkknoppix", respectively. Place them all into /mnt/hda8 and give them root ownership and execute permissions. Their usage will be explained as we proceed.
---------- cut here ----------
#!/bin/bash
# findfiles hd_installation_dir
# Locates files which need write access but do not have it on live CD
# Results are sent to stdout
# Boot from live CD before running this
if ls "$1" >/dev/null 2>&1 ; then
od=$PWD
cd $1
find -newer $od/touchme | sed -n -e '1,$s/^.\//touch -c \//p' | /bin/bash 2>&1 | sed -n -e '1,$s/^touch: //p' | sed -n -e '1,$s/: .*//p' > /dev/stdout
cd $od
else
echo "Usage: findfiles hd_installation_dir"
echo ""
echo "Locates files which need write access but do not have it on live CD"
echo "Results are sent to stdout"
echo "Boot from live CD before running this"
fi
---------- cut here ----------
#!/bin/bash
# mkdslcd src_dir dest_file [vol_id]
# Creates a DSL remastered ISO image file
volid=$3
if $volid="" ; then
volid="DSL"
fi
if ls "$1" >/dev/null 2>&1 ; then
if ls "$1"/KNOPPIX/boot.cat >/dev/null 2>&1 ; then
# We have DSL version 0.7.x or earlier
mkisofs -r -J -V "$volid" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o "$2" "$1"
elif ls "$1"/boot/isolinux/boot.cat >/dev/null 2>&1 ; then
# We have DSL version 0.8.x or later
mkisofs -r -J -l -no-emul-boot -no-pad -boot-load-size 4 -boot-info-table -hide-rr-moved -V "$volid" -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o "$2" "$1"
else
echo "Unrecognized DSL CD directory structure"
fi
else
echo "Usage: mkdslcd src_dir dest_file [vol_id]"
echo ""
echo "Creates a DSL remastered ISO image file"
fi
---------- cut here ----------
#!/bin/bash
# mkknoppix src_dir dest_file
# Creates a compressed KNOPPIX image file
if ls "$1" >/dev/null 2>&1 ; then
mkisofs -R "$1" | create_compressed_fs - 65536 > "$2"
else
echo "Usage: mkknoppix src_dir dest_file"
echo ""
echo "Creates a compressed KNOPPIX image file"
fi
---------- cut here ----------
FREE SPACE PREPARATION
Open emelfm as root, and make sure hidden files are visible in both panes. In /mnt/hda8, create the subdirectories /cd, /mnt, and /source. If you are running DSL version 0.7.x or earlier, also create the subdirectory /mnt7. Mount /cdrom (your original DSL live CD) and copy everything except that big /cdrom/KNOPPIX/KNOPPIX file from /cdrom to /mnt/hda8/cd. If you are remastering from DSL version 0.8.x or greater, the contents of /mnt/hda8 should now look like this:
/mnt/hda8
/cd
| /KNOPPIX
| /boot
| | /isolinux
| | boot.cat
| | boot.msg
| | f2
| | f3
| | german.kbd
| | isolinux.bin
| | isolinux.cfg
| | linux24
| | logo.16
| | minirt24.gz
| /lost+found
| index.html
/mnt
/source
findfiles
mkdslcd
mkknoppix
and if you are remastering from DSL version 0.7.x or earlier, the contents of /mnt/hda8 should now look like this:
/mnt/hda8
/cd
| /KNOPPIX
| | boot.cat
| | boot.img
| /lost+found
| index.html
/mnt
/mnt7
/source
findfiles
mkdslcd
mkknoppix
Some additional files may exist, depending on the specific DSL version.
REWRITTEN FILE IDENTIFICATION
{Note: This section may not, strictly speaking, be necessary. I originally did this to locate all files needing write access, then edited the snot out of the Knoppix boot scripts to give them that. Later, I discovered that modifying the directory structure of the DSL hard drive installation so that it more closely matched that of the original live CD (this is covered below) required less Knoppix boot script editing, and was, overall, a cleaner and more effective remastering solution. Your feedback on this is encouraged.}
While still running DSL from an original live CD with hda8 mounted, as root, execute the following command:
touch /mnt/hda8/touchme
This creates a dummy file with a reference timestamp that we will use to identify which files in your DSL hard drive installation require write access.
Next, reboot DSL from your hard drive installation. Run every program that you have added to DSL since installing it on the hard drive. If necessary, connect to your DSL PC from another computer over a network to make sure all DSL server daemons are running properly. The idea here is to get your DSL hard drive installation to write to any needed log, status, and temporary files so that we can make sure to give all of those files write access when DSL is later run from our remastered live CD.
When all appears well, reboot DSL again from the original live CD. As root, mount both hda7 and hda8, then go to /mnt/hda8 and enter the command:
findfiles /mnt/hda7 > needwr
The file you have just created, /mnt/hda8/needwr, is a list of all files in your DSL hard drive installation which require write access (their timestamps are newer than that of /mnt/hda8/touchme) and either do not have that on the original DSL live CD, or their directories do not even exist on the original DSL CD.
DSL HARD DRIVE INSTALLATION PREPARATION
Now comes the messy part: Cleaning up the copy of your DSL hard drive installation so that your remaster turns out as neat as possible. First of all, depending on your intended use for your remastered CD, you may or may not want to remove any "proprietary" information from /mnt/hda8/source. This includes things like web browser caches, cookies, and typed and visited histories; emails, email account, and login info; ppp phone numbers, login usernames, and passwords; any other passwords, such as for samba server or vnc server, as well as configuration files; any text files containing personal info; maybe even things like ethernet IP addresses and /etc/hosts computer names, if they are specific to your own network. Deleting your .bash_history is also a good thing to do, especially if it contains any "sudo" commands. You get the idea. Some of these items are most easily cleaned up by booting your DSL hard drive installation and running the appropriate apps or configuration utilities. In other cases, it may be easiest to simply delete files from /mnt/hda8/source as shown below.
Boot DSL from the original live CD, mount hda7 and hda8, and open emelfm as root.
Copy *everything* from /mnt/hda7 to /mnt/hda8/source. You can then unmount hda7.
Delete all the files in the /mnt/hda8/source/tmp directory except for any *.uci compressed CD images which you use.
Whenever you empty out a directory, it's probably a good idea to put back into that directory whatever was in it on the original DSL CD, just to be safe. A peek inside /KNOPPIX/tmp reveals a few files and directories, so I'd recommend copying those over to /mnt/hda8/source/tmp.
It soon became obvious to me why the creators of DSL omitted the Debian dpkg database from DSL. It can be huge, and the apt extensions are being constantly updated on the Internet anyway, so we shall dispose of it.
Delete the /mnt/hda8/source/var/cache/apt directory. Then copy the /KNOPPIX/var/cache/apt directory (this is from the original DSL live CD) to /mnt/hda8/source/var/cache/apt.
Likewise, delete the /mnt/hda8/source/var/lib/apt directory, then copy the /KNOPPIX/var/lib/apt directory to /mnt/hda8/source/var/lib/apt.
Delete the /mnt/hda8/source/var/lib/dpkg directory. This concludes (almost) the removal of the dpkg database.
Next, delete the files, but not any subdirectories, in /mnt/hda8/source/var/run.
Delete the /mnt/hda8/source/var/locks directory.
Delete the files, but not any subdirectories, in /mnt/hda8/source/etc/sysconfig.
Delete all files except those named System.map* from /mnt/hda8/source/boot.
Delete the /mnt/hda8/source/lost+found directory.
Delete the symbolic link /mnt/hda8/source/linux24 (This may be different for other Linux kernel or DSL versions).
Delete the /mnt/hda8/source/mnt directory, then copy the /KNOPPIX/mnt directory to /mnt/hda8/source/mnt.
If the /mnt/hda8/source/home/dsl/mnt directory exists, delete everything inside it.
When booting DSL from live CD, the user settings in /home/dsl are actually copied over from /etc/skel, so we need to make the following adjustments:
Delete the file /mnt/hda8/source/home/dsl/dsl-dpkg.dsl (This is the last piece of the dpkg database).
Delete the directory /mnt/hda8/source/home/dsl/boot.
Delete the entire contents of the /mnt/hda8/source/etc/skel directory, then move everything that remains in the /mnt/hda8/source/home/dsl directory into /mnt/hda8/source/etc/skel.
DSL-KNOPPIX BOOT FILE MODIFICATION
If you are running DSL version 0.7.x or earlier, as root, go to /mnt/hda8/cd/KNOPPIX and enter the command:
mount boot.img /mnt/hda8/mnt7 -o loop
then go to /mnt/hda8/mnt7 and enter the commands:
gunzip miniroot.gz
mount miniroot /mnt/hda8/mnt -o loop
If you are running DSL version 0.8.x or later, as root, go to /mnt/hda8/cd/boot/isolinux and enter the commands:
gunzip minirt24.gz
mount minirt24 /mnt/hda8/mnt -o loop
For all DSL versions, go to /mnt/hda8/mnt and open the file linuxrc with scite.
Next, do a search for the string "Creating directories", followed by a search for the string "Done". You should now be looking at a section of code that looks somewhat like the following:
# Extremely important, init crashes on shutdown if this is only a link
:> /etc/ioctl.save
:> /etc/pnm2ppa.conf
# Must exist for samba to work
[ -d /var/lib/samba ] && :> /var/lib/samba/unexpected.tdb
# Diet libc bug workaround
cp -f /KNOPPIX/etc/localtime /etc/localtime
echo "${BLUE}Done.${NORMAL}"
To ensure write access for all necessary files on your remastered live CD, insert these lines immediately before the echo Done line:
# Added by [your_name_here] for remastering from HD installation
rm -f /var/cache/apt
cp -Rp /KNOPPIX/var/cache/apt /var/cache
rm -f /var/lib/apt
cp -Rp /KNOPPIX/var/lib/apt /var/lib
so the section of code in question now looks like this:
# Extremely important, init crashes on shutdown if this is only a link
:> /etc/ioctl.save
:> /etc/pnm2ppa.conf
# Must exist for samba to work
[ -d /var/lib/samba ] && :> /var/lib/samba/unexpected.tdb
# Diet libc bug workaround
cp -f /KNOPPIX/etc/localtime /etc/localtime
# Added by noclobber for remastering from HD installation
rm -f /var/cache/apt
cp -Rp /KNOPPIX/var/cache/apt /var/cache
rm -f /var/lib/apt
cp -Rp /KNOPPIX/var/lib/apt /var/lib
echo "${BLUE}Done.${NORMAL}"
Save the file and close scite. Then execute the command:
umount /mnt/hda8/mnt
If you are running DSL version 0.7.x or earlier, execute the command:
gzip /mnt/hda8/mnt7/miniroot
For DSL version 0.8.x or later, execute the command:
gzip /mnt/hda8/cd/boot/isolinux/minirt24
This would be a good place to tackle some of DSL's bootup annoyances.
If you are working with DSL version 0.7.x or earlier, open the file /mnt/hda8/mnt7/syslinux.cfg with scite.
For DSL version 0.8.x or later, open the file /mnt/hda8/cd/boot/isolinux/isolinux.cfg with scite.
Lilo is not used when booting DSL from live CD, but many lilo boot options also work in this file. In the default APPEND line, I prefer "vga=normal" instead of "vga=791". I also add the option "nodhcp" to the APPEND line to help avoid problems with initializing my eth0 interface, since I use static IP addresses on my local network. In addition, I like to shorten the bootup message prompt timeout from 30 seconds (the "TIMEOUT 300" line) to more like 5-10 seconds. Edit this as you wish, then save the file and close scite.
If you are running DSL version 0.7.x or earlier, execute the command:
umount /mnt/hda8/mnt7
LIVE CD IMAGE CREATION
Now, either in emelfm or from a root access terminal, go to /mnt/hda8 and enter the command:
mkknoppix /mnt/hda8/source /mnt/hda8/cd/KNOPPIX/KNOPPIX
When this finishes, enter this command, where vol_id is an optional volume label for your remastered CD:
mkdslcd /mnt/hda8/cd /mnt/hda8/dsl4me.iso [vol_id]
dsl4me.iso is your DSL remaster image, and its exact location is not critical. If space on hda8 is limited or you wish to burn the image from Windows, you can mount a FAT partition and place dsl4me.iso there.
TESTING
Burn and boot your remastered CD. No error messages should appear during bootup, your desktop should appear as it did when DSL was run from your hard drive, and all your apps should run well without errors (apt can be reenabled from the fluxbox menu).
That's it!
[/code:1] |
|
Back to top |
|
|
roberts
Joined: 17 Apr 2006 Posts: 320 Location: OC CA USA
|
Posted: Wed Aug 16, 2006 10:00 pm Post subject: |
|
|
Please DO NOT mix [b]gnu-utils.dsl[/b] which are specific to [b]DSL[/b] with [b]DSL-N[/b]. You are downgrading many things which will only cause grief.
Actually, DSL-N is really not ready to be remastered. It is in Release Candidate mode. Many things are changing. I would not recommend it at this point. |
|
Back to top |
|
|
RayRoko
Joined: 04 Sep 2006 Posts: 4
|
Posted: Thu Nov 30, 2006 6:46 pm Post subject: cant find knoppix kernel sources |
|
|
I can't find kernel-source-2.6.11-custom-knoppix.deb from anywhere. Anyone could share this file with me or point me to a link? |
|
Back to top |
|
|
RayRoko
Joined: 04 Sep 2006 Posts: 4
|
Posted: Thu Nov 30, 2006 9:31 pm Post subject: |
|
|
ok I took the kernel sources from the Knoppix 4.0.2 DVD. I have a suggestion on how to make the gnu utilities for 2.6 kernel:
on the original DSL gnu utils file, do:
(we make a list of files in gnu-utils.dsl and put it in the gnufilelist24.txt)
tar -ztf gnu-utils.dsl >> gnufilelist24.txt
then go to the root your knoppix machine (with 4.0.2 CD/DVD), copy gnufilelist24.txt to /, become root and do from /:
(create a tar archive (tarball) from files listed in gnufilelist24.txt)
tar --files-from=./gnufilelist24.txt -cvf gnu-utils26.tar
then
gzip gnu-utils26.tar
(you'll get gnu-utils26.tar.gz)
That's essentially gnu-utils.dsl for DSL-N with the following files missing:
/usr/X11R6/lib/libXau.so.0
/usr/X11R6/lib/libXcursor.so.1.0
/usr/X11R6/lib/libXcursor.so.1
/usr/X11R6/lib/libXft.so.2.1.1
/usr/X11R6/lib/libXft.so.1.1
/usr/X11R6/lib/libXfont.so.0
/usr/X11R6/lib/libXft.so.1
/usr/X11R6/lib/libXft.so.2
/usr/X11R6/lib/libXrender.so.1
/usr/X11R6/lib/libXrender.so.1.2
/usr/X11R6/lib/libxrx.so.6.3
/usr/X11R6/lib/libxrx.so.6
/usr/X11R6/lib/X11/etc/xmodmap.std
/usr/X11R6/lib/X11/fonts/encodings/fonts.dir
/usr/X11R6/lib/X11/fonts/misc/cursor.pcf.gz
/usr/X11R6/lib/X11/fonts/util/fonts.dir
/usr/sbin/mkfontdir
/usr/lib/libfreetype.so.6.3.4
Now bring the gnu-utils26.tar.gz to the root of your DSL-N and do:
(extract files from the new archive on the top of old gnu utils)
tar -zxvf gnu-utils26.tar.gz.
Probably this is an ugly hack but time will tell Next I'm gonna think where to get the missing files from. It would be nice to have an opinion of the gurus on this hack |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|