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 <mh+knoppix-remaster@zugschlus.de> | ||
+ | # 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 <mh+knoppix-remaster@zugschlus.de> | ||
+ | # 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* |
Revision as of 10:45, 20 February 2005
Переводы:
Knoppix Remastering Howto Deutsch Knoppix Remastering Howto Spanish en español Knoppix Remastering Howto French Knoppix Remastering Howto Indonesian Knoppix Remastering Howto Russian
Смотрите также :
Knoppix Custom Kernel Howto Using and Customizing Knoppix
===
====
- CD-ISO
- DVD-ISO
====
- Откройте root shell:
- Меню: Kmenu->Knoppix->Root Shell
- Смонтируйте раздел :
mount -rw /dev/hda1 /mnt/hda1
mount
mkdir /mnt/hda1/knx
cat /proc/meminfo
cd /mnt/hda1/knx ; dd if=/dev/zero of=swapfile bs=1M count=750 ; mkswap swapfile ; swapon swapfile
mkdir -p /mnt/hda1/knx/master/KNOPPIX mkdir -p /mnt/hda1/knx/source/KNOPPIX
cp -Rp /KNOPPIX/* /mnt/hda1/knx/source/KNOPPIX
cp /cdrom/index.html /mnt/hda1/knx/master/
- < 3.4 :
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/ \;
chroot /mnt/hda1/knx/source/KNOPPIX
mount /dev/hdaX on /mnt/hdaX type ext3 (rw,nosuid,nodev)
^d # control+d выйти из chroot mount /dev/hda1 /mnt/hda1
mount /dev/hda1 on /mnt/hda1 type ext3 (rw)
mkdir /mnt/hda1/knx/source/KNOPPIX/KNOPPIX mount --bind /KNOPPIX /mnt/hda1/knx/source/KNOPPIX mount --bind /dev /mnt/hda1/knx/source/KNOPPIX/dev
umount /mnt/hda1/knx/source/KNOPPIX/dev ; rm /mnt/hda1/knx/source/KNOPPIX/KNOPPIX
mount -t proc /proc proc
cp /etc/dhcpc/resolv.conf /mnt/hda1/knx/source/KNOPPIX/etc/dhcpc/resolv.conf
ping google.com
- Обновите Ваши пакеты командой :
apt-get update
dpkg-query -l
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n
apt-get remove --purge <name-of-package-to-remove>
deborphan
deborphan | xargs apt-get -y remove
deborphan | xargs apt-get -s -y remove
apt-get install <name-of-package-to-install>
<search-term> :
apt-cache search .* | sort | less
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P
apt-get clean
umount /proc
====
export DISPLAY=localhost:0.0
- Файл фона X-ов лежит в /cdrom/KNOPPIX/background.gif (в knoppix 3.4: background.jpg)
- Так же как floppyconfig, cdromconfig будет запущен как cdrom/KNOPPIX/knoppix.sh
rm -rf /mnt/hda1/knx/source/KNOPPIX/.rr_moved
mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" -hide-rr-moved -cache-inodes -no-bak -pad /mnt/hda1/knx/source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs - 65536 > /mnt/hda1/knx/master/KNOPPIX/KNOPPIX
cd /mnt/hda1/knx/master rm -f KNOPPIX/md5sums; find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; >> KNOPPIX/md5sums
<= 3.3 :
mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -hide-rr-moved -o /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master
mkisofs -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master
Советы
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
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n
и не нужна dpkg-awk или awk или perl.
apt-get remove --purge pkg-name
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' >topurge
dpkg -P `cat topurge `
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P
dpkg -P `cat orphaned `". "deborphan | xargs dpkg -P
- Примечание по swap:
- Патч Justinа [
====
[
qemu -m 128 -cdrom /temp/knoppix-custom.iso -boot d -user-net
====
title KNOPPIX root (hd0,0) kernel /boot.knoppix/vmlinuz 2 fromhd=/dev/hda4 lang=us initrd /boot.knoppix/miniroot.gz
Другие Howto на http://www.stirnimann.com/mystuff/doc/knoppix.txt
[
. (invoke ../remaster from here) |-- master (invoke ../../от | |-- 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 <mh+knoppix-remaster@zugschlus.de> # 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/createcompressedfs - 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
#!/bin/bash -x # This script will loop-mount boot floppy and initrd image # Copyright (C) 2004 by Marc Haber <mh+knoppix-remaster@zugschlus.de> # 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*