Rabu, 28 Mei 2014

Cara remastering melalui terminal linux

CARA Remastering Melalui terminal Linux


(seperti shadow dan gdm.conf-custom dapat menggangu auto login)


7.bersihkan lingkungan chroot dari file2 yang tidak diperlukan


----------------------------------------------

apt-get clean

----------------------------------------------


----------------------------------------------

find /var/run /var/log /var/mail /var/spool /var/lock /var/backups /var/tmp -type f -exec rm {} \;

----------------------------------------------


----------------------------------------------

rm -r /tmp/* /root/* 2>/dev/null

----------------------------------------------


8.jika menggunakan gdm recreate config filenya tapi jika tidak ingin dirubah maka skip langkah

ini


-----------------------------------------------

[ -f "/etc/gdm/factory-gdm.conf" ] && cp -f /etc/gdm/factory-gdm.conf /etc/gdm/gdm.conf 2>/dev/null

-----------------------------------------------


9.buat beberapa file di /var/log:


-----------------------------------------------

for i in dpkg.log lastlog mail.log syslog auth.log daemon.log faillog lpr.log mail.warn user.log boot debug mail.err messages wtmp bootstrap.log dmesg kern.log mail.info

do

touch /var/log/${i}

done

-----------------------------------------------

beberapa file ini adalah log yang udah dihapus di step 7. kita buat file kosong

untuk mencegah system dari complaining pada saat boot


10.kluar dari chroot


-----------------------------------------------

exit

-----------------------------------------------


D.Langkah selanjutya Remastering Melalui Terminal Linux mempersiapkan cd directory tree


1.copy kernel initrd dan memtest yang sudah disiapkan dari chroot


-----------------------------------------------

sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-$(uname -r) ${CD}/boot/vmlinuz

-----------------------------------------------


-----------------------------------------------

sudo cp -vp ${WORK}/rootfs/boot/initrd.img-$(uname -r) ${CD}/boot/initrd.gz

-----------------------------------------------


-----------------------------------------------

sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot

-----------------------------------------------


2.(optonal) generate manifest

dibutuhkan jika mengsinstall ubiquity


-----------------------------------------------

sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}/filesystem.manifest

-----------------------------------------------


-----------------------------------------------

sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}

-----------------------------------------------


-----------------------------------------------

REMOVE='ubiquity casper live-initramfs user-setup discover1 xresprobe os-prober libdebian-installer4'

-----------------------------------------------


-----------------------------------------------

for i in $REMOVE

do

sudo sed -i "/${i}/d" ${CD}/${FS_DIR}/filesystem.manifest-desktop

done

------------------------------------------------


3.unmount bin direktori


------------------------------------------------

sudo umount ${WORK}/rootfs/dev ${WORK}/rootfs/proc

------------------------------------------------


4.convert the directory tree kedalam squashfs


------------------------------------------------

sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}

------------------------------------------------


5.langkah selanjutnya Remastering Melalui Terminal Linux buat grub loader untuk cd


------------------------------------------------

sudo find /boot /usr/lib/grub/ -iname 'stage2_eltorito' -exec cp -v {} ${CD}/boot/grub \;

------------------------------------------------


buat menu.list


------------------------------------------------

sudo nano ${CD}/boot/grub/menu.lst

------------------------------------------------


copy text dibawah ini dan save kedalam menu.list


------------------------------------------------

# By default, boot the first entry.

default 0


# Boot automatically after 30 secs.

timeout 30


color cyan/blue white/blue



title                Start Linux in Graphical Mode

kernel                /boot/vmlinuz BOOT=casper boot=casper nopersistent rw quiet splash

initrd                /boot/initrd.gz


title                Start Linux in Safe Graphical Mode

kernel                /boot/vmlinuz BOOT=casper boot=casper xforcevesa rw quiet splash

initrd                /boot/initrd.gz


title                Start Linux in Text Mode

kernel                /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw quiet

initrd                /boot/initrd.gz


title                Start Presistent Live CD

kernel                /boot/vmlinuz BOOT=casper boot=casper persistent rw quiet splash

initrd                /boot/initrd.gz


title                Start Linux Graphical Mode from RAM

kernel                /boot/vmlinuz BOOT=casper boot=casper toram nopersistent rw quiet splash

initrd                /boot/initrd.gz


title                Memory Test

kernel                /boot/memtest86+.bin


title                Boot the First Hard Disk

root                (hd0)

chainloader +1

------------------------------------------------


6.calculate md5


------------------------------------------------

cd $CD && find . -type f -print0 | xargs -0 sudo md5sum | sudo tee ${CD}/md5sum.txt

------------------------------------------------


E. build the cd


1.buat file isonya


------------------------------------------------

sudo mkisofs -b boot/grub/stage2_eltorito \

-no-emul-boot -boot-load-size 4 -boot-info-table \

-V "Custom Live CD" -cache-inodes -r -J -l \

-o ~/live-cd.iso $CD

------------------------------------------------


sekarang tinggal menunggu sampai file isonya jadi dan sudah siap untuk di test lewat qemu atau virtualbox


2.(optional) hapus workspace yang telah dibuat


------------------------------------------------

[ -d "$WORK" ] && rm -r $WORK $CD

------------------------------------------------

0 komentar:

Posting Komentar

tolong komentar dulu

Teknologi komputer

software

Game

waghfir. Diberdayakan oleh Blogger.

Butuh bantuan waghfir,

cari di blog ini click.....