Difference between revisions of "Knoppix Remastering Howto Russian"
From Knoppix Documentation Wiki
| Line 224: | Line 224: | ||
Другие Howto на http://www.stirnimann.com/mystuff/doc/knoppix.txt | Другие Howto на http://www.stirnimann.com/mystuff/doc/knoppix.txt | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | . (invoke ../remaster from here) | ||
| + | |||
| + | | |-- KNOPPIX | ||
| + | |||
| + | |||
| + | | | `-- (другие мелкие файлы) | ||
| + | | `-- index.html | ||
| + | `-- source | ||
| + | `-- KNOPPIX (this directory can be chrooted into) | ||
| + | |-- bin | ||
| + | |-- boot | ||
| + | |-- cdrom | ||
| + | |-- dev | ||
| + | |-- etc | ||
| + | |-- floppy | ||
| + | |-- home | ||
| + | |-- initrd | ||
| + | |-- lib | ||
| + | |-- mnt | ||
| + | |-- none | ||
| + | |-- opt | ||
| + | |-- proc | ||
| + | |-- root | ||
| + | |-- sbin | ||
| + | |-- tmp -> /var/tmp | ||
| + | |-- usr | ||
| + | |-- var | ||
| + | `-- vmlinuz -> boot/vmlinuz-2.4.22-xfs | ||
| + | ---- | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | #!/bin/bash -x | ||
| + | # This script builds a new KNOPPIX ISO image. | ||
| + | # Copyright (C) 2004 by Marc Haber <[email protected]> | ||
| + | # License: GPL V2 | ||
| + | |||
| + | ROOT="$PWD" | ||
| + | SOURCE="$ROOT/source/KNOPPIX" | ||
| + | MASTER="$ROOT/master" | ||
| + | CLOOPTARGET="$ROOT/master/KNOPPIX/KNOPPIX" | ||
| + | TARGET="$ROOT" | ||
| + | EXCLUDELIST="$ROOT/source/excludelist" | ||
| + | |||
| + | rm -rf $SOURCE/.rr_moved | ||
| + | |||
| + | cd $SOURCE | ||
| + | mkisofs -R -U -V "KNOPPIX.net filesystem" \ | ||
| + | -P "KNOPPIX www.knoppix.net" \ | ||
| + | -hide-rr-moved -cache-inodes -no-bak -pad \ | ||
| + | -exclude-list $EXCLUDELIST \ | ||
| + | . | nice -5 /usr/bin/create''compressed''fs - 65536 > $CLOOPTARGET | ||
| + | |||
| + | cd $MASTER | ||
| + | rm -f KNOPPIX/md5sums | ||
| + | find -type f -not -name md5sums -not -name boot.cat -exec md5sum {} \; >> KNOPPIX/md5sums | ||
| + | mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img \ | ||
| + | -c KNOPPIX/boot.cat -hide-rr-moved -o $TARGET/knoppix.iso $MASTER | ||
| + | ---- | ||
| + | |||
| + | |||
| + | |||
| + | <!-- lines starting with space a preformatted --> | ||
| + | #!/bin/bash -x | ||
| + | # This script will loop-mount boot floppy and initrd image | ||
| + | # Copyright (C) 2004 by Marc Haber <[email protected]> | ||
| + | # License: GPL V2 | ||
| + | unset CDPATH || true | ||
| + | |||
| + | # if not root, re-invoke self as root | ||
| + | if [[ "`id -u`" -ne 0 ]]; then | ||
| + | export LOCUSER="$USER" | ||
| + | export LOCHOME="$HOME" | ||
| + | if [[ "${SHELLOPTS/xtrace/}" != "$SHELLOPTS" ]]; then | ||
| + | sudo bash -x $0 $@ | ||
| + | exit $? | ||
| + | else | ||
| + | sudo $0 $@ | ||
| + | exit $? | ||
| + | fi | ||
| + | else | ||
| + | LOCUSER="${LOCUSER:-$USER}" | ||
| + | LOCHOME="${LOCHOME:-$HOME}" | ||
| + | fi | ||
| + | set -e | ||
| + | |||
| + | KNOPPIXDIR="KNOPPIX" | ||
| + | BOOTIMGFILE="$KNOPPIXDIR/boot.img" | ||
| + | BOOTIMGFS="vfat" | ||
| + | BOOTIMGDIR="boot.img" | ||
| + | INITRDGZ="$BOOTIMGDIR/miniroot.gz" | ||
| + | INITRDFILE="$KNOPPIXDIR/miniroot" | ||
| + | INITRDFS="ext2" | ||
| + | INITRDDIR="miniroot" | ||
| + | |||
| + | mountbootimage() { | ||
| + | if ! modprobe loop; then | ||
| + | echo >&2 "ERR: cannot load loop module" | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | if ! [[ -e "$BOOTIMGFILE" ]]; then | ||
| + | echo >&2 "ERR: no $BOOTIMGFILE found" | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | for nofile in $BOOTIMGDIR $INITRDGZ $INITRDFILE $INITRDDIR; do | ||
| + | if [[ -e "$nofile" ]]; then | ||
| + | echo >&2 "ERR: $nofile already exists" | ||
| + | exit 1 | ||
| + | fi | ||
| + | done | ||
| + | |||
| + | mkdir -p $BOOTIMGDIR | ||
| + | mount -o loop,uid=$LOCUSER -t $BOOTIMGFS $BOOTIMGFILE $BOOTIMGDIR | ||
| + | |||
| + | < $INITRDGZ gunzip > $INITRDFILE | ||
| + | mkdir -p $INITRDDIR | ||
| + | mount -o loop -t $INITRDFS $INITRDFILE $INITRDDIR | ||
| + | } | ||
| + | |||
| + | umountbootimage() { | ||
| + | dd if=/dev/zero of=$INITRDDIR/nullfile || true | ||
| + | sync | ||
| + | rm $INITRDDIR/nullfile | ||
| + | umount $INITRDDIR | ||
| + | rmdir $INITRDDIR | ||
| + | < $INITRDFILE gzip --best > $INITRDGZ | ||
| + | rm -f $INITRDFILE | ||
| + | |||
| + | umount $BOOTIMGDIR | ||
| + | rmdir $BOOTIMGDIR | ||
| + | |||
| + | syslinux KNOPPIX/boot.img | ||
| + | } | ||
| + | |||
| + | case "`basename $0`" in | ||
| + | mountbootimage) | ||
| + | mountbootimage | ||
| + | ;; | ||
| + | umountbootimage) | ||
| + | umountbootimage | ||
| + | ;; | ||
| + | *) | ||
| + | echo >&2 "ERR: called with unknown name `basename $0`" | ||
| + | exit 1 | ||
| + | ;; | ||
| + | esac | ||
| + | |||
| + | |||
| + | (от gnarvaja) | ||
| + | |||
| + | |||
| + | |||
| + | #!/bin/bash | ||
| + | # Assumes that the current directory is the working space | ||
| + | # original.iso is an image of the CD we will be using as master | ||
| + | mount -t iso9660 original.iso ./oldcd -o ro,loop | ||
| + | # initialize the compressed loop device | ||
| + | losetup /dev/cloop1 ./oldcd/KNOPPIX/KNOPPIX | ||
| + | mount -t iso9660 /dev/cloop1 ./KNOPPIX -o ro,loop | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | # !/bin/bash | ||
| + | # Clean package files generated by aptitude | ||
| + | rm /var/log/aptitude | ||
| + | rm /var/lib/apt/lists/*debian* | ||
| + | rm /var/lib/apt/lists/*knoppix* | ||