added generating iso part plus lotsa updated logic
This commit is contained in:
parent
847ef7624c
commit
db48988a5d
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 502 KiB |
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
Binary file not shown.
|
@ -0,0 +1,28 @@
|
|||
DEFAULT live
|
||||
LABEL live
|
||||
menu label ^Start or install Ubuntu Remix
|
||||
kernel /casper/vmlinuz
|
||||
append file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --
|
||||
LABEL check
|
||||
menu label ^Check CD for defects
|
||||
kernel /casper/vmlinuz
|
||||
append boot=casper integrity-check initrd=/casper/initrd.lz quiet splash --
|
||||
LABEL memtest
|
||||
menu label ^Memory test
|
||||
kernel /install/memtest
|
||||
append -
|
||||
LABEL hd
|
||||
menu label ^Boot from first hard disk
|
||||
localboot 0x80
|
||||
append -
|
||||
DISPLAY isolinux.txt
|
||||
TIMEOUT 1000
|
||||
PROMPT 1
|
||||
|
||||
#prompt flag_val
|
||||
#
|
||||
# If flag_val is 0, display the "boot:" prompt
|
||||
# only if the Shift or Alt key is pressed,
|
||||
# or Caps Lock or Scroll lock is set (this is the default).
|
||||
# If flag_val is 1, always display the "boot:" prompt.
|
||||
# http://linux.die.net/man/1/syslinux syslinux manpage
|
|
@ -0,0 +1,65 @@
|
|||
# Comboot modules:
|
||||
# * menu.c32 - provides a text menu
|
||||
# * vesamenu.c32 - provides a graphical menu
|
||||
# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
|
||||
# * hdt.c32 - hardware detection tool
|
||||
# * reboot.c32 - reboots the system
|
||||
#
|
||||
# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
|
||||
# If /usr and /boot are on the same file system, symlink the files instead
|
||||
# of copying them.
|
||||
#
|
||||
# If you do not use a menu, a 'boot:' prompt will be shown and the system
|
||||
# will boot automatically after 5 seconds.
|
||||
#
|
||||
# Note: A ^ in a label before a character means one can use that to quickly select it.
|
||||
#
|
||||
# HELPFUL SOURCES
|
||||
# http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project
|
||||
# https://wiki.archlinux.org/index.php/Syslinux
|
||||
# The wikis provides further configuration examples
|
||||
|
||||
# search path for the c32 support libraries (libcom32, libutil etc.)
|
||||
PATH
|
||||
|
||||
# Need this for images as backgrounds
|
||||
DEFAULT vesamenu.c32
|
||||
# If 1 it'd present the boot prompt
|
||||
PROMPT 0
|
||||
# wait 15 seconds
|
||||
TIMEOUT 150
|
||||
MENU RESOLUTION 1024 768
|
||||
MENU BACKGROUND splash.png
|
||||
MENU TITLE Sol-OS
|
||||
|
||||
## Theming
|
||||
MENU COLOR border 30;44 #40ffffff #a0000000 std
|
||||
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
|
||||
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
|
||||
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
|
||||
MENU COLOR help 37;40 #c0ffffff #a0000000 std
|
||||
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
|
||||
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
|
||||
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
|
||||
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
|
||||
|
||||
## Menu Options
|
||||
LABEL solosLive
|
||||
MENU label ^Try Sol-OS
|
||||
KERNEL /casper/vmlinuz
|
||||
append boot=casper initrd=/casper/initrd.gz file=/images/filesystem.squashfs quiet
|
||||
|
||||
LABEL solosInstall
|
||||
MENU label ^Install Sol-OS
|
||||
KERNEL /casper/vmlinuz
|
||||
APPEND boot=casper initrd=/casper/initrd.gz file=/images/filesystem.squashfs finstall quiet splash
|
||||
|
||||
MENU SEPARATOR
|
||||
|
||||
LABEL hd
|
||||
MENU label ^Boot from first hard disk
|
||||
localboot 0x80
|
||||
|
||||
LABEL reboot
|
||||
MENU LABEL ^Reboot
|
||||
COM32 reboot.c32
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,41 @@
|
|||
Boot Instructions for the Remix User
|
||||
|
||||
To give some boot-time instructions to the user create an isolinux.txt file in image/isolinux, for example:
|
||||
|
||||
************************************************************************
|
||||
|
||||
This is an Ubuntu Remix Live CD.
|
||||
|
||||
For the default live system, enter "live". To run memtest86+, enter "memtest"
|
||||
|
||||
************************************************************************
|
||||
|
||||
|
||||
Splash Screen
|
||||
|
||||
A graphic can be displayed at boot time, but it is optional.
|
||||
The example text above requires a special character along with
|
||||
the file name of the splash image (splash.rle).
|
||||
To create that character, do the following use the following command:
|
||||
|
||||
printf "\x18" >emptyfile
|
||||
|
||||
and then edit the emptyfile with any text editor. Add the file name just next to the
|
||||
first character and add the text you want to display at boot time beneath it and save the file as "isolinux.txt"
|
||||
|
||||
To create the splash.rle file, create an image 480 pixels wide. Convert it to 15 colours,
|
||||
indexed (perhaps using GIMP) and "Save As" to change the ending to .bmp which converts the
|
||||
image to a bitmap format.
|
||||
|
||||
|
||||
---- IN GIMP DO THE FOLLOWING ----
|
||||
1. Open an image.
|
||||
2. Scake it to 480 and make sure hight is bound to it.
|
||||
3. Go to image > mode > indexed (Set minimum number of colors to 15 if you have issues down he road Otherwise leave it as is.)
|
||||
5. Save As a BMP. When doing so set compatibility options on for 'Do not write color space information'
|
||||
|
||||
|
||||
Then install the "netpbm" and 'syslinux-utils' packages and run
|
||||
|
||||
1. bmptoppm splash.bmp > splash.ppm
|
||||
2. ppmtolss16 '#ffffff=7' < splash.ppm > splash.rle
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
splash.rle
|
||||
************************************************************************
|
||||
|
||||
This is an Ubuntu Remix Live CD.
|
||||
|
||||
For the default live system, enter "live". To run memtest86+, enter "memtest"
|
||||
|
||||
************************************************************************
|
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -51,7 +51,8 @@ function confirm_dialouge() {
|
|||
# ---- Messages Used Throughout The Process ---- #
|
||||
|
||||
function chroot_big_dump_mesage() {
|
||||
echo "Run each time you chroot:"
|
||||
echo "NOTE: COPY_OVER_TO_CHROOT is removed after exit from chroot env."
|
||||
echo "\nRun each time you chroot:"
|
||||
echo "\texport HOME=/root"
|
||||
echo "\texport LC_ALL=C"
|
||||
echo "\nRun once in chroot:"
|
||||
|
|
|
@ -10,13 +10,15 @@ dpkg-divert --rename --remove /sbin/initctl
|
|||
|
||||
|
||||
# Remove old kernels
|
||||
ls /boot/vmlinuz-2.6.**-**-generic > list.txt
|
||||
ls /boot/vmlinuz-5.4.**-**-generic > list.txt
|
||||
sum=$(cat list.txt | grep '[^ ]' | wc -l)
|
||||
|
||||
if [ $sum -gt 1 ]; then
|
||||
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
|
||||
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
|
||||
fi
|
||||
rm list.txt
|
||||
|
||||
# Remove the network stuff
|
||||
|
||||
apt-get clean
|
||||
rm -rf /tmp/*
|
||||
rm /etc/resolv.conf
|
||||
|
|
11
start.sh
11
start.sh
|
@ -12,8 +12,10 @@ function main() {
|
|||
|
||||
# First setup the debootstrap env...
|
||||
./step_1_debootstrap.sh
|
||||
# Then setup and run chroot
|
||||
# Then setup and run chroot...
|
||||
./step_2_chroot.sh
|
||||
# Create the CD...
|
||||
./step_3_create_CD.sh
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,8 +41,10 @@ function sanity_check() {
|
|||
|
||||
xyphr=$(which Xephyr) ## Chroot view window || alt desktop window
|
||||
sysLnx=$(which syslinux) ## Casper stuff
|
||||
sysTools=$(which ppmtolss16) ## Part of syslinux-utils
|
||||
squash=$(which unsquashfs) ## Squashfs-tools
|
||||
genIso=$(which genisoimage) ## Iso maker
|
||||
netpbm=$(which bmptoppm) ## Boot splash maker part
|
||||
if [[ $xyphr == "" ]] || [[ $sysLnx == "" ]] || \
|
||||
[[ $squash == "" ]] || [[ $genIso == "" ]]; then
|
||||
echo "# ---- Missing Some Packages ---- #\n" \
|
||||
|
@ -48,10 +52,11 @@ function sanity_check() {
|
|||
"Syslinux :" "${sysLnx}\n" \
|
||||
"Squashfs-tools :" "${squash}\n" \
|
||||
"Genisoimage :" "${genIso}\n" \
|
||||
"Netpbm :" "${netpbm}\n" \
|
||||
"Going to run :\n" \
|
||||
"\tapt-get install xserver-xephyr syslinux squashfs-tools genisoimage -y"
|
||||
"\tapt-get install xserver-xephyr syslinux squashfs-tools genisoimage netpbm syslinux-utils -y"
|
||||
sleep 2
|
||||
apt-get install xserver-xephyr syslinux squashfs-tools genisoimage -y
|
||||
apt-get install xserver-xephyr syslinux squashfs-tools genisoimage netpbm syslinux-utils -y
|
||||
fi
|
||||
|
||||
if [[ "${ARCH}" == "" ]] || [[ "${RELEASE}" == "" ]]; then
|
||||
|
|
|
@ -21,6 +21,7 @@ function main() {
|
|||
sudo mount -t sysfs sys "${CHROOT_PTH}"/sys/
|
||||
|
||||
# setup some configs stuff for internetz
|
||||
sudo cp -r COPY_OVER_TO_CHROOT/ "${CHROOT_PTH}"
|
||||
sudo cp /etc/hosts "${CHROOT_PTH}"/etc/hosts
|
||||
sudo cp /etc/resolv.conf "${CHROOT_PTH}"/etc/resolv.conf
|
||||
sudo chown $USER "${CHROOT_PTH}"/etc/apt/sources.list
|
||||
|
@ -32,6 +33,7 @@ function main() {
|
|||
sudo chroot "${CHROOT_PTH}"
|
||||
|
||||
# cleanup
|
||||
sudo rm -rf "${CHROOT_PTH}"/COPY_OVER_TO_CHROOT/
|
||||
sudo umount "${CHROOT_PTH}"/dev/
|
||||
sudo umount -lf "${CHROOT_PTH}"/proc/
|
||||
sudo umount -lf "${CHROOT_PTH}"/sys/
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
#!/bin/bash
|
||||
|
||||
. CONFIG.sh
|
||||
|
||||
# set -o xtrace ## To debug scripts
|
||||
# set -o errexit ## To exit on error
|
||||
# set -o errunset ## To exit if a variable is referenced but not set
|
||||
|
||||
|
||||
function main() {
|
||||
# echo "Moving ISO linux parts..."
|
||||
# move_iso_linux_parts;
|
||||
# echo "Creating manifest..."
|
||||
# create_manifest;
|
||||
# echo "Squashing chroot filesystem..."
|
||||
# compress_chroot;
|
||||
# echo "Creating diskdefines data..."
|
||||
# diskdefines;
|
||||
# echo "Creating recognition info..."
|
||||
# remix_recognition;
|
||||
# echo "Creating MD5 data..."
|
||||
# md5_cal;
|
||||
echo "Creating the ISO file..."
|
||||
create_iso;
|
||||
}
|
||||
|
||||
function move_iso_linux_parts() {
|
||||
clear
|
||||
# We will need a kernel and an initrd that was built with the Casper scripts.
|
||||
# Grab them from the chroot. Use the current version.
|
||||
# Note that before 9.10, the initrd was in gz not lz format...
|
||||
echo "If this fails then use what's in chroot/boot/...:"
|
||||
echo "Copying ${CHROOT_PTH}/boot/vmlinuz-5.4.**-**-generic to image/casper/vmlinuz"
|
||||
sudo cp "${CHROOT_PTH}"/boot/vmlinuz-5.4.**-**-generic image/casper/vmlinuz
|
||||
echo "Copying ${CHROOT_PTH}/boot/initrd.img-5.4.**-**-generic to image/casper/initrd.lz"
|
||||
sudo cp "${CHROOT_PTH}"/boot/initrd.img-5.4.**-**-generic image/casper/initrd.lz
|
||||
|
||||
|
||||
# We need the isolinux and memtest binaries.
|
||||
# (Note: some distros place file isolinux.bin under /usr/lib/syslinux .)
|
||||
sudo cp /usr/lib/ISOLINUX/isolinux.bin image/isolinux/
|
||||
sudo cp /usr/lib/syslinux/modules/bios/ldlinux.c32 image/isolinux/ # for syslinux 5.00 and newer
|
||||
# sudo cp /boot/memtest86+.bin image/install/memtest
|
||||
cp BOOT_STRUCTURE_PARTS/isolinux/isolinux.cfg image/isolinux/
|
||||
|
||||
# To give some boot-time instructions to the user
|
||||
echo "\nMoving splash parts to image/isolinux"
|
||||
cp BOOT_STRUCTURE_PARTS/splash_screen/isolinux.txt image/isolinux/
|
||||
cp BOOT_STRUCTURE_PARTS/splash_screen/splash.rle image/isolinux/
|
||||
}
|
||||
|
||||
function create_manifest() {
|
||||
sudo chroot ${CHROOT_PTH} dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee image/casper/filesystem.manifest
|
||||
sudo cp -v image/casper/filesystem.manifest image/casper/filesystem.manifest-desktop
|
||||
REMOVE='ubiquity ubiquity-frontend-gtk ubiquity-frontend-kde casper lupin-casper live-initramfs user-setup discover1 xresprobe os-prober libdebian-installer4'
|
||||
for i in $REMOVE
|
||||
do
|
||||
sudo sed -i "/${i}/d" image/casper/filesystem.manifest-desktop
|
||||
done
|
||||
}
|
||||
|
||||
function compress_chroot() {
|
||||
sudo mksquashfs "${CHROOT_PTH}" image/casper/filesystem.squashfs
|
||||
printf $(sudo du -sx --block-size=1 "${CHROOT_PTH}" | cut -f1) > image/casper/filesystem.size
|
||||
}
|
||||
|
||||
|
||||
function diskdefines() {
|
||||
cat <<EOF > image/README.diskdefines
|
||||
#define DISKNAME ${OS_NAME}
|
||||
#define TYPE binary
|
||||
#define TYPEbinary 1
|
||||
#define ARCH ${ARCH}
|
||||
#define ARCH${ARCH} 1
|
||||
#define DISKNUM 1
|
||||
#define DISKNUM1 1
|
||||
#define TOTALNUM 0
|
||||
#define TOTALNUM0 1
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
function remix_recognition() {
|
||||
touch image/ubuntu
|
||||
mkdir image/.disk/
|
||||
|
||||
touch image/.disk/base_installable
|
||||
echo "full_cd/single" > image/.disk/cd_type
|
||||
echo "${OS_NAME} ${OS_VER}" > image/.disk/info
|
||||
echo "http//your-release-notes-url.com" > image/.disk/release_notes_url
|
||||
}
|
||||
|
||||
function md5_cal() {
|
||||
sudo -s
|
||||
(cd image && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > md5sum.txt)
|
||||
exit
|
||||
}
|
||||
|
||||
function create_iso() {
|
||||
cd image/
|
||||
sudo mkisofs -r -V "${OS_NAME}" -cache-inodes -J -l \
|
||||
-b isolinux/isolinux.bin \
|
||||
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
|
||||
-boot-info-table -o ../"${OS_NAME}".iso .
|
||||
cd ..
|
||||
# sudo mkisofs -D -r -cache-inodes -J -l -b isolinux/isolinux.bin -c \
|
||||
# isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o \
|
||||
# ../"${OS_NAME}".iso .
|
||||
|
||||
}
|
||||
|
||||
main $@;
|
Loading…
Reference in New Issue