Try to let images correctly build again on Linux
This commit is contained in:
parent
f6b98dc603
commit
dea5783dcc
|
@ -1,5 +1,5 @@
|
|||
#$Id$
|
||||
#Copyright (c) 2009 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2011 Pierre Pronchery <khorben@defora.org>
|
||||
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
|||
#functions
|
||||
#private
|
||||
#image_ramdisk
|
||||
_image_ramdisk()
|
||||
_image_ramdisk_pre()
|
||||
{
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
|
||||
IMAGE_FILE Where to write the filesystem image\n\
|
||||
|
@ -24,9 +24,10 @@ _image_ramdisk()
|
|||
|
||||
#sanity check
|
||||
check "$USAGE" DU GZIP IMAGE_FILE MKFS
|
||||
}
|
||||
|
||||
target "install" || exit 2
|
||||
|
||||
_image_ramdisk_post()
|
||||
{
|
||||
_create_directories "bin" "dev" "lib" "proc" "mnt/root"
|
||||
|
||||
echo
|
||||
|
@ -72,7 +73,7 @@ EOF
|
|||
|
||||
|
||||
#image_rootfs
|
||||
_image_rootfs()
|
||||
_image_rootfs_pre()
|
||||
{
|
||||
#FIXME make IMAGE_SIZE optional and use ext2 then
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
|
||||
|
@ -82,9 +83,10 @@ _image_rootfs()
|
|||
|
||||
#sanity check
|
||||
check "$USAGE" DESTDIR DU GZIP IMAGE_FILE MKFS MV SUDO TAR
|
||||
}
|
||||
|
||||
target "install" || exit 2
|
||||
|
||||
_image_rootfs_post()
|
||||
{
|
||||
_create_directories "bin" "dev" "etc" "lib" "sbin"
|
||||
|
||||
echo
|
||||
|
@ -143,15 +145,29 @@ EOF
|
|||
|
||||
|
||||
#public
|
||||
#target_image
|
||||
target_image()
|
||||
#_image_post
|
||||
_image_post()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"ramdisk")
|
||||
_image_ramdisk
|
||||
_image_ramdisk_post
|
||||
;;
|
||||
"rootfs"|*)
|
||||
_image_rootfs
|
||||
_image_rootfs_post
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
#_image_pre
|
||||
_image_pre()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"ramdisk")
|
||||
_image_ramdisk_pre
|
||||
;;
|
||||
"rootfs"|*)
|
||||
_image_rootfs_pre
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#$Id$
|
||||
#Copyright (c) 2010 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2011 Pierre Pronchery <khorben@defora.org>
|
||||
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
#functions
|
||||
#private
|
||||
_image_image()
|
||||
_image_image_pre()
|
||||
{
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
|
||||
IMAGE_FILE Where to write the filesystem image\n\
|
||||
|
@ -32,14 +32,17 @@ _image_image()
|
|||
$DD if="$DEVZERO" of="$IMAGE_FILE" count="$IMAGE_SIZE" &&
|
||||
$MKFS "$IMAGE_FILE" || exit 2
|
||||
$MOUNT "$IMAGE_FILE" "$DESTDIR" || exit 2
|
||||
target "install"
|
||||
}
|
||||
|
||||
_image_image_post()
|
||||
{
|
||||
RET=$?
|
||||
$UMOUNT "$DESTDIR"
|
||||
exit $RET
|
||||
}
|
||||
|
||||
|
||||
_image_iso()
|
||||
_image_iso_pre()
|
||||
{
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
|
||||
IMAGE_FILE Where to write the filesystem image\n\
|
||||
|
@ -54,8 +57,10 @@ _image_iso()
|
|||
MKDIR MKISOFS RAMDISK TAR
|
||||
|
||||
$MKDIR "$DESTDIR" || exit 2
|
||||
target "install" || exit 2
|
||||
}
|
||||
|
||||
_image_iso_post()
|
||||
{
|
||||
#install kernel with ramdisk and modules
|
||||
$MKDIR "$DESTDIR/boot" || exit 2
|
||||
$INSTALL -m 755 "$IMAGE_KERNEL" "$DESTDIR/$KERNEL" || exit 2
|
||||
|
@ -84,7 +89,7 @@ EOF
|
|||
}
|
||||
|
||||
|
||||
_image_ramdisk()
|
||||
_image_ramdisk_pre()
|
||||
{
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:\n\
|
||||
IMAGE_FILE Where to write the filesystem image\n\
|
||||
|
@ -98,8 +103,10 @@ _image_ramdisk()
|
|||
IMAGE_SIZE INSTALL LN MKDIR MKFS MV
|
||||
|
||||
$MKDIR "$DESTDIR" || exit 2
|
||||
target "install" || exit 2
|
||||
}
|
||||
|
||||
_image_ramdisk_post()
|
||||
{
|
||||
#install kernel modules
|
||||
[ ! -z "$IMAGE_MODULES" ] && $CAT "$IMAGE_MODULES" | \
|
||||
(cd "$DESTDIR" && $TAR -xzf -)
|
||||
|
@ -133,17 +140,35 @@ _image_ramdisk()
|
|||
|
||||
|
||||
#public
|
||||
target_image()
|
||||
#_image_post
|
||||
_image_post()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"iso")
|
||||
_image_iso
|
||||
_image_iso_post
|
||||
;;
|
||||
"ramdisk")
|
||||
_image_ramdisk
|
||||
_image_ramdisk_post
|
||||
;;
|
||||
*)
|
||||
_image_image
|
||||
_image_image_post
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
#_image_pre
|
||||
_image_pre()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"iso")
|
||||
_image_iso_pre
|
||||
;;
|
||||
"ramdisk")
|
||||
_image_ramdisk_pre
|
||||
;;
|
||||
*)
|
||||
_image_image_pre
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#$Id$
|
||||
#Copyright (c) 2010 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2011 Pierre Pronchery <khorben@defora.org>
|
||||
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
#functions
|
||||
#private
|
||||
#image_image
|
||||
_image_image()
|
||||
_image_image_pre()
|
||||
{
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:
|
||||
IMAGE_BOOT Path to the bootloader
|
||||
|
@ -49,8 +49,11 @@ _image_image()
|
|||
$SUDO $MKFS "${VND}e" &&
|
||||
$SUDO $MOUNT "/dev/${VND}e" "$DESTDIR" &&
|
||||
$SUDO $CHOWN "$UID:$GID" "$DESTDIR" &&
|
||||
$MKDIR "$DESTDIR$PREFIX" &&
|
||||
_image_targets &&
|
||||
$MKDIR "$DESTDIR$PREFIX"
|
||||
}
|
||||
|
||||
_image_image_post()
|
||||
{
|
||||
$SUDO $CHOWN -R "0:0" "$DESTDIR" &&
|
||||
$SUDO $MKDIR "$DESTDIR/bin" &&
|
||||
$SUDO $MV "$DESTDIR$PREFIX/bin/sh" "$DESTDIR/bin/sh" &&
|
||||
|
@ -87,7 +90,7 @@ EOF
|
|||
|
||||
|
||||
#image_iso
|
||||
_image_iso()
|
||||
_image_iso_pre()
|
||||
{
|
||||
USAGE="Options for $IMAGE_TYPE on $TARGET:
|
||||
IMAGE_BOOT Path to the bootloader
|
||||
|
@ -100,7 +103,10 @@ _image_iso()
|
|||
|
||||
#sanity check
|
||||
check "$USAGE" IMAGE_BOOT IMAGE_FILE IMAGE_KERNEL LDSO MKISOFS
|
||||
target "install" || exit 2
|
||||
}
|
||||
|
||||
_image_iso_post()
|
||||
{
|
||||
$MKDIR "$DESTDIR/dev" || exit 2
|
||||
$SUDO $MKNOD -m 600 "$DESTDIR/dev/console" c 0 0 || exit 2
|
||||
$MKDIR "$DESTDIR/libexec" "$DESTDIR/usr/libexec" || exit 2
|
||||
|
@ -116,39 +122,3 @@ _image_iso()
|
|||
$INSTALLBOOT -m "$MACHINE" -o "console=pc" -e bootxx || exit 2
|
||||
$MKISOFS $MKISOFS_ARGS "$IMAGE_FILE" "$DESTDIR" || exit 2
|
||||
}
|
||||
|
||||
|
||||
#image_targets
|
||||
_image_targets()
|
||||
{
|
||||
#global settings
|
||||
CPPFLAGS="-nostdinc -isystem $DESTDIR$PREFIX/include"
|
||||
CFLAGS="-Wall -ffreestanding -g"
|
||||
|
||||
#libc
|
||||
LDFLAGS="-nostdlib -L$DESTDIR$PREFIX/lib -Wl,-rpath-link,$DESTDIR$PREFIX/lib -Wl,-rpath,$PREFIX/lib"
|
||||
SUBDIRS="System/src/libc"
|
||||
target install || return 2
|
||||
|
||||
#libSystem
|
||||
LDFLAGS="-nostdlib -L$DESTDIR$PREFIX/lib -Wl,-rpath-link,$DESTDIR$PREFIX/lib -Wl,-rpath,$PREFIX/lib -lc"
|
||||
SUBDIRS="System/src/libSystem/src System/src/libSystem/include"
|
||||
target install || return 2
|
||||
LDFLAGS="-nostdlib -L$DESTDIR$PREFIX/lib -Wl,-rpath-link,$DESTDIR$PREFIX/lib -Wl,-rpath,$PREFIX/lib -lc `$CC -print-libgcc-file-name` $DESTDIR$PREFIX/lib/start.o"
|
||||
SUBDIRS="System/src/libSystem/tools"
|
||||
target install || return 2
|
||||
|
||||
#POSIX environment
|
||||
SUBDIRS="Apps/Unix/src/sh
|
||||
Apps/Unix/src/utils
|
||||
Apps/Unix/src/devel
|
||||
Apps/Unix/src/others
|
||||
Apps/Servers/src/inetd"
|
||||
target install || return 2
|
||||
|
||||
#DeforaOS environment
|
||||
SUBDIRS="System/src/Init
|
||||
System/src/Splasher
|
||||
System/src/VFS/src"
|
||||
target install || return 2
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#$Id$
|
||||
#Copyright (c) 2009 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2011 Pierre Pronchery <khorben@defora.org>
|
||||
|
||||
|
||||
|
||||
|
@ -9,15 +9,29 @@
|
|||
|
||||
#functions
|
||||
#public
|
||||
#target_image
|
||||
target_image()
|
||||
#_image_post
|
||||
_image_post()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"iso")
|
||||
_image_iso
|
||||
_image_iso_post
|
||||
;;
|
||||
*)
|
||||
_image_image
|
||||
_image_image_post
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
#_image_pre
|
||||
_image_pre()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"iso")
|
||||
_image_iso_pre
|
||||
;;
|
||||
*)
|
||||
_image_image_pre
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#$Id$
|
||||
#Copyright (c) 2009 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2011 Pierre Pronchery <khorben@defora.org>
|
||||
|
||||
|
||||
|
||||
|
@ -9,15 +9,29 @@
|
|||
|
||||
#functions
|
||||
#public
|
||||
#target_image
|
||||
target_image()
|
||||
#_image_post
|
||||
_image_post()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"iso")
|
||||
_image_iso
|
||||
_image_iso_post
|
||||
;;
|
||||
*)
|
||||
_image_image
|
||||
_image_image_post
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
#_image_pre
|
||||
_image_pre()
|
||||
{
|
||||
case "$IMAGE_TYPE" in
|
||||
"iso")
|
||||
_image_iso_pre
|
||||
;;
|
||||
*)
|
||||
_image_image_pre
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#$Id$
|
||||
#Copyright (c) 2009 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2011 Pierre Pronchery <khorben@defora.org>
|
||||
|
||||
|
||||
|
||||
|
@ -9,8 +9,15 @@
|
|||
|
||||
#functions
|
||||
#public
|
||||
#target_image
|
||||
target_image()
|
||||
#_image_post
|
||||
_image_post()
|
||||
{
|
||||
_image_image
|
||||
_image_image_post
|
||||
}
|
||||
|
||||
|
||||
#_image_pre
|
||||
_image_pre()
|
||||
{
|
||||
_image_image_pre
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user