Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e41d449
Showing
53 changed files
with
13,929 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Makefile | ||
|
||
SHELL := sh -e | ||
|
||
LANGUAGES = de | ||
|
||
SCRIPTS = bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/* | ||
|
||
all: test build | ||
|
||
test: | ||
@echo -n "Checking for syntax errors" | ||
|
||
@for SCRIPT in $(SCRIPTS); \ | ||
do \ | ||
sh -n $${SCRIPT}; \ | ||
echo -n "."; \ | ||
done | ||
|
||
@echo " done." | ||
|
||
@# We can't just fail yet on bashisms (FIXME) | ||
@if [ -x "$$(which checkbashisms 2>/dev/null)" ]; \ | ||
then \ | ||
echo -n "Checking for bashisms"; \ | ||
for SCRIPT in $(SCRIPTS); \ | ||
do \ | ||
checkbashisms -f -x $${SCRIPT} || true; \ | ||
echo -n "."; \ | ||
done; \ | ||
echo " done."; \ | ||
else \ | ||
echo "W: checkbashisms - command not found"; \ | ||
echo "I: checkbashisms can be optained from: "; \ | ||
echo "I: http://git.debian.org/?p=devscripts/devscripts.git"; \ | ||
echo "I: On Debian systems, checkbashisms can be installed with:"; \ | ||
echo "I: apt-get install devscripts"; \ | ||
fi | ||
|
||
build: | ||
@echo "Nothing to build." | ||
|
||
install: | ||
# Installing executables | ||
mkdir -p $(DESTDIR)/sbin | ||
cp bin/live-new-uuid bin/live-snapshot bin/live-swapfile $(DESTDIR)/sbin | ||
|
||
mkdir -p $(DESTDIR)/usr/share/live-boot | ||
cp bin/live-preseed bin/live-reconfigure local/languagelist $(DESTDIR)/usr/share/live-boot | ||
|
||
mkdir -p $(DESTDIR)/usr/share/initramfs-tools | ||
cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools | ||
|
||
# Installing docs | ||
mkdir -p $(DESTDIR)/usr/share/doc/live-boot | ||
cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-boot | ||
|
||
mkdir -p $(DESTDIR)/usr/share/doc/live-boot/examples | ||
cp -r etc/* $(DESTDIR)/usr/share/doc/live-boot/examples | ||
# (FIXME) | ||
|
||
# Installing manpages | ||
for MANPAGE in manpages/en/*; \ | ||
do \ | ||
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \ | ||
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \ | ||
done | ||
|
||
for LANGUAGE in $(LANGUAGES); \ | ||
do \ | ||
for MANPAGE in manpages/$${LANGUAGE}/*; \ | ||
do \ | ||
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \ | ||
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \ | ||
done; \ | ||
done | ||
|
||
uninstall: | ||
# Uninstalling executables | ||
rm -f $(DESTDIR)/sbin/live-snapshot $(DESTDIR)/sbin/live-swapfile | ||
rm -rf $(DESTDIR)/usr/share/live-boot | ||
rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live | ||
rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live* | ||
rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/live | ||
|
||
# Uninstalling docs | ||
rm -rf $(DESTDIR)/usr/share/doc/live-boot | ||
# (FIXME) | ||
|
||
# Uninstalling manpages | ||
for MANPAGE in manpages/en/*; \ | ||
do \ | ||
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \ | ||
rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \ | ||
done | ||
|
||
for LANGUAGE in $(LANGUAGES); \ | ||
do \ | ||
for MANPAGE in manpages/$${LANGUAGE}/*; \ | ||
do \ | ||
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \ | ||
rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \ | ||
done; \ | ||
done | ||
|
||
clean: | ||
|
||
distclean: | ||
|
||
reinstall: uninstall install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0~a1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/sh | ||
# -*- coding: utf-8 -*- | ||
# | ||
# «live-new-uuid» - Creates and injects new UUIDs for live disks | ||
# | ||
# Create new UUIDs for disks to prevent conflicts and booting the wrong live | ||
# directory. Particularly useful in creating recovery disks that need to be | ||
# able to also work with recovery partitioning schemes. | ||
# | ||
# Copyright (C) 2008, Dell Inc. | ||
# | ||
# Author: | ||
# - Mario Limonciello <Mario_Limonciello@Dell.com> | ||
# | ||
# This script is free software; you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License as published by the Free | ||
# Software Foundation; either version 2 of the License, or at your option) | ||
# any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this application; if not, write to the Free Software Foundation, Inc., 51 | ||
# Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
################################################################################## | ||
|
||
set -e | ||
|
||
help() { | ||
echo | ||
echo "USAGE: $0 initrd.{l,g}z <path-to-new-initrd> <path-to-new-live-uuid> " | ||
echo | ||
echo "initrd.{l,g}z is the absolute path to the original gzipped or lzmaed initramfs" | ||
echo "<path-to-new-initrd> is the destination directory for the new compressed initramfs" | ||
echo "<path-to-new-live-uuid> is the destination directory for the new live-uuid-TYPE " | ||
echo | ||
echo "if either path is absent, they will end up in the current directory " | ||
echo "TYPE is determined by an already existing live-uuid-* or by 'uname -s'" | ||
} | ||
|
||
if [ "$#" = "0" ] || [ "x$1" = x-h ] || [ "x$1" = x--help ]; then | ||
help | ||
exit 3 | ||
fi | ||
|
||
CWD=`pwd` | ||
TEMPDIR=`mktemp -d /tmp/uuid-XXXXXX` | ||
TYPE=`uname -r | cut -d '-' -f 3` | ||
|
||
if echo "$1" | grep ".lz$" >/dev/null; then | ||
COMPRESSOR="lzma" | ||
SUFFIX=".lz" | ||
elif echo "$1" | grep ".gz$" >/dev/null; then | ||
COMPRESSOR="gzip" | ||
SUFFIX=".gz" | ||
else | ||
echo "Unsupported archive type." | ||
exit 2 | ||
fi | ||
|
||
if [ -z "$2" ] || [ ! -d "$2" ] || [ "$2" = "." ]; then | ||
COMPRESS_DIR="$CWD" | ||
else | ||
COMPRESS_DIR="$2" | ||
fi | ||
|
||
if [ -z "$3" ] || [ ! -d "$3" ] || [ "$3" = "." ]; then | ||
LIVEDIR="$CWD" | ||
else | ||
LIVEDIR="$3" | ||
fi | ||
|
||
cd "$TEMPDIR" | ||
$COMPRESSOR -cd "$1" -S "$SUFFIX" | cpio -id | ||
uuidgen -r > conf/uuid.conf | ||
find . | cpio --quiet --dereference -o -H newc | $COMPRESSOR -9c > "$COMPRESS_DIR/initrd$SUFFIX" | ||
if [ "$(ls "$LIVEDIR/live-uuid"-* >/dev/null 2>&1 | wc -l)" = 1 ]; then | ||
cp conf/uuid.conf "$LIVEDIR/live-uuid"-* | ||
else | ||
cp conf/uuid.conf "$LIVEDIR/live-uuid-$TYPE" | ||
fi | ||
cd "$CWD" | ||
rm -rf "$TEMPDIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
PATH=/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
root="${1}" | ||
question="${2}" | ||
value="${3}" | ||
seen="${4}" | ||
|
||
[ "${seen}" ] || seen=true | ||
|
||
if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-boot >/dev/null | ||
then | ||
|
||
chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-boot >/dev/null << EOF | ||
REGISTER debian-installer/dummy ${question} | ||
SET ${question} ${value} | ||
FSET ${question} seen ${seen} | ||
EOF | ||
|
||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
export PATH=/usr/bin:/usr/sbin:/sbin:/bin | ||
|
||
frontend=noninteractive | ||
|
||
findcommandinroot () | ||
{ | ||
ROOT="${1}/" | ||
shift | ||
|
||
while [ "${#}" -ge 1 ] | ||
do | ||
P="${PATH}" | ||
|
||
while [ "${P}" ] | ||
do | ||
D=${P%%:*} | ||
P=${P#*:} | ||
|
||
if [ "${D}" = "${P}" ] | ||
then | ||
P= | ||
fi | ||
|
||
if [ -z "${D}" ] | ||
then | ||
D=. | ||
fi | ||
|
||
if [ -x "${ROOT}${D}/${1}" ] | ||
then | ||
echo "${D}/${1}" | ||
return 0 | ||
fi | ||
done | ||
|
||
shift | ||
done | ||
|
||
return 1 | ||
} | ||
|
||
runcommandinroot () | ||
{ | ||
C=$(findcommandinroot "${1}" "${2}") | ||
ROOT="${1}" | ||
|
||
shift | ||
shift | ||
|
||
[ -n "${C}" ] && chroot "${ROOT}" "${C}" "${@}" | ||
} | ||
|
||
root="${1}" | ||
package="${2}" | ||
|
||
version=$(runcommandinroot "${root}" dpkg-query -W --showformat='${Version}' "${package}" 2>/dev/null) || version="" | ||
|
||
if [ -z "${version}" ] | ||
then | ||
echo >&2 "${0}: package '${package}' is not installed" | ||
exit 0 | ||
fi | ||
|
||
runcommandinroot "${root}" dpkg-reconfigure -fnoninteractive --no-reload "${package}" | ||
|
||
exit 0 |
Oops, something went wrong.