From d85a9898b89c7f318bd4a5e850a8b0e9befccf7e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 13 Aug 2013 17:43:42 +0200 Subject: [dnbd3] update requested git commit of dnbd3 --- remote/modules/dnbd3/dnbd3.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/remote/modules/dnbd3/dnbd3.conf b/remote/modules/dnbd3/dnbd3.conf index 943e7f78..c1a3eb2e 100644 --- a/remote/modules/dnbd3/dnbd3.conf +++ b/remote/modules/dnbd3/dnbd3.conf @@ -2,8 +2,7 @@ #REQUIRED_CONTENT_PACKAGES="libgconf-2-4 fontconfig-config" REQUIRED_MODULES="kernel" REQUIRED_GIT="git://git.openslx.org/dnbd3.git" -REQUIRED_BRANCH="simon" -REQUIRED_COMMIT="2a57d02723295cb688f1643ebabdbf549ad63fa3" +REQUIRED_COMMIT="37868b9e5f7c26c61a928a61b7cc705eedb7e5a6" REQUIRED_BINARIES=" dnbd3-client " -- cgit v1.2.3-55-g7522 From 6dbe346fdb79658a5d0d590f52e820331a6ad029 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 13 Aug 2013 23:25:52 +0200 Subject: [rootfs-stage32] Properly generate and update /etc/issue with version information --- .../etc/systemd/system/update-etc_issue.service | 9 +++ .../data/opt/openslx/scripts/openslx-create_issue | 12 ++++ .../data/opt/openslx/scripts/udhcpc-openslx | 84 ++++++++-------------- remote/rootfs/rootfs-stage32/rootfs-stage32.build | 8 +++ remote/rootfs/rootfs-stage32/rootfs-stage32.conf | 1 - .../rootfs/rootfs-stage32/templates/issue.template | 9 +++ 6 files changed, 67 insertions(+), 56 deletions(-) create mode 100644 remote/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service create mode 100644 remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue create mode 100644 remote/rootfs/rootfs-stage32/templates/issue.template diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service new file mode 100644 index 00000000..c4f45a3c --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service @@ -0,0 +1,9 @@ +[Unit] +Description=Update /etc/issue +Before=sysinit.target shutdown.target +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/openslx-create_issue +RemainAfterExit=no diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue new file mode 100644 index 00000000..c09162dc --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue @@ -0,0 +1,12 @@ +#/bin/sh + +# Set greeting and add information on booted system +# Fixme (add version string and distro name) +len=$(expr length "$(cat /etc/hostname)") +while [ $len -le 52 ] ; do + space="$space " + len=$(($len + 1)) +done + +sed "s/%space%/$space/g" /opt/openslx/etc/issue.template > /etc/issue + diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx index b49e2207..fd88ca30 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx @@ -43,12 +43,12 @@ case "$1" in if [ -n "$router" ]; then ip route add default via "$router" fi - + # Update resolver configuration file CONF="" if [ -n "$domain" ]; then printf -v CONF "domain $domain\nsearch $domain\n" - elif [ -n "$SLX_NET_DOMAIN" ]; then + elif [ -n "$SLX_NET_DOMAIN" ]; then printf -v CONF "domain $SLX_NET_DOMAIN\nsearch $SLX_NET_DOMAIN\n" fi for i in $dns; do @@ -71,55 +71,29 @@ case "$1" in # Update IP sed -i "s/^\(SLX_PXE_CLIENT_IP=\).*$/\1'$ip'/" /opt/openslx/config - # Update hostname - dns_host=$(rdns "$ip") - if [ -z "$dns_host" ]; then - # fallback to what the dhcp told us - dns_host="$hostname" - fi - # Avoid empty hostnames - [ -z "$dns_host" ] && dns_host="slx-client" - echo "$dns_host" > "/proc/sys/kernel/hostname" - echo "$dns_host" > "/etc/hostname" - if grep '^SLX_HOSTNAME=' /opt/openslx/config 2>/dev/null; then - sed -i "s/^\(SLX_HOSTNAME=\).*$/\1'$dns_host'/" /opt/openslx/config - else - echo "# Config written by openslx-dhcp-script (1)" >> /opt/openslx/config - echo "SLX_HOSTNAME='$dns_host'" >> /opt/openslx/config + # Only if network is not ready yet + if [ ! -e "/run/udhcpc/network-ready" ]; then + # Update hostname + dns_host=$(rdns "$ip") + if [ -z "$dns_host" ]; then + # fallback to what the dhcp told us + dns_host="$hostname" + fi + # Avoid empty hostnames + [ -z "$dns_host" ] && dns_host="slx-client" + echo "$dns_host" > "/proc/sys/kernel/hostname" + echo "$dns_host" > "/etc/hostname" + if grep '^SLX_HOSTNAME=' /opt/openslx/config 2>/dev/null; then + sed -i "s/^\(SLX_HOSTNAME=\).*$/\1'$dns_host'/" /opt/openslx/config + else + echo "# Config written by openslx-dhcp-script (1)" >> /opt/openslx/config + echo "SLX_HOSTNAME='$dns_host'" >> /opt/openslx/config + fi + # Update /etc/issue for proper spacing + /opt/openslx/scripts/openslx-create_issue fi - # Set greeting and add information on booted system - # Fixme (add version string and distro name) - version="bwLehrpools/-" - len=$(expr length ${version}) - if [ $len -le 28 ] ; then - vdstr="Stateless Workstation (${version})" - smax=52 - else - vdstr="${version}" - smax=76 - fi - while [ $len -le $smax ] ; do - vdstr="$vdstr " - len=$(($len + 1)) - done - len=$(expr length ${dns_host}) - while [ $len -le 52 ] ; do - space="$space " - len=$(($len + 1)) - done - echo " - WELCOME TO $space \n (\l) - _____ ______ ______ __ __ _______ __ __ __ __ __ ______ - / _ | _ | ___| | | | | ____| | | | | | | | | |/ ____| - | | | | |_| | |_ | | | | |___ | | / / __ | | | | | ___ - | | | | ___/| _| | | ____ | | | | |__| | | | |_ | - | |_| | | | |___| | | | ____| | |___ / / | | | | |___ | - _____/|__| |______|__| |__| |_______|______|__| |__| |__| |__| ______/ - - $vdstr (c) -" > /etc/issue fi - + # Hostname in /etc/hosts touch /etc/hosts if [ -n "$dns_host" ]; then @@ -145,7 +119,7 @@ case "$1" in fi fi sed -i -r '/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\s*$/d' /etc/hosts - + # We consider the network setup to be complete if an interface is being configured that # has a default route and some dns servers set. if [ -n "$router" ] && [ -n "$dns" ] && [ ! -e "/run/udhcpc/network-ready" ]; then @@ -174,7 +148,7 @@ case "$1" in else echo "NFS is active, not removing old ip adress. warning: lease may expire after a while." fi - + if [ -x /sbin/resolvconf ]; then # Automatic handling :-) resolvconf -d "${interface}.udhcpc" @@ -183,23 +157,23 @@ case "$1" in rm -f "$THISFILE" rebuild_resolv_conf fi - + ;; leasefail) echo "$0: Lease failed: $message" - + ;; nak) echo "$0: Received a NAK: $message" - + ;; *) echo "$0: Unknown udhcpc command: $1"; exit 1; - + ;; esac diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.build b/remote/rootfs/rootfs-stage32/rootfs-stage32.build index 596d8deb..66805660 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build @@ -53,6 +53,7 @@ build() { local NUMFILES=$(cat "${FILELIST}" | wc -l) if [ "x$NUMFILES" != "x" -a "x$NUMFILES" != "x0" ]; then pinfo "File list generated at ${MODULE_BUILD_DIR}/${FILELIST} ($NUMFILES entries)" + pinfo "If something fails here, try to clean this module first." tarcopy "$(cat "${FILELIST}")" "${MODULE_BUILD_DIR}" fi } @@ -126,6 +127,13 @@ post_copy() { pwarning "Could not determine distribution" fi fi + # Create issue.template + local DIST=$(lsb_release -sd) + local GITC=$(git rev-parse --short HEAD) + local DATE=$(date "+%Y-%m-%d") + local VERSION=$(echo "bwLehrpool/$DIST built $DATE (git: $GITC)" | escape_replace) + mkdir "$TARGET_BUILD_DIR/opt/openslx/etc" + sed "s/%version%/$VERSION/g" templates/issue.template > "$TARGET_BUILD_DIR/opt/openslx/etc/issue.template" || perror "Could not create issue template" } diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf index fb56f7d9..dcdcd347 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf @@ -53,7 +53,6 @@ REQUIRED_LIBRARIES=" libcap libresolv libau" REQUIRED_FILES=" - /etc/issue /etc/inputrc /etc/localtime /etc/login.defs diff --git a/remote/rootfs/rootfs-stage32/templates/issue.template b/remote/rootfs/rootfs-stage32/templates/issue.template new file mode 100644 index 00000000..e15c19d5 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/templates/issue.template @@ -0,0 +1,9 @@ + WELCOME TO %space% \n (\l) + _____ ______ ______ __ __ _______ __ __ __ + / _ | _ | ___| | | | | ____| | | | | | + | | | | |_| | |_ | | | | |___ | | / / + | | | | ___/| _| | | ____ | | | | + | |_| | | | |___| | | | ____| | |___ / / + _____/|__| |______|__| |__| |_______|______|__| |__| - NG + + %version% (c) -- cgit v1.2.3-55-g7522 From 7181018b457cef9fd0780042ea5a5020f132c20d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 13 Aug 2013 23:34:13 +0200 Subject: fix for last commit --- remote/rootfs/rootfs-stage32/rootfs-stage32.build | 6 +++--- remote/rootfs/rootfs-stage32/templates/issue.template | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.build b/remote/rootfs/rootfs-stage32/rootfs-stage32.build index 66805660..8ed9951e 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build @@ -131,9 +131,9 @@ post_copy() { local DIST=$(lsb_release -sd) local GITC=$(git rev-parse --short HEAD) local DATE=$(date "+%Y-%m-%d") - local VERSION=$(echo "bwLehrpool/$DIST built $DATE (git: $GITC)" | escape_replace) - mkdir "$TARGET_BUILD_DIR/opt/openslx/etc" - sed "s/%version%/$VERSION/g" templates/issue.template > "$TARGET_BUILD_DIR/opt/openslx/etc/issue.template" || perror "Could not create issue template" + local VERSION=$(echo "bwLehrpool/$DIST $DATE/$GITC" | escape_replace) + mkdir -p "$TARGET_BUILD_DIR/opt/openslx/etc" + sed "s/%version%/$VERSION/g" "$MODULE_DIR/templates/issue.template" > "$TARGET_BUILD_DIR/opt/openslx/etc/issue.template" || perror "Could not create issue template" } diff --git a/remote/rootfs/rootfs-stage32/templates/issue.template b/remote/rootfs/rootfs-stage32/templates/issue.template index e15c19d5..db29bb54 100644 --- a/remote/rootfs/rootfs-stage32/templates/issue.template +++ b/remote/rootfs/rootfs-stage32/templates/issue.template @@ -6,4 +6,4 @@ | |_| | | | |___| | | | ____| | |___ / / _____/|__| |______|__| |__| |_______|______|__| |__| - NG - %version% (c) + %version% (c) -- cgit v1.2.3-55-g7522 From e822b58478a1e7db8bcac4def772158e3493ece4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 13 Aug 2013 23:41:00 +0200 Subject: fix for fix --- .../etc/systemd/system/sysinit.target.wants/update-etc_issue.service | 1 + .../rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue | 0 2 files changed, 1 insertion(+) create mode 120000 remote/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service mode change 100644 => 100755 remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service new file mode 120000 index 00000000..4540789e --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service @@ -0,0 +1 @@ +../update-etc_issue.service \ No newline at end of file diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue old mode 100644 new mode 100755 -- cgit v1.2.3-55-g7522 From 32968f0116a3b9a138e6e6b3eb3d001091d59459 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 13 Aug 2013 23:51:32 +0200 Subject: respect 80 columns width (in case no drm could be loaded) --- remote/rootfs/rootfs-stage32/templates/issue.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/rootfs/rootfs-stage32/templates/issue.template b/remote/rootfs/rootfs-stage32/templates/issue.template index db29bb54..e200c1c0 100644 --- a/remote/rootfs/rootfs-stage32/templates/issue.template +++ b/remote/rootfs/rootfs-stage32/templates/issue.template @@ -1,4 +1,4 @@ - WELCOME TO %space% \n (\l) + WELCOME TO %space% \n (\l) _____ ______ ______ __ __ _______ __ __ __ / _ | _ | ___| | | | | ____| | | | | | | | | | |_| | |_ | | | | |___ | | / / -- cgit v1.2.3-55-g7522