Question: How to perform fully scripted iso image customization instead of using GUI
HarisHashim opened this issue · 7 comments
Hello, this is a question rather than an issue.
Is it possible as per the title? And how? Maybe roughly list the step. I can perform/test that step and contribute a wiki.
What I have in mind is start with the latest Ubuntu iso image, add and remove package and then rebuild new installable iso image. All done by just executing one script that contains customizer cli commands.
TIA
Haris
Have you had a look at my other repo?
https://github.com/kamilion/kamikazi-core
https://github.com/kamilion/kamikazi-core/tree/master/buildscripts/bionic
run setup-build-environment.sh to get all the packages needed. (once per builder)
It's two steps right now -- you need the official lubuntu 18.04.1 64bit iso.
http://cdimage.ubuntu.com/lubuntu/releases/18.04/release/lubuntu-18.04.1-desktop-amd64.iso
http://cdimage.ubuntu.com/lubuntu/releases/18.04/release/lubuntu-18.04.1-desktop-i386.iso
Run mini-rebuild.sh to take in the official lubuntu ISO, and purge all the Office and Media packages from it.
This needs to be done once, as the main kamikazi iso uses minilubuntu as the source.
After that, run build.sh to take the now-shrunk minilubuntu, and add xen packages to get a kamikazi ISO.
the .synpkg files are simply exported lists from Synaptic.
Feel free to take the scripts apart and do whatever you want with them -- Kamikazi's buildscripts are WTFPL licensed.
If that's too much to dig through, here's the most minimal hook script that would work.
https://gist.github.com/kamilion/3a2c87b1a72b01659b580a20df13e617
@kamilion thanks for the other repo. Will play around with it.
At the same I would love to use Customizer as tool to customize a distro but at the end of the step Customizer can or will generate a script or set of scripts that can be saved to github so that other people can rebuild the distro ISO by checking out the github project.
Is this possible at the moment?
I give kamikazi a try by going to kamikazi-core/buildscripts/bionic and do
- sudo ./setup-build-environment.sh
and
- sudo mini-rebuild.sh
In this step I have to downoad lubuntu-18.04.1-desktop-amd64.iso and put it into /home/ubuntu/Downloads . I have no idea why!
Did I miss some step? For instance should I run Customizer UI first?
Appreciat your feedback in step by step format.
TIA
Haris
Update:
It turns out that Kamikaze build script did some configuration change to Customizer conf file (/etc/customizer.conf). This is the file that set location where iso is located. It then use customizer commands to extract and build ubuntu remix iso.
After few hours cracking the nut. I finally got it to build.
Kamikaze is pretty much what I am looking. In the sense that it is a build script that make use of Customizer to create Ubuntu based remix iso image.
But when testing the ISO, I got stuck at this screen. The iso is not booting up! Appreciate your advise.
It turns out the image run fine in Virtual Box. So Kamikazi is awesome and Hyper-V is crap! :D
Hm, I've never tried running under hyper-v before; so I don't know offhand what is missing to support it.
Kamikazi was meant to replace ESXi and Hyper-V core server, and includes the Xen hypervisor, the KVM hypervisor, and the LXD containers system. If the system is booted without Xen; KVM is automatically active.
I see you were able to put together the BCOS repository after taking some time to look at the minilubuntu scripts.
Great! Let me know if you have any questions about how I chose to script things.
I should point out, the synpkg files were generated with the Synaptic Package Manager GUI tool.
It had a weird format of a package name, followed by two tabs, and the operation to perform (install/remove/purge) followed by a line ending.
I used awk to extract the package name in the 00- scripts so they can be installed.
Your build errors are coming because the scripts & resources do not exist within the build chroot.
You commented out the lines that obtain the scripts during build.
# echo "BCOS: Installing git."
# apt-get install -y --no-install-recommends git
# echo "BCOS: Configuring git."
# git config --global user.email "kamilion@gmail.com"
# git config --global user.name "Graham Cantin"
# git config --global push.default simple
# mkdir -p /home/git
# cd /home/git
# echo "BCOS: Checking out kamikazi-core repository..."
# git clone https://kamilion@github.com/kamilion/kamikazi-core.git --depth=1
# echo "BCOS: Attempting to rebuild ISO contents..."
# cd /home/git/kamikazi-core/buildscripts/bionic/
# git pull
->
# This hook is happening inside the chroot. We need to either get our buildscripts from github,
# Or copy them inside the Extracted chroot before starting the hooks/rebuild process.
echo "BCOS: Installing git."
apt-get install -y --no-install-recommends git
echo "BCOS: Configuring git."
git config --global user.email "HarisHashim@github.com"
git config --global user.name "HarisHashim"
git config --global push.default simple
mkdir -p /home/git
cd /home/git
echo "BCOS: Checking out BCOS repository..."
git clone https://HarisHashim@github.com/HarisHashim/BCOS.git --depth=1
echo "BCOS: Attempting to rebuild ISO contents..."
cd /home/git/BCOS/buildscripts/
git pull # Make sure we have the very latest version available
You'll also need to comment out
https://github.com/HarisHashim/BCOS/blob/master/buildscripts/00-build-minilubuntu-iso-from-source.sh#L10
or re-add the 01-add-replacement-browser.sh script, your choice.
Don't forget to add a license to your repo; all of the resources I created for building kamikazi were provided under the WTFPL license; which means you're free to choose your own license for your own project.
Good luck!
Wow! You are very helpful. Thanks @kamilion .
I am actually doing several think at the same time. Will read through your comment and test your suggestion again when I get back to BCOS in few days.
Will like to add that the source in BCOS can build ISO. But the ISO fail to install with some error at the end of the install process. Because of that error GRUB2 is not installed. I can chroot into the installed OS and install/setup GRUB. After that it will run find.
Most probably, this is what you mentioned in you reply above. I will test this again and comment here.
Thanks & You Are Awesome!
Haris
Notes:
About license. Probably it will be MIT. But my short-attention-time-span-brain does not really think much about that yet :D . So far I only have the time to try and dump code to Github. Higher level thinking is still blurry and in need of more oxygen.