Added simple installer for the whole OS. Note that this installer depends on 'extlinux' which comes as 32-bit binary. The installer works fine but the dynamic libraries need better handling for 64-bit host machines. Most probably additional 32-bit 'glibc' build will be required in order to generate the proper libraries.
This commit is contained in:
parent
a80d1d07a7
commit
ca11f484d9
@ -153,6 +153,7 @@ COPY_SOURCE_ISO=true
|
|||||||
# Refer to the README file for more information.
|
# Refer to the README file for more information.
|
||||||
#
|
#
|
||||||
#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils
|
#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils
|
||||||
|
#OVERLAY_BUNDLES=mll_utils
|
||||||
|
|
||||||
# This property enables the standard penguin boot logo in the upper left corner
|
# This property enables the standard penguin boot logo in the upper left corner
|
||||||
# of the screen. The property is used in 'xx_build_kernel.sh'. The default value
|
# of the screen. The property is used in 'xx_build_kernel.sh'. The default value
|
||||||
|
@ -130,7 +130,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the ISOLINUX configuration file.
|
# Create the ISOLINUX configuration file.
|
||||||
echo 'default kernel.xz initrd=rootfs.xz vga=ask' > ./isolinux.cfg
|
echo 'default kernel.xz initrd=rootfs.xz vga=ask' > ./syslinux.cfg
|
||||||
|
|
||||||
# Now we generate the ISO image file.
|
# Now we generate the ISO image file.
|
||||||
genisoimage \
|
genisoimage \
|
||||||
|
@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
time sh overlay_mll_utils_01_prepare.sh
|
time sh overlay_mll_utils_01_prepare.sh
|
||||||
time sh overlay_mll_utils_02_disk_erase.sh
|
time sh overlay_mll_utils_02_disk_erase.sh
|
||||||
time sh overlay_mll_utils_03_install.sh
|
time sh overlay_mll_utils_03_installer.sh
|
||||||
|
time sh overlay_mll_utils_04_install.sh
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ fi
|
|||||||
|
|
||||||
if [ "\$PRINT_HELP" = "true" ] ; then
|
if [ "\$PRINT_HELP" = "true" ] ; then
|
||||||
cat << DEOF
|
cat << DEOF
|
||||||
|
|
||||||
This utility wipes disk partitions or entire disks in secure way by
|
This utility wipes disk partitions or entire disks in secure way by
|
||||||
overwriting all sectors with random data. Use the '-h' or '--help' option
|
overwriting all sectors with random data. Use the '-h' or '--help' option
|
||||||
to print again this information. Requires root permissions.
|
to print again this information. Requires root permissions.
|
||||||
@ -43,12 +44,13 @@ if [ "\$PRINT_HELP" = "true" ] ; then
|
|||||||
mll-disk-erase sdb 8
|
mll-disk-erase sdb 8
|
||||||
|
|
||||||
The above example wipes '/dev/sdb' 8 times in row.
|
The above example wipes '/dev/sdb' 8 times in row.
|
||||||
|
|
||||||
DEOF
|
DEOF
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "$(id -u)" = "0" ] ; then
|
if [ ! "\$(id -u)" = "0" ] ; then
|
||||||
echo "You need root permissions. Use '-h' or '--help' for more information."
|
echo "You need root permissions. Use '-h' or '--help' for more information."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -65,9 +67,12 @@ if [ ! "\$2" = "" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for n in \$(seq \$NUM_LOOPS) ; do
|
for n in \$(seq \$NUM_LOOPS) ; do
|
||||||
dd if=/dev/urandom of=/dev/\$1 bs=1024b conv=notrunc
|
echo " Windows update \$n of \$NUM_LOOPS is being installed. Please wait..."
|
||||||
|
dd if=/dev/urandom of=/dev/\$1 bs=1024b conv=notrunc > /dev/null 2>\&1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo " All updates have been installed."
|
||||||
|
|
||||||
CEOF
|
CEOF
|
||||||
|
|
||||||
chmod +rx sbin/mll-disk-erase
|
chmod +rx sbin/mll-disk-erase
|
||||||
|
123
src/overlay_mll_utils_03_installer.sh
Executable file
123
src/overlay_mll_utils_03_installer.sh
Executable file
@ -0,0 +1,123 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
if [ ! -d "$SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||||
|
echo "The directory $SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd work/overlay/mll_utils
|
||||||
|
|
||||||
|
# 'mll-install' BEGIN
|
||||||
|
|
||||||
|
# This script installs Minimal Linux Live on Ext2 partition.
|
||||||
|
cat << CEOF > sbin/mll-install
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CURRENT_DIR=\$(pwd)
|
||||||
|
PRINT_HELP=false
|
||||||
|
|
||||||
|
if [ "\$1" = "" -o "\$1" = "-h" -o "\$1" = "--help" ] ; then
|
||||||
|
PRINT_HELP=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put more business logic here (if needed).
|
||||||
|
|
||||||
|
if [ "\$PRINT_HELP" = "true" ] ; then
|
||||||
|
cat << DEOF
|
||||||
|
|
||||||
|
This is the Minimal Linux Live installer. Requires root permissions.
|
||||||
|
|
||||||
|
Usage: mll-install DEVICE
|
||||||
|
|
||||||
|
DEVICE The device where Minmal Linux Live will be installed. Specify only
|
||||||
|
the name, e.g. 'sda'. The installer will automatically convert this
|
||||||
|
to '/dev/sda' and will exit with warning message if the device does
|
||||||
|
not exist.
|
||||||
|
|
||||||
|
mll-install sdb
|
||||||
|
|
||||||
|
The above example installs Minimal Linux Live on '/dev/sdb'.
|
||||||
|
|
||||||
|
DEOF
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! "\$(id -u)" = "0" ] ; then
|
||||||
|
echo "You need root permissions. Use '-h' or '--help' for more information."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e /dev/\$1 ] ; then
|
||||||
|
echo "Device '/dev/\$1' does not exist. Use '-h' or '--help' for more information."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat << DEOF
|
||||||
|
|
||||||
|
Minimal Linux Live will be installed on device '/dev/\$1'. The device will be
|
||||||
|
formatted with Ext2 and all previous data will be lost. Press 'Ctrl + C' to
|
||||||
|
exit or any other key to continue.
|
||||||
|
|
||||||
|
DEOF
|
||||||
|
|
||||||
|
read -n1 -s
|
||||||
|
|
||||||
|
umount /dev/\$1 2>/dev/null
|
||||||
|
sleep 1
|
||||||
|
mkfs.ext2 /dev/\$1
|
||||||
|
mkdir /tmp/mnt/inst
|
||||||
|
mount /dev/\$1 /tmp/mnt/inst
|
||||||
|
sleep 1
|
||||||
|
cd /tmp/mnt/device
|
||||||
|
cp -r kernel.xz rootfs.xz syslinux.cfg src minimal /tmp/mnt/inst 2>/dev/null
|
||||||
|
cd /tmp/mnt/inst
|
||||||
|
/sbin/extlinux --install .
|
||||||
|
cd ..
|
||||||
|
umount /dev/\$1
|
||||||
|
sleep 1
|
||||||
|
rmdir /tmp/mnt/inst
|
||||||
|
|
||||||
|
cat << DEOF
|
||||||
|
|
||||||
|
Installation is now complete. Device '/dev/\$1' should be bootable now. Check
|
||||||
|
the above output for any errors. You need to remove the ISO image and restart
|
||||||
|
the system. Let us hope the installation process worked!!! :)
|
||||||
|
|
||||||
|
DEOF
|
||||||
|
|
||||||
|
cd \$CURRENT_DIR
|
||||||
|
|
||||||
|
CEOF
|
||||||
|
|
||||||
|
chmod +rx sbin/mll-install
|
||||||
|
|
||||||
|
# 'mll-install' END
|
||||||
|
|
||||||
|
if [ ! -d "$SRC_DIR/work/syslinux" ] ; then
|
||||||
|
echo "The installer depends on Syslinux which is missing. Cannot continue."
|
||||||
|
exit 1
|
||||||
|
fi;
|
||||||
|
|
||||||
|
cd $SRC_DIR/work/syslinux
|
||||||
|
cd $(ls -d syslinux-*)
|
||||||
|
|
||||||
|
cp bios/extlinux/extlinux \
|
||||||
|
$SRC_DIR/work/overlay/mll_utils/sbin
|
||||||
|
|
||||||
|
# Big mama hack - find workaround and remove it!!!
|
||||||
|
# Both syslinux and extlinux are 32-bit executables which require 32-bit libs.
|
||||||
|
mkdir -p $SRC_DIR/work/overlay/mll_utils/lib
|
||||||
|
mkdir -p $SRC_DIR/work/overlay/mll_utils/usr/lib
|
||||||
|
cp /lib/ld-linux.so.2 \
|
||||||
|
$SRC_DIR/work/overlay/mll_utils/lib
|
||||||
|
cp /lib/i386-linux-gnu/libc.so.6 \
|
||||||
|
$SRC_DIR/work/overlay/mll_utils/usr/lib
|
||||||
|
# Big mama hack - end.
|
||||||
|
|
||||||
|
echo "Minimal Linux Live installer has been generated."
|
||||||
|
|
||||||
|
cd $SRC_DIR
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user