Commit 577cb00a authored by Gustav Geier's avatar Gustav Geier

Added scripts, updated .gitignore

parent 3aec0ff5
.filesystems
*.lz
*.iso
FreeDOS/
#!/bin/bash
set -e
something_is_mounted_at() {
grep -q " $1/\? " /proc/mounts
}
if [[ $EUID -ne 0 ]]
then
echo "Du bist nicht ROOT ... verwende \"sudo bash $0\" !"
exit 2
fi
mkdir -p /target
if ! something_is_mounted_at /target
then
if [ -n "$1" ]
then
mount "$1" /target
else
echo "Nothing mounted at /target. Give filesystem to mount as parameter #1"
exit 1
fi
fi
something_is_mounted_at /target/dev || mount --rbind /dev /target/dev
something_is_mounted_at /target/sys || mount --bind /sys /target/sys
something_is_mounted_at /target/proc || mount --bind /proc /target/proc
debian_chroot=TARGET chroot /target /bin/bash -l || true
echo -e "\n*************************************"
echo -e "* *"
echo -e "* You are out of CHROOT now! *"
echo -e "* *"
echo -e "*************************************"
#end;
#!/bin/bash
set -e
MY_DIR="$( readlink -f "$( dirname "${BASH_SOURCE[0]}" )" )"
if [[ $UID -ne 0 ]]; then
echo "$0 must be run as root"
exit 1
fi
MPOINT=""
source "$MY_DIR/mount-stick-repo.sh" #detect mountpoint
if [ -n "$MPOINT" ]; then
SOURCE_PATH="$MPOINT"
#SRC_LST=/etc/apt/sources.list.d/lipoffline.list #"$(mktemp --suffix=".list")"
#echo "deb [ trusted=yes ] file:$SOURCE_PATH/archives precise lip" > $SRC_LST
#apt-get -o Dir::Etc::SourceList=$SRC_LST update
#apt-get update
/bin/bash $MY_DIR/liprepoctl.sh on "$SOURCE_PATH"
else
echo "No stick, no repo; good luck."
exit 1
fi
exit 0
#end;
This diff is collapsed.
#!/bin/bash
ACTION="$1"
FILENAME="/etc/apt/sources.list.d/lipoffline.list"
ACTIVATED=`test -e "$FILENAME"`
function install_repo()
{
echo "# offline repository of the linux install party
deb [ trusted=yes ] file://$1/archives precise lip" > "$FILENAME"
}
function uninstall_repo()
{
rm -f "$FILENAME"
}
case $ACTION in
"on")
if [ -z "$2" ]; then
echo "No repository location specified!"
exit 2
fi
install_repo "$2"
apt-get update
echo "Repository is now active, remember to call \"$0 off\" to deactivate it when you are done."
;;
"off")
uninstall_repo
apt-get update
echo "Repository is now inactive."
;;
"check")
echo "State: $ACTIVATED"
;;
*)
echo "Unknown action $ACTION"
exit 1
;;
esac
#! /bin/bash
set -e
#find device
DEV="$(blkid -t "LABEL=MultiBoot" -o device | head -n1 || echo '')"
PS3="[1,2,3]<Enter>: "
while [ -z "$DEV" ]; do
echo "Der LIP-Install-USB-Stick wurde nicht gefunden."
echo "Jetzt einstecken oder ohne weitermachen"
select i in "Stick ist jetzt gesteckt" \
"Ohne Stick weitermachen" \
"Installation abbrechen" ; do
case $i in
"Stick ist jetzt gesteckt")
DEV="$(blkid -t "LABEL=MultiBoot" -o device | head -n1 || echo '')"
;;
"Ohne Stick weitermachen")
DEV='-nomount-'
;;
"Installation abbrechen")
exit 2
;;
*)
echo "Das sollte nicht passieren. Helfer fragen."
exit 99
;;
esac
break
done
done
if [ "$DEV" = "-nomount-" ]; then
echo "Mache ohne USB-Stick weiter."
MPOINT=""
#exit 0
else
echo "Stick gefunden als $DEV"
# ask udisks to mount it always.
udisks --mount "$DEV"
# see where it is mounted
DEVFILE=${DEV#/dev/}
MPOINT="$(qdbus --system org.freedesktop.UDisks /org/freedesktop/UDisks/devices/${DEVFILE} org.freedesktop.DBus.Properties.Get org.freedesktop.UDisks.Device "DeviceMountPaths" | head -n1)"
echo "Der Stick it als '$MPOINT' gemountet"
fi
#end;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment