coLinux - Tools! This package contains tools that can be used to setup and manage your coLinux distributions. This release is still considered alpha. However, there are enough features available to bootstrap a full Linux distribution like GenToo. Requirements: 1. coLinux 0.6.1 or later installed. 2. Base Cygwin install. 3. Adiquate memory and hardware to run coLinux. Where to download: http://docbill.freeshell.org/coLinux/ Installation: Extract this package to any directory you wish, and then run the setup.sh script. Your coLinux installation will be found by checking the registry setting: \HKCU\Software\coLinux\ If this registry setting is not set, you will need to set the COLINUX environmental variable. As an example I would install coLinux install these tools with the following command: cp colinux-tools.exe /usr/local cd /usr/local unzip colinux-tools.exe cd colinux-tools ./setup.sh The tools would then be available in the directory: /cygdrive/e/usr/local/colinux-tools Note1: You may execute colinux-tools.exe instead of using unzip. Contents of this package: GENERAL Files - README.txt You are reading it now. - gpl.txt The GPL license. If you do not accept the terms of this license you must contact Foxtrot Technologies Inc. and obtain a different license and remove this software from your system until you obtain a license that you accept. - bootdisk-no-modules.ext2 This is a read-only filesystem used for running interactive commands and processing image files. Note1: "bootdisk-no-modules.ext2" is built using the source in src/linux, GenToo Linux, and busybox. - bootdisk.ext2 (created by setup.sh) This is a read-only filesystem used for running interactive commands and processing image files. ./mkconfig bootdisk.ext2 > bootdisk.colinux.xml ./colinux bootdisk - src The source directory for the bootdisk /sbin/init program and the Cygwin getScript.exe and putScript.exe programs. Linux Programs (included on the bootdisks) [, addgroup, adduser, ar, arping, ash, awk, basename, bunzip2, busybox, bzcat, cal, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devfsd, df, dirname, dmesg, dos2unix, dpkg, du, dumpkmap, echo, edit, egrep, env, ex, expr, false, fgrep, find, fold, free, freeramdisk, fsck.minix, ftpget, ftpput, getScript, getty, grep, gunzip, gzip, halt, head, hexdump, hostid, hostname, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ipcalc, jfs_mkfs, kill, killall, klogd, last, length, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls, lsmod, man, md5sum, mesg, mkdir, mke2fs, mke2fsfile, mkfifo, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.ext2, mkfs.ext3, mkfs.jfs, mkfs.minix, mkfs.xfs, mknod, mkreiserfs, mkswap, mktemp, modprobe, more, mount, mv, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping, pipe_progress, pivot_root, poweroff, printf, ps, putScript, pwd, readlink, realpath, reboot, reset, rm, rmdir, rmmod, route, rpm, sed, seq, setkeycodes, sh, sleep, sort, start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon, sync, sysctl, syslogd, tail, tar, tee, telnet, telnetd, test, time, top, touch, tr, traceroute, true, tty, udhcpc, umount, uname, uniq, unix2dos, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, wc, wget, which, who, whoami, xargs, yes, zcat Use: 'man' to find out further info about most of the Linux commands. Example: ./mkconfig bootdisk.ext2 > bootdisk.colinux.xml ./colinux bootdisk.ext2 ... In your console window ... man ls Cygwin Programs - setup.sh Create all the other Cygwin scripts and the bootdisk.ext2 filesystem. Example: ./setup.sh - automount (created by setup.sh) A tool to mark a filesystem for mounting when loading from the bootdisk. Calls the Linux mount command. Example: ./mkfs -t ext2 rootfs.ext2 1576M ./automount rootfs.ext2 /mnt/rootfs ./mkconfig bootdisk.iso rootfs.ext2 > example.colinux.xml ./colinux example - colinux (created by setup.sh) A script to invoke a Linux distribution under coLinux. - getScript.exe A program to extract the script appended to the end of an image file with the ./putScript program. If the image file does not have a script no output is printed. Example: vi smallswap.sh ./putScript -i shallwap.sh smallswap.swap 16M - install-gentoo (created by setup.sh) An example script I used to install-gentoo. Once running it you can start "gentoo" with the command "colinux gentoo". You will then need to follow the "gentoo" installation guide to setup networking and such. Start off at chapter 6, and skip chapter nine. If you have coLinux setup to work with dhcpcd, networking will be enabled for you. To use this script you will need both a stage3 tarball and a portage tarball. I found stage1 does not contain the necessary programs for configuring the network. I have not tried stage2. Here are the steps I used to install gentoo: 1. Downloaded a stage1, stage2, or stage3 gentoo tarball. 2. Setup bridging between the network devices under Windows XP. 3. Run ./install-gentoo 5. Verified networking with a ping command. 6. Proceed with the instructions in the gentoo manual starting with chapter six. 7. Ignore chapter nine. 8. After completing the steps, type "exit". 9. Boot gentoo for the first time with the command "./colinux gentoo". - mkconfig (created by setup.sh) A script for creating a coLinux configuration file listing the desired images. Currently, output is to standard out and only image files are supported. If you need custom network settings or such, edit the script before running it. Example: ./mkconfig bootdisk.ext2 > bookdisk.colinux.xml ./colinux bootdisk Optionally bootparams can also be listed, such as networking configuration: ./mkconfig bootdisk.ext2 IPADDRESS=135.162.253.103 \ GATEWAY=135.162.253.254 DNS=24.226.10.93 \ > bootdisk.colinux.xml ./colinux bootdisk Tip: You can set environmental variables such as kernel boot parameters. - mkfs (created by setup.sh) Creates a linux file system. Calls the Linux mkfs command. Example: ./mkfs -t ext2 smallfs.ext2 16M ./mkconfig bootdisk.ext2 smallfs.ext2 > example.colinux.xml ./colinux example - mkreiserfs (created by setup.sh) Creates a Linux ReiserFS file system. Calls the Linux mkreiserfs command. Example: ./mkreiserfs my.reiserfs 4G ./mkconfig bootdisk.ext2 my.reiserfs > example.colinux.xml ./colinux example - putScript.exe Modify or add a script to the specified file. If the file does not exist create it. Example1: ./mkfs -t ext3 medium.ext3 512M ./getScript medium.ext3 > medium.sh vi medium.sh ./putScript -i medium.sh medium.ext3 < medium.sh Example2: ./putScript -c 'mke2fs $1' medium.ext2 512M Note: Script sizes are limited to 65530 bytes. Note: "$1" will be the device the script was extracted from. - untar (created by setup.sh) This is a script for extracting a tar file under the ramdisk. An example would be: ./mkfs -t ext2 -o vmlinux-modules.ext2 32M ./automount vmlinux-modules.ext2 /mnt/modules ./untar ../vmlinux-modules.tar.gz vmlinux-modules.tarball \ /mnt/modules ./mkconfig bootdisk.ext2 vmlinux-modules.ext2 \ vmlinux-modules.tarball > example.colinux.xml ./colinux example ChangeLog: Version 0.21 to 0.22 - Rewrote the scripts to work with the new putScript syntax. - Wrote a setup.sh script that will create the other scripts. - Wrote a mke2fsfile script, to automate creating an ext2 file. - Added code to setup.sh to copy modules from the coLinux directory to build a bootdisk.ext2 file. - Built an image file without modules for use with the new setup.sh script. - Modified init to remount the bootdisk as readonly. ChangeLog: Version 0.20 to 0.21 - Replace the 0.6.0 modules with the 0.6.1 modules. - Removed mkreiserfs wrapper, since this is nolonger neccissary. - Removed sh wrapper, since this is not neccissary... - Implemented copyRecursive and copySymbolic as part of init so the GNU cp -s is nolonger required. - Replace the GNU cp with busybox cp. ChangeLog: Version 0.19 to 0.20 - Modified init to loop over all cobd devices, regardless of how many exist. - Added a -c and -i flags to putScript. Change the default from reading standard input to moving the script that exists within the file. - Replaced the real mount with the busybox mount. - Replaced the real vi with the busybox vi, since I found out I could delete a character with the x key... - Added the busybox virtual terminal commands, since these are supported with 0.6.1 ChangeLog: Version 0.18 to 0.19 - Added networking support. The variables IPADDRESS, NETMASK, GATEWAY, and DNS can be specified for static routing as bootparams. If IPADDRESS is not supplied, DHCP will be used instead. - Added support for the bootparam HALT=true. This causes halt to be called from /etc/init.d/rcS. - Changed the filesystem used for install-gentoo to reiserfs. This is slower, but safer since many colinux distributions do not run fsck each boot. ChangeLog: Version 0.17 to 0.18 - We've come full circle. init.c now replaces /bin/sh again. It turns out that busybox has a problem running scripts, so /initrd/bin/init is used as a wrapper to correct the problem. - Rewrote the mkreiserfs so copying is done exclusively with sparse files. ChangeLog: Version 0.16 to 0.17 - Revised the init.c program to create a symbolic link to busybox for /sbin/init on the new file system. - Added configurations files for additional busybox utilities. - Removed the ability of init to emulate chroot, pivot_root, ... - Added a wrapper program for mkreiserfs as part of init to create reiserfs with /sbin/mkreiserfs on /dev/cobd? ChangeLog: Version 0.15 to 0.16 - Switched to BusyBox utilities. This saves space and allows more commands, including those needed to configure a network connection from the bootdisk. - Added an option to putScript to create a sparse file of the a specified size. - Added a -1 option to putScript to allow one block to be reserved. - Created a blockCount program to return the size of a file in blocks. - Revised the scripts not to use 'bc', 'dd', or any other none standard cygwin utilities. ChangeLog: Version 0.14 to 0.15 - Rewrote the colinux script to read registry settings to determine where coLinux was installed. - Wrote a mkreiserfs script. mkreiserfs does not work on coLinux block devices, so a temporary file is used. ChangeLog: Version 0.13 to 0.14 - Rewrote the cygwin shell scripts to create sparse files. - Modified the script options to be closer to the Linux counterparts. For example, mkfs now accepts all Linux mkfs options. - Added support for additional file systems to the bootdisk.iso file. - Wrote a mkswap script since the mkfs script does not support swap. ChangeLog: Version 0.12 to 0.13 - Wrote getScript and putScript programs for cygwin, to replace the scripts. The plan is to eventually replace all the scripts to allow the option of compiling the programs without Cygwin. - Modified init.c to use the same code to processes scripts under Linux. There is nolonger a default /etc/initrc script. - Renamed ramdisk.iso to bootdisk.iso since ramdisks are not used. ChangeLog: Version 0.11 to 0.12 - Repackaged bootdisk using my genToo installation. - Rebuilt genToo binaries using -Os -m586 options. - Modified init.c to replace chroot, pivot_root, rmdir, true, and false ChangeLog: Version 0.10 to 0.11 - Switched from using a ramdisk to using the tmpfs. - Add a pivot_root call so the contents of the ISO file may still be accessable from the tmpfs. - Renamed the special sh.c to init.c and moved to /sbin/init. - Moved the ramdisk.tar files onto the ISO disk, so there is no need to allocate additional memory to copy the files to. ChangeLog: Version 0.10 - Initial public release ToDo: (Not neccissarily in order.) 1. Rebuild the coLinux kernel to support the dependancies required for cloop.o. - Once cloop.o is supported, add a Knoppix boot script. 2. Change the filesystem script size to be dynamic instead of fixed. 3. Add an option to the putScript program to create a sparse file, so cp and dd will nolonger be required. 4. Once the core scripts have proven themselves reliable, recode as C programs. 5. Write scripts for bootstrapping other Linux distributions. Known Bugs: 1. The syntax for mkconfig is ackward. 2. There is no way to specify an alternate path for the configuration file when running the colinux script. 3. putScript.exe should make sure a file ends at a block boundry. Legal Stuff: Copyright (C) 2004 Foxtrot Technologies Inc. All right reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Contact Foxtrot Technologies Inc. for more information about this software. http://www.foxtrottechnologies.net AUTHOR: Bill C. Riemers http://docbill.freeshell.org