28 Juli 2013

Cara membuat modules Porteus dari source code

Sebenernya ini ada di homepage porteus, tapi kali aja ada yang gak tau :D
tapi gue ganti beberapa langkah, cz menurut ane itu agak membingungkan :D

Ok, pertama download source codenya (sbg contoh download source code wbar yang agak kecilan :D )
Extract, mau pke aplikasi atau terminal silahkan (y), sama aja kok.. terus ingat-ingat dimana folder tsb..
buka terminal, buka sbg root, ketikan

# PKG=NAMA_PKG_TSB
# TMP=/tmp/$PKG
# mkdir $TMP
# cd FOLDER_HASIL_EXTRACT_TADI
# ./configure
# make
# make install-strip DESTDIR=$TMP || make install DESTDIR=$TMP

kalau ada /tmp/NAMA_PKG_TADI/usr/share/applications/*.desktop gue saranin kita ketikan ini di terminal
# chmod +x TEMPAT_FILE_DESKTOP_TADI

kalau dirasa udah kita balik lagi ke terminal yang tadi
ketikan

#dir2xzm $TMP /mnt/DISK_TEMPAT_NYIMPEN_PORTEUS/porteus/modules/NAMA_PKG_TADI.xzm

kalau udah selesai kita cobain dan kita run tu aplikasi :D
sbgai contoh tadi kita mau install wbar
run di terminal dg
$ wbar

kalau jalan berarti berhasil, kalau gak keluar apa-apa berarti gagal dan harus balik lagi dimana kesalahan itu :D

silahkan coba hasil compile gue dari cara diatas :D
wbar & lxtask

oh iya, ane nyobain ubah extension xzm ke sfs dan ternyata lanjar jaya pas di coba di Saluki :D
juga pas liat di forum modules Porteus juga bisa di pke di Slax dengan ganti extension xzm ke sb
selamat mencoba!

#NOTE! Ini cuma untuk personal saja, kalau mau di share ke orang lain
Baca ini : 

MODULE CREATION RULES

Every Porteus module contains all files and directories with full path needed for the package to function. For example, a module with bash (the binary and some man pages) would look like this:

/bin/
/bin/bash
/usr/
/usr/man/
/usr/man/man1/
/usr/man/man1/bash.1

Since Porteus is designed to be a lightweight portable system the size of your module should be as small as possible. Uncompress all archives which may be safely left uncompressed (for example man pages, because LZMA will compress them far better), delete all files which are not needed to run the software (for example unneeded documentation, unused sounds, png/jpg images, unneeded translations from /usr/share/locale) and strip all unneeded symbols from binaries.

If you compiled the module from source codes and you used a script then provide the build script, which is used to create the module. The build script must handle the whole module creation. Any manual work (copying / deleting files, etc) aside the build script is not allowed. The script serves as a documentation as to how to create your module; moreover it makes it easy to take over your module in the case you stop updating it. Copy the build script to your module to:

/usr/src/porteusbuilds/your_module_name.porteusbuild

When you compile the software, make sure to use correct cflags and parameters. The following is recommended in order to use i486 instructions (which provides the best backward compatibility), but tune the performance of the code as if the target architecture was i686.

CFLAGS="-O3 -march=i486 -mtune=i686" ./configure --prefix=/usr --build=i486-Slackware-linux

Never include any existing files from Porteus in your module, even if you modified them. In other words, your module should never 'overwrite' any existing file in Porteus, unless you have a sensible reason to do so. It can make your module incompatible with newer Porteus versions and it can cause problems with modules from other users. If you really have to overwrite a file in Porteus, (for example in order to append a new path to /etc/ld.so.conf), write a startup script instead, which will modify (update) the particular file, instead of overwriting it by your module.

Example startup script to delete one line from ld.so.conf and add a new one at the end:

#!/bin/bash
sed -i -r '\;/usr/local/lib;d' /etc/ld.so.conf
echo '/opt/kde/lib' >> /etc/ld.so.conf

Here is a sample list of few files which should never be included in your module:

/etc/init.d
/etc/rc.d/rc.S
/etc/rc.d/rc.M
/etc/rc.d/rc.K
/etc/rc.d/rc.local
/lib/modules/2.6.x/modules.dep
/lib/modules/2.6.x/modules.alias
/etc/ld.so.conf
/etc/ld.so.cache
/etc/passwd
/etc/group
/etc/shadow

maaf gak di translate, ane juga bingung, malahan gak ngerti kalau yang ini :D

Tidak ada komentar:

Posting Komentar