You are on page 1of 3

Linux kurs

mkfs make filesystem


dev device folder
-t -type
mount mozemo da koristimo kada zelimo da povucemo neke rezultate obrade sa nekog
servera.
mount mount a file system. All files accessible in a Unix system are arranged in one big
tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The
mount command serves to attach the file system found on some device to the big file tree.
cp copy
loop kruzi po fajlu, ako nemamo fizicki cd. Prolazi kroz fajl dok ne prodje kroz sve
podatke
Treba pripaziti na koriscenje komande root!!!

SSH Secure Shell:


moze da se kompajlira sa GNU C
ne koristi floating point brojeve pri programiranju kernela
sudo chown -R rtrkl:rtrkll <zeljena destinacija> - otkljucavanje zakljucanih foldera
make allnoconfig koristi se u Embedded sistemima (za minimalisticki sistem)

chown Change owner, change the user and/or group ownership of each given File to a
new Owner. Chown can also change the ownership of a file to match the user/group of an
existing reference file.

KOMPAJLIRANJE I INSTALIRANJE KERNELA:

make

sudo make install

sudo make modules_install


PATCH-ovanje:
bzcat ..//patch-2.6.11.bz2 /patch -p1
bzcat (or bzip2 -dc) decompresses all specified files to the standard output.
cd..
mv linux-2.6.10 linux-2.6.11
vi patch-2.6.11.bz2
Ctrl + Alt oslobadja mis iz qemu terminala!

Raspakivanje sourca:
sudo tar -xf linux-2.6.26.3.tar.bz2 ili bez sudo ako ne zelimo da dobijemo lokovan folder.
Dodavanje u path (svejedno je gdje se nalazimo):
export PATH=/mnt/labs/mips-toolchain/usr/bin/:$PATH
export LD_LIBRARY_PATH=/mnt/labs/mips-toolchain/usr/lib/:$LD_LIBRARY_PATH
u Makefile-u mijenjamo:
ARCH ?= mips
CROSS_COMPILE
?= mips-linux../ - vraca se u kernel
.ko kernel object file
cp linux<verzija>.config .config
sudo cp qemu-ifup /usr/bin/qemu-ifup
sudo cp qemu-isdown /usr/bin/qemu-ifdown
sudo apt-get install nfs-kernel-server
sudo cp exports /etc/exports

/etc/exports znaci da smo u rootu

qemu:
Instaliranje qemu-a:

qemu-kvm-extras
df_andi pustanje demo u qemuu (pingvini se krecu po povrsini)
sudo apt-get install

insmod /src/hello_version.ko za pozdrav na pocetku


rmmod helloversion za pozdrav na kraju
kmaloc zauzima 2n velicinu memorije. Najbolje traziti racno onoliko memorije koliko nam
treba. Minimum koliko smije da se zauzme je 32 ili 64 bajta.
kzaloc zauzme odredjeni prostor i popuni ga nulama
vmalloc zauzimanje memorije u virtualnom prostoru, vfree oslobadja istu
kmemleak provjeravamo da li smo oslobodili dinamicki zauzetu memoriju.
Potom ukucamo
make dok smo u
ovom folderu!

Pravljenje PATCH-a:
<folder u kom je linux> - rsync -a linux-<verzija>/ linux-<verzija>-patch
<folder linux<verzija>> - make distclean brise objektne fajlove
<folder u kom je linux> - diff -Nurp linux-<verzija>/ linux-<verzija>-patch/ > patchfile

rsync (Remote Sync) is a most commonly used command for copying and synchronizing
files and directories remotely as well as locally in Linux/Unix systems. With the help of rsync

command you can copy and synchronize your data remotely and locally across directories,
across disks and networks, perform data backups and mirroring between two Linux machines.
make distclean Additionally erase anything ./configure created.
diff Display the differences between two files, or each corresponding file in two
directories. Each set of differences is called a "diff" or "patch". For files that are identical, diff
normally produces no output; for binary (non-text) files, diff normally reports only that they are
different.
pdflush promjene koje su se desile na memoriji da flesuje na disk
PRIORITETI:
-20(maximum); 19(minimum)
-ako zelimo da zadamo prioritet to mozemo samo iz root-a
insmod src/hello_version.ko ispisuje minor i major brojeve (ucitava modul)
rmmod hello_version (uklanja modul iz Linux Kernela)
ls -la dev echo ispisuje sta se nalazi u echo
cat dev/echo ispisuje ono sto se nalazi u echo
dd if=/dev/zero of=naziv_image_fajla.img bs=1M count=64 Kreiranje image diska (64MB
fajl)
mkfs.ext2 -F naziv_image_fajla.img Formatiranje disk imagea u ext2 format
sudo mount -o loop t ext2 <image fajl> <putanja do image fajla> - mountovanje image fajla

You might also like