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!

Linux Kurs

  • Upload
    mile

  • View
    216

  • Download
    3

Embed Size (px)

DESCRIPTION

Linux kurs

Citation preview

Page 1: Linux Kurs

Linux kurs

mkfs – make filesystemdev – device folder

-t -typemount – 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 bigtree, the file hierarchy, rooted at /. These files can be spread out over several devices. Themount command serves to attach the file system found on some device to the big file tree.

cp – copyloop – 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 folderamake allnoconfig – koristi se u Embedded sistemima (za minimalisticki sistem)

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

KOMPAJLIRANJE I INSTALIRANJE KERNELA:➔ make➔ sudo make install➔ sudo make modules_install

PATCH-ovanje:

bzcat ..//patch-2.6.11.bz2 /patch -p1bzcat (or bzip2 -dc) – decompresses all specified files to the standard output.

cd..mv linux-2.6.10 linux-2.6.11vi patch-2.6.11.bz2

Ctrl + Alt – oslobadja mis iz qemu terminala!

Page 2: Linux Kurs

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/:$PATHexport LD_LIBRARY_PATH=/mnt/labs/mips-toolchain/usr/lib/:$LD_LIBRARY_PATH

u Makefile-u mijenjamo:ARCH ?= mipsCROSS_COMPILE ?= mips-linux-

../ - vraca se u kernel

.ko – kernel object filecp linux<verzija>.config .config

sudo cp qemu-ifup /usr/bin/qemu-ifupsudo cp qemu-isdown /usr/bin/qemu-ifdown

sudo apt-get install nfs-kernel-serversudo cp exports /etc/exports /etc/exports – znaci da smo u rootu

qemu:

Instaliranje qemu-a:sudo apt-get install qemu-kvm-extrasdf_andi – pustanje demo u qemuu (pingvini se krecu po povrsini)

insmod /src/hello_version.ko – za pozdrav na pocetkurmmod helloversion – za pozdrav na kraju

kmaloc – zauzima 2n velicinu memorije. Najbolje traziti racno onoliko memorije koliko namtreba. 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.

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 synchronizingfiles and directories remotely as well as locally in Linux/Unix systems. With the help of rsync

Potom ukucamo make dok smo u ovom folderu!

Page 3: Linux Kurs

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 twodirectories. Each set of differences is called a "diff" or "patch". For files that are identical, diffnormally produces no output; for binary (non-text) files, diff normally reports only that they aredifferent.

pdflush – promjene koje su se desile na memoriji da flesuje na diskPRIORITETI:-20(maximum); 19(minimum)-ako zelimo da zadamo prioritet to mozemo samo iz root-ainsmod 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 echodd 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 formatsudo mount -o loop – t ext2 <image fajl> <putanja do image fajla> - mountovanje image fajla