The auto-configuration script sets the default KDE background image to be an image from the CD-ROM. An image that you can easily change when you are remastering KNOPPIX.
*
o In KNOPPIX 3.3 and below it is /cdrom/KNOPPIX/background.gif
o In KNOPPIX 3.4 and above it is /cdrom/KNOPPIX/background.jpg
Friday, May 25, 2007
Autorunning Programs
When you want to autorun some programs, one can create a script and put it in the directory /etc/rc5.d/ (This only loads items before X loads). Read up on the SysV init process for more possibilities.
Editing the KNOPPIX auto-configuration script
Editing the KNOPPIX auto-configuration script
User Settings
User settings are in /etc/skel. This directory will be copied to make new user home directories.
tip: don't put files in /root they will be only available (at runtime) in /KNOPPIX/root
Note that the default user 'knoppix' is not created by adduser(1), thus /etc/skel is not copied completely but rather selectively. That is, to make a file .xyrc appear in /home/knoppix, it is not sufficient to place it in /etc/skel. One possibility is to extend the code in /etc/X11/Xsession.d/45xsession which is responsible for filling /home/knoppix.
tip: don't put files in /root they will be only available (at runtime) in /KNOPPIX/root
Note that the default user 'knoppix' is not created by adduser(1), thus /etc/skel is not copied completely but rather selectively. That is, to make a file .xyrc appear in /home/knoppix, it is not sufficient to place it in /etc/skel. One possibility is to extend the code in /etc/X11/Xsession.d/45xsession which is responsible for filling /home/knoppix.
Working in the Chroot Environment
Remember that anything you do or create in the chrooted environment will get burned to the CD. If you make any changes (e.g,. to the APT configuration, proxy settings, etc.), make a note to back the changes out before remastering.
Internet Access
To use the Internet you need to edit /etc/resolv.conf to add your nameserver or exit the chroot and copy the outer resolv.conf into the chroot folder:
cp /etc/dhcpc/resolv.conf /mnt/hda1/knx/source/KNOPPIX/etc/dhcpc/resolv.conf
(proxies (a.k.a. doing it at work): you can type "export http_proxy=http://your.proxy.com:")
To check your chrooted internet connection,
ping google.com
(if ICMP is barred at some corporate firewall or something then try "lynx http://www.google.com" and see if you get the page -after a cookie "allow")
[edit]
SMB access
Also change smb.conf to your MS group if you want smbd support (MSHOME is XP Home ed. usually, and WORKGROUP is 9x Windows)
APT
Update your package list with apt-get update.
Note: If 'apt-get update fails with "FATAL -> Could not set non-blocking flag Bad file descriptor", you need to make sure your chrooted environment is mounted without the "nodev" option. (see above where it talks about the /dev/null errors when entering the chroot environment for the first time)
Warning: apt-get upgrade is a BAD IDEA. It will, quite probably, render your KNOPPIX remaster unbootable, or broken in some way. A far safer method is to only upgrade packages as necessary.
Note: If apt-get fails with "Dynamic NMap ran out of room" you might try this little gem, which fixed the problem for me:
#echo 'APT::Cache-Limit "25168524";'>> /etc/apt/apt.conf
(I did this while chrooted as described above.)
Before you can add stuff, you will probably need to remove some packages. To get a list of packages installed, type this:
dpkg-query -l
If you are looking for big installed packages then the command
dpkg-awk "Status: .* installed$" -- Package Installed-Size | \
awk '{print $2}' | egrep -v '^$' | xargs -n2 echo | \
perl -pe 's/(\S+)\s(\S+)/$2 $1/' | sort -rg
will list the packages with size in descending order.
At least ten times faster is the command
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n
and you don't need dpkg-awk or awk or perl; however it does not exclude packages that are not installed. If you have trouble with the above sort command, try using KPackage, expanded all the trees and sorted by the size column to find big packages.
Or, you could use this command to get the qpkg-query speed with the non-installed packages not listed:
dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}'
It does the same thing as above, I assume. I couldn't get the first one to work because I don't have dpkg-awk.
To remove a package (and all packages dependant on it), type this:
apt-get remove --purge name-of-package-to-remove
To check for orphaned packages, type this:
deborphan
Want to save more space by getting rid of those pesky orphans (how cruel!), type this (Warning, you won't be prompted yes/no to remove these packages. When you press Enter after this command, those packages will be gone):
deborphan | xargs apt-get -y remove
If you're uncertain about the previous command and want to see what will happen without making any changes, just add the -s option to the apt-get command like this (you can do this with all of the apt-get commands, and it's a good habit to use this option before mass operations like this one):
deborphan | xargs apt-get -s -y remove
Now the good stuff. If you wish to add a package, type this:
apt-get install 'name-of-package-to-install
What, don't know what packages to install? Type this. When the list appears, you can peruse (over 13k lines!) or search for things using /search-term:
apt-cache search .* | sort | less
When you're done removing and adding packages, a good way to clean up is by typing this
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P
Also, because the Debian package system keeps a cache of downloaded packages, you may want to run the following to clear out those spare files:
apt-get clean
Internet Access
To use the Internet you need to edit /etc/resolv.conf to add your nameserver or exit the chroot and copy the outer resolv.conf into the chroot folder:
cp /etc/dhcpc/resolv.conf /mnt/hda1/knx/source/KNOPPIX/etc/dhcpc/resolv.conf
(proxies (a.k.a. doing it at work): you can type "export http_proxy=http://your.proxy.com:
To check your chrooted internet connection,
ping google.com
(if ICMP is barred at some corporate firewall or something then try "lynx http://www.google.com" and see if you get the page -after a cookie "allow")
[edit]
SMB access
Also change smb.conf to your MS group if you want smbd support (MSHOME is XP Home ed. usually, and WORKGROUP is 9x Windows)
APT
Update your package list with apt-get update.
Note: If 'apt-get update fails with "FATAL -> Could not set non-blocking flag Bad file descriptor", you need to make sure your chrooted environment is mounted without the "nodev" option. (see above where it talks about the /dev/null errors when entering the chroot environment for the first time)
Warning: apt-get upgrade is a BAD IDEA. It will, quite probably, render your KNOPPIX remaster unbootable, or broken in some way. A far safer method is to only upgrade packages as necessary.
Note: If apt-get fails with "Dynamic NMap ran out of room" you might try this little gem, which fixed the problem for me:
#echo 'APT::Cache-Limit "25168524";'>> /etc/apt/apt.conf
(I did this while chrooted as described above.)
Before you can add stuff, you will probably need to remove some packages. To get a list of packages installed, type this:
dpkg-query -l
If you are looking for big installed packages then the command
dpkg-awk "Status: .* installed$" -- Package Installed-Size | \
awk '{print $2}' | egrep -v '^$' | xargs -n2 echo | \
perl -pe 's/(\S+)\s(\S+)/$2 $1/' | sort -rg
will list the packages with size in descending order.
At least ten times faster is the command
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n
and you don't need dpkg-awk or awk or perl; however it does not exclude packages that are not installed. If you have trouble with the above sort command, try using KPackage, expanded all the trees and sorted by the size column to find big packages.
Or, you could use this command to get the qpkg-query speed with the non-installed packages not listed:
dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}'
It does the same thing as above, I assume. I couldn't get the first one to work because I don't have dpkg-awk.
To remove a package (and all packages dependant on it), type this:
apt-get remove --purge name-of-package-to-remove
To check for orphaned packages, type this:
deborphan
Want to save more space by getting rid of those pesky orphans (how cruel!), type this (Warning, you won't be prompted yes/no to remove these packages. When you press Enter after this command, those packages will be gone):
deborphan | xargs apt-get -y remove
If you're uncertain about the previous command and want to see what will happen without making any changes, just add the -s option to the apt-get command like this (you can do this with all of the apt-get commands, and it's a good habit to use this option before mass operations like this one):
deborphan | xargs apt-get -s -y remove
Now the good stuff. If you wish to add a package, type this:
apt-get install 'name-of-package-to-install
What, don't know what packages to install? Type this. When the list appears, you can peruse (over 13k lines!) or search for things using /search-term:
apt-cache search .* | sort | less
When you're done removing and adding packages, a good way to clean up is by typing this
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P
Also, because the Debian package system keeps a cache of downloaded packages, you may want to run the following to clear out those spare files:
apt-get clean
Setting up for Remastering
- Boot from the Knoppix CD
- Open a root shell:
- Menu: Kmenu->Knoppix->Root Shell
- Note: All commands below are run from this root shell.
- Configure your Internet connection (we'll need this later). If you use DHCP, it should already be configured.
- Note: Run ifconfig to check.
- Find the partition you will use to work on. In this example it is called hda1 . The partition should have a minimum of 3 GB free space
- Mount the partition:
mount -rw /dev/hda1 /mnt/hda1
- Note: Make sure that it is read/write or you will get errors when you later chroot. To check: run mount
- Create a root directory to work in -- if you put all your files here it will be easy to clean up
-
mkdir /mnt/hda1/knx
-
- If you don't have 1 GB RAM (egrep "(MemTotal|SwapTotal)" /proc/meminfo (physical+swap)) then you will need a swapfile:
-
cd /mnt/hda1/knx
dd if=/dev/zero of=swapfile bs=1M count=750
mkswap swapfile
swapon swapfile
-
- Make 2 directories, one for your new Master CD, one for the source, on a disk partition. Also, make additional directories under these named KNOPPIX:
-
mkdir -p /mnt/hda1/knx/master/KNOPPIX
mkdir -p /mnt/hda1/knx/source/KNOPPIX
-
- Now, copy the KNOPPIX files to your source directory :
-
cp -Rp /KNOPPIX/* /mnt/hda1/knx/source/KNOPPIX
- Note: This will take a long time (you are copying 2GB). Warning: you will be tempted to replace this copy command with a much faster procedure: create an empty directory, then use unionfs to merge the empty directory with /KNOPPIX in order to create the read-write copy. However, as of Knoppix 4.0.2, there is a bug in unionfs that causes this faster procedure to fail. For now, stick with the copy-command shown above.
-
- Additionally, copy the 'boot' folder from your cdrom - you'll need these files to build the ISO later.
-
cp -ar /cdrom/boot /mnt/hda1/knx/master/boot
-
- For Knoppix 5.0.1 you also have to copy the 'modules' folder:
-
cp -ar /cdrom/KNOPPIX/modules /mnt/hda1/knx/master/KNOPPIX/.
-
- Copy the main HTML page for the startup page:
-
cp /cdrom/index.html /mnt/hda1/knx/master/
-
- Copy everything necessary files except the ~700 Mb KNOPPIX file.
- <>
-
cd /cdrom/KNOPPIX && find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/hda1/knx/master/KNOPPIX/ \;
- >= 3.4:
-
cd /cdrom && find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/hda1/knx/master/ \;
-
- for the DVD Version you have to use -size -15000k and copy the KNOPPIX2 folder like this
- cp /cdrom/KNOPPIX/KNOPPIX2 /mnt/hda1/knx/master/KNOPPIX/
- setup the environment for chroot
- mount --bind /dev /mnt/hda1/knx/source/KNOPPIX/dev
- mount --bind /proc /mnt/hda1/knx/source/KNOPPIX/proc
- Now you can "chroot" into the copied KNOPPIX:
-
chroot /mnt/hda1/knx/source/KNOPPIX
-
- If you see errors regarding /dev/null, see the common problems section
You are now chrooted. "/" is actually "/mnt/hda1/knx/source/KNOPPIX"
Compiling Beryl for other non-Debian distributions
Before starting, please read the spec files in trunk/distro-specific-build-files directory.
Example beryl-core.spec:
BuildRequires: X11-devel >= 1.0.0
BuildRequires: x11-util-macros >= 1.0.1
BuildRequires: x11-proto-devel
BuildRequires: libpng-devel
BuildRequires: libwnck-devel
BuildRequires: libgnome-window-settings-devel
BuildRequires: gnome-desktop-devel
BuildRequires: libxcomposite-devel
BuildRequires: libxdamage-devel
BuildRequires: intltool
Building
Example for beryl-core:
In trunk directory:
cd /trunk
cp -r distro-specific-build-files/beryl-core/debian/ beryl-core/
cd beryl-core/
chmod +x autogen.sh
chmod +x debian/rules
./autogen.sh --prefix=/usr
dpkg-buildpackage -rfakeroot
When the above is complete, you will have the beryl-core and beryl-core-dev debian packages. Install them with dpkg -i.
The other packages listed above depend on beryl-core and beryl-core-dev. Repeat the above process for them.
Example
....
BuildRequires: beryl-core-devel
Subscribe to:
Posts (Atom)