Next
Previous
Contents
Polla apo ta parapanw efarmozontai epishs se ekkinhsh apo cd-rom. Mia
pou - etsi ki alliws - h8ela na gracw kai gia ekkinhsh apo cd-rom,
pros8etw edw tis katallhles plhrofories, wste na mhn janagracw dyo fores
ta idia pragmata.
Giati na 8eloyme na bootaroyme enan H/Y apo cd-rom; H ekkinhsh apo
cd-rom mas endiaferei se periptwseis, opoy 8eloyme na trejoyme mia polu
eidikh efarmogh, px ena kiosk (s.t.m. : Des to Kiosk HowTo), ena programma
bashs dedomenwn biblio8hkhs, h ena intenet cafe, kai den exoyme diktyo h
server, gia na kanoyme sthsimo root over nfs.
H basikh arxh pali einai aplh : na ekkinhsoyme ws root m' ena cd-rom.
Gia na mporesoyme : 8a xrhsimopoihsoyme thn epektash rockridge, gia na
topo8ethsoyme ena unix-like filesystem epanw sto cd, kai thn epektash
Eltorito, gia na kanoyme to cd ekkinhsimo.
Ta pragmata den mporei na einai toso apla
Fysika, ayto to sthsimo paroysiazei merika problhmata. Ta perissotera
einai ta idia me ta parapanw :
- 8a xreiastoume prosbash eggrafhs sta : /dev, /var & /tmp.
- 8a xrhsimopoihsoyme tis idies luseis, opws gia to root over nfs
(des parapanw) :
- Gia to /dev , 8a xrhsimopoihsoyme to Devfs .
- Gia ta /var kai /tmp , 8a xrhsimopoihsoyme ena diamoirasmeno
(shared) ramdisk toy 1 MB. To kanoyme shared, gia na xrhsimopoihsoyme ton
xwro oso apotelesmatikotera ginetai. To /tmp antika8istatai m' ena symlink
pros to /var/tmp , gia na katasthsoyme dynato ton diamoirasmo.
- Doyleuei ej isoy kala to na gemisoyme to ramdisk me tarballs, h
protypa (template) directories. Omws, einai polu eykolotero na kanoyme
allages me ta protypa dirs, ara 8a xrhsimopoihsoyme ayta.
- Merikes efarmoges xreiazontai prosbash eggrafhs sto /home.
- Balte sto /var ta home directories twn xrhstwn poy 8a trejoyn tis
efarmoges aytes, kai gemiste ta me ta ypoloipa periexomena toy /var se
ka8e epanekkinhsh.
- To /etc/mtab prepei na mporei na grafetai :
- Ftiajete ena link pros to /proc/mounts kai dhmioyrghste ena adeio
arxeio mounts sto /proc, opws parapanw.
Twra, poy gnwrizoyme ti na kanoyme kai pws, hr8e h stigmh na ftiajoyme
ena dokimastiko sthsimo :
- Kat' arxhn, parte enan H/Y ap' aytous poy 8elete na xrhsimopoihsete,
kai balte mesa enan megalo sklhro disko ki ena cd recorder.
- Balte to Linux poy sas aresei epanw s' ayto to mhxanhma, ki afhste
eleu8erh mia partition twn 650 MB gia to dokimastiko sthsimo. Ayth h
egkatastash 8a fanei xrhsimh sto na ftiajoyme to iso-image toy cd kai na to
rijoyme sta cd's ekkinhshs, ara egkatasthste ta aparaithta ergaleia. Epishs,
8a mas xreiastei sto na dior8wsoyme ola ta bugs, poy den mas epitrepoyn na
bootaroyme to mhxanhma ths dokimhs.
- Egkatasthste to Linux ths epiloghs sas epanw sthn partition twn 650
MB, me to sthsimo poy 8elete na perasei kai sto cd. Ayto 8a einai kai to
sthsimo poy 8a xrhsimopoihsoyme stis dokimes.
- 3ekinhste apo th dokimastikh partition.
- Kante compile enan pyrhna, opws perigracame sto tmhma 3.1 .
Akoloy8hste ola ta bhmata, dioti oi aparaithtes allages gia to devfs
ejakoloy8oun na xreiazontai! Sto bhma 3 toy tmhmatos 3.1, pros8este ta ejhs :
- isofs compiled mesa ston pyrhna
- devfs compiled mesa ston pyrhna
- yposthrijh cdrom compiled mesa ston pyrhna
- o,ti allo xreiazeste, eite compiled mesa ston pyrhna, eite ws module.
- Ry8miste to dokimastiko sthsimo :
- Dhmioyrghste ton xrhsth, poy 8a trejei thn efarmogh.
- Balte to home directory toy sto /var.
- An xreiastei, egkatasthste thn efarmogh.
- An xreiastei, kante ry8miseis gia thn efarmogh.
- Kante tis ry8miseis toy sygkekrimenoy xrhsth, wste h efarmogh na
trejei aytomata meta to login.
- Ry8miste to Linux, wste aytomata na kanei login gia ton xrhsth.
- Ry8miste o,tidhpote allo xreiazetai ru8mish.
- Dokimaste to oti ola doyleuoyn swsta.
- Ekkinhste thn kyriws egkatastash kai kante mount thn partition twn
650 MB sto directory /test ths kyriws egkatastashs.
- Balte ta parakatw s' ena arxeio, me to onoma /test/etc/rc.d/rc.iso .
To source aytou toy arxeioy mpainei sthn arxh toy rc.sysinit, gia na
ftiajei to /var .
#/var
echo Ftiaxnoume to /var ...
mke2fs -q -i 1024 /dev/ram1 1024
mount /dev/ram1 /var -o defaults,rw
cp -a /lib/var /
#Epanaferoume tis ry8miseis tou devfs, xreiazomaste to proc
mount -t proc /proc /proc
/etc/rc.d/rc.devfs restore /etc/sysconfig
umount /proc
- Dior8wnoyme to /test/etc/rc.sysinit , bazontas sxolio stis grammes
opoy o root fortwnetai rw, kai pros8etoyme tis akoloy8es 2 grammes amesws
meta ton orismo toy PATH :
#gia na bootaroume apo cdrom
. /etc/rc.d/rc.iso
- Antigrafoyme ta parakatw s' ena script kai to ekteloume. Ayto 8a
ftiajei ena protypo gia to /var kai 8a dhmioyrghsei ta links twn /tmp kai
/etc/mtab.
#!/bin/sh
echo tmp
rm -fR /test/tmp
ln -s var/tmp /test/tmp
###
echo mtab
touch /test/proc/mounts
rm /test/etc/mtab
ln -s /proc/mounts /test/etc/mtab
###
echo var
mv /test/var/lib /test/lib/var-lib
mv /test/var /test/lib
mkdir /test/var
ln -s /lib/var-lib /test/lib/var/lib
rm -fR /test/lib/var/catman
rm -fR /test/lib/var/log/httpd
rm -f /test/lib/var/log/samba/*
for i in `find /test/lib/var/log -type f`; do cat /dev/null > $i; done
rm `find /test/lib/var/lock -type f`
rm `find /test/lib/var/run -type f`
- Afairwntas th dhmioyrgia toy /etc/issue* apo to /test/etc/rc.local,
apla 8a to anagkasoyme na apotuxei.
- Twra epanekkinoume th dokimastikh partition, h opoia 8a diabastei
apla san ena cd-rom. An kati den doylecei, epanekkinhste me thn kyriws
partition, dior8wste to, janadokimaste to, k.o.k. . H, mporeite na kanete
remount / rw th dokimastikh partition, na to dior8wsete, kai na
epanekkinhsete katey8eian me th dokimastikh partition jana. Gia na kanete
remount / rw , dwste :
mount -o remount,rw /
Ftiaxnontas ena boot image
Prwta-prwta, ekkinhste me thn kyriws partition. Gia na ftiajete ena
ekkinhsimo cd, 8a xreiasteite ena image mias bootable disketas. Den 8a
doylecei to aplo dd s' ena zimage, epeidh o loader sthn arxh toy zimage
den fainetai n' agapaei thn ceutikh disketa, poy dhmioyrgei to ekkinhsimo
cd. Etsi, 8a xrhsimopoihsoyme to syslinux :
- Pairnoyme to boot.img apo ena cd toy RedHat
- Kanoyme mount to boot.img kapoy anamesa sto loopback, dinontas :
mount boot.img kapou -o loop -t vfat
- Afairoume o,tidhpote apo to boot.img , ektos apo ta :
- Antigrafoyme to kernel image ths dokimastikhs partition sto boot.img .
- Dior8wnoyme to syslinux.cfg , wste na periexei ta ejhs
(antika8istwntas, fysika, to zImage me to katallhlo onoma image) :
default linux
label linux
kernel zImage
append root=/dev/<balte edw to onoma tou cdrom sas>
- Umount boot.img:
umount kapou
- An to /etc/mtab sas einai link gia to /proc/mounts , to umount den 8'
afhsei aytomata eleu8ero to /dev/loop0 , synepws eley8erwste to dinontas :
losetup -d /dev/loop0
Dhmioyrgwntas to iso image
Afou exoyme to boot image kai mia egkatastash poy mporei na jekinhsei
apo ena readonly mount, eftase h stigmh na ftiajoyme ena iso image toy cd :
- Antigracte to boot.img sto /test
- Kante cd sto directory, opoy 8elete n' apo8hkeusete to image.
Bebaiw8eite oti brisketai epanw se mia partition me arketo eleu8ero xwro.
- Twra, ftiajte to image, plhktrologwntas :
mkisofs -R -b boot.img -c boot.catalog -o boot.iso /test
Epalh8euontas to iso image
- Kante mount to image anamesa sto loopback device, dinontas :
mount boot.iso kapou -o loop -t iso9660
- Twra epibebaiwste oti ta periexomena einai entajei.
- Kante umount to boot.iso :
umount kapou
- An to /etc/mtab sas einai link pros to /proc/mounts , to umount den
8' apeley8erwsei aytomata to /dev/loop0 . Ayto eley8erwste to,
plhktrologwntas :
losetup -d /dev/loop0
Grafontas to CD
Ypo8etontas oti exete egkatasthsei kai ry8misei to cdrecord gia ton
eggrafea sas, dwste :
cdrecord -v speed=<epi8umhth taxuthta eggrafhs> dev=<path
pros to generic scsi device tou eggrafea sas> boot.iso
E, o titlos ayths ths paragrafoy ta leei ola! ;)
Next
Previous
Contents