diff options
| author | Michael Neves | 2013-02-27 19:37:04 +0100 |
|---|---|---|
| committer | Michael Neves | 2013-02-27 19:37:04 +0100 |
| commit | 459c9c02adf020d3e85d809c902196e801085a65 (patch) | |
| tree | aeec9e371eb37ea0419c05870b4a9a699c331d70 /remote/tools | |
| parent | copy modules/firmware to stage31, generate separate initramfs for squashfs (diff) | |
| parent | tihi (diff) | |
| download | tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.tar.gz tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.tar.xz tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.zip | |
init and build_core merges
Diffstat (limited to 'remote/tools')
| -rw-r--r-- | remote/tools/base/base.build | 25 | ||||
| -rw-r--r-- | remote/tools/base/base.conf | 7 | ||||
| -rw-r--r-- | remote/tools/dbus/dbus.build | 16 | ||||
| -rw-r--r-- | remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build | 50 | ||||
| -rw-r--r-- | remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.conf | 2 | ||||
| -rw-r--r-- | remote/tools/ldm/ldm.build | 44 | ||||
| -rw-r--r-- | remote/tools/policykit/policykit.build | 4 | ||||
| -rw-r--r-- | remote/tools/policykit/policykit.conf | 2 | ||||
| -rw-r--r-- | remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount | 8 | ||||
| -rw-r--r-- | remote/tools/xorg/xorg.build | 21 |
10 files changed, 84 insertions, 95 deletions
diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build index 7087664b..805fbbda 100644 --- a/remote/tools/base/base.build +++ b/remote/tools/base/base.build @@ -9,11 +9,11 @@ fetch_source() { build() { - BUILDDIR=${TOOL_DIR}/${TOOL}/build - mkdir -p ${BUILDDIR} + BUILDDIR="${TOOL_DIR}/${TOOL}/build" + mkdir -p "${BUILDDIR}" FILELIST="list_binaries_and_files" - [ -e ${FILELIST} ] && rm ${FILELIST} + [ -e "${FILELIST}" ] && rm "${FILELIST}" for BIN in ${REQUIRED_BINARIES} do @@ -21,10 +21,7 @@ build() { if [ ! -z ${BIN_LOCATION} -a -e ${BIN_LOCATION} ]; then pdebug "Processing $BIN at $BIN_LOCATION ..." - echo ${BIN_LOCATION} >> "${FILELIST}" - [ -L "${BIN_LOCATION}" ] \ - && pdebug "${BIN_LOCATION} is a symbolic link, copying $(readlink -f "${BIN_LOCATION}")" \ - && echo $(readlink -f "${BIN_LOCATION}") >> "${FILELIST}" + get_link_chain ${BIN_LOCATION} >> "${FILELIST}" else perror "${BIN} not found on the system! Please install it." fi @@ -32,9 +29,9 @@ build() { for LIB in ${REQUIRED_LIBRARIES} do - for LIB_LOCATION in $(locate ${LIB} | grep ^/lib/) + for LIB_LOCATION in $(find /lib/ -name "${LIB}.so*") do - echo ${LIB_LOCATION} >> "${FILELIST}" + get_link_chain "${LIB_LOCATION}" >> "${FILELIST}" done done @@ -52,9 +49,7 @@ build() { local NUMFILES=$(cat "${FILELIST}" | wc -l) if [ "x$NUMFILES" != "x" -a "x$NUMFILES" != "x0" ]; then pinfo "File list generated at ${BUILDDIR}/${FILELIST} ($NUMFILES entries)" - tar -cp $(cat "${FILELIST}") | tar -xp -C "${BUILDDIR}" - local RET=$? - [ $RET -ne 0 ] && perror "tar-copy from '$FILELIST' to '$BUILDDIR' failed." + tarcopy "$(cat "${FILELIST}")" "${BUILDDIR}" fi } @@ -65,14 +60,14 @@ post_copy() { # copy devices from running system cp -a /dev/{console,kmsg,mem,null,shm,tty,tty0,tty1,tty9,fb0,urandom,zero} \ - "${INIT_DIR}"/dev + "${INIT_DIR}"/dev || perror "Copying devices from running system failed." # set /etc/environment to include /openslx/bin and /openslx/sbin echo "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/openslx/sbin:/openslx/bin\"" \ > "${INIT_DIR}/etc/environment" # copy static files - cp -r "${TOOL_DIR}/${TOOL}/data/*" "${INIT_DIR}" + cp -r "${TOOL_DIR}/${TOOL}"/data/* "${INIT_DIR}" || perror "Copying static files from data/* failed." # better: dirname $(ldd $SHELL|grep libc | awk -F " " '{print $3}') # copy pam modules, TODO: better way to find arch-dependant interfix... @@ -93,7 +88,7 @@ post_copy() { # setup root accoun USER=root PASSWORD='!r00t' add_user - [ ! -d ${INIT_DIR}/root ] && mkdir ${INIT_DIR}/root + mkdir -p ${INIT_DIR}/root echo "minilinux-$(hostname)" > "${INIT_DIR}/etc/hostname" diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 85b638e6..6a95ab2c 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -9,7 +9,8 @@ REQUIRED_BINARIES=" bash sulogin mount umount - mount.nfs + mount.nfs4 + umount.nfs4 mount.aufs umount.aufs rm @@ -40,9 +41,7 @@ REQUIRED_LIBRARIES=" libcap libau" REQUIRED_DIRECTORIES=" /etc/pam.d /etc/security" -REQUIRED_FILES=" /sbin/mount.nfs4 - /sbin/umount.nfs4 - /etc/environment +REQUIRED_FILES=" /etc/environment /etc/pam.conf /etc/issue /etc/inputrc diff --git a/remote/tools/dbus/dbus.build b/remote/tools/dbus/dbus.build index 5254497f..83cc8efa 100644 --- a/remote/tools/dbus/dbus.build +++ b/remote/tools/dbus/dbus.build @@ -9,25 +9,25 @@ fetch_source() { } build() { - BUILDDIR=${TOOL_DIR}/${TOOL}/build + BUILDDIR="${TOOL_DIR}/${TOOL}/build" COPYLIST="list_dpkg_output" - [ -e ${COPYLIST} ] && rm ${COPYLIST} + [ -e "${COPYLIST}" ] && rm "${COPYLIST}" for FILE in $(dpkg -L dbus | grep -v share/doc | grep -v share/man) do - [ ! -d ${FILE} ] && echo ${FILE} >> ${COPYLIST} + [ ! -d "${FILE}" ] && echo ${FILE} >> "${COPYLIST}" done # prepare target dir & copy there [ ! -d ${BUILDDIR} ] && mkdir -p ${BUILDDIR} - (tar -cpv $(cat ${COPYLIST}|sort -u) | tar -xpv -C ${BUILDDIR}) &> /dev/null + tarcopy "$(cat "${COPYLIST}" | sort -u)" "${BUILDDIR}" } post_copy() { # copy static dbus systemd unit files to stage3.2 - SYSTEMDDIR=${INIT_DIR}/etc/systemd/system - [ ! -d ${SYSTEMDDIR} ] && mkdir -p ${SYSTEMDDIR} - cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} - + SYSTEMDDIR="${INIT_DIR}/etc/systemd/system" + mkdir -p "${SYSTEMDDIR}" + cp -r "${TOOL_DIR}/${TOOL}/data/"* "${INIT_DIR}" || perror "Copying data/* failed." } + diff --git a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build index 734481d7..edd3427a 100644 --- a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build +++ b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.build @@ -1,13 +1,8 @@ #tool/distro specific functions for fetching, building and installing dependencies fetch_source () { - if [ ! -e .fetched_source ]; then - [ ! -d src ] && mkdir src - wget $URL - tar xfz $VERSION.tar.gz -C src/ - rm $VERSION.tar.gz - touch .fetched_source - fi + [ ! -e .fetched_source ] && download_untar "$URL" "src/" + touch .fetched_source } install_dependencies() { @@ -15,29 +10,32 @@ install_dependencies() { } build () { - BUILDDIR=$TOOL_DIR/$TOOL/build + BUILDDIR="$TOOL_DIR/$TOOL/build" if [ ! -e .built ]; then - cd src/$VERSION - ./configure --prefix="/" --datarootdir="/usr/share" - make - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - DESTDIR=$BUILDDIR make install + cd "src/$VERSION" + pinfo "Running configure" + ./configure --prefix="/" --datarootdir="/usr/share" || perror "failed." + pinfo "Running make" + make || perror "failed." + mkdir -p "$BUILDDIR" + pinfo "Running make install" + DESTDIR="$BUILDDIR" make install || perror "failed." COPYLIST="list_dpkg_output" - [ -e $COPYLIST ] && rm $COPYLIST + [ -e "$COPYLIST" ] && rm "$COPYLIST" for PACKAGE in ${REQUIRED_PACKAGES} do for FILE in $(dpkg -L ${PACKAGE} | grep -v share/doc | grep -v share/man) do - [ ! -d $FILE ] && echo $FILE >> $COPYLIST + [ ! -d $FILE ] && echo $FILE >> "$COPYLIST" done done # prepare target dir & copy there - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR + mkdir -p "$BUILDDIR" + tarcopy "$(cat "$COPYLIST" | sort -u)" "$BUILDDIR" cd - touch .built @@ -47,13 +45,15 @@ build () { post_copy() { #copy static data files - cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} + cp -r "${TOOL_DIR}/${TOOL}/data/"* "${INIT_DIR}" || perror "Copying data/* failed." # TODO: FIX PATH TO TRIPLET... - 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 - mkdir -p ${INIT_DIR}/etc/pango - 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 - cp -r /var/lib/polkit-1 ${INIT_DIR}/var/lib + 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" || perror "pixbuf-query-loaders failed." + mkdir -p "${INIT_DIR}/etc/pango" || perror "Making etc/pango failed." + pango-querymodules > "${INIT_DIR}/etc/pango/pango.modules" || perror "pango-querymodules failed." + gtk-update-icon-cache-3.0 "${INIT_DIR}/usr/share/icons/hicolor/" || perror "update-icon-cache-3.0 failed." + update-mime-database "${INIT_DIR}/usr/share/mime" || perror "update-mime-database failed." + mkdir -p "${INIT_DIR}/var/lib" + cp -r "/var/lib/polkit-1" "${INIT_DIR}/var/lib/" || perror "Copying -r /var/lib/polkit-1 to '${INIT_DIR}/var/lib/' failed." } + diff --git a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.conf b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.conf index faf9f32c..f243fc20 100644 --- a/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.conf +++ b/remote/tools/ldm-gtk-greeter/ldm-gtk-greeter.conf @@ -5,3 +5,5 @@ REQUIRED_PACKAGES="libgdk-pixbuf2.0-0 libpango1.0-0 librsvg2-common shared-mime- REQUIRED_BINARIES="lightdm-gtk-greeter" REQUIRED_DIRECTORIES="/usr/lib /usr/share/lightdm-gtk-greeter /usr/share/mime /usr/share/xgreeters /usr/share/icons /usr/share/themes /etc /usr/bin /usr/share/polkit-1 /usr/share/dbus-1" REQUIRED_FILES="/etc/lightdm/lightdm-gtk-greeter.conf" +REQUIRED_MODULES="ldm" + diff --git a/remote/tools/ldm/ldm.build b/remote/tools/ldm/ldm.build index 76f53410..9f45e058 100644 --- a/remote/tools/ldm/ldm.build +++ b/remote/tools/ldm/ldm.build @@ -1,13 +1,8 @@ #tool/distro specific functions for fetching, building and installing dependencies fetch_source () { - if [ ! -e .fetched_source ]; then - [ ! -d src ] && mkdir src - wget $URL - tar xf $VERSION.tar.gz -C src/ - rm $VERSION.tar.gz - touch .fetched_source - fi + [ ! -e .fetched_source ] && download_untar "$URL" "src/" + touch .fetched_source } install_dependencies() { @@ -15,29 +10,31 @@ install_dependencies() { } build () { - BUILDDIR=$TOOL_DIR/$TOOL/build - + BUILDDIR="$TOOL_DIR/$TOOL/build" if [ ! -e .built ]; then - cd src/$VERSION - ./configure --prefix="/" --datarootdir="/usr/share" - make - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - DESTDIR=$BUILDDIR make install + cd "src/$VERSION" + pinfo "Running configure" + ./configure --prefix="/" --datarootdir="/usr/share" || perror "failed." + pinfo "Running make" + make || perror "failed." + mkdir -p "$BUILDDIR" + pinfo "Running make install" + DESTDIR="$BUILDDIR" make install || perror "failed." COPYLIST="list_dpkg_output" - [ -e $COPYLIST ] && rm $COPYLIST + [ -e "$COPYLIST" ] && rm "$COPYLIST" for PACKAGE in ${REQUIRED_PACKAGES} do for FILE in $(dpkg -L ${PACKAGE} | grep -v share/doc | grep -v share/man) do - [ ! -d $FILE ] && echo $FILE >> $COPYLIST + [ ! -d $FILE ] && echo $FILE >> "$COPYLIST" done done #prepare target dir & copy there - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR + mkdir -p "$BUILDDIR" + tarcopy "$(cat "$COPYLIST" | sort -u)" "$BUILDDIR" cd - touch .built @@ -46,11 +43,14 @@ build () { } post_copy() { - [ ! -d ${INIT_DIR}/var/lib/lightdm ] && mkdir -p ${INIT_DIR}/var/lib/lightdm - touch ${INIT_DIR}/var/lib/lightdm/.Xauthority - chown -R lightdm:lightdm ${INIT_DIR}/var/lib/lightdm/ + mkdir -p "${INIT_DIR}/var/lib/lightdm" + touch "${INIT_DIR}/var/lib/lightdm/.Xauthority" || perror "Cannot touch '${INIT_DIR}/var/lib/lightdm/.Xauthority'" + local LDMUID=$(add_user "lightdm") + local LDMGID=$(add_group "lightdm") + pinfo "lightdm user and group is $LDMUID $LDMGID" + chown -R "${LDMUID}:${LDMGID}" "${INIT_DIR}/var/lib/lightdm/" || perror "chowning '${INIT_DIR}/var/lib/lightdm/' failed." #copyi static data files - cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR} + cp -r "${TOOL_DIR}/${TOOL}/data/"* "${INIT_DIR}" || perror "Copying data/ failed." } diff --git a/remote/tools/policykit/policykit.build b/remote/tools/policykit/policykit.build index 871025a1..a42f48b7 100644 --- a/remote/tools/policykit/policykit.build +++ b/remote/tools/policykit/policykit.build @@ -45,9 +45,7 @@ build () { # prepare target dir & copy there if [ -s "$COPYLIST" ]; then pinfo "using tar to copy all dependencies to $BUILDDIR" - tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR - local RET=$? - [ $RET -ne 0 ] && perror "copy failed." + tarcopy "$(cat "$COPYLIST" | sort -u)" "$BUILDDIR" else pinfo "no dependencies found!" fi diff --git a/remote/tools/policykit/policykit.conf b/remote/tools/policykit/policykit.conf index 1ccef0e6..c8c27cf3 100644 --- a/remote/tools/policykit/policykit.conf +++ b/remote/tools/policykit/policykit.conf @@ -5,3 +5,5 @@ REQUIRED_PACKAGES="" REQUIRED_BINARIES="" REQUIRED_DIRECTORIES="/bin /etc /lib /usr/share/dbus-1 /usr/share/polkit-1" REQUIRED_FILES="" +REQUIRED_MODULES="systemd" + diff --git a/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount b/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount deleted file mode 100644 index 995f123f..00000000 --- a/remote/tools/systemd/data/etc/systemd/system/openslx-mnt.mount +++ /dev/null @@ -1,8 +0,0 @@ -[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/xorg/xorg.build b/remote/tools/xorg/xorg.build index 590d0bb0..6ce5747c 100644 --- a/remote/tools/xorg/xorg.build +++ b/remote/tools/xorg/xorg.build @@ -1,37 +1,38 @@ #!/bin/bash install_dependencies() { - echo "No dependencies." + : } fetch_source() { - echo "Extracting from running system..." + : } build() { - BUILDDIR=$TOOL_DIR/$TOOL/build + BUILDDIR="$TOOL_DIR/$TOOL/build" COPYLIST="list_dpkg_output" - [ -e $COPYLIST ] && rm $COPYLIST + [ -e "$COPYLIST" ] && rm "$COPYLIST" for PACKAGE in ${REQUIRED_PACKAGES} do for FILE in $(dpkg -L ${PACKAGE} | grep -v share/doc | grep -v share/man) do - [ ! -d $FILE ] && echo $FILE >> $COPYLIST + [ ! -d $FILE ] && echo $FILE >> "$COPYLIST" done done # prepare target dir & copy there - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - (tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR) &>/dev/null + mkdir -p "$BUILDDIR" + tarcopy "$(cat "$COPYLIST" | sort -u)" "$BUILDDIR" } post_copy() { - [ ! -d $INIT_DIR/etc/X11 ] && mkdir -p $INIT_DIR/etc/X11 + mkdir -p "$INIT_DIR/etc/X11" [ ! -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 + mkdir -p "$INIT_DIR/var/lib/xkb" + cp /var/lib/xkb/server* "$INIT_DIR/var/lib/xkb/" || perror "Copying /var/lib/xkb/server* to '$INIT_DIR/var/lib/xkb/' failed." } + |
