-> 2,212 views

Membuat LiveCD

Sekedar berbagi untuk yang ingin membuat LiveCD. Selengkapnya dapat diakses ke: http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD

Langkah-langkahnya adalah

  1. Penyiapan sistem dasar (bootstrap)
     http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD/PenyiapanSistemDasar
  1. Instalasi paket blankon-desktop (atau blankon-desktop-minimalis)

 http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD/InstalasiPaketMeta

  1. Instalasi kernel
     http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD/InstalasiKernel
  1. Instalasi paket tambahan (ubiquity dkk) yang ada di kategori live di bibit paket
  1. Pembuatan sistem berkas bertipe squashfs
     http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD/MembuatSquashfs
  1. Instalasi bootloader (syslinux atau grub)
     http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD/InstalasiBootloader
  1. Pembuatan ISO
     http://dev.blankonlinux.or.id/wiki/Dokumentasi/Lokakarya/MembuatLiveCD/PembuatanISO
  1. Tertib

Penyiapan Sistem Dasar

Untuk membuat LiveCD dibutuhkan sistem dasar yang berisi paket-paket yang harus ada dalam sebuah LiveCD. Debian mempunyai debootstrap yaitu alat untuk membuat sistem dasar debian tanpa harus tersedianya apt atau dpkg. debootstrap hanya mengunduh file .deb dari repository lalu mengekstraknya dalam suatu direktori yang selanjutnya dapat di chroot.

chroot adalah program untuk memindahkan pengguna yang sedang menjalankannya dari lingkungan sekarang ke lingkungan yang baru. chroot itu tidak ada hubungannya dengan pengguna bernama root, tapi berhubungan dengan direktori root (/) di sistem.

Sebuah Analogi

Ibaratnya kita punya rumah yang sangat besar sekali. Didalamnya terdapat kamar-kamar, ruang tamu, ruang makan, dapur dsb lengkap dengan segala perabotannya. Di salah satu kamar kita bikin rumah baru lagi, lengkap dengan perabotan dan kamar-kamar lagi.

Nah dengan menjalankan chroot kita artinya masuk ke rumah dalam kamar tadi dan menutup pintu. Semua yang kita lakukan di situ, nyanyi-nyanyi, lompat-lompat, guling-guling, tiduran, corat coret tembok, boleh. Seolah-olah dunia baru… Tapi hanya berpengaruh pada rumah dalam kamar itu saja. Ini tidak bisa disebut mesin virtual. Sebab rumah baru itu bukan virtual. Tapi beneran. Perabotannya beneran. Kamarnya beneran. Foto yang ada di ruang tamu beneran. Penggorengan di dapur semuanya beneran.

Instalasi debootstrap

$ sudo apt-get install debootstrap dchroot

Buatlah direktori kerja kita. misal livecd. lalu jalankan debootstrap didalamnya.

$ mkdir livecd
$ cd livecd
~/livecd$ sudo debootstrap intrepid chroot http://kambing.ui.edu/ubuntu

Catatan:

  • intrepid: rilis yang digunakan
  • chroot: direktori yang akan dipakai (ubahlah sesuai selera anda)

Ini akan memakan waktu cukup lama tergantung koneksi anda. Jika berhasil akan terlihat seperti log-debootstrap (attachment). debootstrap akan membuat struktur direktori root baru

~/livecd/chroot$ ll -d */ | awk '{print $8}' | xargs sudo du -h --max-depth=0

Keluaran:

4.8M    bin/
4.0K    boot/
12K     dev/
2.3M    etc/
4.0K    home/
8.0M    lib/
247M    lib64/
4.0K    media/
4.0K    mnt/
4.0K    opt/
4.0K    proc/
12K     root/
4.2M    sbin/
4.0K    srv/
4.0K    sys/
4.0K    tmp/
105M    usr/
57M     var/

 

Instalasi paket blankon-desktop (atau blankon-desktop-minimalis)

Instalasi Kernel

  1. Silahkan chroot
$ sudo cp /etc/resolv.conf chroot/etc/resolv.conf
$ sudo chroot chroot
  1. mount dan tentukan bahasa
/# mount -t proc proc-blive /proc
/# mount -t devpts devpts-blive /dev/pts
/# mount -t sysfs sysfs-blive /sys
/# export HOME=/root
/# export LC_ALL=C
  1. Buat file /etc/apt/sources.list yang berisi (isikan dengan mirror kesukaan anda):
    $ cp /etc/apt/sources.list chroot/etc/apt/sources.list

yang berisikan

deb http://kambing.ui.edu/ubuntu jaunty main restricted multiverse universe
deb http://arsip.blankonlinux.or.id/blankon nanggar main restricted
  1. Update sistem dan install paket meta
/# apt-get update
/# apt-get dist-upgrade
/# apt-get install blankon-desktop blankon-minimal blankon-standard

Keluaran:

root@blankone:/# aptitude update
Hit http://mirror.unej.ac.id jaunty Release.gpg
Get:1 http://mirror.unej.ac.id nanggar Release.gpg [189B]
Hit http://mirror.unej.ac.id jaunty Release
Get:2 http://mirror.unej.ac.id nanggar Release [9727B]
Hit http://mirror.unej.ac.id jaunty/main Packages
Ign http://mirror.unej.ac.id nanggar Release   
Get:3 http://mirror.unej.ac.id jaunty/restricted Packages [8848B]
Get:4 http://mirror.unej.ac.id jaunty/universe Packages [4757kB]
Get:5 http://mirror.unej.ac.id jaunty/multiverse Packages [197kB]
Get:6 http://mirror.unej.ac.id nanggar/main Packages [71.3kB]
Get:7 http://mirror.unej.ac.id nanggar/restricted Packages [28.5kB]
Fetched 5073kB in 4s (1216kB/s)                  
Reading package lists... Done
W: GPG error: http://mirror.unej.ac.id nanggar Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B85EF00D2CCF12D8
W: You may want to run apt-get update to correct these problems

Current status: 5 updates [+5], 20748 new [+20748].
root@blankone:/# apt-get install blankon-desktop

 

Instalasi Kernel

melanjutkan dari halaman  ini, maka langkah selanjutnya adalah:

  1. buat file /etc/kernel-img.conf (di chroot), isi dengan:
do_bootloader = No
do_initrd = Yes 
warn_initrd = No
  1. Masih di chroot, silahkan install kernelnya:
/# apt-get install linux-image-2.6.28-11-generic casper

Keluaran:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  grub grub-common localechooser-data user-setup uuid-runtime wireless-crda
Suggested packages:
  grub-doc mdadm multiboot-doc fdutils linux-doc-2.6.28 linux-source-2.6.28
The following NEW packages will be installed:
  casper grub grub-common linux-image-2.6.28-11-generic localechooser-data user-setup uuid-runtime wireless-crda
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.3MB of archives.
After this operation, 97.9MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  localechooser-data user-setup casper
Install these packages without verification [y/N]? y
Get:1 http://mirror.unej.ac.id jaunty/main wireless-crda 1.7 [15.0kB]
Get:2 http://mirror.unej.ac.id jaunty/main linux-image-2.6.28-11-generic 2.6.28-11.42 [24.6MB]
Get:3 http://mirror.unej.ac.id jaunty/main uuid-runtime 1.41.4-1ubuntu1 [49.4kB]
Get:4 http://mirror.unej.ac.id jaunty/main grub-common 1.96+20080724-12ubuntu2 [93.5kB]
Get:5 http://mirror.unej.ac.id jaunty/main grub 0.97-29ubuntu53 [404kB]
Get:6 http://mirror.unej.ac.id nanggar/main localechooser-data 2.09ubuntu2+blankon1 [5276B]
Get:7 http://mirror.unej.ac.id nanggar/main user-setup 1.23ubuntu20+blankon4 [133kB]
Get:8 http://mirror.unej.ac.id nanggar/main casper 1.173+blankon2 [39.9kB]
Fetched 25.3MB in 2s (9080kB/s)
Preconfiguring packages ...
Selecting previously deselected package wireless-crda.
(Reading database ... 66493 files and directories currently installed.)
Unpacking wireless-crda (from .../wireless-crda_1.7_i386.deb) ...
Selecting previously deselected package linux-image-2.6.28-11-generic.
Unpacking linux-image-2.6.28-11-generic (from .../linux-image-2.6.28-11-generic_2.6.28-11.42_i386.deb) ...
Done.

...
... (dipotong)
...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.28-11-generic
  1. umount
/# umount devpts-blive
/# umount sysfs-blive
/# umount proc-blive

Membuat Squashfs

Squashfs adalah jenis file system yang mendukung kompresi sehingga cocok digunakan pada LiveCD. Kita akan membuat image dari chroot tadi, atau dengan kata lain direktori chroot itu akan kita masukkan dalam sebuah sistem berkas baru berjenis squashfs.

  1. Install program pembuat squashfs
/# apt-get install squashfs-tools

Keluaran:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  squashfs-source lzma-source
The following NEW packages will be installed:
  squashfs-tools
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 123kB of archives.
After this operation, 311kB of additional disk space will be used.
Get:1 http://kambing.ui.edu intrepid/main squashfs-tools 1:3.3-7ubuntu1 [123kB]
Fetched 123kB in 0s (412kB/s)   
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously deselected package squashfs-tools.
(Reading database ... 11764 files and directories currently installed.)
Unpacking squashfs-tools (from .../squashfs-tools_1%3a3.3-7ubuntu1_amd64.deb) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up squashfs-tools (1:3.3-7ubuntu1) ...
  1. Pastikan kita berada di / lalu lakukan perintah ini
/# mksquashfs / filesystem.squashfs -e filesystem.squashfs

Keluaran:

Parallel mksquashfs: Using 1 processor
Creating little endian 3.1 filesystem on filesystem.squashfs, block size 131072.
[===============================================================================================================================================================] 12532/12532 100%
Exportable Little endian filesystem, data block size 131072, compressed data, compressed metadata, compressed fragments, duplicates are removed
Filesystem size 166166.12 Kbytes (162.27 Mbytes)
        47.74% of uncompressed filesystem size (348088.57 Kbytes)
Inode table size 142854 bytes (139.51 Kbytes)
        31.86% of uncompressed inode table size (448402 bytes)
Directory table size 132499 bytes (129.39 Kbytes)
        55.07% of uncompressed directory table size (240604 bytes)
Number of duplicate files found 751
Number of inodes 13532
Number of files 11081
Number of fragments 1303
Number of symbolic links  895
Number of device nodes 86
Number of fifo nodes 2
Number of socket nodes 0
Number of directories 1468
Number of uids 5
        root (0)
        syslog (101)
        libuuid (100)
        news (9)
        klog (102)
Number of gids 13
        video (44)
        audio (29)
        tty (5)
        kmem (15)
        disk (6)
        adm (4)
        shadow (42)
        mail (8)
        staff (50)
        libuuid (101)
        src (40)
        utmp (43)
        klog (103)

Artinya buatlah sebuah berkas bernama filesystem.squashfs berisi semua berkas mulai dari direktori / tapi jangan menyertakan filesystem.squashfs yang sedang dibuat ke dalamnya. PERHATIAN: opsi -e filesystem.squashfs itu sangat penting. Kalau tidak pakai itu nanti berkas cetakannya juga masuk dalam squashfsnya, dan bersifat rekursif.

  1. Keluar dari chroot
/# exit
  1. Buat direktori untuk direkam dalam CD.
~/livecd$ mkdir -p binary/casper
  1. Salin kernel dan initrd dari direktori chroot ke direktori casper. Tapi potong namanya
~/livecd$ cp chroot/boot/vmlinuz-2.6.27-7-generic binary/casper/vmlinuz
~/livecd$ cp chroot/boot/initrd.img-2.6.27-7-generic binary/casper/initrd.img
  1. Buat berkas parameters.txt dalam direktori binary/casper. Lalu isi dengan  http://pastebin.com/m3b26788f
Boot Parameters for Debian Live
-------------------------------

Updated for casper 1.77+debian-7 on 2007-02-08.

These options (can be combined) work from the syslinux bootprompt:

casper casper-getty
casper xdebconf
casper hostname=HOSTNAME
casper userfullname=USERFULLNAME
casper username=USERNAME
casper {keyb|kbd-chooser/method}=KEYBOARD
casper {klayout|console-setup/layoutcode}=LAYOUT
casper {kvariant|console-setup/variantcode}=VARIANT     ,
casper {kmodel|console-setup/modelcode}=CODE ,  koptions=OPTIONS
casper ip=IFACE,ADDRESS,NETMASK,GATEWAY[:IFACE,ADDRESS,NETMASK,GATEWAY]*
casper ip[=frommedia]
casper {live-media|bootfrom}=DEVICE
casper live-media-offset=BYTES
casper locale=LOCALE | debian-installer/locale=LOCALE
casper netboot[=nfs|cifs]
casper persistent
casper nopersistent
casper showmounts
casper todisk=DEVICE
casper toram
casper {preseed/file|file}=FILE
casper package/question=VALUE

Values for the vga kernel parameter:

Colours   640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
 4 bits |    ?       ?     0x302      ?        ?        ?         ?
 8 bits |  0x300   0x301   0x303    0x305    0x161    0x307     0x31C
15 bits |    ?     0x310   0x313    0x316    0x162    0x319     0x31D
16 bits |    ?     0x311   0x314    0x317    0x163    0x31A     0x31E
24 bits |    ?     0x312   0x315    0x318      ?      0x31B     0x31F
32 bits |    ?       ?       ?        ?      0x164      ?

Colours   640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
 4 bits |    ?       ?      770       ?        ?        ?         ?
 8 bits |   768     769     771      773      353      775       796
15 bits |    ?      784     787      790      354      793       797
16 bits |    ?      758     788      791      355      794       798
24 bits |    ?      786     789      792       ?       795       799
32 bits |    ?       ?       ?        ?       356       ?

 

Instalasi Bootloader

Kita pakai syslinux, Pakai grub juga boleh kalau mau.

  1. Install syslinux dalam chroot
~/livecd$ sudo chroot chroot apt-get install syslinux

Keluaran:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  mtools
Suggested packages:
  floppyd
The following NEW packages will be installed:
  mtools syslinux
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 617kB of archives.
After this operation, 1380kB of additional disk space will be used.
Do you want to continue [Y/n]? 
Get:1 http://kambing.ui.edu intrepid/main mtools 3.9.11-1 [207kB]
Get:2 http://kambing.ui.edu intrepid/main syslinux 2:3.63+dfsg-2ubuntu3 [410kB]
Fetched 617kB in 0s (687kB/s)    
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously deselected package mtools.
(Reading database ... 11773 files and directories currently installed.)
Unpacking mtools (from .../mtools_3.9.11-1_amd64.deb) ...
Selecting previously deselected package syslinux.
Unpacking syslinux (from .../syslinux_2%3a3.63+dfsg-2ubuntu3_amd64.deb) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up mtools (3.9.11-1) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Setting up syslinux (2:3.63+dfsg-2ubuntu3) ...
  1. Siapkan direktori syslinux
~/livecd$ mkdir -p binary/isolinux
~/livecd$ ls binary/
casper  isolinux
  1. Salin program isolinux.bin dari dalam chroot ke direktory binary/isolinux
~/livecd$ cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux
~/livecd$ ls binary/isolinux/
isolinux.bin
  1. Buat berkas bernama binary/isolinux/isolinux.cfg, isi dengan
DEFAULT /casper/vmlinuz
GFXBOOT bootlogo
APPEND  boot=casper initrd=/casper/initrd.img  boot=casper union=aufs

LABEL live
   menu label IniDiaBlankOnLive
   kernel /casper/vmlinuz
   append initrd=/casper/initrd.img boot=casper union=aufs

TIMEOUT 300
PROMPT 1
  1. Salin squashfs tadi ke direktori binary/casper
~/livecd$ cp chroot/filesystem.squashfs binary/casper
cp: cannot open `chroot/filesystem.squashfs' for reading: Permission denied
~/livecd$ sudo cp chroot/filesystem.squashfs binary/casper
~/livecd$ ls -al binary/casper/
total 177168
-rwx------ 1 root   root   170156032 2008-10-31 19:39 filesystem.squashfs
-rw-r--r-- 1 kholis kholis   8721650 2008-10-31 19:16 initrd.img
-rw-r--r-- 1 kholis kholis      2045 2008-10-31 19:22 parameters.txt
-rw-r--r-- 1 kholis kholis   2339712 2008-10-31 19:16 vmlinuz
  1. Ambil data bawaan syslinux dan gfxboot di bazaar dev.blankonlinux.or.id
~/livecd$ bzr branch http://dev.blankonlinux.or.id/bzr/meuligoe/pabrik-cd/
Branched 3 revision(s).                                                                                                                                                           
~/livecd$ ls
binary  chroot  pabrik-cd
  1. Copy data dari bzr tadi
~/livecd$ cp pabrik-cd/blankon-cd-factory/syslinux/* binary/isolinux
~/livecd$ cp pabrik-cd/data/meuligoe/cdlive/syslinux/* binary/isolinux

 

Pembuatan ISO

  1. Install genisoimage
~/livecd$ sudo apt-get install genisoimage
  1. Generate menjadi iso image
~/livecd$ genisoimage -v -A BlankOnCDFactory -p BlankOn -publisher BlankOn -V "BlankOnSaya" -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.cat -o binary.iso -J -l -cache-inodes -allow-multidot binary

Keluaran:

Warning: creating filesystem that does not conform to ISO-9660.
I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage 1.1.6 (Linux)
Scanning binary
Scanning binary/isolinux
Excluded by match: binary/isolinux/boot.cat
Scanning binary/casper
genisoimage: Permission denied. File binary/casper/filesystem.squashfs is not readable - ignoring
Writing:   Initial Padblock                        Start Block 0
Done with: Initial Padblock                        Block(s)    16
Writing:   Primary Volume Descriptor               Start Block 16
Done with: Primary Volume Descriptor               Block(s)    1
Writing:   Eltorito Volume Descriptor              Start Block 17
Size of boot image is 4 sectors -> No emulation
Done with: Eltorito Volume Descriptor              Block(s)    1
Writing:   Joliet Volume Descriptor                Start Block 18
Done with: Joliet Volume Descriptor                Block(s)    1
Writing:   End Volume Descriptor                   Start Block 19
Done with: End Volume Descriptor                   Block(s)    1
Writing:   Version block                           Start Block 20
Done with: Version block                           Block(s)    1
Writing:   Path table                              Start Block 21
Done with: Path table                              Block(s)    4
Writing:   Joliet path table                       Start Block 25
Done with: Joliet path table                       Block(s)    4
Writing:   Directory tree                          Start Block 29
Done with: Directory tree                          Block(s)    3
Writing:   Joliet directory tree                   Start Block 32
genisoimage: Unexpected joliet directory length 164 expected: 168 ''
Done with: Joliet directory tree                   Block(s)    3
Writing:   Directory tree cleanup                  Start Block 35
Done with: Directory tree cleanup                  Block(s)    0
Writing:   Extension record                        Start Block 35
Done with: Extension record                        Block(s)    1
Writing:   The File(s)                             Start Block 36
 87.96% done, estimate finish Fri Oct 31 19:51:40 2008
Total translation table size: 2048
Total rockridge attributes bytes: 1813
Total directory bytes: 4574
Path table size(bytes): 40
Done with: The File(s)                             Block(s)    5502
Writing:   Ending Padblock                         Start Block 5538
Done with: Ending Padblock                         Block(s)    150
Max brk space used 0
5688 extents written (11 MB)
  1. Akan tercipta file binary.iso
~/livecd$ ls
binary  binary.iso  chroot  pabrik-cd
  1. Siap dicoba. Screenshot di attachment

 

Comments Off on Membuat LiveCD

Filed under Command, ISO, Komunitas, Script, Software

Comments are closed.