Selasa, 27 Mei 2008

Bootdisk - Distro Linux

Pada dasarnya, script yang digunakan untuk membuat linux distro adalah sebagai berikut :
---------start code
#!/bin/sh
# Script pembuatan distro linux floppy
# Oleh : Rama A Mamuaya [ admin@admin.org ]
# Homepage http://admin.org/

# HowTo :
# make dir named root in active dir.
# inside root dir, create all dir needed ( etc,dev,bin,usr,…) :

# ./root/bin
# ./root/etc
# ./

$KERNEL = /usr/src/linux/arch/i386/boot/bzImage
$ROOTFS = ./rootfs.gz
$BANNER = 'distrobootdisk.sh by admin ( admin@admin.org )'

echo 'Creating Zero Device......'
dd if=/dev/zero of=rootfs bs=1k count=4096


echo 'Formatting device to ext2......'
mke2fs -Fm0 rootfs

echo 'Mounting device ......'
mkdir /mnt/fux
mount disk.ext2 /mnt/fux -o loop

echo 'Copying FileSystems......'
cp -r ./root/* /mnt/fux

echo 'Unmount filesystems......'
umount /mnt/fux
gzip -9 ./rootfs

echo 'Putting bootsector on Floppy'
syslinux /dev/fd0

echo 'Creating bootdisk......'
mount /dev/fd0 /mnt/floppy
cp $ROOTFS /mnt/floppy
cp $KERNEL /mnt/floppy/fuxlinux

cat >syslinux.cfg << _EOF_
# Bootdisk generated by distrobootdisk.sh
# Bootdisk based on FUX-Linux.
# http://admin.org/
# admin@admin.org
default fux
display fux.msg
prompt 1
label fux
kernel fuxlinux
append initrd=rootfs.gz root=/dev/fd0
_EOF_

cat >fux.msg << __EOF__
Welcome to Distro-Linux Bootdisk Linux system Distro-Linux by Admin ( admin@admin.org )
Visit http://admin.org/
__EOF__

echo 'Unmounting Floppy device......'
umount /mnt/floppy
echo 'Its up to you now......'
echo $BANNER
exit
end code-----------

Related Post :



0 comments:

R