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. Adiquate memory and hardware to run coLinux. Recommended: (Neccissary to run the scripts...) 1. Unix commands 'bash' and 'rm'. Available from Cygwin or MinGW. 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. To extract the package, you may either use unzip, or you may run the executable. Next, if you have installed a version of bash and rm, run setup.sh to create the scripts. (You may need to edit setup.sh and NOTICE.txt to change the path to your scripts...) Example: I would install coLinux install these tools with the following cygwin commands: 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 Windows Programs - 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 - 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. - blockcount.exe Count the number of 64k blocks in a file. (The optional second argument can be the blocksize. Example: ./blockcount rootfs.ext2 8192 - pathconvert.exe If cygwin1.dll can be found, converts a cygwin path to a standard windows path. Otherwise the path is printed without conversion. Equivalent to the cygwin command "cygpath -W", but does not introduce a cygwin dependancy. Example: ./pathconvert /cygdrive/c/coLinux NOTE: The special value %COLINUX% may be used to refer to the coLinux installation directory. Example: ./pathconvert "%COLINUX%" - cygwin-pathconvert.exe For internal use. Do not call directly. - sparsecopy.exe Copy a file or directory with the sparse attribute on the newly created files. '-' may be used for standard input and output. Example: ./sparsecopy rootfs.ext2 newrootfs.ext2 - coLinux-wrapper.exe Wrapper to find and execute coLinux-daemon.exe. The value of the registry entry HKEY_CURRENT_USER\Software\coLinux\ is used to find coLinux executables. Windows Bash Shell Scripts - setup.sh Create all the other shell 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. - 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 - 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 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. Once the core scripts have proven themselves reliable, recode as C programs. 4. 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. 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