Updates on the log messages.

This commit is contained in:
Ivan Davidov 2016-04-24 01:17:40 +03:00
parent 7d89539d3f
commit 52867dce45
8 changed files with 43 additions and 41 deletions

View File

@ -20,14 +20,14 @@ cd source
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading kernel source bundle file. The '-c' option allows the download to resume. # Downloading kernel source bundle file. The '-c' option allows the download to resume.
echo "Downloading kernel source bundle from '$DOWNLOAD_URL'." echo "Downloading kernel source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else else
echo "Using local kernel source bundle $SRC_DIR/source/$ARCHIVE_FILE" echo "Using local kernel source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi fi
# Delete folder with previously extracted kernel. # Delete folder with previously extracted kernel.
echo "Removing kernel work area..." echo "Removing kernel work area. This may take a while..."
rm -rf ../work/kernel rm -rf ../work/kernel
mkdir ../work/kernel mkdir ../work/kernel

View File

@ -25,8 +25,8 @@ if [ "$USE_PREDEFINED_KERNEL_CONFIG" = "true" ] ; then
cp -f $SRC_DIR/config_predefined/kernel.config .config cp -f $SRC_DIR/config_predefined/kernel.config .config
else else
# Create default configuration file for the kernel. # Create default configuration file for the kernel.
echo "Generating default kernel configuration..."
make defconfig make defconfig
echo "Generated default kernel configuration."
# Changes the name of the system to 'minimal'. # Changes the name of the system to 'minimal'.
sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config

View File

@ -20,14 +20,14 @@ cd source
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading glibc source bundle file. The '-c' option allows the download to resume. # Downloading glibc source bundle file. The '-c' option allows the download to resume.
echo "Downloading glibc source bundle from '$DOWNLOAD_URL'." echo "Downloading glibc source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else else
echo "Using local glibc source bundle $SRC_DIR/source/$ARCHIVE_FILE" echo "Using local glibc source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi fi
# Delete folder with previously extracted glibc. # Delete folder with previously extracted glibc.
echo "Removing glibc work area..." echo "Removing glibc work area. This may take a while..."
rm -rf ../work/glibc rm -rf ../work/glibc
mkdir ../work/glibc mkdir ../work/glibc

View File

@ -12,16 +12,16 @@ cd work/glibc
cd $(ls -d *) cd $(ls -d *)
# Prepare working area, e.g. 'work/glibc/glibc-2.23/glibc_objects'. # Prepare working area, e.g. 'work/glibc/glibc-2.23/glibc_objects'.
echo "Preparing glibc object area..." echo "Preparing glibc object area. This may take a while..."
rm -rf ./glibc_objects rm -rf ./glibc_objects
mkdir glibc_objects mkdir glibc_objects
# Prepare install area, e.g. 'work/glibc/glibc-2.23/glibc_installed'. # Prepare install area, e.g. 'work/glibc/glibc-2.23/glibc_installed'.
echo "Preparing glibc install area..."
rm -rf ./glibc_installed rm -rf ./glibc_installed
mkdir glibc_installed mkdir glibc_installed
cd glibc_installed cd glibc_installed
GLIBC_INSTALLED=$(pwd) GLIBC_INSTALLED=$(pwd)
echo "Prepared glibc install area."
# All glibc work is done from the working area. # All glibc work is done from the working area.
cd ../glibc_objects cd ../glibc_objects

View File

@ -20,14 +20,14 @@ cd source
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading BusyBox source bundle file. The '-c' option allows the download to resume. # Downloading BusyBox source bundle file. The '-c' option allows the download to resume.
echo "Downloading BusyBox source bundle from '$DOWNLOAD_URL'." echo "Downloading BusyBox source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else else
echo "Using local BusyBox source bundle $SRC_DIR/source/$ARCHIVE_FILE" echo "Using local BusyBox source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi fi
# Delete folder with previously extracted busybox. # Delete folder with previously extracted busybox.
echo "Removing BusyBox work area..." echo "Removing BusyBox work area. This may take a while..."
rm -rf ../work/busybox rm -rf ../work/busybox
mkdir ../work/busybox mkdir ../work/busybox

View File

@ -20,14 +20,14 @@ cd source
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading SYSLINUX source bundle file. The '-c' option allows the download to resume. # Downloading SYSLINUX source bundle file. The '-c' option allows the download to resume.
echo "Downloading SYSLINUX source bundle from '$DOWNLOAD_URL'." echo "Downloading SYSLINUX source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else else
echo "Using local SYSLINUX source bundle $SRC_DIR/source/$ARCHIVE_FILE" echo "Using local SYSLINUX source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi fi
# Delete folder with previously extracted Syslinux. # Delete folder with previously extracted Syslinux.
echo "Removing SYSLINUX work area..." echo "Removing SYSLINUX work area. This may take a while..."
rm -rf ../work/syslinux rm -rf ../work/syslinux
mkdir ../work/syslinux mkdir ../work/syslinux

View File

@ -15,17 +15,17 @@ WORK_SYSLINUX_DIR=$(pwd)
cd ../../.. cd ../../..
# Remove the old ISO file if it exists. # Remove the old ISO file if it exists.
echo "Removing old ISO image..."
rm -f minimal_linux_live.iso rm -f minimal_linux_live.iso
echo "Old ISO image files has been removed."
# Remove the old ISO generation area if it exists. # Remove the old ISO generation area if it exists.
echo "Removing old ISO image work area..." echo "Removing old ISO image work area..."
rm -rf work/isoimage rm -rf work/isoimage
# This is the root folder of the ISO image. # This is the root folder of the ISO image.
echo "Preparing ISO image work area..."
mkdir work/isoimage mkdir work/isoimage
cd work/isoimage cd work/isoimage
echo "Prepared new ISO image work area."
# Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image root folder. # Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image root folder.
cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin . cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin .
@ -100,7 +100,7 @@ elif [ "$OVERLAY_TYPE" = "folder" ] ; then
cp -rf $SRC_DIR/11_generate_iso/* minimal/rootfs/ cp -rf $SRC_DIR/11_generate_iso/* minimal/rootfs/
else else
echo "Generated ISO image will have no overlay structure." echo "Generating ISO image with no overlay structure..."
fi fi
# Create ISOLINUX configuration file. # Create ISOLINUX configuration file.
@ -124,6 +124,7 @@ if [ "$(id -u)" = "0" ] ; then
chown $(logname) ../../minimal_linux_live.iso chown $(logname) ../../minimal_linux_live.iso
chown $(logname) ../../work/minimal_linux_live.iso chown $(logname) ../../work/minimal_linux_live.iso
chown -R $(logname) . chown -R $(logname) .
echo "Applied original ownership to all affected files and folders."
fi fi
cd ../.. cd ../..

View File

@ -3,113 +3,114 @@
# Create sparse file of 20MB which can be used by QEMU. # Create sparse file of 20MB which can be used by QEMU.
if [ "$1" = "" ] ; then if [ "$1" = "" ] ; then
# Create new hard disk image file.
rm -f hdd.img rm -f hdd.img
truncate -s 20M hdd.img truncate -s 20M hdd.img
echo "Created new hard disk image file 'hdd.img' with 20MB size."
elif [ "$1" = "-f" -o "$1" = "-folder" ] ; then elif [ "$1" = "-f" -o "$1" = "-folder" ] ; then
if [ ! "$(id -u)" = "0" ] ; then if [ ! "$(id -u)" = "0" ] ; then
echo "Using option '-f' (or '-folder') requires root permissions." echo "Using option '-f' (or '-folder') requires root permissions."
exit 1 exit 1
fi fi
echo "Create new hard disk image file with 20MB size."
rm -f hdd.img rm -f hdd.img
truncate -s 20M hdd.img truncate -s 20M hdd.img
echo "Created new hard disk image file 'hdd.img' with 20MB size."
LOOP_DEVICE=$(losetup -f) LOOP_DEVICE=$(losetup -f)
echo "Attach hard disk image file to loop device."
losetup $LOOP_DEVICE hdd.img losetup $LOOP_DEVICE hdd.img
echo "Attached hard disk image file to loop device."
echo "Format hard disk image file with Ext2 filesystem."
mkfs.ext2 $LOOP_DEVICE mkfs.ext2 $LOOP_DEVICE
echo "Hard disk image file has been formatted with Ext2 filesystem."
echo "Mount hard disk image file to temporary folder."
mkdir folder mkdir folder
mount hdd.img folder mount hdd.img folder
echo "Mounted hard disk image file to temporary folder."
echo "Create overlay structure."
mkdir -p folder/minimal/rootfs mkdir -p folder/minimal/rootfs
mkdir -p folder/minimal/work mkdir -p folder/minimal/work
echo "Overlay structure has been created."
echo "Create sample text file."
echo "This file is on external hard disk." > folder/minimal/rootfs/overlay.txt echo "This file is on external hard disk." > folder/minimal/rootfs/overlay.txt
echo "Created sample text file."
echo "Unmount hard disk image file."
umount folder umount folder
rm -rf folder rm -rf folder
echo "Unmounted hard disk image file."
echo "Detach hard disk image file from loop device."
losetup -d $LOOP_DEVICE losetup -d $LOOP_DEVICE
echo "Detached hard disk image file from loop device."
echo "Apply original ownership to hard disk image file."
chown $(logname) hdd.img chown $(logname) hdd.img
echo "Applied original ownership to hard disk image file."
elif [ "$1" = "-s" -o "$1" = "-sparse" ] ; then elif [ "$1" = "-s" -o "$1" = "-sparse" ] ; then
if [ ! "$(id -u)" = "0" ] ; then if [ ! "$(id -u)" = "0" ] ; then
echo "Using option '-s' (or '-sparse') requires root permissions." echo "Using option '-s' (or '-sparse') requires root permissions."
exit 1 exit 1
fi fi
echo "Create new hard disk image file with 20MB size."
rm -f hdd.img rm -f hdd.img
truncate -s 20M hdd.img truncate -s 20M hdd.img
echo "Created new hard disk image file 'hdd.img' with 20MB size."
LOOP_DEVICE_HDD=$(losetup -f) LOOP_DEVICE_HDD=$(losetup -f)
echo "Attach hard disk image file to loop device."
losetup $LOOP_DEVICE_HDD hdd.img losetup $LOOP_DEVICE_HDD hdd.img
echo "Attached hard disk image file to loop device."
echo "Format hard disk image file with FAT filesystem."
mkfs.vfat $LOOP_DEVICE_HDD mkfs.vfat $LOOP_DEVICE_HDD
echo "Hard disk image file has been formatted with FAT filesystem."
echo "Mount hard disk image file to temporary folder."
mkdir sparse mkdir sparse
mount hdd.img sparse mount hdd.img sparse
echo "Mounted hard disk image file to temporary folder."
echo "Create new overlay image file with 1MB size."
rm -f sparse/minimal.img rm -f sparse/minimal.img
truncate -s 1M sparse/minimal.img truncate -s 1M sparse/minimal.img
echo "Created new overlay image file with 1MB size."
LOOP_DEVICE_OVL=$(losetup -f) LOOP_DEVICE_OVL=$(losetup -f)
echo "Attach overlay image file to loop device."
losetup $LOOP_DEVICE_OVL sparse/minimal.img losetup $LOOP_DEVICE_OVL sparse/minimal.img
echo "Attached overlay image file to loop device."
echo "Format overlay image file with Ext2 filesystem."
mkfs.ext2 $LOOP_DEVICE_OVL mkfs.ext2 $LOOP_DEVICE_OVL
echo "Overlay image file has been formatted with Ext2 filesystem."
echo "Mount overlay image file to temporary folder."
mkdir ovl mkdir ovl
mount sparse/minimal.img ovl mount sparse/minimal.img ovl
echo "Mounted overlay image file to temporary folder."
echo "Create overlay structure."
mkdir -p ovl/rootfs mkdir -p ovl/rootfs
mkdir -p ovl/work mkdir -p ovl/work
echo "Overlay structure has been created."
echo "Create sample text file." echo "Create sample text file."
echo "This file is on external hard disk." > ovl/rootfs/overlay.txt echo "This file is on external hard disk." > ovl/rootfs/overlay.txt
echo "Apply root ownership to overlay content."
chown -R root:root ovl chown -R root:root ovl
echo "Applied root ownership to overlay content."
echo "Unmount overlay image file."
umount ovl umount ovl
sleep 1 sleep 1
rm -rf ovl rm -rf ovl
echo "Unmounted overlay image file."
echo "Detach overlay image file from loop device."
losetup -d $LOOP_DEVICE_OVL losetup -d $LOOP_DEVICE_OVL
sleep 1 sleep 1
echo "Overlay image file has been detached from loop device."
echo "Unmount hard disk image file."
umount sparse umount sparse
sleep 1 sleep 1
rm -rf sparse rm -rf sparse
echo "Unmounted hard disk image file."
echo "Detach hard disk image file from loop device."
losetup -d $LOOP_DEVICE_HDD losetup -d $LOOP_DEVICE_HDD
sleep 1 sleep 1
echo "Hard disk image file has been detached from loop device."
echo "Apply original ownership to hard disk image file."
chown $(logname) hdd.img chown $(logname) hdd.img
echo "Applied original ownership to hard disk image file."
else else
echo "Option '$1' is not recognized. Valid options are '-f' and '-s'." echo "Option '$1' is not recognized. Valid options are '-f' and '-s'."
fi fi