diff options
author | Jonathan Bauer | 2013-03-14 14:22:20 +0100 |
---|---|---|
committer | Jonathan Bauer | 2013-03-14 14:22:20 +0100 |
commit | 2a94d11a5525f66698678a76f1341831b2e622f7 (patch) | |
tree | d68bf6ae8b5f9c227002c0e8c4bfafb9c48160d8 /server | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff) | |
download | tm-scripts-2a94d11a5525f66698678a76f1341831b2e622f7.tar.gz tm-scripts-2a94d11a5525f66698678a76f1341831b2e622f7.tar.xz tm-scripts-2a94d11a5525f66698678a76f1341831b2e622f7.zip |
new arguments for mltk, see manpages & changed INIT_DIR to TARGET_BUILD DIR
Diffstat (limited to 'server')
-rwxr-xr-x | server/build_core | 73 |
1 files changed, 3 insertions, 70 deletions
diff --git a/server/build_core b/server/build_core index 8bea4043..cf748428 100755 --- a/server/build_core +++ b/server/build_core @@ -20,85 +20,18 @@ MODULE_DIR=${ROOT_DIR}/server -STAGE31_STATIC_DIR=${ROOT_DIR}/data/stage3.1 -STAGE31_DIR=${MODULE_DIR}/stage3.1 +STAGE31_DIR=${ROOT_DIR}/remote/stage3.1 STAGE32_DIR=${ROOT_DIR}/remote/stage3.2 # initial checks initial_checks() { 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 -b busybox' first." + [ -d "${STAGE31_DIR}" ] || perror "No stage3.1 directory found. Please run './mltk core -b' first." + [ -d "${STAGE32_DIR}" ] || perror "No stage3.2 directory found. Please run './mltk tools -b' 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}'" - - # produce openslx dir - mkdir -p "${MODULE_DIR}/openslx/mnt" || perror "Cannot create openslx dir '${MODULE_DIR}/openslx/mnt'" - - # create basic directory structure - mkdir -p "${STAGE31_DIR}"/{bin,dev,proc,run,etc,mnt,sys} || perror "Cannot create basic directory structure in '${STAGE31_DIR}'" - - # copy device files from running system - cp -a /dev/{console,kmsg,mem,null,tty,tty0,tty1,tty9,urandom,zero} \ - "${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." - - # fetch the libraries needed for busybox - BASICLIBS="" - for i in $(ldd "${STAGE31_DIR}/bin/busybox"); - do - if [ $(echo $i | grep '^/' | grep -c ld) -eq 1 \ - -o $(echo $i | grep '^/' | grep -c libc.so) -eq 1 ]; - then - BASICLIBS="$BASICLIBS $i $(readlink -f "$i")" - fi - done - tarcopy "$BASICLIBS" "${STAGE31_DIR}" - - #check for kernel modules, if not present copy from system - if [ ! -d ${STAGE31_DIR}/lib/modules ]; - then - pinfo "Copying modules for kernel $(uname -r)..." - mkdir -p "${STAGE31_DIR}/lib/modules/$(uname -r)/kernel" || perror "Cannot create '${STAGE31_DIR}/lib/modules/$(uname -r)/kernel'" - cd /lib/modules/$(uname -r)/kernel || perror "No Directory /lib/modules/$(uname -r)/kernel found." - tarcopy "$(cat ${MODULE_DIR}/stage31.modules)" "${STAGE31_DIR}/lib/modules/$(uname -r)/kernel" - cd - >/dev/null - else - pinfo "Not copying kernel modules from system, as '${STAGE31_DIR}/lib/modules' already exists." - fi - - #check for firmware, if not present copy from system - if [ ! -d ${STAGE31_DIR}/lib/firmware ]; - then - pinfo "Copying firmware for kernel $(uname -r)..." - mkdir -p "${STAGE31_DIR}/lib/firmware/$(uname -r)" || perror "Cannot create '${STAGE31_DIR}/lib/firmware/$(uname -r)'" - cd /lib/firmware || perror "No Directory /lib/firmware found." - tarcopy "$(cat ${MODULE_DIR}/stage31.firmware)" "${STAGE31_DIR}/lib/firmware" - cd - >/dev/null - cd /lib/firmware/$(uname -r) || perror "No Directory /lib/firmware/$(uname -r) found." - tarcopy "$(cat ${MODULE_DIR}/stage31.firmware)" "${STAGE31_DIR}/lib/firmware/$(uname -r)" - cd - >/dev/null - else - pinfo "Not copying firmware from system, as '${STAGE31_DIR}/lib/firmware' already exists." - fi - - #quick fix for modules.* files - cp /lib/modules/$(uname -r)/modules.* ${STAGE31_DIR}/lib/modules/$(uname -r)/ - - #generate initramfs - generate_initramfs "initramfs" "${STAGE31_DIR}" -} - generate_squashfs() { [[ $CORE_NO_SQUASHFS == 1 ]] && return local TOOL_STR="$TOOL_STR generate_squashfs:" |