Skip to content
Snippets Groups Projects
Commit a402f7b8 authored by Daniel Schulte's avatar Daniel Schulte
Browse files

Legacy scripts

parent e71c7bf4
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -e
DIR=$(pwd)
if [ ! -e "$DIR/lip32" -o ! -e "$DIR/lip64" ]; then
echo "Working directories not existing. Please run unsquash.sh before this"
exit 1
fi
if [ -e "$DIR/lipcommon" ]; then
echo "lipcommon dir exists. Please remove it before running this"
exit 1
fi
echo -n "Creating 32-bit checksums... "
pushd "$DIR/lip32" > /dev/null
find . -type f -print0 | sort -z | xargs -0 md5sum > "$DIR/32.md5"
popd > /dev/null
echo "done"
echo -n "Creating 64-bit checksums... "
pushd "$DIR/lip64" > /dev/null
find . -type f -print0 | sort -z | xargs -0 md5sum > "$DIR/64.md5"
popd > /dev/null
echo "done"
mkdir -p "$DIR/lipcommon"
echo -n "Diffing checksums... "
diff --old-line-format="" --new-line-format="" --unchanged-line-format="%L" "$DIR/32.md5" "$DIR/64.md5" > "$DIR/both.md5" || true
echo "done"
echo -n "Deduplicating... "
cut -d" " -f3- "$DIR/both.md5" | tr \\n \\0 | (cd "$DIR/lip64"; xargs -0 cp -v --parents -pt "$DIR/lipcommon/" )
cut -d" " -f3- "$DIR/both.md5" | tr \\n \\0 | (cd "$DIR/lip32"; xargs -0 rm )
cut -d" " -f3- "$DIR/both.md5" | tr \\n \\0 | (cd "$DIR/lip64"; xargs -0 rm )
echo "done"
echo "Ok. Now run squash.sh"
exit 0;
#!/bin/bash
set -e
WORKDIR="$(pwd)"
function unpack_initrd
{
FILE="$1"
FOLDER="$2"
mkdir -p "$FOLDER/remaster-initrd"
pushd "$FOLDER/remaster-initrd" > /dev/null
lzma -d < "$FILE" | cpio -i
popd > /dev/null
}
function pack_initrd
{
OUTDIR="$1"
INDIR="$2"
if [ ! -d "$INDIR/remaster-initrd" ]; then
echo "Temp directory does not exist. Bug?"
exit 1
fi
pushd "$INDIR/remaster-initrd" > /dev/null
find | cpio -H newc -o | lzma -z > "$OUTDIR/initrd.lz"
popd > /dev/null
}
if [ $# -eq 0 ]; then
echo "Usage: $0 INITRD_FILE PATH_TO_CUSTOMIZE_LIP"
exit 1
fi
INITRD_FILE="$1"
PATH_TO_CUSTOMIZE_LIP="$2"
if [ ! -f "$INITRD_FILE" ]; then
echo "Initrd file '$INITRD_FILE' not found"
exit 1
fi
if [ ! -d "$PATH_TO_CUSTOMIZE_LIP" ]; then
echo "You must specify the path to the customize-lip folder"
exit 1
fi
TMPDIR="$(mktemp -d)"
unpack_initrd "$INITRD_FILE" "$TMPDIR"
pushd "$PATH_TO_CUSTOMIZE_LIP" > /dev/null
. $PATH_TO_CUSTOMIZE_LIP/customize_initrd "$TMPDIR"
popd > /dev/null
pack_initrd "$WORKDIR" "$TMPDIR"
echo "Ok, all done"
exit 0
#!/bin/bash
set -e
DIR="$(pwd)"
if [ ! -e "$DIR/lip32" -o ! -e "$DIR/lip64" -o ! -e "$DIR/lipcommon" ]; then
echo "Working directories (lip32, lip64, lipcommon) don't exists. Please run unsquash.sh and deduplicate.sh before this"
exit 1
fi
SUFFIX=""
if [ -e lip32.squashfs -o -e lip64.squashfs -o -e lipcommon.squashfs ]; then
echo ".squashfs files already existing using .squashfs.new for output (will overwrite)"
SUFFIX=".new"
fi
mksquashfs lip32 "lip32.squashfs$SUFFIX" -comp xz
mksquashfs lip64 "lip64.squashfs$SUFFIX" -comp xz
mksquashfs lipcommon "lipcommon.squashfs$SUFFIX" -comp xz
ls -lah
exit 0
#!/bin/bash
set -e
if [ -e lip32 -o -e lip64 ]; then
echo "Workspace exisiting. Please clean up!"
exit 1
fi
unsquashfs -f -d lip32 lip32.squashfs
unsquashfs -f -d lip32 lipcommon.squashfs
unsquashfs -f -d lip64 lip64.squashfs
unsquashfs -f -d lip64 lipcommon.squashfs
echo "Ok. Now run chroot.sh (lip32|lip64) and do stuff"
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment