Стиль написания - "лог с примечаниями".
Аудитория - "продвинутые пользователи".
С одной стороны, стиль позволит сделать описанное даже обычному windows-пользователю, а с другой избавляет меня от разжевывания. Большинство материала в сети представляет собой очень общую информацию, у меня на ранних этапах всегда возникал дифицит конкретики. Так вот она, в чистом виде. Периодически буду конечно дописывать старые незаконченные описания настроек того или иного, создавать новые, но уже по ходу дела.
С уважением, Gena.
Введение
Идея
Преамбула
- Noutbook ASUS - P4 2500, 256 Mb, 40 Gb, Net 100Mb, Modem 56k, DVD-combo.
- AMD K6-2 400, 32 Mb DIMM (недавно купил еще 64, но ставить буду с 32-мя), 8 Gb HDD, CD-ROM, ISA Voice-Modem 56k, Net 100Mb - 2шт;
- AMD 486DX2-80, 16 Mb SIMM, 850 Mb HDD, CD-ROM; (пока без бл.пит.)
- AMD Duron 1200 (Гы - остались только мать и проц);
Live-CD
- Компьютер запускает LILO или подобный загрузчик.
- LILO знает где находится ядро и запускает его.
- Запускается ядро, после проведения стандартных тестов, оно монтирует корневую файловую систему.
- После этого запускается /sbin/init и операционная система запускается в соответствии с /etc/inittab и скриптами rc.d.
- Загрузка с CD с ISOLINUX.
- ISOLINUX загружает ядро из каталога /isolinux на CD-диске.
- Затем ISOLINUX загружает initrd.gz, сжатую ext2 файловую систему.
- Важно понимать, что initrd.gz загружается не ядром! Ядро запускается и разжимает initrd.gz в память (обычно в /dev/ram0) и монтирует его в корень. Ядро должно быть собрано с опциями поддержки initrd и ramdisk.
- Ядро пытается запустить linuxrc в новой файловой системе.
- Программа linuxrc в свою очередь пытается примонтировать CD-диск, а затем копирует сжатую основную файловую систему в память (обычно в /dev/ram1). Новая файловая система монтируется и в её каталоге /dev создается символическая ссылка на CD-драйв.
- После завершения работы linuxrc, управление возвращается ядру и оно пытается примонтировать свою сконфигурированную файловую систему. В данном случае, с помощью команды rdev указываем ядру использовать /dev/ram1 в качестве корневой файловой системы, в которой есть /sbin/init и система стартует прямо из памяти.
- Включаем компьютер (можно виртуальный) и грузим Slackware.
- :) Вставляем 1 CD Slackware 10.0 в подставку для кофе.
- Поехали...
root@gena:/:# su
root@gena:/:# mount /home/ftp/pub/download/all/slackware/slackware-10.0-install
-d1.iso /mnt/hd/ -o loop
root@gena:/:# ls /mnt/hd/
ANNOUNCE.10_0 COPYING isolinux slackware
bootdisks COPYRIGHT.TXT kernels Slackware-HOWTO
BOOTING.TXT CRYPTO_NOTICE.TXT PACKAGES.TXT SPEAK_INSTALL.TXT
ChangeLog.txt FAQ.TXT README.TXT SPEAKUP_DOCS.TXT
CHECKSUMS.md5 FILELIST.TXT RELEASE_NOTES UPGRADE.TXT
CHECKSUMS.md5.asc GPG-KEY rootdisks
root@gena:/:# mkdir ~/iso
root@gena:/:# mkdir ~/iso/cdimage
root@gena:/:# mkdir ~/iso/initrd
root@gena:/:# mkdir ~/iso/network
root@gena:/:# cp -R /mnt/hd/isolinux/ ~/iso/cdimage/
root@gena:/:# cd ~/iso/
root@gena:~/iso:# ls cdimage/isolinux/
f2.txt isolinux.bin iso.sort pcmcia.dsk setpkg
f3.txt isolinux.boot message.txt README.TXT
initrd.img isolinux.cfg network.dsk sbootmgr/
root@gena:~/iso:# cd cdimage/isolinux/
root@gena:~/iso/cdimage/isolinux:# cp /mnt/hd/kernels/bare.i/bzImage ./
root@gena:~/iso/cdimage/isolinux:# vi isolinux.cfg
root@gena:~/iso:# cat cdimage/isolinux/isolinux.cfg
default /isolinux/bzImage initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0
ramdisk_size=9999 rw root=/dev/ram SLACK_KERNEL=bare.i
prompt 1
timeout 1
root@gena:~/iso/cdimage/isolinux:# rm -f f2.txt f3.txt iso.sort pcmcia.dsk
root@gena:~/iso/cdimage/isolinux:# rm -f README.TXT setpkg message.txt
root@gena:~/iso/cdimage/isolinux:# rm -rf sbootmgr
root@gena:~/iso/cdimage/isolinux:# ls
bzImage initrd.img isolinux.bin isolinux.boot isolinux.cfg network.dsk
root@gena:~/iso/cdimage/isolinux:# gzip -d initrd.img -S .img
root@gena:~/iso/cdimage/isolinux:# mount initrd /mnt/md/ -o loop
root@gena:~/iso/cdimage/isolinux:# ls /mnt/md/
bin/ cdrom@ etc/ lib/ lost+found/ proc/ sbin/ tag/ usr/
boot@ dev/ floppy/ linuxrc@ mnt/ root/ sys/ tmp/ var/
root@gena:~/iso/cdimage/isolinux:# cp -r /mnt/md/* ../../initrd/
root@gena:~/iso/cdimage/isolinux:# umount /mnt/md/
root@gena:~/iso/cdimage/isolinux:# mount network.dsk /mnt/md/ -o loop
root@gena:~/iso/cdimage/isolinux:# cp -r /mnt/md/* ../../network
root@gena:~/iso/cdimage/isolinux:# umount /mnt/md/
root@gena:~/iso/cdimage/isolinux:# cd ../../initrd/
root@gena:~/iso/initrd:# ls
bin/ cdrom@ etc/ lib/ lost+found/ proc/ sbin/ tag/ usr/
boot@ dev/ floppy/ linuxrc@ mnt/
root@gena:~/iso/initrd:# vi ./bin/network
reading ./bin/network
wrote ./bin/network, 172 lines, 4761 chars
root@gena:~/iso/initrd:# vi ../network/scripts/network.sh
reading ../network/scripts/network.sh
wrote ../network/scripts/network.sh, 170 lines, 5102 chars
root@gena:~/iso/initrd:# vi ./etc/rc.d/rc.S
reading ./etc/rc.d/rc.S
wrote ./etc/rc.d/rc.S, 164 lines, 4732 chars
root@gena:~/iso/initrd:# echo /sbin/ifconfig eth0 192.168.6.148 >>
etc/rc.d/rc.inet1
root@gena:~/iso/initrd:# echo /sbin/route add -net 192.168.6.0 broadcast
192.168.6.255 netmask 255.255.255.0 eth0 >> etc/rc.d/rc.inet1
root@gena:~/iso/initrd:# cd ..
root@gena:~/iso:# vi build-cd
reading build-cd
wrote build-cd, 31 lines, 769 chars
root@gena:~/iso:# chmod +x build-cd
root@gena:~/iso:# ./build-cd
9999+0
9999+0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2512 inodes, 9996 blocks
0 blocks (0.00%) reserved for the super user
First data block=1
2 block groups
8192 blocks per group, 8192 fragments per group
1256 inodes per group
Superblock backups stored on blocks:
8193
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
1604+0
1604+0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
200 inodes, 1604 blocks
0 blocks (0.00%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
200 inodes per group
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 960
Total directory bytes: 2048
Path table size(bytes): 26
Max brk space used 5000
2904 extents written (5 MB)
root@gena:~/iso:# tar xzf /mnt/hd/slackware/n/openssh-3.8.1p1-i486-1.tgz
-C initrd/
root@gena:~/iso:# echo /etc/rc.d/rc.sshd start >> initrd/etc/rc.d/rc.S
root@gena:~/iso:# cp /usr/bin/passwd initrd/usr/bin/
root@gena:~/iso:# cd initrd/
root@gena:~/iso/initrd:# chroot ./
root@H:/:# /bin/sh /install/doinst.sh
root@H:/:# rm -rf /install/
root@H:/:# passwd
Changing password for root
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
Password changed.
root@H:/:# cat /etc/shadow
root:$1$o08/aP6t$jeKz1v/BZW3uQl5AY2tnx0:12795:0:::::
halt:*:9797:0:::::
operator:*:9797:0:::::
shutdown:*:9797:0:::::
sync:*:9797:0:::::
bin:*:9797:0:::::
ftp:*:9797:0:::::
daemon:*:9797:0:::::
adm:*:9797:0:::::
lp:*:9797:0:::::
mail:*:9797:0:::::
news:*:9797:0:::::
uucp:*:9797:0:::::
man:*:9797:0:::::
games:*:9797:0:::::
guest:*:9797:0:::::
nobody:*:9797:0:::::
sshd:*:9797:0:::::
root@H:/:# exit
root@gena:~/iso/initrd:# cp -d /usr/lib/libcrypto.so* lib/
root@gena:~/iso/initrd:# cp -d /usr/lib/libz.so* lib/
root@gena:~/iso/initrd:# chroot ./
root@H:/:# /etc/rc.d/rc.sshd start
Generating public/private rsa1 key pair.
Your identification has been saved in /etc/ssh/ssh_host_key.
Your public key has been saved in /etc/ssh/ssh_host_key.pub.
The key fingerprint is:
2a:f1:a4:04:bf:00:37:a1:6f:70:e1:e3:13:d3:f9:c1 root@gena
Generating public/private dsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
3d:04:ce:f4:c5:d3:7f:51:a4:43:29:ad:f2:7f:1b:2d root@gena
Generating public/private rsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
73:8f:21:6e:9d:27:31:5e:69:9d:10:a6:24:4b:27:67 root@gena
root@H:/:# exit
root@gena:~/iso:# cd initrd/
root@gena:~/iso/initrd:# rm -f bin/bash
root@gena:~/iso/initrd:# cp /bin/bash bin/bash
root@gena:~/iso/initrd:# ln -sf bin/bash bin/ash
root@gena:~/iso/initrd:# cp -d /usr/lib/libhistory.so* lib/
root@gena:~/iso/initrd:# cp -d /usr/lib/libreadline.so* lib/
root@gena:~/iso/initrd:# cp -d /lib/libtermcap.so.2* lib/
root@gena:~/iso/initrd:# du -hs
9.6M
root@gena:~/iso/initrd:#../build-cd
9999+0 входных записей
9999+0 выходных записей
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2512 inodes, 9996 blocks
0 blocks (0.00%) reserved for the super user
First data block=1
2 block groups
8192 blocks per group, 8192 fragments per group
1256 inodes per group
Superblock backups stored on blocks:
8193
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
1604+0 входных записей
1604+0 выходных записей
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
200 inodes, 1604 blocks
0 blocks (0.00%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
200 inodes per group
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 960
Total directory bytes: 2048
Path table size(bytes): 26
Max brk space used 5000
3664 extents written (7 MB)
root@gena:~/iso/initrd:# cdrecord dev=ATAPI:0,1,0 blank=fast
Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 JЖrg Schilling
cdrecord: Warning: Running on Linux-2.6.10
cdrecord: There are unsettled issues with Linux-2.5 and newer.
cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.
scsidev: 'ATAPI:0,1,0'
devname: 'ATAPI'
scsibus: 0 target: 1 lun: 0
Warning: Using ATA Packet interface.
Warning: The related Linux kernel interface code seems to be unmaintained.
Warning: There is absolutely NO DMA, operations thus are slow.
Using libscg version 'schily-0.8'.
Device type : Removable CD-ROM
Version : 0
Response Format: 2
Capabilities :
Vendor_info : 'TOSHIBA '
Identifikation : 'DVD-ROM SD-R2312'
Revision : '1708'
Device seems to be: Generic mmc2 DVD-ROM.
Using generic SCSI-3/mmc CD-R/CD-RW driver (mmc_cdr).
Driver flags : MMC-3 SWABAUDIO BURNFREE
Supported modes: TAO PACKET SAO R96P R96R R96R
Starting to write CD/DVD at speed 10 in real BLANK mode for single session.
Last chance to quit, starting real write 0 seconds. Operation starts.
root@gena:~/iso/initrd:# cdrecord dev=ATAPI:0,1,0 ../iso.img
cdrecord: No write mode specified.
cdrecord: Asuming -tao mode.
cdrecord: Future versions of cdrecord may have different drive dependent
defaults.
cdrecord: Continuing in 5 seconds...
Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jrg
Schilling
cdrecord: Warning: Running on Linux-2.6.10
cdrecord: There are unsettled issues with Linux-2.5 and newer.
cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.
scsidev: 'ATAPI:0,1,0'
devname: 'ATAPI'
scsibus: 0 target: 1 lun: 0
Warning: Using ATA Packet interface.
Warning: The related Linux kernel interface code seems to be unmaintained.
Warning: There is absolutely NO DMA, operations thus are slow.
Using libscg version 'schily-0.8'.
Device type : Removable CD-ROM
Version : 0
Response Format: 2
Capabilities :
Vendor_info : 'TOSHIBA '
Identifikation : 'DVD-ROM SD-R2312'
Revision : '1708'
Device seems to be: Generic mmc2 DVD-ROM.
Using generic SCSI-3/mmc CD-R/CD-RW driver (mmc_cdr).
Driver flags : MMC-3 SWABAUDIO BURNFREE
Supported modes: TAO PACKET SAO R96P R96R R96R
Starting to write CD/DVD at speed 10 in real TAO mode for single session.
Last chance to quit, starting real write 0 seconds. Operation starts.
Turning BURN-Free off
Track 01: Total bytes read/written: 7503872/7503872 (3664 sectors).
Ой, чуть не забыл :)) - root password: slackware
ВСЕ!
А вот как выглядит Апофеоз:
gena@gena:~:$ ssh root@192.168.6.148
The authenticity of host '192.168.6.148 (192.168.6.148)' can't be established.
RSA key fingerprint is 2d:fb:c4:4d:10:00:7f:06:fb:4e:db:a2:63:b3:f6:df.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.6.148' (RSA) to the list of known hosts.
root@192.168.6.148's password:
Linux 2.4.26.
If you're upgrading an existing Slackware system, you might want to
remove old packages before you run 'setup' to install the new ones. If
you don't, your system will still work but there might be some old files
left laying around on your drive.
Just mount your Linux partitions under /mnt and type 'pkgtool'. If you
don't know how to mount your partitions, type 'pkgtool' and it will tell
you how it's done.
To partition your hard drive(s), use 'cfdisk' or 'fdisk'.
To activate PCMCIA/Cardbus devices needed for installation, type 'pcmcia'.
To activate network devices needed for installation, type 'network'.
To start the main installation, type 'setup'.
root@slackware:~1