Skip to content
Snippets Groups Projects
Commit e6b5af36 authored by Lars Beckers's avatar Lars Beckers Committed by Christopher Spinrath
Browse files

some cleanup

parent 5a9b1c25
Branches
No related tags found
No related merge requests found
yes
--- a/lib/partman/finish.d/01apt_clone_save 2013-01-12 03:31:22.000000000 +0000
+++ b/lib/partman/finish.d/01apt_clone_save 2013-04-06 16:23:16.103678237 +0000
@@ -39,6 +39,9 @@
close_dialog
done
+#lip patch to prevent the apt-clone save call
+root=""
+
if [ -z "$root" ]; then
# The partition is going to be formatted; there's nothing to preserve.
exit 0
no
#!/bin/bash
#======= CONFIG BEGIN =======
UCK_BIN_DIR="/home/chris/uck/bin/uck"
UCK_WORKAREA="/home/chris/uck" #only used to define other config items
LOG_DIR="/var/log/uck/"
#32bit
REMASTER_HOME32="$UCK_WORKAREA"/remaster-home32
REMASTER_ISO32="$UCK_WORKAREA/isos/precise-desktop-i386.iso"
CUSTOMIZE_DIR32="$UCK_WORKAREA/customize-lip32"
#64bit
REMASTER_HOME64="$UCK_WORKAREA"/remaster-home64
REMASTER_ISO64="$UCK_WORKAREA/isos/precise-desktop-amd64.iso"
CUSTOMIZE_DIR64="$UCK_WORKAREA/customize-lip64"
REMASTER_BOTH="$UCK_WORKAREA/remaster-homeall"
REMASTER_BOTH_SOURCE="$REMASTER_HOME64"
function lip_uck_remaster32_base()
{
schroot --quiet -c uck32 -- "$UCK_BIN_DIR/uck-remaster" $@
}
function lip_uck_remaster64_base()
{
$UCK_BIN_DIR/uck-remaster $@
}
#======= CONFIG END =======
lip_ok() {
echo
echo -ne "\033[32;7m" # gruen
echo -n "$@"
echo -e "\033[0m" # normal
}
lip_err() {
echo
echo -ne "\033[31;7m" # rot
echo -n "$@"
echo -e "\033[0m" # normal
}
function lip_create_md5sums()
{
pushd "$1/remaster-root"
find . -type f -print0 | sort -z | xargs -0 md5sum > "$2"
popd
}
#if [[ $EUID -ne 0 ]]
# then
# echo "Du bist nicht ROOT ... verwende \"sudo bash $0\" !"
# exit 1
#fi
function lip_clean_dir()
{
echo "Cleaning $1, make sure there is nothing mounted!"
rm -rf "$1/remaster-iso/"
rm -rf "$1/remaster-initrd/"
rm -rf "$1/remaster-root/"
rm -rf "$1/remaster-root-home/"
rm -rf "$1/customization-scripts/"
lip_ok "OK"
}
function lip_clean32()
{
lip_clean_dir "$REMASTER_HOME32"
}
function lip_clean64()
{
lip_clean_dir "$REMASTER_HOME64"
}
function lip_cleanboth()
{
echo "Cleaning $REMASTER_BOTH, make sure there is nothing mounted!"
rm -rf "$REMASTER_BOTH/remaster-root/"
rm -rf "$REMASTER_BOTH/remaster-iso/"
lip_ok "OK"
}
function lip_clean()
{
lip_clean32
lip_clean64
lip_cleanboth
}
function lip_init()
{
if [[ $EUID -ne 0 ]]
then
lip_err "Require root permissions..."
return 1
fi
mkdir -p "$LOG_DIR"
echo "Create REMASTER_HOME directories..."
mkdir -p "$REMASTER_HOME32"
mkdir -p "$REMASTER_HOME64"
lip_ok "OK."
echo "Checking iso images..."
test -e "$REMASTER_ISO32" && lip_ok "found 32 image!"
test -e "$REMASTER_ISO64" && lip_ok "found 64 image!"
lip_ok "OK."
echo "Checking customize directories..."
test -d "$CUSTOMIZE_DIR32" && lip_ok "found 32 customize dir!"
test -d "$CUSTOMIZE_DIR64" && lip_ok "found 64 customize dir!"
lip_ok "OK."
echo "Removing uck customize directories..."
rm -rf "$REMASTER_HOME32/customization-scripts/"
rm -rf "$REMASTER_HOME64/customization-scripts/"
lip_ok "OK"
}
function lip_uck_remaster32()
{
pushd "$UCK_BIN_DIR"
lip_uck_remaster32_base "$REMASTER_ISO32" "$CUSTOMIZE_DIR32" $REMASTER_HOME32
popd
}
function lip_uck_remaster64()
{
pushd "$UCK_BIN_DIR"
lip_uck_remaster64_base "$REMASTER_ISO64" "$CUSTOMIZE_DIR64" $REMASTER_HOME64
popd
}
function lip_uck_remaster_parallel()
{
echo "OK you may follow the output with \"tail -f $LOG_DIR/uck<arch>.log\""
lip_uck_remaster32 &> "$LOG_DIR/uck32.log" &
lip_uck_remaster64 &> "$LOG_DIR/uck64.log" &
wait
echo "uck-remaster finished, see what we have ( or not )"
}
function lip_check_remaster_success()
{
if [ ! -d "$REMASTER_HOME32/remaster-root" ] || [ ! -e "$REMASTER_HOME32/remaster-new-files/livecd.iso" ]
then
lip_err "uck-remaster (32bit) failed: could not find output files..."
return 1
fi
if [ ! -d "$REMASTER_HOME64/remaster-root" ] || [ ! -e "$REMASTER_HOME64/remaster-new-files/livecd.iso" ]
then
lip_err "uck-remaster (64bit) failed: could not find output files..."
return 1
fi
lip_ok "OK"
}
function lip_generate_md5()
{
echo "Generating md5 sums for 32bit..."
lip_create_md5sums "$REMASTER_HOME32" "$REMASTER_BOTH/32.md5"
lip_ok "OK"
ls -lah "$REMASTER_BOTH/32.md5"
echo "Generating md5 sums for 64bit..."
lip_create_md5sums "$REMASTER_HOME64" "$REMASTER_BOTH/64.md5"
lip_ok "OK"
ls -lah "$REMASTER_BOTH/64.md5"
}
function lip_diff_md5()
{
echo "Computing diff..."
diff --old-line-format="" --new-line-format="" --unchanged-line-format="%L" "$REMASTER_BOTH/32.md5" "$REMASTER_BOTH/64.md5" > "$REMASTER_BOTH/both.md5" || true
lip_ok "OK"
ls -lah "$REMASTER_BOTH/both.md5"
}
function lip_deduplicate_files()
{
echo "Deduplicating files..."
mkdir -p "$REMASTER_BOTH/remaster-root/"
cut -d" " -f3- "$REMASTER_BOTH/both.md5" | tr \\n \\0 | (cd "$REMASTER_HOME64/remaster-root"; xargs -0 cp -v --parents -pt "$REMASTER_BOTH/remaster-root/" )
cut -d" " -f3- "$REMASTER_BOTH/both.md5" | tr \\n \\0 | (cd "$REMASTER_HOME32/remaster-root"; xargs -0 rm )
cut -d" " -f3- "$REMASTER_BOTH/both.md5" | tr \\n \\0 | (cd "$REMASTER_HOME64/remaster-root"; xargs -0 rm )
lip_ok "OK"
}
function lip_deduplicate()
{
lip_generate_md5
lip_diff_md5
lip_deduplicate_files
}
function lip_prepare_isofs()
{
echo "Creating final isofs..."
rm -rf "$REMASTER_BOTH/remaster-iso"
mkdir -p "$REMASTER_BOTH"
rsync -av --exclude="casper/*" "$REMASTER_HOME64/remaster-iso" "$REMASTER_BOTH/"
mkdir -p "$REMASTER_BOTH/remaster-iso/casper"
cp -v "$REMASTER_HOME64/remaster-iso/casper/filesystem.size" "$REMASTER_BOTH/remaster-iso/casper/"
cp -v "$REMASTER_HOME64/remaster-iso/casper/vmlinuz.efi" "$REMASTER_BOTH/remaster-iso/casper/vmlinuz64"
cp -v "$REMASTER_HOME32/remaster-iso/casper/vmlinuz" "$REMASTER_BOTH/remaster-iso/casper/vmlinuz32"
cp -v "$REMASTER_HOME64/remaster-iso/casper/initrd.lz" "$REMASTER_BOTH/remaster-iso/casper/initrd64.lz"
cp -v "$REMASTER_HOME32/remaster-iso/casper/initrd.lz" "$REMASTER_BOTH/remaster-iso/casper/initrd32.lz"
cp -v "$REMASTER_HOME32/remaster-iso/.disk/casper-uuid-generic" "$REMASTER_BOTH/remaster-iso/.disk/casper-uuid-generic-32"
}
function lip_mksquashfs()
{
echo "mksquashfs lipcommon.squashfs"
mksquashfs "$REMASTER_BOTH/remaster-root" "$REMASTER_BOTH/remaster-iso/casper/lipcommon.squashfs" -comp xz
echo "mksquashfs lip32.squashfs"
mksquashfs "$REMASTER_HOME32/remaster-root" "$REMASTER_BOTH/remaster-iso/casper/lip32.squashfs" -comp xz
echo "mksquashfs lip64.squashfs"
mksquashfs "$REMASTER_HOME64/remaster-root" "$REMASTER_BOTH/remaster-iso/casper/lip64.squashfs" -comp xz
lip_ok "OK"
ls -lah "$REMASTER_BOTH/remaster-iso/casper"
}
function lip_full_run()
{
$LIP_HELP lip_init
$LIP_HELP lip_clean
$LIP_HELP lip_uck_remaster64
$LIP_HELP lip_uck_remaster32
$LIP_HELP lip_check_remaster_success
$LIP_HELP lip_deduplicate
$LIP_HELP lip_prepare_isofs
$LIP_HELP lip_mksquashfs
$LIP_HELP lip_ok "done."
}
function lip_full_run_parallel()
{
lip_init
lip_uck_remaster_parallel
lip_check_remaster_success
lip_deduplicate
lip_prepare_isofs
lip_mksquashfs
lip_ok "done."
}
function lip_command_order()
{
echo "A full run consists of:"
LIP_HELP="echo"
lip_full_run
LIP_HELP=
}
lip_ok "LIP remaster helper functions loaded!"
lip_command_order
echo
echo "Good Luck :-)"
--- a/libraries/remaster-live-cd.sh 2013-03-19 19:27:55.711312314 +0100
+++ b/libraries/remaster-live-cd.sh 2013-03-19 19:33:33.048317375 +0100
@@ -514,7 +514,7 @@
if [ `echo -e "${SQUASHFS_VERSION}\n4.2" | sort | head -n1` = "4.2" ]; then
if [ `echo -e "${GUEST_KERNEL_VERSION}\n2.6.30" | sort | head -n1` = "2.6.30" ]; then
echo "Squashfs>=4.1, guest kernel>=2.6.30: Enabling XZ compression for squashfs..."
- EXTRA_OPTS="${EXTRA_OPTS} -comp xz"
+ EXTRA_OPTS="${EXTRA_OPTS} -comp xz -Xbcj x86 -Xdict-size 25% -b 1024K"
fi
fi
--- a/libraries/remaster-live-cd.sh (revision 474)
+++ b/libraries/remaster-live-cd.sh (working copy)
@@ -528,9 +533,10 @@
function remove_iso_remaster_dir()
{
if [ -e "$ISO_REMASTER_DIR" ] ; then
- echo "Removing ISO remastering dir..."
- remove_directory "$ISO_REMASTER_DIR" ||
- failure "Failed to remove directory $ISO_REMASTER_DIR, error=$?"
+ #echo "Removing ISO remastering dir..."
+ #remove_directory "$ISO_REMASTER_DIR" ||
+ # failure "Failed to remove directory $ISO_REMASTER_DIR, error=$?"
+ true
fi
}
@@ -538,16 +544,18 @@
{
if [ -e "$REMASTER_DIR" ] ; then
unmount_pseudofilesystems
- echo "Removing remastering root dir..."
- remove_directory "$REMASTER_DIR"
+ #echo Removing remastering root dir..."
+ #remove_directory "$REMASTER_DIR"
+ true
fi
}
function remove_remaster_initrd()
{
if [ -e "$INITRD_REMASTER_DIR" ]; then
- echo "Removing initrd remastering dir..."
- remove_directory "$INITRD_REMASTER_DIR"
+ #echo "Removing initrd remastering dir..."
+ #remove_directory "$INITRD_REMASTER_DIR"
+ true
fi
}
#/bin/bash
set -e
DEVICE=$(blkid -t LABEL=MULTIBOOT -odevice)
MPOINT=/mnt
UPDATE_SCRIPT="./scripts/update_stick.sh"
if [ ! $EUID -eq 0 ]; then
echo "You are not root..."
exit 1
fi
if [ -z $DEVICE ]; then
echo "No stick found..."
exit 1
fi
mount "$DEVICE" "$MPOINT"
pushd "$MPOINT" > /dev/null
if [ -e "$UPDATE_SCRIPT" ]; then
echo "Using $UPDATE_SCRIPT."
bash ./scripts/update_stick.sh
else
echo "No $UPDATE_SCRIPT avaiable."
echo "Falling back to plain git commands."
git checkout master
git pull
fi
popd > /dev/null
umount "$MPOINT"
sync
exit 0
File added
Dies ist das USB Image Tool von www.alexpage.de/usb-image-tool/ , rebundled als 7-zip SFX.
Anleitung siehe 7-Zip-Hilfe: "copy /b 7zS.sfx + config.txt + usbit.7z usbit.exe"
Einzelteile:
- 7zS.sfx: Self-Extractor aus dem "7z-extra"-Package von 7-zip.org (version 4.57, steinalt aber funktioniert)
- config.txt: die config Datei aus diesem Verzeichnis
- usbit.7z: eine mit 7-zip (7-zip für Windows, Version 4.57) gepackte Version vom "USB Image Tool 1.58"
;!@Install@!UTF-8!
Title="USB Image Tool from www.alexpage.de/usb-image-tool/"
Progress="no"
RunProgram="USB Image Tool.exe"
;!@InstallEnd@!
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment