Forgot to perform 'git add' on most of the files from the previous commit.

This commit is contained in:
Ivan Davidov 2016-04-23 01:52:33 +03:00
parent 416670ca72
commit 8420232e44
19 changed files with 184 additions and 55 deletions

View File

@ -2,7 +2,7 @@
# #
# http://kernel.org # http://kernel.org
# #
KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.6.tar.xz KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.4.6.tar.xz
# You can find the latest GNU libc source bundles here: # You can find the latest GNU libc source bundles here:
# #
@ -22,32 +22,32 @@ BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.24.2.tar.bz2
# #
# http://kernel.org/pub/linux/utils/boot/syslinux # http://kernel.org/pub/linux/utils/boot/syslinux
# #
SYSLINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz
### ### ### ### ### ### ###
### ### ### ### ### ### ###
### ### ### ### ### ### ###
# Use predefined '.config' file when building the kernel. This overrides the config generation # Use predefined '.config' file when building the kernel. This overrides the config generation
# in '02_build_kernel.sh' and the build process uses the config file provided in this parameter. # in '02_build_kernel.sh' and the build process uses the config file provided in this parameter.
# You can comment, leave undefined or use nonexisting file in order to disable the property and # Place the configuration file here: config_predefined/kernel.config
# rely on automatic config generation. The file location is relative from the source folder.
# #
# KERNEL_CONFIG_FILE=path/to/predefined/kernel.config USE_PREDEFINED_KERNEL_CONFIG=false
# Use predefined '.config' file when building BusyBox. This overrides the config generation in # Use predefined '.config' file when building BusyBox. This overrides the config generation in
# '07_build_busybox.sh' and the build process uses the config file provided in this parameter. # '07_build_busybox.sh' and the build process uses the config file provided in this parameter.
# You can comment, leave undefined or use nonexisting file in order to disable the property and # # Place the configuration file here: config_predefined/busybox.config
# rely on automatic config generation. The file location is relative from the source folder.
# #
# BUSYBOX_CONFIG_FILE=path/to/predefined/busybox.config USE_PREDEFINED_BUSYBOX_CONFIG=false
# Define the overlay type to use. Possible values are 'sparse' and 'folder'. You can use any other # Define the overlay type to use. Possible values are 'sparse' and 'folder'. You can use any other
# value, no value, or comment the property in order to disable it. Put your overlay content in the # value, no value, or comment the property in order to disable it. Put your overlay content in the
# folder '11_generate_iso' and it will be automatically merged with the root file system on boot. # folder '11_generate_iso' and it will be automatically merged with the root file system on boot.
# The build process creates either '/minimal.img/rootfs' or '/minimal/rootfs' (read below) and this # The build process creates either '/minimal.img/rootfs' or '/minimal/rootfs' (read below) and this
# folder contains all overlay content in it. If the boot media is writeable, then all changes on # folder contains all overlay content in it. The build process also creates '/minimal.img/work'
# the root filesystem are automatically persisted. # or '/minimal/work'. This folder is used by the overlay driver to store modifications related
# to the read only storage. If the overlay media is writeable, then all changes on
# the root filesystem are automatically persisted and preserved on reboot.
# #
# sparse - use sparse file 'minimal.img' with hardcoded maximal size of 1MB (see 11_generate_iso.sh). # sparse - use sparse file 'minimal.img' with hardcoded maximal size of 1MB (see 11_generate_iso.sh).
# The generated ISO image is larger because the sparse file is treated as regular file. This # The generated ISO image is larger because the sparse file is treated as regular file. This
@ -60,3 +60,8 @@ SYSLINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinu
# #
OVERLAY_TYPE=folder OVERLAY_TYPE=folder
# Use already downloaded source bundles instead of downloading them from internet. This is useful
# when you have already downloaded the sources and have no internet connection. Or if you want to
# share your version of "Minimal Linux Live" with predefined sources.
USE_LOCAL_SOURCE=false

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
echo "Cleaning up the work area..." echo "Cleaning up the work area. This may take a while..."
rm -rf work rm -rf work
mkdir work mkdir work

View File

@ -1,18 +1,33 @@
#!/bin/sh #!/bin/sh
SRC_DIR=$(pwd)
# Grab everything after the '=' character. # Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character. # Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/} ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd source cd source
# Downloading kernel file. if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# -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'."
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else
echo "Using local kernel source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted kernel. # Delete folder with previously extracted kernel.
echo "Removing kernel work area..."
rm -rf ../work/kernel rm -rf ../work/kernel
mkdir ../work/kernel mkdir ../work/kernel

View File

@ -8,16 +8,24 @@ cd work/kernel
cd $(ls -d *) cd $(ls -d *)
# Cleans up the kernel sources, including configuration files. # Cleans up the kernel sources, including configuration files.
echo "Preparing kernel work area..."
make mrproper make mrproper
# Read the 'KERNEL_CONFIG_FILE' property from '.config' # Read the 'USE_PREDEFINED_KERNEL_CONFIG' property from '.config'
KERNEL_CONFIG_FILE="$SRC_DIR/$(grep -i KERNEL_CONFIG_FILE $SRC_DIR/.config | cut -f2 -d'=')" USE_PREDEFINED_KERNEL_CONFIG="$(grep -i USE_PREDEFINED_KERNEL_CONFIG $SRC_DIR/.config | cut -f2 -d'=')"
if [ -f $KERNEL_CONFIG_FILE ] ; then if [ "$USE_PREDEFINED_KERNEL_CONFIG" = "true" -a ! -f $SRC_DIR/config_predefined/kernel.config ] ; then
echo "Config file $SRC_DIR/config_predefined/kernel.config does not exist."
USE_PREDEFINED_KERNEL_CONFIG="false"
fi
if [ "$USE_PREDEFINED_KERNEL_CONFIG" = "true" ] ; then
# Use predefined configuration file for the kernel. # Use predefined configuration file for the kernel.
cp $KERNEL_CONFIG_FILE .config echo "Using config file $SRC_DIR/config_predefined/kernel.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
# Changes the name of the system to 'minimal'. # Changes the name of the system to 'minimal'.
@ -30,10 +38,12 @@ fi
# Compile the kernel with optimization for 'parallel jobs' = 'number of processors'. # Compile the kernel with optimization for 'parallel jobs' = 'number of processors'.
# Good explanation of the different kernels: # Good explanation of the different kernels:
# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux # http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux
echo "Building kernel..."
make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l) make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l)
# Install kernel headers in './usr' (this is not '/usr') which are used later # Install kernel headers in './usr' (this is not '/usr') which are used later
# when we build and configure the GNU C library (glibc). # when we build and configure the GNU C library (glibc).
echo "Generating kernel headers..."
make headers_install make headers_install
cd ../../.. cd ../../..

View File

@ -1,18 +1,33 @@
#!/bin/sh #!/bin/sh
SRC_DIR=$(pwd)
# Grab everything after the '=' character. # Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i GLIBC_SOURCE_URL .config | cut -f2 -d'=') DOWNLOAD_URL=$(grep -i GLIBC_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character. # Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/} ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd source cd source
# Downloading glibc file. if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# -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'."
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else
echo "Using local glibc source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted glibc. # Delete folder with previously extracted glibc.
echo "Removing glibc work area..."
rm -rf ../work/glibc rm -rf ../work/glibc
mkdir ../work/glibc mkdir ../work/glibc

View File

@ -12,10 +12,12 @@ 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..."
rm -rf ./glibc_objects rm -rf ./glibc_objects
mkdir glibc_objects mkdir glibc_objects
# Prepare installation 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
@ -27,12 +29,15 @@ cd ../glibc_objects
# glibc is configured to use the root folder (--prefix=) and as result all libraries # glibc is configured to use the root folder (--prefix=) and as result all libraries
# will be installed in '/lib'. Kernel headers are taken from our already prepared # will be installed in '/lib'. Kernel headers are taken from our already prepared
# kernel header area (see 02_build_kernel.sh). Packages 'gd' and 'selinux' are disabled. # kernel header area (see 02_build_kernel.sh). Packages 'gd' and 'selinux' are disabled.
echo "Configuring glibc..."
../configure --prefix= --with-headers=$WORK_KERNEL_DIR/usr/include --without-gd --without-selinux --disable-werror ../configure --prefix= --with-headers=$WORK_KERNEL_DIR/usr/include --without-gd --without-selinux --disable-werror
# Compile glibc with optimization for "parallel jobs" = "number of processors". # Compile glibc with optimization for "parallel jobs" = "number of processors".
echo "Building glibc..."
make -j $(grep ^processor /proc/cpuinfo | wc -l) make -j $(grep ^processor /proc/cpuinfo | wc -l)
# Install glibc in the installation area, e.g. 'work/glibc/glibc-2.23/glibc_installed'. # Install glibc in the installation area, e.g. 'work/glibc/glibc-2.23/glibc_installed'.
echo "Installing glibc..."
make install DESTDIR=$GLIBC_INSTALLED -j $(grep ^processor /proc/cpuinfo | wc -l) make install DESTDIR=$GLIBC_INSTALLED -j $(grep ^processor /proc/cpuinfo | wc -l)
cd ../../.. cd ../../..

View File

@ -25,14 +25,14 @@ cd glibc_installed
# | | # | |
# | +--asm-generic (kernel) # | +--asm-generic (kernel)
# | | # | |
# | +--asm-generic (kernel)
# | |
# | +--linux (kernel) # | +--linux (kernel)
# | | # | |
# | +--mtd (kernel) # | +--mtd (kernel)
# | # |
# +--lib (glibc) # +--lib (glibc)
echo "Preparing glibc..."
mkdir -p usr mkdir -p usr
cd usr cd usr

View File

@ -1,18 +1,33 @@
#!/bin/sh #!/bin/sh
SRC_DIR=$(pwd)
# Grab everything after the '=' character. # Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=') DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character. # Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/} ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd source cd source
# Downloading busybox source. if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# -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'."
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else
echo "Using local BusyBox source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted busybox. # Delete folder with previously extracted busybox.
echo "Removing BusyBox work area..."
rm -rf ../work/busybox rm -rf ../work/busybox
mkdir ../work/busybox mkdir ../work/busybox

View File

@ -15,16 +15,24 @@ cd work/busybox
cd $(ls -d *) cd $(ls -d *)
# Remove previously generated artifacts. # Remove previously generated artifacts.
echo "Preparing BusyBox work area..."
make distclean make distclean
# Read the 'BUSYBOX_CONFIG_FILE' property from '.config' # Read the 'USE_PREDEFINED_BUSYBOX_CONFIG' property from '.config'
BUSYBOX_CONFIG_FILE="$SRC_DIR/$(grep -iBUSYBOX_CONFIG_FILE $SRC_DIR/.config | cut -f2 -d'=')" USE_PREDEFINED_BUSYBOX_CONFIG="$(grep -i USE_PREDEFINED_BUSYBOX_CONFIG $SRC_DIR/.config | cut -f2 -d'=')"
if [ -f $BUSYBOX_CONFIG_FILE ] ; then if [ "$USE_PREDEFINED_BUSYBOX_CONFIG" = "true" -a ! -f $SRC_DIR/config_predefined/busybox.config ] ; then
echo "Config file $SRC_DIR/config_predefined/busybox.config does not exist."
USE_PREDEFINED_BUSYBOX_CONFIG="false"
fi
if [ "$USE_PREDEFINED_BUSYBOX_CONFIG" = "true" ] ; then
# Use predefined configuration file for Busybox. # Use predefined configuration file for Busybox.
cp $BUSYBOX_CONFIG_FILE .config echo "Using config file $SRC_DIR/config_predefined/busybox.config"
cp -f $SRC_DIR/config_predefined/busybox.config .config
else else
# Create default configuration file. # Create default configuration file.
echo "Generating default BusyBox configuration..."
make defconfig make defconfig
# The 'inetd' applet fails to compile because we use the glibc installation area as # The 'inetd' applet fails to compile because we use the glibc installation area as
@ -41,9 +49,11 @@ GLIBC_INSTALLED_ESCAPED=$(echo \"$GLIBC_INSTALLED\" | sed 's/\//\\\//g')
sed -i "s/.*CONFIG_SYSROOT.*/CONFIG_SYSROOT=$GLIBC_INSTALLED_ESCAPED/" .config sed -i "s/.*CONFIG_SYSROOT.*/CONFIG_SYSROOT=$GLIBC_INSTALLED_ESCAPED/" .config
# Compile busybox with optimization for "parallel jobs" = "number of processors". # Compile busybox with optimization for "parallel jobs" = "number of processors".
echo "Building BusyBox..."
make busybox -j $(grep ^processor /proc/cpuinfo | wc -l) make busybox -j $(grep ^processor /proc/cpuinfo | wc -l)
# Create the symlinks for busybox. The file 'busybox.links' is used for this. # Create the symlinks for busybox. The file 'busybox.links' is used for this.
echo "Generating BusyBox based initramfs area..."
make install make install
cd ../../.. cd ../../..

View File

@ -10,6 +10,7 @@ cd ../../../..
cd work cd work
echo "Preparing initramfs work area..."
rm -rf rootfs rm -rf rootfs
cd busybox cd busybox

View File

@ -1,8 +1,8 @@
::sysinit:/etc/bootscript.sh ::sysinit:/etc/bootscript.sh
::restart:/sbin/init ::restart:/sbin/init
::shutdown:echo "Syncing file buffers..." ::shutdown:echo "Sync file buffers..."
::shutdown:/bin/sync ::shutdown:sync
::shutdown:echo "Unmounting all filesystems..." ::shutdown:echo "Unmount all filesystems..."
::shutdown:umount -a -r ::shutdown:umount -a -r
::ctrlaltdel:/sbin/reboot ::ctrlaltdel:/sbin/reboot
::once:cat /etc/welcome.txt ::once:cat /etc/welcome.txt

View File

@ -3,8 +3,14 @@
echo "Welcome to \"Minimal Linux Live\" (/init)" echo "Welcome to \"Minimal Linux Live\" (/init)"
# Let's mount all core file systems. # Let's mount all core file systems.
/etc/prepare.sh /etc/01_prepare.sh
# Now let's create new mountpoint in RAM and make it our new root location. # Create new mountpoint in RAM, make it our new root location and overlay it
exec /etc/switch.sh # with our storage area (if overlay area exists at all). This operation invokes
# the script '/etc/03_switch.sh' as the new init process.
exec /etc/02_overlay.sh
echo "(/init) - you can never see this unless there is a serious bug..."
# Wait until any key has been pressed.
read -n1 -s

View File

@ -8,6 +8,7 @@ rm -f rootfs.cpio.gz
cd rootfs cd rootfs
# Packs the current 'initramfs' folder structure in 'cpio.gz' archive. # Packs the current 'initramfs' folder structure in 'cpio.gz' archive.
echo "Packing initramfs..."
find . | cpio -R root:root -H newc -o | gzip > ../rootfs.cpio.gz find . | cpio -R root:root -H newc -o | gzip > ../rootfs.cpio.gz
cd ../.. cd ../..

View File

@ -1,18 +1,33 @@
#!/bin/sh #!/bin/sh
SRC_DIR=$(pwd)
# Grab everything after the '=' character. # Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i SYSLINUX_SOURCE_URL .config | cut -f2 -d'=') DOWNLOAD_URL=$(grep -i SYSLINUX_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character. # Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/} ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd source cd source
# Downloading Syslinux file. if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# -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'."
wget -c $DOWNLOAD_URL wget -c $DOWNLOAD_URL
else
echo "Using local SYSLINUX source bundle $SRC_DIR/source/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted Syslinux. # Delete folder with previously extracted Syslinux.
echo "Removing SYSLINUX work area..."
rm -rf ../work/syslinux rm -rf ../work/syslinux
mkdir ../work/syslinux mkdir ../work/syslinux

View File

@ -15,12 +15,15 @@ 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
# 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..."
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
@ -80,7 +83,7 @@ if [ "$OVERLAY_TYPE" = "sparse" -a "$(id -u)" = "0" ] ; then
# Copy the overlay content. # Copy the overlay content.
cp -r $SRC_DIR/11_generate_iso/* sparse/rootfs/ cp -r $SRC_DIR/11_generate_iso/* sparse/rootfs/
# Unmount the sparse file and thelete the temporary folder. # Unmount the sparse file and delete the temporary folder.
$BUSYBOX umount sparse $BUSYBOX umount sparse
rm -rf sparse rm -rf sparse
@ -95,7 +98,9 @@ elif [ "$OVERLAY_TYPE" = "folder" ] ; then
mkdir -p minimal/rootfs mkdir -p minimal/rootfs
mkdir -p minimal/work mkdir -p minimal/work
cp -r $SRC_DIR/11_generate_iso/* minimal/rootfs/ cp -rf $SRC_DIR/11_generate_iso/* minimal/rootfs/
else
echo "Generated ISO image will have no overlay structure."
fi fi
# Create ISOLINUX configuration file. # Create ISOLINUX configuration file.

View File

@ -17,6 +17,8 @@ clean:
@rm -rf work @rm -rf work
@echo "Removing generated ISO image..." @echo "Removing generated ISO image..."
@rm -f minimal_linux_live.iso @rm -f minimal_linux_live.iso
@echo "Removing predefined configuration files..."
@rm -f config_predefined/*.config
@echo "Removing build log file..." @echo "Removing build log file..."
@rm -f minimal_linux_live.log @rm -f minimal_linux_live.log

7
src/generate_hdd.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Create sparse file of 20MB which can be used by QEMU.
rm -f hdd.img
truncate -s 20M hdd.img

View File

@ -1,9 +1,17 @@
#!/bin/sh #!/bin/sh
# Use this script without arguments to run the generated ISO image with QEMU.
# If you pass '-hdd' or '-h' the virtual hard disk 'hdd.img' will be attached.
# Note that this virtual hard disk has to be created in advance. You can use
# the script 'generate_hdd.sh' to generate the hard disk image file. Once you
# have hard disk image, you can use it as overlay device and persist all your
# changes. See the '.config' file for more information on the overlay support.
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
echo "Starting QEMU with attached ISO image and hard disk."
qemu-system-i386 -m 64M -hda hdd.img -cdrom minimal_linux_live.iso -boot d
else
echo "Starting QEMU with attached ISO image."
qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso -boot d qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso -boot d
fi
# Use this when you want to play with hard disk content. You can manually create
# sparse file (/minimal.img) and put overlay content (/minimal.img/rootfs) in it.
#
# qemu-system-i386 -m 64M -hda hdd.img -cdrom minimal_linux_live.iso -boot d

View File

@ -1,8 +1,17 @@
#!/bin/sh #!/bin/sh
qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso -boot d # Use this script without arguments to run the generated ISO image with QEMU.
# If you pass '-hdd' or '-h' the virtual hard disk 'hdd.img' will be attached.
# Note that this virtual hard disk has to be created in advance. You can use
# the script 'generate_hdd.sh' to generate the hard disk image file. Once you
# have hard disk image, you can use it as overlay device and persist all your
# changes. See the '.config' file for more information on the overlay support.
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
echo "Starting QEMU with attached ISO image and hard disk."
qemu-system-x86_64 -m 64M -hda hdd.img -cdrom minimal_linux_live.iso -boot d
else
echo "Starting QEMU with attached ISO image."
qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso -boot d
fi
# Use this when you want to play with hard disk content. You can manually create
# sparse file (/minimal.img) and put overlay content (/minimal.img/rootfs) in it.
#
# qemu-system-x86_64 -m 64M -hda hdd.img -cdrom minimal_linux_live.iso -boot d