48 lines
1.0 KiB
Plaintext
48 lines
1.0 KiB
Plaintext
#$Id$
|
|
|
|
|
|
|
|
#includes
|
|
source "`dirname $0`/Apps/Devel/src/scripts/targets/Linux"
|
|
|
|
|
|
#functions
|
|
target_image()
|
|
{
|
|
$UMOUNT "$DESTDIR"
|
|
$MKDIR "$DESTDIR" || exit 2
|
|
$DD if="$DEVZERO" of="$DISK_IMAGE" count="$DISK_SIZE" &&
|
|
$MKFS "$DISK_IMAGE" || exit 2
|
|
$MOUNT "$DISK_IMAGE" "$DESTDIR" || exit 2
|
|
target "install"
|
|
RET=$?
|
|
$UMOUNT "$DESTDIR"
|
|
exit $RET
|
|
}
|
|
|
|
|
|
target_iso()
|
|
{
|
|
$MKDIR "$DESTDIR/boot/grub" || exit 2
|
|
$CP "/usr/lib/grub/i386-pc/stage2_eltorito" \
|
|
"$DESTDIR/boot/grub" || exit 2
|
|
$CP "$KERNEL" "$DESTDIR/boot/uKernel" || exit 2
|
|
if [ ! -z "$RAMDISK_IMAGE" ]; then
|
|
$CP "$RAMDISK_IMAGE" "$DESTDIR/boot/initrd.img"
|
|
GRUB_INITRD="initrd /boot/initrd.img"
|
|
fi
|
|
$CAT > "$DESTDIR/boot/grub/menu.lst" << EOF
|
|
default 0
|
|
timeout 10
|
|
|
|
title DeforaOS
|
|
kernel /boot/uKernel $KERNEL_ARGS
|
|
$GRUB_INITRD
|
|
EOF
|
|
[ ! -z "$KERNEL_MODULES" ] && cat "$KERNEL_MODULES" | \
|
|
(cd "$DESTDIR" && tar xzf -)
|
|
$MKISOFS -b "boot/grub/stage2_eltorito" -no-emul-boot \
|
|
-boot-load-size 4 -boot-info-table \
|
|
-o "$CDROM_IMAGE" "$DESTDIR"
|
|
}
|