pull/13/merge
Peter Jin 2016-07-20 11:13:21 +00:00 committed by GitHub
commit af384c6bdf
3 changed files with 14 additions and 13 deletions

View File

@ -9,13 +9,13 @@
# in order to update isolinux.bin for CD booting. # in order to update isolinux.bin for CD booting.
LIVEKITNAME="mylinux" 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 # 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 # Live Kit with a different kernel than the one you are actually running
KERNEL=$(uname -r) KERNEL=$(uname -r)
# Kernel file, will be copied to your Live Kit
VMLINUZ=/boot/vmlinuz-"$KERNEL"
# List of directories which will be modularized # List of directories which will be modularized
# No subdirectories are allowed, no slashes, # No subdirectories are allowed, no slashes,
# so You can't use /var/tmp here for example # 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" EXCLUDE="/etc/fstab /etc/mtab"
# Temporary directory to store livekit filesystem # 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 # Bundle extension, for example 'sb' for .sb extension
BEXT=sb BEXT=sb

11
build
View File

@ -22,9 +22,9 @@ fi
# build initramfs image # build initramfs image
echo "Building intramfs image..." echo "Building intramfs image..."
cd initramfs cd initramfs || exit 1
INITRAMFS=$(./initramfs_create "$LIVEKITNAME") INITRAMFS=$(./initramfs_create "$LIVEKITNAME")
cd .. cd .. || exit 1
# create live kit filesystem (cpio archive) # create live kit filesystem (cpio archive)
rm -Rf "$LIVEKITDATA" rm -Rf "$LIVEKITDATA"
@ -54,7 +54,7 @@ fi
# create ISO for CD image # create ISO for CD image
echo "Creating ISO file for CD boot..." echo "Creating ISO file for CD boot..."
cd "$LIVEKITDATA" cd "$LIVEKITDATA" || exit 1
TARGET=/mnt/z TARGET=/mnt/z
if [ ! -d $TARGET ]; then if [ ! -d $TARGET ]; then
TARGET=/tmp 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 . \ -b "$LIVEKITNAME"/boot/isolinux.bin -c "$LIVEKITNAME"/boot/isolinux.boot . \
>/dev/null 2>/dev/null >/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..." echo "Creating ZIP for USB boot..."
rm -f "$TARGET/$LIVEKITNAME-$ARCH.zip" rm -f "$TARGET/$LIVEKITNAME-$ARCH.zip"
zip -0 -r "$TARGET/$LIVEKITNAME-$ARCH.zip" * zip -0 -r "$TARGET/$LIVEKITNAME-$ARCH.zip" *
cd .. cd .. || exit 1
rm -Rf "$LIVEKITDATA" rm -Rf "$LIVEKITDATA"
echo "finished. Find your result in $TARGET" echo "finished. Find your result in $TARGET"

View File

@ -113,7 +113,7 @@ create_bundle()
{ {
debug_log "create_module" "$*" debug_log "create_module" "$*"
rm -f "$2" # overwrite, never append to existing file 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 cp -a /??* $SWITCH 2>/dev/null # only copy two-and-more-letter directories
cd $SWITCH cd $SWITCH
echo "This file indicates that we successfully escaped initramfs" > $SWITCH/lib/initramfs_escaped 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 fi
} }
@ -247,7 +247,7 @@ device_bestfs()
local FS local FS
FS="$(blkid "$1" | sed -r "s/.*TYPE=//" | tr -d '"' | tr [A-Z] [a-z])" 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" FS="vfat"
elif [ "$FS" = "ntfs" ]; then elif [ "$FS" = "ntfs" ]; then
FS="ntfs-3g" FS="ntfs-3g"