Difference between pages "Conversion" and "Pxe"

From Linuxintro
(Difference between pages)
imported>ThorstenStaerk
 
imported>ThorstenStaerk
 
Line 1: Line 1:
= Images =
+
'''PXE''' stands for '''P'''reboot E'''x'''ecution '''E'''nvironment. It is used to boot a computer using booting information from over the network.
== convert image formats ==
 
Use the command convert like this:
 
[[convert (command)|convert]] ''name''.''format'' ''name''.''jpg''
 
  
= Music files =
+
= Overview =
 +
The typical PXE boot looks like this:
 +
# Computer ''A'' starts. Its [http://en.wikipedia.org/wiki/BIOS BIOS] is set to do a PXE [[boot]], so booting from the network.
 +
# Computer ''A'' acquires an IP address from [[dhcp]] [[server]] ''B''.
 +
# Computer ''A'' downloads its booting files ([[initrd]] and [[kernel]]) via [[tftp]] from ''B''.
 +
# Computer ''A'' executes the kernel just as if it had from its local [[hard disk]].
  
== wav to mp3 ==
+
= How to start =
install [[laMe]], e.g. for SUSE Linux:
+
In this example we use SUSE Linux 12.1.
yast -i lame
 
Then do the conversion like this:
 
<pre>
 
tweedleburg:~/music # ls -l Various\ Artists\ -\ 04\ -\ Wer\ Hat\ Die\ Schönsten\ Schäfchen\?.wav
 
-rw-r--r-- 1 root root 23682332 Aug 18 20:10 Various Artists - 04 - Wer Hat Die Schönsten Schäfchen?.wav
 
tweedleburg:~/music # lame Various\ Artists\ -\ 04\ -\ Wer\ Hat\ Die\ Schönsten\ Schäfchen\?.wav
 
LAME 3.99.5 64bits (http://lame.sf.net)
 
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
 
Encoding Various Artists - 04 - Wer Hat Die Schönsten Schäfchen?.wav
 
      to Various Artists - 04 - Wer Hat Die Schönsten Schäfchen?.mp3
 
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3
 
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
 
  5141/5141  (100%)|    0:04/    0:04|    0:04/    0:04|  33.079x|    0:00
 
------------------------------------------------------------------------------------------------------------
 
  kbps        LR    MS  %    long switch short %
 
  128.0      14.3  85.7        99.1   0.5  0.4
 
Writing LAME Tag...done
 
ReplayGain: -6.3dB
 
tweedleburg:~/music # ls -l Various\ Artists\ -\ 04\ -\ Wer\ Hat\ Die\ Schönsten\ Schäfchen\?.mp3
 
-rw-r--r-- 1 root root 2149145 Aug 18 20:19 Various Artists - 04 - Wer Hat Die Schönsten Schäfchen?.mp3
 
</pre>
 
  
== k3b cannot convert music files? ==
+
== DHCP ==
install "libk3b2-mp3"
+
To allow your computers to boot from the network, they first need an IP address. So, [[set up a dhcp-server]]. Make sure /etc/dhcpd.conf contains the following lines:
 +
allow booting;
 +
allow bootp;
 +
authoritative; # I am the one and only here
 +
Make sure your "subnet" section contains the following lines:
 +
next-server ''192.168.0.5'';
 +
filename "pxelinux.0";
 +
Make sure you have restarted your dhcpd:
 +
/etc/init.d/dhcpd restart
  
= Videos =
+
== TFTP ==
Main article: [[Video Conversion]]
+
After your computers have received their IP address, they start asking for their booting file from the TFTP-server, in this case ''192.168.0.5''. So, make sure they can get it.
 +
* [[Install]] tftp and syslinux:
 +
# yast -i tftp syslinux
 +
* copy syslinux' pxelinux.0 to /srv/tftpboot/:
 +
# rpm -ql syslinux | grep pxelinux.0
 +
/usr/share/syslinux/gpxelinux.0
 +
/usr/share/syslinux/pxelinux.0
 +
# cp /usr/share/syslinux/pxelinux.0 /srv/tftpboot/
 +
* Activate the tftp server. To do this, change /etc/xinetd.d/tftp. Replace
 +
disable = yes
 +
with
 +
disable = no
 +
Then restart xinetd which hosts tftpd:
 +
/etc/init.d/xinetd restart
 +
* Test it:
 +
tftp ''192.168.0.5'' -c get pxelinux.0
 +
Test your configuration now by booting a connected computer from PXE. You should get an error message saying that the configuration file pxelinux.cfg/default has not been found.
  
== convert video to 3gp ==
+
== pxelinux.cfg/default ==
  mencoder ''INPUTFILE'' -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o movie.avi -ofps 12
+
Create a /srv/tftpboot/pxelinux.cfg/default like this:
 +
default linux
 +
timeout 0
 +
prompt 1
 +
display display.msg
 +
 +
  label linux
 +
  kernel vmlinuz
 +
  append initrd=initrd
  
  mplayer -vo null -ao pcm -af resample=8000,volume=+4db:sc ''INPUTFILE''
+
* Now you must supply kernel (vmlinuz) and initrd into the tftp folder:
 +
  cp /boot/vmlinuz /srv/tftpboot
 +
cp /boot/initrd /srv/initrd
  
  [[ffmpeg]] -i movie.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 ''OUTPUTFILE''
+
== Change initial ramdisk ==
 +
If you now want to change the initrd to actually do something, you can do it like this:
 +
cd /tftpboot
 +
mkdir tmp
 +
cd tmp
 +
cp ../initrd.img ./initrd.gz
 +
gunzip initrd.gz
 +
mkdir tmp2
 +
cd tmp2
 +
  [[cpio]] -id < ../initrd
 +
Do the needed changes now in this folder. Then pack the initrd again:
 +
[[find]] . | cpio --create --format='newc' > ../newinitrd
 +
cd ..
 +
[[gzip]] newinitrd
 +
Your new [[initrd]] is now called newinitrd.gz.
  
== convert 3gp-Video to DivX ==
+
= See also =
mencoder -ovc divx4 vid.3gp -o vid.avi
+
* [http://en.wikipedia.org/wiki/Preboot_Execution_Environment Wikipedia on PXE]
 +
* http://www.digitalpeer.com/id/linuxnfs
  
== convert video for Palm ==
+
[[Category:Networking]]
mencoder source.mpg -ofps 15 -srate 24000 -oac mp3lame -lameopts
+
[[Category:Boot]]
cbr:br=32:vol=5:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=96:vhq:
+
[[Category:Guides]]
keyint=300 -vop scale=480:320 -o target.avi
 
 
 
or
 
mencoder source.mpg -srate 24000 -oac mp3lame -lameopts cbr:br=32:vol5:mode=3\
 
-fps 30 -ofps 30 -ovc lavc -vop scale=320:240 -o target.avi
 
 
 
= extract mpg from .bin =
 
Problem: If you use [[file (command)]] on a .bin file, it outputs "data".
 
Solution:
 
[http://www.vcdgear.com vcdgear] -dat2mpg ''infile.bin'' ''outfile.mpg''
 
 
 
= Software packages =
 
== convert rpm to deb ==
 
alien --to-deb 123.rpm
 
 
 
= wikis =
 
* [[Convert a dokuwiki to mediawiki]]
 

Revision as of 13:13, 9 December 2012

PXE stands for Preboot Execution Environment. It is used to boot a computer using booting information from over the network.

Overview

The typical PXE boot looks like this:

  1. Computer A starts. Its BIOS is set to do a PXE boot, so booting from the network.
  2. Computer A acquires an IP address from dhcp server B.
  3. Computer A downloads its booting files (initrd and kernel) via tftp from B.
  4. Computer A executes the kernel just as if it had from its local hard disk.

How to start

In this example we use SUSE Linux 12.1.

DHCP

To allow your computers to boot from the network, they first need an IP address. So, set up a dhcp-server. Make sure /etc/dhcpd.conf contains the following lines:

allow booting;
allow bootp;
authoritative; # I am the one and only here

Make sure your "subnet" section contains the following lines:

next-server 192.168.0.5;
filename "pxelinux.0";

Make sure you have restarted your dhcpd:

/etc/init.d/dhcpd restart

TFTP

After your computers have received their IP address, they start asking for their booting file from the TFTP-server, in this case 192.168.0.5. So, make sure they can get it.

# yast -i tftp syslinux
  • copy syslinux' pxelinux.0 to /srv/tftpboot/:
# rpm -ql syslinux | grep pxelinux.0
/usr/share/syslinux/gpxelinux.0
/usr/share/syslinux/pxelinux.0
# cp /usr/share/syslinux/pxelinux.0 /srv/tftpboot/
  • Activate the tftp server. To do this, change /etc/xinetd.d/tftp. Replace
disable = yes

with

disable = no

Then restart xinetd which hosts tftpd:

/etc/init.d/xinetd restart
  • Test it:
tftp 192.168.0.5 -c get pxelinux.0

Test your configuration now by booting a connected computer from PXE. You should get an error message saying that the configuration file pxelinux.cfg/default has not been found.

pxelinux.cfg/default

Create a /srv/tftpboot/pxelinux.cfg/default like this:

default linux
timeout 0
prompt 1
display display.msg

label linux
  kernel vmlinuz
  append initrd=initrd
  • Now you must supply kernel (vmlinuz) and initrd into the tftp folder:
cp /boot/vmlinuz /srv/tftpboot
cp /boot/initrd /srv/initrd

Change initial ramdisk

If you now want to change the initrd to actually do something, you can do it like this:

cd /tftpboot
mkdir tmp
cd tmp
cp ../initrd.img ./initrd.gz
gunzip initrd.gz
mkdir tmp2
cd tmp2
cpio -id < ../initrd

Do the needed changes now in this folder. Then pack the initrd again:

find . | cpio --create --format='newc' > ../newinitrd
cd ..
gzip newinitrd

Your new initrd is now called newinitrd.gz.

See also