diff options
author | Simon Rettberg | 2021-07-12 13:32:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-07-12 13:32:27 +0200 |
commit | d69028811168853efdaad3f07f70dff93fccd112 (patch) | |
tree | ceeb992ba51e0712419272c06420a37ae921eb19 | |
parent | [vbox-src] fix awk call (diff) | |
download | mltk-d69028811168853efdaad3f07f70dff93fccd112.tar.gz mltk-d69028811168853efdaad3f07f70dff93fccd112.tar.xz mltk-d69028811168853efdaad3f07f70dff93fccd112.zip |
Remove COPYLIST boilerplate from every module; move to setup_target
45 files changed, 70 insertions, 833 deletions
diff --git a/core/bin/setup_target b/core/bin/setup_target index 1e19a063..86e80e17 100755 --- a/core/bin/setup_target +++ b/core/bin/setup_target @@ -180,22 +180,22 @@ export_builds() { copy_files_with_deps () { [ ! -d "$MODULE_BUILD_DIR" ] && pinfo "No build directory found, skipping dependency copying" && return 0 - cd "$MODULE_BUILD_DIR" + cde "$MODULE_BUILD_DIR" local COPYFILES_LIST="${TARGET_BUILD_DIR}/opt/openslx/.mltk/${MODULE}.copy_files_with_deps" rm -f -- "${COPYFILES_LIST}" # from REQUIRED_BINARIES - follow symlinks and ldd the file [ ! -z "${REQUIRED_BINARIES}" ] && pinfo "Gathering required binaries from config file..." - local OPTIONAL + local OPTIONAL FILENAME for FILENAME in ${REQUIRED_BINARIES}; do - if [[ "$FILENAME" == @* ]]; then + if [[ "${FILENAME:0:1}" == "@" ]]; then OPTIONAL="yes" - FILENAME=$(echo "$FILENAME" | cut -c 2- ) + FILENAME="${FILENAME:1}" else OPTIONAL="no" fi - local FILE_CANDIDATES=$( find . -name "${FILENAME}" -a \( -type f -o -type l \) ) + local FILE_CANDIDATES="$( find . -name "${FILENAME}" -a \( -type f -o -type l \) )" local FINAL_LIST="" # Check result of find if [ "$(echo "$FILE_CANDIDATES" | wc -l)" -gt 1 ]; then @@ -208,6 +208,12 @@ copy_files_with_deps () { done FINAL_LIST=$(trim "$FINAL_LIST") if [ -z "$FINAL_LIST" ]; then + # Not found in build dir; if install mode, check if it's in the PKG_CONTENT_FILE + if [ -n "$MLTK_INSTALL" ]; then + # TODO: Might want to iterate over all the matches and check if at least one of them + # is +x + grep -q "/${FILENAME}\$" "$PKG_CONTENT_FILE" && continue + fi perror "\tNo binary found for ${FILENAME}. None of the candidates ($FILE_CANDIDATES) is executable." fi if [[ "$FINAL_LIST" == *" "* ]]; then @@ -217,12 +223,16 @@ copy_files_with_deps () { fi elif [ "$OPTIONAL" == "no" -a -z "$FILE_CANDIDATES" ]; then # No candidate + # Same as above: accept existing file in / + if [ -n "$MLTK_INSTALL" ]; then + grep -q "/${FILENAME}\$" "$PKG_CONTENT_FILE" && continue + fi perror "Could not find required binary $FILENAME" else # One candidate - local TESTFILE=$(readlink -f "$FILE_CANDIDATES") - if [ -f "$TESTFILE" -a -x "$TESTFILE" ]; then - FINAL_LIST=${FILE_CANDIDATES} + local TESTFILE="$( readlink -f "$FILE_CANDIDATES" )" + if [ -f "$TESTFILE" ] && [ -x "$TESTFILE" ]; then + FINAL_LIST="${FILE_CANDIDATES}" elif [ "$OPTIONAL" = "no" ]; then perror "No executable regular file found for '$FILENAME' (potential match was $(echo $FILE_CANDIDATES))" fi @@ -236,10 +246,16 @@ copy_files_with_deps () { # from REQUIRED_LIBRARIES - like binaries, follow symlinks and ldd, but also expand the lib-name # by looking for files named <libname>.so* - [ ! -z "$REQUIRED_LIBRARIES" ] && pinfo "Gathering required libraries from config file..." + [ -n "$REQUIRED_LIBRARIES" ] && pinfo "Gathering required libraries from config file..." for LIB in $REQUIRED_LIBRARIES; do FILE_CANDIDATES=$(find . -name "${LIB}.so*") - [ -z "$FILE_CANDIDATES" ] && perror "Cannot find required library $LIB" + if [ -z "$FILE_CANDIDATES" ]; then + if [ -n "$MLTK_INSTALL" ]; then + # TODO: Escape LIB and use a proper regex with -P + grep -qF "/${LIB}.so" "$PKG_CONTENT_FILE" && continue + fi + perror "Cannot find required library $LIB" + fi for LOCATION in $FILE_CANDIDATES; do pdebug "* $LOCATION" get_link_chain "${MODULE_BUILD_DIR}/${LOCATION}" "${MODULE_BUILD_DIR}" >> "${COPYFILES_LIST}" @@ -275,6 +291,9 @@ copy_files_with_deps () { continue fi fi + if [ -n "$MLTK_INSTALL" ] && ! [ -e "${MODULE_BUILD_DIR}/${ENTRY}" ]; then + [ -e "/${ENTRY}" ] && continue # OK for install mode... I think + fi get_link_chain "${MODULE_BUILD_DIR}/${ENTRY}" "${MODULE_BUILD_DIR}" >> "${COPYFILES_LIST}" done @@ -286,7 +305,7 @@ copy_files_with_deps () { fi # unchanged? local OLD="${COPYFILES_LIST}.old" - if [ -s "$OLD" ] && diff "$OLD" "$COPYFILES_LIST"; then + if [ -s "$OLD" ] && cmp "$OLD" "$COPYFILES_LIST"; then return fi local CLISTCOUNT=$(cat "$COPYFILES_LIST" | wc -l) @@ -439,6 +458,7 @@ process_module() { local BUILD_FLAG="${MODULE_WORK_DIR}/meta/build_complete.flag" local AUTOCLONE_FILE="${MODULE_WORK_DIR}/meta/repos" local MD5FILE="${TARGET_BUILD_DIR}/opt/openslx/.mltk/${MODULE}.md5" + local PKG_CONTENT_FILE="${MODULE_WORK_DIR}/meta/list_package_contents" mkdir -p "${TARGET_BUILD_DIR}/opt/openslx/.mltk" "${MODULE_WORK_DIR}/meta" if [ ! -d "${MODULE_DIR}" ]; then if [ -z "$DEPOF" ]; then @@ -447,7 +467,6 @@ process_module() { perror "Module directory for '$MODULE' not found in ${TARGET_DIR} (is a dependency of${DEPOF})" return fi - mkdir -p "${MODULE_WORK_DIR}" cde "${MODULE_DIR}" # Simple check for modified .build / .config, in which case we'll run a module clean first if [ -f "$MD5FILE" ]; then @@ -503,8 +522,14 @@ process_module() { fi # Build if [ ! -e "$BUILD_FLAG" ]; then - pinfo "## Building" + list_packet_files > "$PKG_CONTENT_FILE" || perror "Could not write packet content list to $PKG_CONTENT_FILE" + # Copy all required packages' contents to build dir, but not in install mode + if [ -z "$MLTK_INSTALL" ]; then + pinfo "## Copying required packages to build dir" + tarcopy "$( sort -u "$PKG_CONTENT_FILE" )" "${MODULE_BUILD_DIR}" + fi cde "${MODULE_WORK_DIR}" + pinfo "## Building" build # calls perror if something fails, no need to do that here strip_recursive "$MODULE_BUILD_DIR" touch "$BUILD_FLAG" || pwarning "Error setting built-flag" diff --git a/core/modules/alsa/module.build b/core/modules/alsa/module.build index 078aa338..a5cbb6b6 100644 --- a/core/modules/alsa/module.build +++ b/core/modules/alsa/module.build @@ -4,15 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - - # These shitty greps are 'excludes' for this high quality scientific linux. - list_packet_files | grep -v "^/etc/asound.state" \ - | grep -v "^/etc/modprobe.d/local.conf" >> "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" - + : } post_copy() { diff --git a/core/modules/cups/module.build b/core/modules/cups/module.build index 2b29bb7d..ae2913a3 100644 --- a/core/modules/cups/module.build +++ b/core/modules/cups/module.build @@ -5,13 +5,7 @@ fetch_source() { } build() { - local COPYLIST file - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - + local file # Move any disabled backends to the backend directory mv -n -- "${MODULE_BUILD_DIR}/usr/lib/cups/backend-available/"* "${MODULE_BUILD_DIR}/usr/lib/cups/backend/" rm -f -- "${MODULE_BUILD_DIR}/usr/lib/cups/backend-available/"* diff --git a/core/modules/dbus/module.build b/core/modules/dbus/module.build index a001a2b8..e6a6a05a 100644 --- a/core/modules/dbus/module.build +++ b/core/modules/dbus/module.build @@ -5,12 +5,6 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "${COPYLIST}" ] && rm "${COPYLIST}" - - list_packet_files >> "${COPYLIST}" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" - # Generate systemd files mkdir -p "$MODULE_BUILD_DIR/etc/systemd/system/dbus.service.d" diff --git a/core/modules/dnbd3/module.build b/core/modules/dnbd3/module.build index 1c877c8f..929304bc 100644 --- a/core/modules/dnbd3/module.build +++ b/core/modules/dnbd3/module.build @@ -30,11 +30,6 @@ build() { || perror "Could not create installation directory." cp -f "fuse/dnbd3-fuse" "server/dnbd3-server" "$install_dir" \ || perror "Could not copy components to installation directory." - - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" } post_copy() { diff --git a/core/modules/dunst/module.build b/core/modules/dunst/module.build index 16e0bb5b..d09204e5 100644 --- a/core/modules/dunst/module.build +++ b/core/modules/dunst/module.build @@ -5,18 +5,14 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - # copy udev rules to correct location - [ -d "${MODULE_BUILD_DIR}/lib/udev" ] && mv "${MODULE_BUILD_DIR}/lib/udev" "${MODULE_BUILD_DIR}/usr/lib/" + if [ -d "${TARGET_BUILD_DIR}/usr/lib/udev" ] && [ -d "${MODULE_BUILD_DIR}/lib/udev" ]; then + mv "${MODULE_BUILD_DIR}/lib/udev" "${MODULE_BUILD_DIR}/usr/lib/" + fi } post_copy() { mkdir -p "${TARGET_BUILD_DIR}/etc/X11" - [ ! -e ${TARGET_BUILD_DIR}/etc/X11/X ] && ln -s /usr/bin/Xorg ${TARGET_BUILD_DIR}/etc/X11/X + [ ! -e ${TARGET_BUILD_DIR}/etc/X11/X ] && ln -s /usr/bin/Xorg ${TARGET_BUILD_DIR}/etc/X11/X } diff --git a/core/modules/etherwake/module.build b/core/modules/etherwake/module.build index 50b24da5..55424e56 100644 --- a/core/modules/etherwake/module.build +++ b/core/modules/etherwake/module.build @@ -18,11 +18,6 @@ build() { sed "s,%ETHTOOL%,$(which ethtool)," "${MODULE_DIR}/templates/99-enable-wol-disable-pause.rules" \ > "${MODULE_BUILD_DIR}/etc/udev/rules.d/99-enable-wol-disable-pause.rules" \ || perror "Cannot write udev rule to enable WOL" - - local COPYLIST="list_dpkg_output" - rm -f -- "$COPYLIST" - list_packet_files >> "$COPYLIST" - tarcopy "$( < "$COPYLIST" sort -u )" "${MODULE_BUILD_DIR}" } post_copy() { diff --git a/core/modules/firefox/module.build b/core/modules/firefox/module.build index 63e32c5e..a5cbb6b6 100644 --- a/core/modules/firefox/module.build +++ b/core/modules/firefox/module.build @@ -4,11 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/gdisk/data/inc/prepare_localhd.functions b/core/modules/gdisk/data/inc/prepare_localhd.functions deleted file mode 100755 index 363c5083..00000000 --- a/core/modules/gdisk/data/inc/prepare_localhd.functions +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/ash -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2014..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to support@bwlehrpool.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# Local hard disk autodetection script for OpenSLX linux stateless clients, -# detecting special GPT partitions - -############################################################################# - -# Patition IDs -# Prefix for all paritions is 0FC63DAF-8483-4772-8E79-9999999999 -# Suffix: -# 44: non-persistent scratch partition -# 45: persistent partiton -# 46: non-persistent openslx partition for config, overlayfs and qcow images - -# We use special non assigned partition type for harddisk scratch -# space, thus no normal filesystem will be incidentally deleted or -# corrupted - -# Set disks to none -ID44= -ID45= -ID46= - -# General formatter for the /tmp partition on a local harddisk -diskfm () { - mopt="" # Global var! - local target="$1" - local fslist="xfs jfs ext4" - local fs - local path - [ $# -ge 2 ] && fslist="$2" - for fs in $fslist ; do - unset available - case $(cat /proc/filesystems) in - *${fs}*) available=yes;; - *) modprobe "${fs}" && available=yes;; - esac - if [ -n "${available}" ]; then - unset found - if which "mkfs.$fs" >/dev/null; then - found=yes - case "mkfs.$fs" in - mkfs.xfs) - fopt="-fq" - ;; - mkfs.jfs) - fopt="-q" - ;; - mkfs.ext4) - fopt="-Fq" - ;; - esac - mkfs.$fs ${fopt} "${target}" - fi - [ -n "$found" ] && break - fi - done -} - -# function format_pid () -# Formats partition with id 44, 45, 46 -# expects id as parameter -# usage: format_pid [44|45|46] -format_pid () { - local fmtpid=$1 - local target - case $fmtpid in - 44) - target=$ID44 - ;; - 45) - target=$ID45 - ;; - 46) - target=$ID46 - ;; - esac - if echo $target | grep -q '/dev/disk/' - then - # check for supported filesystem and formatter - diskfm $target - else - echo "Could not format partition ID $fmtpid" - fi -} - -# function mount_pid () -# Mounts partition with id 44, 45, 46 -# expects id and mountpoint as parameter -# usage: mount_pid [44|45|46] $MNT -mount_pid () { - local mntpid=$1 - local target=$2 - local source - if [ "x$2" = "x" ] - then - echo "No mountpoint specified dummy!" - else - case $mntpid in - 44) - source=$ID44 - ;; - 45) - source=$ID45 - ;; - 46) - source=$ID46 - ;; - esac - mkdir -p $target - if busybox mount -t auto "$source" "$target" - then - [ "x$mntpid}" = "x44" ] && chmod a+rwxt $target - if echo "$target" | grep -Eq "^mnt/|^/mnt/" - then - fstabtarget=$(echo $target | sed -re "s/[/]{0,1}mnt//") - echo -e "$source\t$fstabtarget\tauto\tnoexec\t0 0" \ - >>/mnt/etc/fstab - fi - else - echo "Could not mount partition ID $mntpid" - fi - fi -} - -# Get partition types -hdisks=$(ls /dev/disk/by-path/*-part[0-9]* \ - | sed -re "s,(.*)-part[0-9]*,\1," \ - | sort -u) - -if echo $hdisks | grep -q '/dev/disk/' - then - for hd in $(echo $hdisks) - do - upartid=$(sgdisk -p $hd 2>/dev/null | awk '$6~/FFFF/ {print $1}') - for upt in $(echo $upartid) - do - echo "${hd}-part${upt} $(sgdisk -i $upt $hd)" \ - | awk '$5 ~ /0FC63DAF-8483-4772-8E79-[0]{10}4[4-6]/ \ - {print $5 "=" $1}' \ - | sed -re "s,0FC63DAF-8483-4772-8E79-[0]{10},ID," \ - >> /etc/hdisks.conf - done - done - if [ -r /etc/hdisks.conf ] - then - . /etc/hdisks.conf - echo -e "Partitions found:\n$(cat /etc/hdisks.conf | cut -d'=' -f1)" - else - echo "No pratition IDs 44, 45 or 46 found" - fi - -fi - diff --git a/core/modules/gdisk/data/inc/setup_gpt.differentapproach b/core/modules/gdisk/data/inc/setup_gpt.differentapproach deleted file mode 100755 index 6f3013ee..00000000 --- a/core/modules/gdisk/data/inc/setup_gpt.differentapproach +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/ash -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2014..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to support@bwlehrpool.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- - -# Partition IDs -# Prefix for all partitions is 0FC63DAF-8483-4772-8E79-9999999999 -# Suffix: -# 44: non-persistent scratch partition -# 45: persistent partition -# 46: non-persistent openslx partition for config, overlayfs and qcow images - -# We use special non assigned partition type for harddisk scratch -# space, thus no normal filesystem will be incidentally deleted or -# corrupted - -PREFIX=/mnt - -# Set disks to none -ID44= -ID45= -ID46= - -# Mountpoints -ID44MNT=/tmp -ID45MNT=/opt/openslx/mnt/persistent -ID46MNT=/opt/openslx/mnt/non-persistent - -# General formatter for the /tmp partition on a local harddisk -diskfm () { - mopt="" # Global var! - local target="$1" - local fslist="xfs jfs ext4" - local fs - local path - [ $# -ge 2 ] && fslist="$2" - for fs in $fslist ; do - unset available - case $(cat /proc/filesystems) in - *${fs}*) available=yes;; - *) modprobe "${fs}" && available=yes;; - esac - if [ -n "${available}" ]; then - unset found - if which "mkfs.$fs" ; then - found=yes - case "mkfs.$fs" in - mkfs.xfs) - fopt="-fq" - ;; - mkfs.jfs) - fopt="-q" - ;; - mkfs.ext4) - fopt="-Fq" - ;; - esac - mkfs.$fs ${fopt} "${target}" - fi - [ -n "$found" ] && break - fi - done -} - -# Format and mount ID44 (/tmp) -mount_id44 () { - HAVE_TMP=no - if echo $ID44 | grep -q '/dev/disk/' - then - # check for supported filesystem and formatter - if diskfm $ID44; then - mkdir -p $PREFIX$ID44MNT - if mount -t auto "$ID44" "$PREFIX$ID44MNT" 2>/dev/null - then - chmod a+rwxt $PREFIX$ID44MNT - echo -e "$ID44\t$ID44MNT\tauto\tnoexec\t0 0" >> "/etc/fstab" - HAVE_TMP=yes - else - echo "Could not mount partition $ID44" - fi - else - echo "Could not format partition $ID44" - fi - fi -} - -# Mount persistent partition 45 -mount_id45 () { - HAVE_PERSISTENT=no - if echo $ID45 | grep -q '/dev/disk/' - then - mkdir -p $PREFIX$ID45MNT - if mount -t auto "$ID45" "$PREFIX$ID45MNT" 2>/dev/null - then - echo -e "$ID45\t$ID45MNT\tauto\tnoauto\t0 0" >> "/etc/fstab" - HAVE_PERSISTENT=yes - else - echo "Could not mount persistent partition $ID45" - fi - fi -} - -# Mount non-persistent partition 46 -mount_id46 () { - HAVE_NONPERSISTENT=no - if echo $ID46 | grep -q '/dev/disk/' - then - # check for supported filesystem and formatter - if diskfm $ID46; then - mkdir -p $PREFIX$ID46MNT - if mount -t auto -o noexec "$ID46" "$PREFIX$ID46MNT" 2>/dev/null - then - echo -e "$ID46\t$ID46MNT\tauto\tnoauto,noexec\t0 0" >> "/etc/fstab" - HAVE_NONPERSISTENT=yes - else - echo "Could not mount non-persistent partition $ID46" - fi - else - echo "Could not format partition $ID44" - fi - fi -} - -# Get partition types -hdisks=$(ls /dev/disk/by-path/*-part[0-9]* \ - | sed -re "s,(.*)-part[0-9]*,\1," \ - | sort -u) - -if echo $hdisks | grep -q '/dev/disk/' - then - for hd in $(echo $hdisks) - do - upartid=$(sgdisk -p $hd 2>/dev/null | awk '$6~/FFFF/ {print $1}') - for upt in $(echo $upartid) - do - echo "${hd}-part${upt} $(sgdisk -i $upt $hd)" \ - | awk '$5 ~ /0FC63DAF-8483-4772-8E79-[0]{10}4[4-6]/ \ - {print $5 "=" $1}' \ - | sed -re "s,0FC63DAF-8483-4772-8E79-[0]{10},ID," \ - >> /etc/hdisks.conf - done - done - [ -r /etc/hdisks.conf ] && . /etc/hdisks.conf - -fi - diff --git a/core/modules/gdisk/data/inc/setup_gpt.old b/core/modules/gdisk/data/inc/setup_gpt.old deleted file mode 100755 index 96d92b1c..00000000 --- a/core/modules/gdisk/data/inc/setup_gpt.old +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/ash - -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2013..2018 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to support@bwlehrpool.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# -# Local hard disk autodetection script for OpenSLX linux stateless clients, -# detecting swap and special partitions - -############################################################################# - -# Mount point for persistent scratch partition (type 45) -PERSISTENT="/opt/openslx/persistent" - -# General formatter for the /tmp partition on a local harddisk -diskfm () { - mopt="" # Global var! - local target="$1" - local fslist="xfs jfs ext3 ext2 ext4" - local fs - local path - [ $# -ge 2 ] && fslist="$2" - for fs in $fslist ; do - unset available - case $(cat /proc/filesystems) in - *${fs}*) available=yes;; - *) modprobe "${fs}" && available=yes;; - esac - if [ -n "${available}" ]; then - unset found - if which "mkfs.$fs" ; then - found=yes - case "mkfs.$fs" in - mkfs.xfs) - fopt="-f -b size=4k -s size=4k -l size=512b" # fastest formatting possible :) - mopt="-o noexec" - ;; - mkfs.ext2) - fopt="-Fq" - mopt="-o nocheck,noexec" - ;; - mkfs.ext3|mkfs.ext4) - fopt="-Fq" - mopt="-o noexec" - ;; - mkfs.reiserfs) - fopt="-f" - mopt="-o noexec" - ;; - mkfs.jfs) - fopt="-q" - mopt="-o noexec" - ;; - esac - mkfs.$fs ${fopt} "${target}" - fi - [ -n "$found" ] && break - fi - done -} - -mount_temp () { - local PRE=$(pwd) - if ! cd /tmp; then - mount_temp_fallback $@ - return $? - fi - mount $@ /tmp || return 1 - chmod a+rwxt /tmp - # Move stuff from working directory, which is old /tmp, to new /tmp just mounted - mv ./* ./.[!.]* ./..?* /tmp/ 2> /dev/null - local OLD=$(LANG=C ls -alh | grep -v -E ' \.\.?$' | grep -v '^total') - [ -n "$OLD" ] && echo -- "Leftovers:" && echo -- "$OLD" - cd "$PRE" -} - -mount_temp_fallback () { - mkdir -p /tmptmp - mv /tmp/* /tmp/.* /tmptmp/ 2> /dev/null - mount $@ /tmp || return 1 - chmod a+rwxt /tmp - mv /tmptmp/* /tmptmp/.* /tmp/ - rmdir /tmptmp - return 0 -} - -fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition" - -echo "Partitions:" -cat "/etc/disk.partition" - - -# sgdisk -i 1 /dev/sda | grep -o "0FC63DAF-8483-4772-8E79-[4]\{12\}" - -# Check for standard swap partitions and make them available to the system -HAVE_SWAP=no -for hdpartnr in $(sed -n -e "/ 82 /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do - echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab" - swapon "$hdpartnr" -p 10 && HAVE_SWAP=yes # low priority, in case we have zram swap, prefer that) -done - -# We use special non assigned partition type (id44) for harddisk scratch -# space, thus no normal filesystem will be incidentally deleted or -# corrupted -HAVE_TEMP=no -for hdpartnr in $(sed -n -e "/ 44 /p" "/etc/disk.partition" | 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 - mount_temp "$mopt" "$hdpartnr" || continue - echo -e "${hdpartnr}\t/tmp\t\tauto\t\tnoexec\t 0 0" >> "/etc/fstab" - HAVE_TEMP=yes - break - else - echo "formatting failed for some reason" - fi # Made this non-forking, systemd should handle it - 2013-05-28 -done - -# Put detected linux partitions (83) into /etc/fstab with "noauto", special -# partition 45 (persistent scratch) to /var/scratch and 46 to /var/openslx -HAVE_PERSISTENT=no -for partid in 83 45 46 ; do - for hdpartnr in $(sed -n -e "/ ${partid} /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do - if [ "${partid}" -eq 83 ]; then - mkdir -p "/media/${hdpartnr#/dev/*}" - echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,noexec\t 0 0" >> "/etc/fstab" - elif [ "${partid}" -eq 45 -a "$HAVE_PERSISTENT" = "no" ]; then - mkdir -p "$PERSISTENT" - if ! mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT"; then - diskfm "$hdpartnr" "jfs xfs ext3" || continue - mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT" || continue - fi - HAVE_PERSISTENT=yes - echo -e "${hdpartnr}\t${PERSISTENT}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab" - elif [ "${partid}" -eq 46 ]; then - mkdir -p "/media/${hdpartnr#/dev/*}" - echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\t\t 0 0" >> "/etc/fstab" - fi - done -done -[ "$HAVE_PERSISTENT" = "no" -a -d "$PERSISTENT" ] && rm -f "$PERSISTENT" - -mount -a - -# Make huge tmpfs if nothing could be mounted for /tmp -if [ "$HAVE_TEMP" = "no" ]; then - mount_temp -t tmpfs -o size=20G none - slxlog "partition-temp" "Running /tmp on tmpfs only!" "/etc/disk.partition" -fi -if [ "$HAVE_SWAP" = "no" ]; then - slxlog "partition-swap" "Have no (formatted) swap partition, using zram swap only!" "/etc/disk.partition" -fi - -exit 0 - diff --git a/core/modules/gdisk/module.build b/core/modules/gdisk/module.build deleted file mode 100644 index 59356ded..00000000 --- a/core/modules/gdisk/module.build +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -fetch_source() { - : -} - -build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - -} - -post_copy() { - copy_kernel_modules -} - diff --git a/core/modules/gdisk/module.conf b/core/modules/gdisk/module.conf deleted file mode 100644 index 2c00fc76..00000000 --- a/core/modules/gdisk/module.conf +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -REQUIRED_MODULES=" - kernel -" -REQUIRED_BINARIES=" - sgdisk - mkfs.xfs - mkfs.ext4 -" -REQUIRED_KERNEL_MODULES=" - kernel/fs/xfs/xfs.ko - kernel/fs/ext4/ext4.ko - kernel/fs/jfs/jfs.ko - kernel/drivers/scsi/3w-9xxx.ko - kernel/drivers/scsi/3w-sas.ko - kernel/drivers/scsi/aacraid/aacraid.ko - kernel/drivers/scsi/aic7xxx/aic79xx.ko - kernel/drivers/scsi/arcmsr/arcmsr.ko - kernel/drivers/scsi/bfa/bfa.ko - kernel/drivers/scsi/bnx2fc/bnx2fc.ko - kernel/drivers/scsi/csiostor/csiostor.ko - kernel/drivers/scsi/fcoe/fcoe.ko - kernel/drivers/scsi/fnic/fnic.ko - kernel/drivers/scsi/hpsa.ko - kernel/drivers/scsi/hptiop.ko - kernel/drivers/scsi/hv_storvsc.ko - kernel/drivers/scsi/initio.ko - kernel/drivers/scsi/isci/isci.ko - kernel/drivers/scsi/libiscsi.ko - kernel/drivers/scsi/lpfc/lpfc.ko - kernel/drivers/scsi/megaraid/megaraid_sas.ko - kernel/drivers/scsi/mpt2sas/mpt2sas.ko - kernel/drivers/scsi/mpt3sas/mpt3sas.ko - kernel/drivers/scsi/mvsas/mvsas.ko - kernel/drivers/scsi/mvumi.ko - kernel/drivers/scsi/pm8001/pm80xx.ko - kernel/drivers/scsi/pmcraid.ko - kernel/drivers/scsi/qla2xxx/qla2xxx.ko - kernel/drivers/scsi/qla4xxx/qla4xxx.ko - kernel/drivers/scsi/scsi_transport_sas.ko - kernel/drivers/scsi/sd_mod.ko - kernel/drivers/scsi/stex.ko - kernel/drivers/scsi/ufs/ufshcd.ko - kernel/drivers/scsi/virtio_scsi.ko - kernel/drivers/scsi/vmw_pvscsi.ko - kernel/drivers/ata/pata_ali.ko - kernel/drivers/ata/pata_it821x.ko - kernel/drivers/ata/pata_acpi.ko - kernel/drivers/ata/pata_atiixp.ko - kernel/drivers/ata/pata_hpt37x.ko - kernel/drivers/ata/pata_ninja32.ko - kernel/drivers/ata/ahci_platform.ko - kernel/drivers/ata/libahci.ko - kernel/drivers/ata/pata_artop.ko - kernel/drivers/ata/pdc_adma.ko - kernel/drivers/ata/pata_marvell.ko - kernel/drivers/ata/sata_promise.ko - kernel/drivers/ata/pata_oldpiix.ko - kernel/drivers/ata/pata_hpt366.ko - kernel/drivers/ata/sata_svw.ko - kernel/drivers/ata/pata_hpt3x3.ko - kernel/drivers/ata/pata_cmd64x.ko - kernel/drivers/ata/pata_sch.ko - kernel/drivers/ata/pata_sis.ko - kernel/drivers/ata/sata_sil.ko - kernel/drivers/ata/pata_it8213.ko - kernel/drivers/ata/pata_pdc202xx_old.ko - kernel/drivers/ata/pata_sil680.ko - kernel/drivers/ata/sata_mv.ko - kernel/drivers/ata/pata_rdc.ko - kernel/drivers/ata/pata_arasan_cf.ko - kernel/drivers/ata/sata_qstor.ko - kernel/drivers/ata/pata_atp867x.ko - kernel/drivers/ata/pata_piccolo.ko - kernel/drivers/ata/ahci.ko - kernel/drivers/ata/sata_sx4.ko - kernel/drivers/ata/libata.ko - kernel/drivers/ata/ata_generic.ko - kernel/drivers/ata/sata_sil24.ko - kernel/drivers/ata/sata_via.ko - kernel/drivers/ata/pata_netcell.ko - kernel/drivers/ata/pata_jmicron.ko - kernel/drivers/ata/sata_nv.ko - kernel/drivers/ata/pata_via.ko - kernel/drivers/ata/acard-ahci.ko - kernel/drivers/ata/sata_vsc.ko - kernel/drivers/ata/pata_hpt3x2n.ko - kernel/drivers/ata/sata_sis.ko - kernel/drivers/ata/sata_uli.ko - kernel/drivers/ata/pata_pdc2027x.ko - kernel/drivers/ata/ata_piix.ko - kernel/drivers/ata/pata_cs5536.ko - kernel/drivers/ata/pata_amd.ko - kernel/drivers/ata/pata_serverworks.ko -" diff --git a/core/modules/gdisk/module.conf.centos b/core/modules/gdisk/module.conf.centos deleted file mode 100644 index 10771637..00000000 --- a/core/modules/gdisk/module.conf.centos +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -REQUIRED_CONTENT_PACKAGES=" - gdisk - xfsprogs - e2fsprogs -" diff --git a/core/modules/gdisk/module.conf.debian b/core/modules/gdisk/module.conf.debian deleted file mode 100644 index 10771637..00000000 --- a/core/modules/gdisk/module.conf.debian +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -REQUIRED_CONTENT_PACKAGES=" - gdisk - xfsprogs - e2fsprogs -" diff --git a/core/modules/gdisk/module.conf.ubuntu b/core/modules/gdisk/module.conf.ubuntu deleted file mode 100644 index 10771637..00000000 --- a/core/modules/gdisk/module.conf.ubuntu +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -REQUIRED_CONTENT_PACKAGES=" - gdisk - xfsprogs - e2fsprogs -" diff --git a/core/modules/hardware-stats/module.build b/core/modules/hardware-stats/module.build index 11bcc643..3c6eb632 100644 --- a/core/modules/hardware-stats/module.build +++ b/core/modules/hardware-stats/module.build @@ -4,12 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - rm -f -- "$COPYLIST" - - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/haveged/module.build b/core/modules/haveged/module.build index 5fa3a36f..a5cbb6b6 100644 --- a/core/modules/haveged/module.build +++ b/core/modules/haveged/module.build @@ -4,9 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - list_packet_files > "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/iperf/module.build b/core/modules/iperf/module.build index 5fa3a36f..a5cbb6b6 100644 --- a/core/modules/iperf/module.build +++ b/core/modules/iperf/module.build @@ -4,9 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - list_packet_files > "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/kdm/module.build b/core/modules/kdm/module.build index c1467859..6be6af93 100644 --- a/core/modules/kdm/module.build +++ b/core/modules/kdm/module.build @@ -5,11 +5,7 @@ fetch_source () { } build () { - COPYLIST="list_dpkg_output" - [ -e "${COPYLIST}" ] && rm "${COPYLIST}" - - list_packet_files >> "${COPYLIST}" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/lightdm-greeter-bwlp/module.build b/core/modules/lightdm-greeter-bwlp/module.build index 76088717..46c690c0 100644 --- a/core/modules/lightdm-greeter-bwlp/module.build +++ b/core/modules/lightdm-greeter-bwlp/module.build @@ -21,11 +21,6 @@ build() { mv "${BUILDDIR}/qt-lightdm-greeter" "${DESTDIR}" mkdir -p "${MODULE_BUILD_DIR}/usr/share/xgreeters" cp "${SRCDIR}/qt-lightdm-greeter.desktop" "${MODULE_BUILD_DIR}/usr/share/xgreeters" - - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" } post_copy() { diff --git a/core/modules/lightdm/module.build b/core/modules/lightdm/module.build index 340f6444..d73ea72e 100644 --- a/core/modules/lightdm/module.build +++ b/core/modules/lightdm/module.build @@ -4,10 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/netpoint-lightdm/module.build b/core/modules/netpoint-lightdm/module.build index 65081bfd..a5cbb6b6 100644 --- a/core/modules/netpoint-lightdm/module.build +++ b/core/modules/netpoint-lightdm/module.build @@ -4,11 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/nscd/module.build b/core/modules/nscd/module.build index 7b89c354..a5cbb6b6 100644 --- a/core/modules/nscd/module.build +++ b/core/modules/nscd/module.build @@ -4,13 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - - return 0 + : } post_copy() { diff --git a/core/modules/openbox/module.build b/core/modules/openbox/module.build index 98ff9520..94ad6095 100644 --- a/core/modules/openbox/module.build +++ b/core/modules/openbox/module.build @@ -4,15 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - # FIXME: Hack: openSUSE's rpm -ql lilsts non-existant pango.modules, which makes - # tarcopy fail. We probably can't fix that, so remove it using grep.... - tarcopy "$(cat "$COPYLIST" | grep -v 'pango\.modules$' | sort -u)" "${MODULE_BUILD_DIR}" - - return 0 + : } post_copy() { diff --git a/core/modules/pam/module.build b/core/modules/pam/module.build index 88624cbe..c099bc1e 100644 --- a/core/modules/pam/module.build +++ b/core/modules/pam/module.build @@ -8,10 +8,6 @@ fetch_source() { build() { mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin" gcc -o "$MODULE_BUILD_DIR/opt/openslx/bin/sslconnect" "$MODULE_DIR/sslconnect.c" -lssl -lcrypto -O3 || perror "Could not compile sslconnect.c" - local COPYLIST="$MODULE_BUILD_DIR/list_packet_files" - # TODO: Hack for SUSE: Ignore file (/var/lib/nfs/state) that does not exist :( - list_packet_files | grep -v '/var/lib/nfs/state' | sort -u > "$COPYLIST" - tarcopy "$(cat "$COPYLIST")" "${MODULE_BUILD_DIR}" # build pam-script separatly since we use a source tarball diff --git a/core/modules/polkit/module.build b/core/modules/polkit/module.build index b1e61f66..c9fbbad6 100644 --- a/core/modules/polkit/module.build +++ b/core/modules/polkit/module.build @@ -8,8 +8,7 @@ fetch_source () { build () { local COPYLIST="$MODULE_WORK_DIR/list_dpkg_output" - list_packet_files > "$COPYLIST" - [ -n "$REQUIRED_DIR_STRUCT" ] && find $REQUIRED_DIR_STRUCT -type d >> "$COPYLIST" + [ -n "$REQUIRED_DIR_STRUCT" ] && find $REQUIRED_DIR_STRUCT -type d > "$COPYLIST" tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" mkdir -p "$MODULE_BUILD_DIR/var/lib/polkit" } diff --git a/core/modules/pvs2/module.build b/core/modules/pvs2/module.build index 39fc0d48..b36ead54 100644 --- a/core/modules/pvs2/module.build +++ b/core/modules/pvs2/module.build @@ -29,13 +29,8 @@ build() { chmod +x "${MODULE_BUILD_DIR}/opt/openslx/pvs2"/*.sh \ || perror "Could not set executable bit for external scripts." fi - - # needed for copying REQUIRED_CONTENT_PACKAGES to build/ - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" } + post_copy() { : } diff --git a/core/modules/qt5core/module.build b/core/modules/qt5core/module.build index f39ee4cd..a183dc1f 100644 --- a/core/modules/qt5core/module.build +++ b/core/modules/qt5core/module.build @@ -5,9 +5,7 @@ fetch_source() { } build() { - local COPYLIST="$MODULE_BUILD_DIR/list_packet_files" - list_packet_files | sort -u > "$COPYLIST" - tarcopy "$(cat "$COPYLIST")" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/rsyslogd/module.build b/core/modules/rsyslogd/module.build index 552d5f43..1d4b25db 100644 --- a/core/modules/rsyslogd/module.build +++ b/core/modules/rsyslogd/module.build @@ -4,20 +4,14 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - - return 0 + : } post_copy() { - - + # TODO This is garbage: Assumes we use our own systemd, hard-coded path + # Fix this or get rid of rsyslogd # pwd = module's build dir - mkdir -p "${TARGET_BUILD_DIR}"/var/spool/rsyslog + mkdir -p "${TARGET_BUILD_DIR}/var/spool/rsyslog" local RSL="$(find /usr/lib/ /lib/ -name rsyslog.service | head -1)" [ -z "$RSL" -o ! -e "$RSL" ] && perror "rsyslog.service not found on vorlage" diff --git a/core/modules/run-virt/module.build b/core/modules/run-virt/module.build index 4de16fb7..ebddd847 100644 --- a/core/modules/run-virt/module.build +++ b/core/modules/run-virt/module.build @@ -5,10 +5,6 @@ fetch_source () { } build () { - local COPYLIST="list_dpkg_output" - rm -f -- "$COPYLIST" - list_packet_files > "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" # Compile pwdaemon mkdir -p "${MODULE_BUILD_DIR}/opt/openslx/bin" gcc -D_GNU_SOURCE -std=gnu99 -o "${MODULE_BUILD_DIR}/opt/openslx/bin/pwdaemon" -Os "${MODULE_DIR}/pw_daemon.c" || perror "Could not compile the pwdaemon" diff --git a/core/modules/samba/module.build b/core/modules/samba/module.build index d24e7a87..a5cbb6b6 100644 --- a/core/modules/samba/module.build +++ b/core/modules/samba/module.build @@ -4,22 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - if [ "x$PACKET_MANAGER" == "xzypper" ]; then - if [ $(zypper lr | grep -ci filesystems) -eq 0 ]; then - zypper addrepo http://download.opensuse.org/repositories/filesystems/openSUSE_${SYS_VERSION} Filesystems - pinfo "Repository added: OpenSuse Build filesystems" - fi - # Ubuntu writes to /etc, Suse does not: - mkdir "$MODULE_BUILD_DIR"/etc/ - cp /usr/share/doc/packages/smbnetfs/smbnetfs.conf "$MODULE_BUILD_DIR"/etc/ - fi - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - return 0 + : } post_copy() { diff --git a/core/modules/slxbrowser/module.build b/core/modules/slxbrowser/module.build index 9ab0cb22..b1d420ad 100644 --- a/core/modules/slxbrowser/module.build +++ b/core/modules/slxbrowser/module.build @@ -14,12 +14,6 @@ build() { cmake "$SRCDIR" || perror "'cmake $SRCDIR' failed." make || perror "'make' failed." - - local COPYLIST="$MODULE_BUILD_DIR/list_packet_files" - list_packet_files | sort -u > "$COPYLIST" - tarcopy "$(cat "$COPYLIST")" "${MODULE_BUILD_DIR}" - - cd - > /dev/null } post_copy() { diff --git a/core/modules/smartctl/module.build b/core/modules/smartctl/module.build index 5fa3a36f..a5cbb6b6 100644 --- a/core/modules/smartctl/module.build +++ b/core/modules/smartctl/module.build @@ -4,9 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - list_packet_files > "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/smbclient/module.build b/core/modules/smbclient/module.build index 98b9b8db..75572509 100644 --- a/core/modules/smbclient/module.build +++ b/core/modules/smbclient/module.build @@ -4,12 +4,6 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - mkdir -p "${MODULE_BUILD_DIR}/usr/lib/cups/backend" || perror "Could not create '${MODULE_BUILD_DIR}/usr/lib/cups/backend'" local BIN_LOCATION="$(which smbspool)" if [ ! -z "${BIN_LOCATION}" -a -e "${BIN_LOCATION}" ]; then diff --git a/core/modules/sssd/module.build b/core/modules/sssd/module.build index 3f124d9c..57e45757 100644 --- a/core/modules/sssd/module.build +++ b/core/modules/sssd/module.build @@ -4,11 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/sudo/module.build b/core/modules/sudo/module.build index 5fa3a36f..a5cbb6b6 100644 --- a/core/modules/sudo/module.build +++ b/core/modules/sudo/module.build @@ -4,9 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - list_packet_files > "$COPYLIST" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/systemd-distro/module.build b/core/modules/systemd-distro/module.build index a2d65c66..c7d9d09d 100644 --- a/core/modules/systemd-distro/module.build +++ b/core/modules/systemd-distro/module.build @@ -8,10 +8,6 @@ build () { pwarning "No systemd binary found in PATH. " perror "Make sure the system uses systemd before using this module." fi - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "$MODULE_BUILD_DIR" mkdir -p "${MODULE_BUILD_DIR}/etc/systemd/system" for svc in kexec reboot poweroff halt; do sed 's/umount\.target//' "${MODULE_BUILD_DIR}/lib/systemd/system/systemd-${svc}.service" \ diff --git a/core/modules/usbguard/module.build b/core/modules/usbguard/module.build index d4879f91..142a905e 100644 --- a/core/modules/usbguard/module.build +++ b/core/modules/usbguard/module.build @@ -7,10 +7,6 @@ fetch_source() { build() { # copy REQUIRED_CONTENT_PACKAGES to mltk/tmp/work/<module>/build/ - #COPYLIST="list_dpkg_output" - #[ -e "$COPYLIST" ] && rm "$COPYLIST" - #list_packet_files >> "$COPYLIST" - #tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" # Compile libsodium cd "${MODULE_WORK_DIR}/src/libsodium/${REQUIRED_LIBSODIUM_UNTAR_NAME}" || perror "Could not cd to '${MODULE_WORK_DIR}/src/libsodium'. Did download_untar in fetch_source work?" ./configure || perror "configure failed" diff --git a/core/modules/vmware-version-check/module.build b/core/modules/vmware-version-check/module.build index 0f34cbee..5086d1bc 100644 --- a/core/modules/vmware-version-check/module.build +++ b/core/modules/vmware-version-check/module.build @@ -5,11 +5,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + : } post_copy() { diff --git a/core/modules/x11vnc/module.build b/core/modules/x11vnc/module.build index 0238f1bd..a183dc1f 100644 --- a/core/modules/x11vnc/module.build +++ b/core/modules/x11vnc/module.build @@ -5,12 +5,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - + : } post_copy() { diff --git a/core/modules/xfwm/module.build b/core/modules/xfwm/module.build index d7b9b209..a5cbb6b6 100644 --- a/core/modules/xfwm/module.build +++ b/core/modules/xfwm/module.build @@ -4,13 +4,7 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - rm -f -- "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$( < "$COPYLIST" sort -u )" "${MODULE_BUILD_DIR}" - - return 0 + : } post_copy() { diff --git a/core/modules/xorg/module.build b/core/modules/xorg/module.build index 8e165f08..bb6be5ba 100644 --- a/core/modules/xorg/module.build +++ b/core/modules/xorg/module.build @@ -15,12 +15,6 @@ fetch_source() { } build() { - COPYLIST="list_dpkg_output" - [ -e "$COPYLIST" ] && rm "$COPYLIST" - - list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" - # copy udev rules to correct location if [ -d "${MODULE_BUILD_DIR}/lib/udev" ]; then cp -r "${MODULE_BUILD_DIR}/lib/udev" "${MODULE_BUILD_DIR}/usr/lib/" diff --git a/core/rootfs/rootfs-stage31/module.build b/core/rootfs/rootfs-stage31/module.build index 024aadd0..3c72c385 100644 --- a/core/rootfs/rootfs-stage31/module.build +++ b/core/rootfs/rootfs-stage31/module.build @@ -6,8 +6,8 @@ fetch_source() { build() { local COPYLIST BIN_LOCATION DRM_MODULES FILE BIN MODNAME PCI_FILE ALIAS VENDOR DEVICE LIB - local COPYLIST="list_binaries_and_files" - [ -e "$COPYLIST" ] && rm -f "$COPYLIST" + COPYLIST="${MODULE_WORK_DIR}/list_binaries_and_files" + rm --f "$COPYLIST" for BIN in $REQUIRED_BINARIES; do local BIN_LOCATION=$(which "$BIN") [ -z "$BIN_LOCATION" ] && perror "Cannot find $BIN" diff --git a/core/rootfs/rootfs-stage32/module.build b/core/rootfs/rootfs-stage32/module.build index 3c32878b..c7190586 100644 --- a/core/rootfs/rootfs-stage32/module.build +++ b/core/rootfs/rootfs-stage32/module.build @@ -5,15 +5,8 @@ fetch_source() { } build() { - if [ ! -z "$REQUIRED_CONTENT_PACKAGES" ]; then - local COPYLIST="list_dpkg_output" - [ -e "${COPYLIST}" ] && rm "${COPYLIST}" - list_packet_files >> "${COPYLIST}" - tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" - fi - local FILELIST="list_binaries_and_files" - [ -e "${FILELIST}" ] && rm "${FILELIST}" + rm -f "${FILELIST}" # Get ldconfig mkdir -p "$MODULE_BUILD_DIR/sbin" |