diff --git a/.config b/.config index 38e2d75..03240e1 100644 --- a/.config +++ b/.config @@ -9,13 +9,13 @@ # in order to update isolinux.bin for CD booting. LIVEKITNAME="mylinux" -# Kernel file, will be copied to your Live Kit -VMLINUZ=/boot/vmlinuz - # Kernel version. Change it to "3.2.28" for example, if you are building # Live Kit with a different kernel than the one you are actually running KERNEL=$(uname -r) +# Kernel file, will be copied to your Live Kit +VMLINUZ=/boot/vmlinuz-"$KERNEL" + # List of directories which will be modularized # No subdirectories are allowed, no slashes, # so You can't use /var/tmp here for example @@ -26,7 +26,7 @@ MKMOD="bin etc home lib lib64 opt root sbin srv usr var" EXCLUDE="/etc/fstab /etc/mtab" # Temporary directory to store livekit filesystem -LIVEKITDATA=/tmp/$LIVEKITNAME-data-$$ +LIVEKITDATA=$(mktemp -d "/tmp/$LIVEKITNAME-data.XXXXXX") # Bundle extension, for example 'sb' for .sb extension BEXT=sb diff --git a/build b/build index 9105965..819dffa 100755 --- a/build +++ b/build @@ -22,9 +22,9 @@ fi # build initramfs image echo "Building intramfs image..." -cd initramfs +cd initramfs || exit 1 INITRAMFS=$(./initramfs_create "$LIVEKITNAME") -cd .. +cd .. || exit 1 # create live kit filesystem (cpio archive) rm -Rf "$LIVEKITDATA" @@ -54,7 +54,7 @@ fi # create ISO for CD image echo "Creating ISO file for CD boot..." -cd "$LIVEKITDATA" +cd "$LIVEKITDATA" || exit 1 TARGET=/mnt/z if [ ! -d $TARGET ]; then TARGET=/tmp @@ -67,11 +67,12 @@ mkisofs -o "$TARGET/$LIVEKITNAME-$ARCH.iso" -v -J -R -D -A "$LIVEKITNAME" -V "$L -b "$LIVEKITNAME"/boot/isolinux.bin -c "$LIVEKITNAME"/boot/isolinux.boot . \ >/dev/null 2>/dev/null -cat "$CWD/bootinfo.txt" | fgrep -v "#" | sed -r "s/mylinux/$LIVEKITNAME/" | sed -r "s/\$/ /" > readme.txt +cat "$CWD/bootinfo.txt" | fgrep -v "#" | sed -r "s/mylinux/$LIVEKITNAME/" | sed -r "s/\$/ +/" > readme.txt echo "Creating ZIP for USB boot..." rm -f "$TARGET/$LIVEKITNAME-$ARCH.zip" zip -0 -r "$TARGET/$LIVEKITNAME-$ARCH.zip" * -cd .. +cd .. || exit 1 rm -Rf "$LIVEKITDATA" echo "finished. Find your result in $TARGET" diff --git a/livekitlib b/livekitlib index 4a9a1d0..d019566 100644 --- a/livekitlib +++ b/livekitlib @@ -113,7 +113,7 @@ create_bundle() { debug_log "create_module" "$*" rm -f "$2" # overwrite, never append to existing file - mksquashfs "$1" "$2" -comp xz -b 512K $3 $4 $5 $6 $7 $8 $9>/dev/null + mksquashfs "$1" "$2" -comp "${COMP:-xz}" -b 512K $3 $4 $5 $6 $7 $8 $9>/dev/null } @@ -131,7 +131,7 @@ transfer_initramfs() cp -a /??* $SWITCH 2>/dev/null # only copy two-and-more-letter directories cd $SWITCH echo "This file indicates that we successfully escaped initramfs" > $SWITCH/lib/initramfs_escaped - exec switch_root -c /dev/console . $0 + exec busybox switch_root -c /dev/console . $0 fi } @@ -247,7 +247,7 @@ device_bestfs() local FS FS="$(blkid "$1" | sed -r "s/.*TYPE=//" | tr -d '"' | tr [A-Z] [a-z])" - if [ "$FS" = "msdos" -o "$FS" = "fat" -o "$FS" = "vfat" ]; then + if [ "$FS" = "msdos" -o "$FS" = "fat" ]; then FS="vfat" elif [ "$FS" = "ntfs" ]; then FS="ntfs-3g" @@ -644,4 +644,4 @@ change_root() mount -n -o remount,ro aufs . pivot_root . mnt/live exec $CHROOT . $INIT < dev/console > dev/console 2>&1 -} \ No newline at end of file +}