From 814c24537b7cef2550de9a72fbc193233b0c7e19 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 1 Feb 2013 17:52:53 +0100 Subject: german keymap --- remote/tools/base/data/etc/keymaps/de_DE | Bin 0 -> 2823 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 remote/tools/base/data/etc/keymaps/de_DE diff --git a/remote/tools/base/data/etc/keymaps/de_DE b/remote/tools/base/data/etc/keymaps/de_DE new file mode 100644 index 00000000..375c2012 Binary files /dev/null and b/remote/tools/base/data/etc/keymaps/de_DE differ -- cgit v1.2.3-55-g7522 From da1d7c15669ad4f6a12eb1a0170dc295da619611 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 5 Feb 2013 16:51:08 +0100 Subject: improved usage info --- mltk | 5 ++++- server/build_core | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mltk b/mltk index 0e244752..2329e707 100755 --- a/mltk +++ b/mltk @@ -100,10 +100,13 @@ read_params() { shift ;; *) - break + break ;; esac done + + # exit if no command + [ "x$BUILD" = "x" -a "x$CLEAN" = "x" ] && print_usage && exit 1 TOOLS="$@" } diff --git a/server/build_core b/server/build_core index c9aa7add..8435a4fe 100755 --- a/server/build_core +++ b/server/build_core @@ -28,7 +28,7 @@ STAGE32_DIR=${ROOT_DIR}/remote/stage3.2 initial_checks() { if [ ! -d ${STAGE32_DIR} ]; then - echo "No stage3.2 directory found. Please run setup_tools first." + echo "No stage3.2 directory found. Please run \"./mltk tools build\" first." exit 1 fi @@ -53,6 +53,7 @@ initial_checks() { cp -r /lib/modules/$(uname -r) ${STAGE32_DIR}/lib/modules/ fi + # TODO: check for aufs and squaskfs modules } generate_initramfs() { @@ -88,7 +89,6 @@ generate_initramfs() { generate_squashfs() { # finalize the initramfs target - [ ! -d ${STAGE32_DIR} ] && echo "No stage3.2 directory found. Please run setup_tools first." && exit 1 [ -e ${STAGE31_DIR}/mnt/openslx.sqfs ] && rm ${STAGE31_DIR}/mnt/openslx.sqfs mksquashfs ${STAGE32_DIR} ${STAGE31_DIR}/mnt/openslx.sqfs -comp xz -b 1M -no-recovery 2>/dev/null -- cgit v1.2.3-55-g7522 From 738ed47b2dd6981e99595001dd87c22e0f9f81df Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 5 Feb 2013 17:29:01 +0100 Subject: [setup_tools] check for locate --- remote/setup_tools | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/remote/setup_tools b/remote/setup_tools index ed6f58e9..091a63da 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -6,14 +6,15 @@ MODULE_DIR=${ROOT_DIR}/remote TOOL_DIR=${MODULE_DIR}/tools INIT_DIR=${MODULE_DIR}/stage3.2 -setup_git () +initial_checks () { - if [ ! -z "${GIT}" ]; then - GIT_BIN=$(which git) - [ -z "${GIT_BIN}" ] && echo "Installing git..." && apt-get install git - fi + for BIN in $(which git) $(which locate) + do + [ -z $BIN ] && echo "Installing $BIN..." && apt-get install $BIN + done } + read_config () { TOOL_CONFIG=${TOOL_DIR}/${TOOL}/${TOOL}.conf @@ -165,6 +166,8 @@ get_basic_libs () { generate_stage32 () { + initial_checks + # if no arguments assume all. if [ "x$1" = "x" -o "x$1" = "xall" ]; then tools=$(ls ${TOOL_DIR}) @@ -183,7 +186,6 @@ generate_stage32 () { cd ${TOOL} read_config read_build - setup_git install_dependencies fetch_source build -- cgit v1.2.3-55-g7522 From c5dfc66d6425faf6ec8297cee1ef0afb552df349 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 7 Feb 2013 20:15:44 +0100 Subject: Modules for systemd scripts for standard configuration (local harddisk, swap, IP and DNS ...) --- .../systemd/data/etc/systemd/system/activate-swap | 30 ++++ .../data/etc/systemd/system/analyse-disk.sh | 120 ++++++++++++++ .../systemd/data/etc/systemd/system/fetch-config | 178 +++++++++++++++++++++ .../systemd/data/etc/systemd/system/ip-dns-conf | 86 ++++++++++ .../data/etc/systemd/system/network@.service | 1 + 5 files changed, 415 insertions(+) create mode 100644 remote/tools/systemd/data/etc/systemd/system/activate-swap create mode 100644 remote/tools/systemd/data/etc/systemd/system/analyse-disk.sh create mode 100644 remote/tools/systemd/data/etc/systemd/system/fetch-config create mode 100644 remote/tools/systemd/data/etc/systemd/system/ip-dns-conf diff --git a/remote/tools/systemd/data/etc/systemd/system/activate-swap b/remote/tools/systemd/data/etc/systemd/system/activate-swap new file mode 100644 index 00000000..10cb42e9 --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/activate-swap @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Initialize swap for OpenSLX linux stateless clients, both for swap on local +# disk partitions as well as compressed ramzswap or similar + +############################################################################# + +# depends on mount-disk.sh +# depends on availability of the appropriate kernel module/functionality + +# try to enable compressed RAM SWAP / ZRAM +if modprobe ${MODPRV} ramzswap 2>/dev/null && [ -f /usr/bin/rzscontrol ] ; then + rzscontrol /dev/ramzswap0 --init + swapon /dev/ramzswap0 2>/dev/null + #hdswap="# disk swap disabled because of enabled compressed ramswap" +elif modprobe ${MODPRV} zram 2>/dev/null ; then + # assign a quarter of total mem to zram + echo $(( $(free -k | awk '/^Mem:/ { print $2 }') * 256 )) > /sys/block/zram0/disksize + mkswap /dev/zram0 2>/dev/null + swapon /dev/zram0 2>/dev/null +fi diff --git a/remote/tools/systemd/data/etc/systemd/system/analyse-disk.sh b/remote/tools/systemd/data/etc/systemd/system/analyse-disk.sh new file mode 100644 index 00000000..0c152dbf --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/analyse-disk.sh @@ -0,0 +1,120 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Local hard disk autoconfiguration script for OpenSLX linux stateless +# clients, detecting swap and special partitions + +############################################################################# + +# Todo: +# * This script should be run just once per boot! +# * The activation of swap could/should be handled in separate script!? +# * The mounting of /tmp could/should be done separately? +# * Same for other partitions, use information of /etc/fstab for that? +# * Should we just install xfs in the source system and boil down everything +# onto that? + +# General formatter for the /tmp partition on a local harddisk +diskfm () { +local target=$1 +local mntpnt=$2 +local fs +local path +for fs in xfs reiserfs ext2 ; do + if strinfile "$fs" /proc/filesystems || modprobe ${MODPRV} $fs ; then + unset $found + for path in /sbin /bin /usr/sbin /usr/bin ; do + if test -x /mnt/$path/mkfs.$fs ; then + found=yes + case mkfs.$fs in + mkfs.xfs) + fopt="-f" + mopt="-o noexec" + ;; + mkfs.ext2) + fopt="-Fq" + mopt="-o nocheck,noexec" + ;; + mkfs.reiserfs) + fopt="-f" + mopt="-o noexec" + ;; + esac + mkfs.$fs $fopt $target >/dev/null 2>&1 #|| error + if [ -z $mntpnt ] ; then + umount /tmp 2>/dev/null + if mount -t $fs -n $mopt $target /tmp 2>/dev/null; then + return 0 + else + mount -n -t tmpfs none /tmp + fi + else + mkdir -p $mntpnt + mount -t $fs -n -o loop $target $mntpnt 2>/dev/null + return 0 + fi + fi + done + [ -z $found ] && continue + else break + fi +done +} + +# Check for local harddisks and appropriate partitions +fdisk -l /dev/$hd|sed -n "/^\/dev\//p" >/etc/disk.partition + +# Check for standard swap partitions and make them available to the system +for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ 82 /p"|sed -e "s/[[:space:]].*//") ; do + echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >>/etc/fstab +done + +# We use special non assigned partition type (id44) for harddisk scratch +# space, thus no normal filesystem will be incidentally deleted or +# corrupted +for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do + # check for supported filesystem and formatter + ( if diskfm $hdpartnr ; then + echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" >/tmp/tmpready + echo -e "$hdpartnr\t/tmp\t\tauto\t\tdefaults\t 0 0" >>/etc/fstab + else + echo "formatting failed for some reason ($(sysup))" >/tmp/tmpready + fi ) & + break +done + +# Put detected linux partitions (83) into /etc/fstab with "noauto", special +# partition 45 (persistent scratch) to /var/scratch and 46 to /var/openslx +for partid in 83 45 46 ; do + for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ ${partid} /p"|sed -e "s/[[:space:]].*//") ; do + mkdir -p /media/${hdpartnr#/dev/*} 2>/dev/null + if [ ${partid} -eq 83 ] ; then + echo -e "$hdpartnr\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,\ +noexec\t 0 0" >>/tmp/fstab + elif [ ${partid} -eq 45 ] ; then + #mount -t auto ${hdpartnr} /media/${hdpartnr#/dev/*} + #ln -sf /media/${hdpartnr#/dev/*} /var/scratch + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\ +\t\t 0 0" >>/tmp/fstab + elif [ ${partid} -eq 46 ] ; then + # Mount a home directory to (/mnt)/var/home + #mount -t auto ${hdpartnr} /mnt/media/${hdpartnr#/dev/*} \n\ + #test -d /mnt/media/${hdpartnr#/dev/*}/home && \ + # ln -sf /media/${hdpartnr#/dev/*} /var/home + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\ +\t\t 0 0" >>/tmp/fstab + fi + done +done + diff --git a/remote/tools/systemd/data/etc/systemd/system/fetch-config b/remote/tools/systemd/data/etc/systemd/system/fetch-config new file mode 100644 index 00000000..556f0f41 --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/fetch-config @@ -0,0 +1,178 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Fetch configuration from server ... + +############################################################################# + +# Depends on configured networking, provides configuration + + +# Todo: rewrite for next-gen system - principle would be the same ... + +# Function for retrieving configuration file (machine-setup) via tftp from a +# predefined server or given source (file=tftp-server:/path via kernel +# command line) +unpack () { +# $1 is config file name to get, $2 IP of server to get file from +local dst=$1 +if [ -s $dst ] ; then + # fixme: handle different types of packaging (gzip/bzip2)?? + if ! tar -xpzf $dst 2> /tmp/ConfTGZ-tar-error ; then + cat /tmp/ConfTGZ-tar-error + error "$unpack_ConfTGZ" nonfatal + rm /tmp/ConfTGZ-tar-error + fi + [ "$DEBUGLEVEL" -le 2 -o "$DEBUGLEVEL" -eq 8 ] && rm $dst + return 0 +else + return 1 +fi +} + +# tftp wrapper +# usage tftp_get [count] +# count is optional - default is 3 - use -1 for indefinit +tftp_get () { + local file="$1" + local file_server="$2" + local download_successful=0 + local countdown="$3" + + if [ -z "$1" -o -z "$2" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[tftp_get] Usage: tftp_get [count]" + return 1; + fi + + [ "$countdown" = "" ] && countdown=3 + + until [ $download_successful -eq 1 ] + do + if [ "$countdown" = "0" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[tftp_get] download of \"$file\" from \"$file_server\" ... failed" + return 0; + fi + tftp -g -r "/$file" -l /tmp/$(basename $file) $file_server + [ -s /tmp/$(basename $file) ] && download_successful=1 + countdown=$(expr $countdown - 1) + usleep 200000 + done + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[tftp_get] download of \"$file\" from \"$file_server\" ... successful" + return 0; +} + + +# wget wrapper +# usage wget_get [count] +# count is optional - default is 3 - use -1 for indefinit +wget_get () { + local file="$1" + local file_server="$2" + local download_successful=0 + local countdown="$3" + + if [ -z "$1" -o -z "$2" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[wget_get] Usage: wget_get [count]" + return 1; + fi + + [ "$countdown" = "" ] && countdown=3 + + until [ $download_successful -eq 1 ] + do + if [ "$countdown" = "0" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[wget_get] download of \"$file\" from \"$file_server\" ... failed" + return 0; + fi + wget -q $file_server$file -O /tmp/$(basename $file) + [ -s /tmp/$(basename $file) ] && download_successful=1 + countdown=$(expr $countdown - 1) + usleep 200000 + done + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[wget_get] download of \"$file\" from \"$file_server\" ... successful" + return 0; +} + + +fileget () { +# normally tftp would be used, alternatively use wget for ftp or http +# if local device file is specified - mount and unmount after copying +local cfgfile +[ "x$fileprot" = "x" ] && fileprot=tftp +if [ "x$filepath" != "x" ] ; then + cfgfile=${filepath} + [ "x$fileserv" = "x" ] && fileserv=$(checkip ${serverip}) + # wait for dns if "fileserv" is a name and not lbd device + [ "$fileprot" != "lbd" ] && \ + echo ${fileserv} | grep -qi [a-z] + [ $DEBUGLEVEL -ge 1 ] && echo "fileget - fileprot:$fileprot, filepath:\ +$filepath, fileserv:$fileserv" >>$LOGFILE + case "$fileprot" in + ftp|http) + wget_get $cfgfile $fileprot://$fileserv \ + && { unpack /tmp/$(basename $cfgfile) && break; } 2>>$LOGFILE + ;; + lbd) + local ldev=$fileserv + echo "Waiting for configuration file ${cfgfile} ...." + [ $DEBUGLEVEL -ge 1 ] && echo "fileget - fileprot:$fileprot, filepath:\ +$filepath, fileserv:$fileserv" >>$LOGFILE + waitfor /mnt/${cfgfile} 10000 + if [ -f /mnt/${cfgfile} ]; then + unpack /mnt/$cfgfile + else + error "$init_errlfg" + fi + ;; + *) + tftp_get $cfgfile $fileserv \ + && unpack /tmp/$(basename $cfgfile) 2>>$LOGFILE + ;; + esac +else + # predefined value for OpenSLX environment; it is expected that this + # directory is just below the tftpboot (path to which the daemon is + # restricted to) + filepath="client-config" + [ "x$fileserv" = "x" ] && fileserv=$(checkip ${serverip}) + [ $DEBUGLEVEL -ge 1 ] && echo "fileget - fileprot:$fileprot, filepath:\ +$filepath, fileserv:$fileserv" >>$LOGFILE + # try to get configuration files successively; start with distro client + # and try last distro default ... + mac=$(echo $macaddr|sed "s/:/-/g") + for cfgfile in ${filepath}/${SYSTEM_NAME}/01-$mac.tgz \ + ${filepath}/${SYSTEM_NAME}/default.tgz ; do + case "$fileprot" in + ftp|http) + wget $fileprot://$fileserv/$cfgfile -O /tmp/$(basename $cfgfile) \ + 2>>$LOGFILE && { unpack /tmp/$(basename $cfgfile) && break; } + ;; + tftp) + tftp_get $cfgfile $fileserv \ + 2>>$LOGFILE && { unpack /tmp/$(basename $cfgfile) && break; } + ;; + esac + done + echo -e "\n## Configuration via fileget from ${fileprot}://${fileserv}/\ +${cfgfile}\n# Hierarchy is distro client and as last distro/default" \ + >>/tmp/confviafile +fi +cat /initramfs/machine-setup >>/tmp/confviafile 2>/dev/null || \ + error "$nomachsetup" +echo "fileget via $fileprot from $fileserv/$cfgfile finished" >/tmp/file-done +[ $DEBUGLEVEL -ge 1 ] && echo "fileget from $cfgfile finished" >>$LOGFILE +} diff --git a/remote/tools/systemd/data/etc/systemd/system/ip-dns-conf b/remote/tools/systemd/data/etc/systemd/system/ip-dns-conf new file mode 100644 index 00000000..f14ecd88 --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/ip-dns-conf @@ -0,0 +1,86 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Set IP and DNS configuration ... + +############################################################################# + +# Depends on running network interface, provides IP and DNS configuration + +# Dns and ip configuration, hostname of the machine --> to be merged with udhcpc.default.script!! +echo "$host_name" >/proc/sys/kernel/hostname +echo -e "# /etc/hosts - file generated by $0 during OpenSLX stage3\ +\n#\n# IP-Address Full-Qualified-Hostname Short-Hostname\n#\n\ +127.0.0.1\tlocalhost\n::1\t\tlocalhost ipv6-localhost ipv6-loopback\n\ +fe00::0\t\tipv6-localnet\nff00::0\t\tipv6-mcastprefix\nff02::1\ +\t\tipv6-allnodes\nff02::2\t\tipv6-allrouters\nff02::3\t\t\ +ipv6-allhosts\n" >/etc/hosts +if [ -n "${domain_name}" ]; then + echo -en "${clientip}\t" >>/etc/hosts + for name in ${domain_name}; do + echo -en "${host_name}.${name} " >>/etc/hosts + done + echo -e "${host_name}" >>/etc/hosts +else + echo -e "${clientip}\t${host_name}" >>/etc/hosts +fi +# set up domainname and resolving +#rm -rf /etc/resolv.conf + +out=/etc/resolv.conf +echo -e "# /etc/resolv.conf - file generated by\n#\t$0:\n\ +#\t${date}\n#options timeout:1 attempts:1 rotate" > $out + +[ "x${domain_name}" != "x" ] && echo -e "domain ${domain_name}" >> $out +[ "x${domain_search}" != "x" ] && echo -e "search ${domain_search}" >> $out +# fallback +[ "x${domain_search}" == "x" ] && [ "x${domain_name}" != "x" ] && \ + echo -e "search ${domain_name}" >> $out + +[ -n "${domain_name_servers}" ] && { + for name in ${domain_name_servers}; do + echo nameserver ${name} >> $out; + done; } + +# Create hostname file +[ -n ${host_name} ] && [ -n ${domain_name} ] && \ + echo "${host_name}.${domain_name}" > /etc/hostname + + +# Set greeting and add information on booted system +len=$(expr length ${SLXVERSION}${SYSTEM_NAME}) +if [ $len -le 28 ] ; then + vdstr="Stateless Workstation (V${SLXVERSION}/${SYSTEM_NAME})" + smax=28 +else + vdstr="V${SLXVERSION}/${SYSTEM_NAME}" + smax=52 +fi +while [ $len -le $smax ] ; do + vdstr="$vdstr " + len=$(($len + 1)) +done +len=$(expr length ${host_name}) +while [ $len -le 30 ] ; do + space="$space " + len=$(($len + 1)) +done +echo " + WELCOME TO $space \n (\l) + _____ ______ ______ __ __ _______ __ __ __ + / _ | _ | ___| | | | | ____| | | | | | + | | | | |_| | |_ | | | | |___ | | / / + | | | | ___/| _| | | ____ | | | | + | |_| | | | |___| | | | ____| | |___ / / + _____/|__| |______|__| |__| |_______|______|__| |__| + + $vdstr (c) +" >/etc/issue diff --git a/remote/tools/systemd/data/etc/systemd/system/network@.service b/remote/tools/systemd/data/etc/systemd/system/network@.service index 01f3a526..db8169c1 100644 --- a/remote/tools/systemd/data/etc/systemd/system/network@.service +++ b/remote/tools/systemd/data/etc/systemd/system/network@.service @@ -7,6 +7,7 @@ Before=network.target Type=oneshot RemainAfterExit=yes ExecStart=/openslx/bin/ip link set dev %I up +# We should have our own extended udhcpc script here (see stuff in ip-dns-conf) ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.default.script -i %I [Install] -- cgit v1.2.3-55-g7522 From 606e20297bc3ebb6f6432178c42de5ac859d7d10 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 8 Feb 2013 17:34:49 +0100 Subject: [base] mount.aufs & mount.nfs --- remote/tools/base/base.build | 23 +++++++++++++++++------ remote/tools/base/base.conf | 13 ++++++++++--- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build index 91cbfa3f..88d19684 100644 --- a/remote/tools/base/base.build +++ b/remote/tools/base/base.build @@ -17,8 +17,16 @@ build() { for BIN in ${REQUIRED_BINARIES} do BIN_LOCATION=$(which ${BIN}) - [ -e ${BIN_LOCATION} ] && echo ${BIN_LOCATION} >> ${FILELIST} - [ -L ${BIN_LOCATION} ] && echo $(readlink ${BIN_LOCATION}) >> ${FILELIST} + if [ ! -z ${BIN_LOCATION} -a -e ${BIN_LOCATION} ]; + then + echo "[$TOOL] Processing $BIN at $BIN_LOCATION ..." + echo ${BIN_LOCATION} >> ${FILELIST} + [ -L ${BIN_LOCATION} ] \ + && echo "[$TOOL] ${BIN_LOCATION} is a symbolic link, copying $(readlink -f ${BIN_LOCATION})" \ + && echo $(readlink -f ${BIN_LOCATION}) >> ${FILELIST} + else + echo "[$TOOL] ${BIN} not found on the system!" + fi done for LIB in ${REQUIRED_LIBRARIES} @@ -38,7 +46,9 @@ build() { [ ! -d ${FILE} ] && echo ${FILE} >> ${FILELIST} done - tar -cpv $(cat ${FILELIST}) | tar -xpv -C ${BUILDDIR} &>/dev/null + echo "[$TOOL] File list generated as ${BUILDDIR}/${FILELIST}." + echo "--------------------------------------------------------------------" + (tar -cpv $(cat ${FILELIST}) | tar -xpv -C ${BUILDDIR}) &>/dev/null } post_copy() { @@ -58,13 +68,13 @@ post_copy() { cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} # copy pam modules, TODO: better way to find arch-dependant interfix... - tar -cpv $(dirname $(locate pam_unix.so|grep ^/lib/)) | tar -xpv -C ${INIT_DIR} &>/dev/null + (tar -cpv $(dirname $(locate pam_unix.so|grep ^/lib/)) | tar -xpv -C ${INIT_DIR}) &>/dev/null # quick fix for /etc/fstab echo "# no configuration" >> ${INIT_DIR}/etc/fstab # link /etc/mtab, needed for systemd - ln -s /proc/self/mounts ${INIT_DIR}/etc/mtab + [ ! -e ${INIT_DIR}/etc/mtab ] && ln -s /proc/self/mounts ${INIT_DIR}/etc/mtab # quick fix for missing group in /etc/group echo "lock:x:128:" >> ${INIT_DIR}/etc/group @@ -80,5 +90,6 @@ post_copy() { #cp -r /lib/modules/$(uname -r) ${INIT_DIR}/lib/modules/$(uname -r) #quick fix xterm symlink - ln -s /usr/lib/libXaw7.so.7.0.0 ${INIT_DIR}/usr/lib/libXaw7.so.7 + [ -e /usr/lib/libXaw7.so.7.0.0 ] && \ + ln -s /usr/lib/libXaw7.so.7.0.0 ${INIT_DIR}/usr/lib/libXaw7.so.7 } diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 5e97fe51..4322aa73 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -8,6 +8,9 @@ REQUIRED_BINARIES=" bash sulogin mount umount + mount.nfs + mount.aufs + umount.aufs rm ldd strace @@ -31,10 +34,13 @@ REQUIRED_LIBRARIES=" libcap libpam libutil libtinfo - libresolv" + libresolv + libau" REQUIRED_DIRECTORIES=" /etc/pam.d /etc/security" -REQUIRED_FILES=" /etc/passwd +REQUIRED_FILES=" /sbin/mount.nfs4 + /sbin/umount.nfs4 + /etc/passwd /etc/shadow /etc/group /etc/hostname @@ -45,4 +51,5 @@ REQUIRED_FILES=" /etc/passwd /etc/login.defs /etc/nsswitch.conf /etc/securetty - /etc/default/locale" + /etc/default/locale + /etc/default/aufs" -- cgit v1.2.3-55-g7522 From d9e747a690f34401e1d545fa4c794310d105f510 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 8 Feb 2013 17:39:04 +0100 Subject: [setup_tools] cleaned up debug message, use -d for debug output or it will write to file. --- remote/setup_tools | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/remote/setup_tools b/remote/setup_tools index 091a63da..ef498960 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -44,6 +44,7 @@ copyfileswithdependencies () [ ! -d build ] && echo "No build directory for ${TOOL} found." && return cd build + [ "x$DEBUG" != "x1" ] && echo "Logging to build_stage32.log" && exec 6>&1 > build_stage32.log COPYFILES_LIST="list_wanted_stage3.2" [ -e ${COPYFILES_LIST} ] && rm ${COPYFILES_LIST} @@ -56,35 +57,46 @@ copyfileswithdependencies () echo "-----------------------------------------------------------------" continue fi - echo "Found ${FILENAME} at ${FILE}. Searching libraries..." + echo "Found ${FILENAME} at ${FILE}" echo ${FILE} >> ${COPYFILES_LIST} # fetch dependencies # quick fix to exclude libc*, else it copies unneeded libs... + # workaround for + ldd ${FILE} &>/dev/null + ldd_exit_code=$? + if [ "x$ldd_exit_code" != "x0" ]; + then + echo "ldd $FILE failed." + continue + fi for i in $(ldd ${FILE} |awk '{print $1 $2 $3}'|grep -v ld-linux|grep -v libc.so*|grep -v linux-gate|grep -v linux-vdso) do arrIN=(${i//=>/ }) - echo "--------------------------------------------------------" - echo "Searching ${arrIN[0]} under $(pwd)..." + echo -e -n "\t${arrIN[0]}" LOCAL_MATCHES=$(find . -name $(echo ${arrIN[0]}|awk -F "." '{print $1}').*) if [ "x${LOCAL_MATCHES}" != "x" ]; then for llib in ${LOCAL_MATCHES}; do - echo "Copying ${llib}" + echo -ne " ->${llib}" echo ${llib} >> ${COPYFILES_LIST} done + echo "" else - echo "Did not found ${arrIN[0]} in $(pwd)" if [ -e ${arrIN[1]} ]; then - echo -n "Trying ${arrIN[1]} ..." - echo " found! Copying." echo ${arrIN[1]} >> ${COPYFILES_LIST} - [ -L ${arrIN[1]} ] && echo $(readlink -f ${arrIN[1]}) >> ${COPYFILES_LIST} + + if [ ! -L ${arrIN[1]} ]; + then + echo -e " -> ${arrIN[1]}" + else + echo -e " -> ${arrIN[1]} -> $(readlink -f ${arrIN[1]})" + echo $(readlink -f ${arrIN[1]}) >> ${COPYFILES_LIST} + fi fi fi done - echo "Copied ${FILENAME}." echo "-----------------------------------------------------------------" done @@ -137,8 +149,12 @@ copyfileswithdependencies () echo ".${ENTRY}" >> ${COPYFILES_LIST} done + # reset pipes + [ "x$DEBUG" != "x1" ] && exec 1>&6 6>&- + #copy to initramfsdir - tar -cpv $(cat ${COPYFILES_LIST}|sort -u) | tar -xpv -C ${INIT_DIR} &>/dev/null + echo "[stage32] Completed file list generation at ${TOOL_DIR}/${TOOL}/build/${COPYFILES_LIST}." + (tar -cpv $(cat ${COPYFILES_LIST}|sort -u) | tar -xpv -C ${INIT_DIR}) &>/dev/null unset REQUIRED_BINARIES unset REQUIRED_LIBRARIES unset REQUIRED_DIRECTORIES @@ -150,6 +166,7 @@ get_basic_libs () { [ ! -d ${INIT_DIR} ] && mkdir ${INIT_DIR} # copy libc and ld-linux separatly + echo "----------------------------------------------------" echo "Looking for libc and ld-linux used for ${SHELL}..." BASICLIBS="" for i in $(ldd ${SHELL}) @@ -160,7 +177,7 @@ get_basic_libs () { BASICLIBS="${BASICLIBS} $i $(readlink -f "$i")" fi done - tar -cpv ${BASICLIBS} | tar -xpv -C ${INIT_DIR} &>/dev/null + (tar -cpv ${BASICLIBS} | tar -xpv -C ${INIT_DIR}) &>/dev/null echo "Basic libs copied." } @@ -183,6 +200,10 @@ generate_stage32 () { TOOL=$1 if [ -d ${TOOL} ]; then + echo "###############################################################" + echo "# BUILDING $TOOL" + echo "###############################################################" + cd ${TOOL} read_config read_build @@ -192,6 +213,10 @@ generate_stage32 () { copyfileswithdependencies post_copy cd ${TOOL_DIR} + + echo "###############################################################" + echo "# COMPLETED $TOOL" + echo "###############################################################" else echo "Tool directory not found." fi -- cgit v1.2.3-55-g7522 From 9a374e9ca134a543467ab96796dae26f13b0d975 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 8 Feb 2013 18:11:33 +0100 Subject: [base] ssh, sshd, scp --- remote/tools/base/base.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 4322aa73..83cd989a 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -18,7 +18,10 @@ REQUIRED_BINARIES=" bash modprobe xterm rsyslogd - ps" + ps + sshd + scp + ssh" REQUIRED_LIBRARIES=" libcap libcidn libcom_err @@ -52,4 +55,7 @@ REQUIRED_FILES=" /sbin/mount.nfs4 /etc/nsswitch.conf /etc/securetty /etc/default/locale - /etc/default/aufs" + /etc/default/aufs + /etc/protocols + /etc/services + /etc/networks" -- cgit v1.2.3-55-g7522 From b548eacd4b737d07a01e575b91e33a045284b98f Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 8 Feb 2013 18:36:01 +0100 Subject: [base] fix for mounting nfs --- remote/tools/base/base.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 83cd989a..9c1500ff 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -58,4 +58,5 @@ REQUIRED_FILES=" /sbin/mount.nfs4 /etc/default/aufs /etc/protocols /etc/services - /etc/networks" + /etc/networks + /etc/netconfig" -- cgit v1.2.3-55-g7522 From dc54111382adcf4afc2539d2dc8ac0f822906c9e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Feb 2013 14:28:02 +0100 Subject: [systemd] service files for: network interface, udhcpc, nfs mount --- remote/tools/base/base.build | 2 +- .../data/etc/systemd/system/network-interface@.service | 8 ++++++++ .../tools/systemd/data/etc/systemd/system/network@.service | 14 -------------- .../systemd/data/etc/systemd/system/openslx-mnt.mount | 8 ++++++++ .../tools/systemd/data/etc/systemd/system/udhcpc@.service | 9 +++++++++ .../systemd/system/udhcpc@.service.wants/openslx-mnt.mount | 1 + .../systemd/data/usr/lib/udev/rules.d/99-systemd.rules | 2 +- 7 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 remote/tools/systemd/data/etc/systemd/system/network-interface@.service delete mode 100644 remote/tools/systemd/data/etc/systemd/system/network@.service create mode 100644 remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount create mode 100644 remote/tools/systemd/data/etc/systemd/system/udhcpc@.service create mode 120000 remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build index 88d19684..70f612b4 100644 --- a/remote/tools/base/base.build +++ b/remote/tools/base/base.build @@ -54,7 +54,7 @@ build() { post_copy() { # make basic directory structure - mkdir -p ${INIT_DIR}/{bin,dev,proc,lib,etc,mnt,sys,var/run,var/lock,var/log,run/lock,run/shm} + mkdir -p ${INIT_DIR}/{bin,dev,proc,lib,etc,mnt,sys,var/run,var/lock,var/log,run/lock,run/shm,openslx/mnt} # copy devices from running system cp -a /dev/{console,kmsg,mem,null,shm,tty,tty0,tty1,tty9,fb0,urandom,zero} \ diff --git a/remote/tools/systemd/data/etc/systemd/system/network-interface@.service b/remote/tools/systemd/data/etc/systemd/system/network-interface@.service new file mode 100644 index 00000000..b3c67d09 --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/network-interface@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Brings interface %i up +Wants=udhcpc@%i.service +Before=udhcpc@%i.service + +[Service] +Type=simple +ExecStart=/openslx/bin/ip link set dev %I up diff --git a/remote/tools/systemd/data/etc/systemd/system/network@.service b/remote/tools/systemd/data/etc/systemd/system/network@.service deleted file mode 100644 index db8169c1..00000000 --- a/remote/tools/systemd/data/etc/systemd/system/network@.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Setup Network Connection -Wants=network.target -Before=network.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/openslx/bin/ip link set dev %I up -# We should have our own extended udhcpc script here (see stuff in ip-dns-conf) -ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.default.script -i %I - -[Install] -WantedBy=multi-user.target diff --git a/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount b/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount new file mode 100644 index 00000000..995f123f --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount @@ -0,0 +1,8 @@ +[Unit] +Description=Mount NFS Share [TEST] + +[Mount] +What=132.230.4.6:/srv/openslx/export/nfs/ubuntu-12.04-test +Where=/openslx/mnt +Type=nfs +Options=ro,async,nolock diff --git a/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service new file mode 100644 index 00000000..6c5c289b --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service @@ -0,0 +1,9 @@ +[Unit] +Description=DHCP Client + +[Service] +Type=simple +ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.default.script -i %I + +[Install] +WantedBy=multi-user.target diff --git a/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount new file mode 120000 index 00000000..70ba668d --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount @@ -0,0 +1 @@ +../openslx-mnt.mount \ No newline at end of file diff --git a/remote/tools/systemd/data/usr/lib/udev/rules.d/99-systemd.rules b/remote/tools/systemd/data/usr/lib/udev/rules.d/99-systemd.rules index 52377d1f..387a5754 100644 --- a/remote/tools/systemd/data/usr/lib/udev/rules.d/99-systemd.rules +++ b/remote/tools/systemd/data/usr/lib/udev/rules.d/99-systemd.rules @@ -31,7 +31,7 @@ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_T # # http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=libudev/libudev-enumerate.c;h=da831449dcaf5e936a14409e8e68ab12d30a98e2;hb=HEAD#l742 -SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network@$name.service" +SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/$name", ENV{SYSTEMD_WANTS}="network-interface@$name.service" SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/bluetooth/devices/%k" SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}="bluetooth.target" -- cgit v1.2.3-55-g7522 From 73b5c26cfaac0a073762f6e69c30532fa0e88662 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 13 Feb 2013 13:36:00 +0100 Subject: german keymap loading & fix for aufs and squashfs modules --- .../tools/systemd/data/etc/systemd/system/load-german-keymap.service | 5 +++++ .../systemd/system/sysinit.target.wants/load-german-keymap.service | 1 + server/build_core | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 remote/tools/systemd/data/etc/systemd/system/load-german-keymap.service create mode 120000 remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service diff --git a/remote/tools/systemd/data/etc/systemd/system/load-german-keymap.service b/remote/tools/systemd/data/etc/systemd/system/load-german-keymap.service new file mode 100644 index 00000000..74753259 --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/load-german-keymap.service @@ -0,0 +1,5 @@ +[Unit] +Description=Setup german keyboard layout + +[Service] +ExecStart=/bin/bash -c 'exec /openslx/sbin/loadkmap < /etc/keymaps/de_DE' diff --git a/remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service b/remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service new file mode 120000 index 00000000..d329f45a --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service @@ -0,0 +1 @@ +../load-german-keymap.service \ No newline at end of file diff --git a/server/build_core b/server/build_core index 8435a4fe..a9763715 100755 --- a/server/build_core +++ b/server/build_core @@ -71,6 +71,10 @@ generate_initramfs() { # copy busybox, its libs and static data to stage3.1 cp -r ${STAGE32_DIR}/openslx/* ${STAGE31_STATIC_DIR}/* ${STAGE31_DIR} + # fix for aufs & squashfs modules needed for stage 3.1 + cp /lib/modules/$(uname -r)/kernel/fs/squashfs/squashfs.ko ${STAGE31_DIR}/lib/modules + cp /lib/modules/$(uname -r)/kernel/ubuntu/aufs/aufs.ko ${STAGE31_DIR}/lib/modules + # fetch the libraries needed for busybox BASICLIBS="" for i in $(ldd ${STAGE31_DIR}/bin/busybox); -- cgit v1.2.3-55-g7522 From 1c702eb56eff3389d5805acb87456872e8e67815 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 13 Feb 2013 15:12:19 +0100 Subject: fix for auto german keyboard layout --- .../etc/systemd/system/getty.target.wants/load-german-keymap.service | 1 + remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount | 1 + .../etc/systemd/system/sysinit.target.wants/load-german-keymap.service | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 remote/tools/systemd/data/etc/systemd/system/getty.target.wants/load-german-keymap.service delete mode 120000 remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service diff --git a/remote/tools/systemd/data/etc/systemd/system/getty.target.wants/load-german-keymap.service b/remote/tools/systemd/data/etc/systemd/system/getty.target.wants/load-german-keymap.service new file mode 120000 index 00000000..d329f45a --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/getty.target.wants/load-german-keymap.service @@ -0,0 +1 @@ +../load-german-keymap.service \ No newline at end of file diff --git a/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount b/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount index 995f123f..70c1d4c8 100644 --- a/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount +++ b/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount @@ -1,5 +1,6 @@ [Unit] Description=Mount NFS Share [TEST] +After=udhcpc@%i.service [Mount] What=132.230.4.6:/srv/openslx/export/nfs/ubuntu-12.04-test diff --git a/remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service b/remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service deleted file mode 120000 index d329f45a..00000000 --- a/remote/tools/systemd/data/etc/systemd/system/sysinit.target.wants/load-german-keymap.service +++ /dev/null @@ -1 +0,0 @@ -../load-german-keymap.service \ No newline at end of file -- cgit v1.2.3-55-g7522 From 6d81b8042a99552a753a3adc863f9b78bd3e57f3 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 13 Feb 2013 16:18:27 +0100 Subject: fix for home/pos1/etc... --- remote/tools/base/base.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 9c1500ff..8b5fe899 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -50,6 +50,7 @@ REQUIRED_FILES=" /sbin/mount.nfs4 /etc/environment /etc/pam.conf /etc/issue + /etc/inputrc /etc/localtime /etc/login.defs /etc/nsswitch.conf -- cgit v1.2.3-55-g7522 From ee6004840abc0b4f5d29f88fbc100854e6b99a24 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 13 Feb 2013 19:01:58 +0100 Subject: TODOS: find triplet name --- remote/tools/base/base.build | 1 + remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build index 70f612b4..95b9de65 100644 --- a/remote/tools/base/base.build +++ b/remote/tools/base/base.build @@ -67,6 +67,7 @@ post_copy() { # copy static files cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} + # better: dirname $(ldd $SHELL|grep libc | awk -F " " '{print $3}') # copy pam modules, TODO: better way to find arch-dependant interfix... (tar -cpv $(dirname $(locate pam_unix.so|grep ^/lib/)) | tar -xpv -C ${INIT_DIR}) &>/dev/null diff --git a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build index 8ddc2e55..fdaba33b 100644 --- a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build +++ b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build @@ -46,8 +46,9 @@ build () { } post_copy() { - #copyi static data files + #copy static data files cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} + # TODO: FIX PATH TO TRIPLET... gdk-pixbuf-query-loaders > ${INIT_DIR}/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache pango-querymodules > ${INIT_DIR}/etc/pango/pango.modules gtk-update-icon-cache-3.0 ${INIT_DIR}/usr/share/icons/hicolor/ -- cgit v1.2.3-55-g7522 From ca31f94038d0c8068fc9d714550db8721fc5d309 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 14 Feb 2013 13:16:52 +0100 Subject: fix path for gtk-pixbuf? --- remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build index fdaba33b..8a8e978d 100644 --- a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build +++ b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build @@ -49,7 +49,8 @@ post_copy() { #copy static data files cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} # TODO: FIX PATH TO TRIPLET... - gdk-pixbuf-query-loaders > ${INIT_DIR}/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache + TRIPLET=$(basename $(dirname $(ldd $SHELL|grep libc | awk -F " " '{print $3}'))) + gdk-pixbuf-query-loaders > ${INIT_DIR}/usr/lib/${TRIPLET}/gdk-pixbuf-2.0/2.10.0/loaders.cache pango-querymodules > ${INIT_DIR}/etc/pango/pango.modules gtk-update-icon-cache-3.0 ${INIT_DIR}/usr/share/icons/hicolor/ update-mime-database ${INIT_DIR}/usr/share/mime -- cgit v1.2.3-55-g7522 From 5bbedbe7b55dde3fabe7dc4797522b77495df6be Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 14 Feb 2013 16:02:01 +0100 Subject: debug output cleaned a bit --- remote/setup_tools | 89 ++++++++++++++++++++++---------------- remote/tools/dbus/dbus.build | 2 +- remote/tools/systemd/systemd.build | 2 +- remote/tools/xorg/xorg.build | 4 +- server/build_core | 3 +- 5 files changed, 56 insertions(+), 44 deletions(-) diff --git a/remote/setup_tools b/remote/setup_tools index ef498960..bb1895d0 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -44,20 +44,25 @@ copyfileswithdependencies () [ ! -d build ] && echo "No build directory for ${TOOL} found." && return cd build - [ "x$DEBUG" != "x1" ] && echo "Logging to build_stage32.log" && exec 6>&1 > build_stage32.log COPYFILES_LIST="list_wanted_stage3.2" [ -e ${COPYFILES_LIST} ] && rm ${COPYFILES_LIST} - + + + echo -e "\n\n*********************************************************" + echo "*" + echo "* Copying required binaries from config file..." + echo "*" + echo -e "*********************************************************\n\n" for FILENAME in ${REQUIRED_BINARIES} do FILE=$(find . -name ${FILENAME} -type f -executable | xargs grep -l ELF) if [ -z "$FILE" ]; then - echo "No Binary found for ${FILENAME}. Skipping." + echo -e "\tNo Binary found for ${FILENAME}. Skipping." echo "-----------------------------------------------------------------" continue fi - echo "Found ${FILENAME} at ${FILE}" + echo -e "\tFound ${FILENAME} at ${FILE}" echo ${FILE} >> ${COPYFILES_LIST} # fetch dependencies # quick fix to exclude libc*, else it copies unneeded libs... @@ -66,14 +71,14 @@ copyfileswithdependencies () ldd_exit_code=$? if [ "x$ldd_exit_code" != "x0" ]; then - echo "ldd $FILE failed." + echo -e "\tldd $FILE failed." continue fi for i in $(ldd ${FILE} |awk '{print $1 $2 $3}'|grep -v ld-linux|grep -v libc.so*|grep -v linux-gate|grep -v linux-vdso) do arrIN=(${i//=>/ }) - echo -e -n "\t${arrIN[0]}" - LOCAL_MATCHES=$(find . -name $(echo ${arrIN[0]}|awk -F "." '{print $1}').*) + echo -en "\t\t${arrIN[0]}" + LOCAL_MATCHES=$(find . -name $(echo ${arrIN[0]}|awk -F "." '{print $1}').so*) if [ "x${LOCAL_MATCHES}" != "x" ]; then for llib in ${LOCAL_MATCHES}; @@ -97,7 +102,7 @@ copyfileswithdependencies () fi fi done - echo "-----------------------------------------------------------------" + echo -e "\t-------------------------------------------------------------------------------------------------------------" done for LIB in ${REQUIRED_LIBRARIES} @@ -108,49 +113,56 @@ copyfileswithdependencies () done done - echo "Copying required directories from config file..." + echo -e "\n\n*********************************************************" + echo "*" + echo "* Copying required directories from config file..." + echo "*" + echo -e "*********************************************************\n\n" for ENTRY in ${REQUIRED_DIRECTORIES} do echo ".${ENTRY}" >> ${COPYFILES_LIST} - for LIB in $(find .${ENTRY} -type f -not -name "*.a" | xargs grep -l ELF) + for BIN in $(find .${ENTRY} -type f -not -name "*.a" | xargs grep -l ELF) do - for i in $(ldd ${LIB} |awk '{print $1 $2 $3}'|grep -v ld-linux|grep -v libc.so*|grep -v linux-gate|grep -v linux-vdso) + echo -e "\tSearching libs for ${BIN}..." + for i in $(ldd ${BIN} |awk '{print $1 $2 $3}'|grep -v ld-linux|grep -v libc.so*|grep -v linux-gate|grep -v linux-vdso) do arrIN=(${i//=>/ }) - echo "--------------------------------------------------------" - echo "Searching ${arrIN[0]} under $(pwd)..." - LOCAL_MATCHES=$(find . -name $(echo ${arrIN[0]}|awk -F "." '{print $1}').*) + echo -e "\t\t---------------------------------------------------------" + echo -ne "\t\tSearching ${arrIN[0]} under $(pwd)..." + LOCAL_MATCHES=$(find . -name $(echo ${arrIN[0]}|awk -F "." '{print $1}').so*) if [ "x${LOCAL_MATCHES}" != "x" ]; then for llib in ${LOCAL_MATCHES}; do - echo "Copying ${llib}" + echo -en "\n\t\tCopying ${llib}" echo ${llib} >> ${COPYFILES_LIST} done + echo "" else - echo "Did not found ${arrIN[0]} in $(pwd)" + echo " not found." if [ ! -z ${arrIN[1]} ]; then - echo -n "Trying ${arrIN[1]} ..." - echo " found! Copying." + echo -e "\t\tCopying from system ${arrIN[1]} ..." echo ${arrIN[1]} >> ${COPYFILES_LIST} [ -L ${arrIN[1]} ] && echo $(readlink -f ${arrIN[1]}) >> ${COPYFILES_LIST} fi fi done - echo "Copied ${LIB}." - echo "-----------------------------------------------------------------" + echo -e "\tCopied $BIN" + echo -e "\t-------------------------------------------------------------------------------------------------------------" done done - echo "Copying required files from config file..." + echo "*********************************************************" + echo "*" + echo "* Copying required files from config file..." + echo "*" + echo "*********************************************************" for ENTRY in ${REQUIRED_FILES} do echo ".${ENTRY}" >> ${COPYFILES_LIST} done - # reset pipes - [ "x$DEBUG" != "x1" ] && exec 1>&6 6>&- #copy to initramfsdir echo "[stage32] Completed file list generation at ${TOOL_DIR}/${TOOL}/build/${COPYFILES_LIST}." @@ -167,43 +179,43 @@ get_basic_libs () { # copy libc and ld-linux separatly echo "----------------------------------------------------" - echo "Looking for libc and ld-linux used for ${SHELL}..." BASICLIBS="" for i in $(ldd ${SHELL}) do if [ $(echo $i | grep '^/' | grep -c ld) -eq 1 -o $(echo $i | grep '^/' | grep -c libc.so) -eq 1 ]; then - echo "Found basic lib at: $i" + echo "Copied $i" BASICLIBS="${BASICLIBS} $i $(readlink -f "$i")" fi done (tar -cpv ${BASICLIBS} | tar -xpv -C ${INIT_DIR}) &>/dev/null - echo "Basic libs copied." } generate_stage32 () { initial_checks + get_basic_libs + # if no arguments assume all. if [ "x$1" = "x" -o "x$1" = "xall" ]; then tools=$(ls ${TOOL_DIR}) set -- $tools fi - # first copy libc and ld-linux - get_basic_libs - # now iterate over given tools and copy them cd ${TOOL_DIR} while (( "$#" )); do - TOOL=$1 + TOOL=$1 if [ -d ${TOOL} ]; then - echo "###############################################################" - echo "# BUILDING $TOOL" - echo "###############################################################" - + echo "###################################################################################" + echo "# BUILDING $TOOL" + echo "#" + + [ "x$DEBUG" != "x1" ] \ + && echo "Logging to ${TOOL_DIR}/${TOOL}/stage32.log" \ + && exec 6>&1 > ${TOOL_DIR}/${TOOL}/stage32.log cd ${TOOL} read_config read_build @@ -214,15 +226,16 @@ generate_stage32 () { post_copy cd ${TOOL_DIR} - echo "###############################################################" - echo "# COMPLETED $TOOL" - echo "###############################################################" + # reset pipes + [ "x$DEBUG" != "x1" ] && exec 1>&6 6>&- + echo "#" + echo "# DONE" + echo "###################################################################################" else echo "Tool directory not found." fi shift done - } clean_tools() { diff --git a/remote/tools/dbus/dbus.build b/remote/tools/dbus/dbus.build index 6c6faaf5..5254497f 100644 --- a/remote/tools/dbus/dbus.build +++ b/remote/tools/dbus/dbus.build @@ -21,7 +21,7 @@ build() { # prepare target dir & copy there [ ! -d ${BUILDDIR} ] && mkdir -p ${BUILDDIR} - tar -cpv $(cat ${COPYLIST}|sort -u) | tar -xpv -C ${BUILDDIR} + (tar -cpv $(cat ${COPYLIST}|sort -u) | tar -xpv -C ${BUILDDIR}) &> /dev/null } post_copy() { diff --git a/remote/tools/systemd/systemd.build b/remote/tools/systemd/systemd.build index 6df35629..d198f821 100644 --- a/remote/tools/systemd/systemd.build +++ b/remote/tools/systemd/systemd.build @@ -19,7 +19,7 @@ install_dependencies() { add-apt-repository --yes ppa:pitti/systemd apt-get update --force-yes fi - apt-get install -y $DEPS + apt-get install -y $DEPS &>/dev/null } build () { diff --git a/remote/tools/xorg/xorg.build b/remote/tools/xorg/xorg.build index 5eaff345..590d0bb0 100644 --- a/remote/tools/xorg/xorg.build +++ b/remote/tools/xorg/xorg.build @@ -25,13 +25,13 @@ build() { # prepare target dir & copy there [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR + (tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR) &>/dev/null } post_copy() { [ ! -d $INIT_DIR/etc/X11 ] && mkdir -p $INIT_DIR/etc/X11 - ln -s /usr/bin/Xorg ${INIT_DIR}/etc/X11/X + [ ! -e ${INIT_DIR}/etc/X11/X ] && ln -s /usr/bin/Xorg ${INIT_DIR}/etc/X11/X [ ! -d $INIT_DIR/var/lib/xkb ] && mkdir -p $INIT_DIR/var/lib/xkb cp /var/lib/xkb/server* $INIT_DIR/var/lib/xkb } diff --git a/server/build_core b/server/build_core index a9763715..6367e9e5 100755 --- a/server/build_core +++ b/server/build_core @@ -82,11 +82,10 @@ generate_initramfs() { if [ $(echo $i | grep '^/' | grep -c ld) -eq 1 \ -o $(echo $i | grep '^/' | grep -c libc.so) -eq 1 ]; then - echo $i BASICLIBS="$BASICLIBS $i $(readlink -f "$i")" fi done - tar cpv $BASICLIBS | tar xpv -C ${STAGE31_DIR} &>/dev/null + (tar cpv $BASICLIBS | tar xpv -C ${STAGE31_DIR}) &>/dev/null } -- cgit v1.2.3-55-g7522