summaryrefslogtreecommitdiffstats
path: root/server/build_core
diff options
context:
space:
mode:
authorMichael Neves2013-02-27 19:37:04 +0100
committerMichael Neves2013-02-27 19:37:04 +0100
commit459c9c02adf020d3e85d809c902196e801085a65 (patch)
treeaeec9e371eb37ea0419c05870b4a9a699c331d70 /server/build_core
parentcopy modules/firmware to stage31, generate separate initramfs for squashfs (diff)
parenttihi (diff)
downloadtm-scripts-459c9c02adf020d3e85d809c902196e801085a65.tar.gz
tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.tar.xz
tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.zip
init and build_core merges
Diffstat (limited to 'server/build_core')
-rwxr-xr-xserver/build_core18
1 files changed, 10 insertions, 8 deletions
diff --git a/server/build_core b/server/build_core
index a0725bec..b2c38702 100755
--- a/server/build_core
+++ b/server/build_core
@@ -26,14 +26,16 @@ STAGE32_DIR=${ROOT_DIR}/remote/stage3.2
# initial checks
initial_checks() {
- [ -d ${STAGE32_DIR} ] || perror "No stage3.2 directory found. Please run './mltk tools build' first."
+ local TOOL_STR="$TOOL_STR initial_checks:"
+ [ -d "${STAGE32_DIR}" ] || perror "No stage3.2 directory found. Please run './mltk --tools -b' first."
- [ -e ${STAGE32_DIR}/openslx/bin/busybox ] || perror "Busybox not found, run './mltk tools build busybox' first."
+ [ -e "${STAGE32_DIR}/openslx/bin/busybox" ] || perror "Busybox not found, run './mltk --tools -b busybox' first."
- if [ -z $(which mksquashfs) ] && perror "mksquashfs not found, please install squashfs-tools first."
+ [ -z $(which mksquashfs) ] && perror "mksquashfs not found, please install squashfs-tools first."
}
generate_rootfs() {
+ local TOOL_STR="$TOOL_STR generate_rootfs:"
# produce stage3.1
mkdir -p "${STAGE31_DIR}" || perror "Cannot create stage3.1 dir '${STAGE31_DIR}'"
@@ -49,7 +51,7 @@ generate_rootfs() {
"${STAGE31_DIR}"/dev || perror "Cannot copy devices from running system"
# copy busybox, its libs and static data to stage3.1
- cp -r "${STAGE32_DIR}/openslx/*" "${STAGE31_STATIC_DIR}/*" "${STAGE31_DIR}" || perror "Copying busybox, its libs and static data failed."
+ cp -r "${STAGE32_DIR}"/openslx/* "${STAGE31_STATIC_DIR}"/* "${STAGE31_DIR}" || perror "Copying busybox, its libs and static data failed."
# fetch the libraries needed for busybox
BASICLIBS=""
@@ -97,7 +99,7 @@ generate_rootfs() {
}
generate_squashfs() {
- # finalize the initramfs target
+ local TOOL_STR="$TOOL_STR generate_squashfs:"
[ -e "${MODULE_DIR}/openslx/mnt/openslx.sqfs" ] && rm "${MODULE_DIR}/openslx/mnt/openslx.sqfs"
pinfo "Writing openslx.sqfs to '${MODULE_DIR}/openslx/mnt/'"
mksquashfs "${STAGE32_DIR}" "${MODULE_DIR}/openslx/mnt/openslx.sqfs" -comp xz -b 1M -no-recovery || perror "mksquashfs failed ($?)."
@@ -107,7 +109,6 @@ generate_squashfs() {
generate_stage31() {
initial_checks
generate_rootfs
-
generate_squashfs
if [ ! -e ${MODULE_DIR}/kernel ]; then
@@ -118,12 +119,13 @@ generate_stage31() {
}
clean_core() {
+ local TOOL_STR="$TOOL_STR clean_core:"
pinfo "Cleaning '${STAGE31_DIR}'..."
- [ -d ${STAGE31_DIR} ] && { rm -rf ${STAGE31_DIR} || perror "rm -rf failed." }
+ [ -d ${STAGE31_DIR} ] && { rm -rf ${STAGE31_DIR} || perror "rm -rf failed."; }
pinfo "Cleaning '${MODULE_DIR}/kernel'..."
[ -e ${MODULE_DIR}/kernel ] && { rm ${MODULE_DIR}/kernel || perror "rm failed." }
pinfo "Cleaning '${MODULE_DIR}/initramfs'..."
- [ -e ${MODULE_DIR}/initramfs ] && { rm ${MODULE_DIR}/initramfs || perror "rm failed." }
+ [ -e ${MODULE_DIR}/initramfs ] && { rm ${MODULE_DIR}/initramfs || perror "rm failed."; }
pinfo "Cleaning '${MODULE_DIR}/openslx'..."
[ -d ${MODULE_DIR}/openslx ] && { rm -rf ${MODULE_DIR}/openslx || perror "rm failed." }
pinfo "Cleaning '${MODULE_DIR}/initramfs2'..."