From cb6795cf2e1658f781c3662ae1ae8cc256bd2cec Mon Sep 17 00:00:00 2001 From: Md Jahidul Hamid Date: Sat, 5 Nov 2016 17:26:48 +0600 Subject: [PATCH] release 2.1.2 with UEFI and hybrid image support --- JLopt | 2 +- README.md | 47 +++++++++++++++++++++++++++------------------ main/custom_desktop | 31 +++++++++++++++++++++++++++--- 3 files changed, 57 insertions(+), 23 deletions(-) diff --git a/JLopt b/JLopt index 4c5cc88..c762c9b 100755 --- a/JLopt +++ b/JLopt @@ -1,7 +1,7 @@ #!/bin/bash project='JLIVECD' description='Live CD/DVD customization tool' -version='2.1.1' +version='2.1.2' bugurl='https://github.com/neurobin/JLIVECD/issues' author='Md. Jahidul Hamid ' source='https://github.com/neurobin/JLIVECD' diff --git a/README.md b/README.md index 2692775..a4f81c4 100755 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ The name and identity elements of a distro are trademarked and copyrighted. Unle This is a simple command line tool to customize live cd/dvd of ubuntu based distros, Linux Mint and some of their derivatives. It is developed with the help of the documentation found on: https://help.ubuntu.com/community/LiveCDCustomization and intended primarily for personal use. This is released under GPL v2 lincense and redistrubtion is free and open complying to the licensing terms of GPL v2 license. +N.B: You need to modify the iso images on your own. It only renders an environment for modification and finally creates the modified iso image. + +Please read through the Additional info section before you start with a Ubuntu or Linux Mint ISO for the first time. + # Features: 1. You can save your project in a suitable directory and keep adding and changing things while checking the ISOs' built on those changes. @@ -22,21 +26,21 @@ https://help.ubuntu.com/community/LiveCDCustomization and intended primarily for # Requirements: -0. bash (This is generally installed by default in most Linux distros) -1. squashfs-tools -2. genisoimage -3. xterm (optional) - +1. bash (This is generally installed by default in most Linux distros) +2. squashfs-tools +3. genisoimage +4. syslinux, syslinux-utils (If you want hybrid ISO image) +5. xterm (optional) Install requirements with the following command: -``` -sudo apt-get install squashfs-tools genisoimage +```sh +sudo apt-get install squashfs-tools genisoimage syslinux syslinux-utils ``` Optionally you can keep `xterm` installed. It will work as a backup terminal in case the default terminal fails to run. -``` +```sh sudo apt-get install xterm ``` @@ -44,7 +48,7 @@ sudo apt-get install xterm give the `install.sh` file execution permission and run it in terminal. -``` +```sh chmod +x ./install.sh ./install.sh # or you can just drag & drop in terminal ``` @@ -55,11 +59,9 @@ Run `JLstart` in a terminal or run it from `menu->system->JLIVECD`. JLIVECD menu image -N.B: This does no modification on it's own. you need to modify the iso images on your own. It only renders an environment for modification and finally creates the modified iso image. And of course, you need an iso image as base as no other image or archive will work with this tool. - Example: -``` +```sh ~$ JLstart Is this a new project: (y/n)?: n @@ -124,6 +126,11 @@ I call it debcache management! # ChangeLog: +###version 2.1.2: + +1. UEFI image support +2. Hybrid image support + ###version 2.1.1: 1. fix `$HOME` and `$LC_ALL` in chroot @@ -160,7 +167,7 @@ I call it debcache management! Example: -``` +```sh enter base iso path: ~/Downloads/x ``` @@ -177,6 +184,8 @@ As there is only one file that matches x is xubuntu-14.04.1-x64.iso, it will tak * Ubuntu 14.04.1 LTS * Ubuntu 14.04.3 LTS +
+ # Additonal info: 1.In Linux Mint 17 XFCE there's a bug. To fix this edit `/usr/sbin/invoke-rc.d` file (in chroot) as: @@ -186,7 +195,7 @@ replace `exit 100` with `exit 0` at line `285` and `421`, then apply upgrade. af 3.In xubuntu 14.04.1 there's another bug: Can't open /scripts/casper-functions" error) to fix this, run this code in chroot: -``` +```sh ln -s /usr/share/initramfs-tools/scripts /scripts ``` @@ -198,7 +207,7 @@ https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1325142 One should be solved by editing: -``` +```sh /var/lib/dpkg/info/whoopsie.prerm /var/lib/dpkg/info/libpam-systemd\:amd64.prerm /var/lib/dpkg/info/libpam-systemd\:amd64.postinst @@ -208,14 +217,14 @@ One should be solved by editing: Other one should be solved by editing: -``` +```sh /etc/kernel/postrm.d/zz-update-grub /etc/kernel/postinst.d/zz-update-grub ``` find the following and comment out the if and fi line: -``` +```sh if [ -e /boot/grub/grub.cfg ]; then #exec update-grub fi @@ -229,12 +238,12 @@ https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1325142 5.You may encounter another bug: `Ubiquity installer, hang/freeze on harddisk detection`. This bug can be solved by editing the file `edit/usr/share/applications/ubiquity-gtkui.desktop` and changing the section `exex` from -``` +```sh sh -c 'ubiquity gtk_ui' ``` to -``` +```sh sh -c 'sudo ubiquity gtk_ui' ``` diff --git a/main/custom_desktop b/main/custom_desktop index 99f6dda..e3231e5 100755 --- a/main/custom_desktop +++ b/main/custom_desktop @@ -284,6 +284,24 @@ if grep -sq '^FastCompression=' $liveconfigfile;then else echo "FastCompression=$choice1" >> $liveconfigfile fi +#check for uefi +uefi="$(grep -soP '(?<=^UEFI=).*' "$liveconfigfile")" +read -t $timeout -p "......Want UEFI image (Y/n)? (default '$uefi'): " choice2 +[[ $choice2 == "" ]] && choice2="$uefi" +if grep -sq '^UEFI=' $liveconfigfile;then + sed -r -i.bak "s/(^UEFI=).*/\1$choice2/" $liveconfigfile +else + echo "UEFI=$choice2" >> $liveconfigfile +fi +#check for hybrid +hybrid="$(grep -soP '(?<=^Hybrid=).*' "$liveconfigfile")" +read -t $timeout -p "......Want hybrid image (Y/n)? (default '$hybrid'): " choice3 +[[ $choice3 == "" ]] && choice3="$hybrid" +if grep -sq '^Hybrid=' $liveconfigfile;then + sed -r -i.bak "s/(^Hybrid=).*/\1$choice3/" $liveconfigfile +else + echo "Hybrid=$choice3" >> $liveconfigfile +fi echo -e "\n......Updating some required files..." ###############################Create CD/DVD############################################################################## cd "$livedir" @@ -315,10 +333,17 @@ if [ -f "md5sum.txt" ]; then find -type f -print0 | xargs -0 md5sum | grep -v isolinux/boot.cat | tee md5sum.txt fi echo -e "\n......Creating the image......" -mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../"$cdname".iso . +if [[ $choice2 == [Yy] ]];then + mkisofs -U -A "$IMAGE_NAME" -V "$IMAGE_NAME" -volset "$IMAGE_NAME" -J -joliet-long -r -v -T -o ../"$cdname".iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot . && echo '......Prepared UEFI image' +else + mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../"$cdname".iso . +fi +if [[ $choice3 == [Yy] ]]; then + isohybrid --uefi ../"$cdname".iso && echo "...... Converted to hybrid image" +fi cd .. echo -e "\n.....Finalizing image....." chmod 777 "$cdname".iso -echo -e "\n......Congratulations! Customized cd/dvd creation completed......." -read -p ".......press enter to exit........." enter +echo -e "\n......All done. Check the result........" +read -p ".......Press enter to exit........." enter exit 0