Comments (9)
This a bit of a hack, but here is how you can achieve what you want to do...
-
Create a file named
cubic.template
, add the following contents, and save it.[Project] cubic_version = CUBIC_VERSION create_date = TIME_STAMP modify_date = TIME_STAMP directory = PROJECT_DIRECTORY [Original] iso_file_name = ORIGINAL_ISO_FILE iso_directory = ORIGINAL_ISO_DIRECTORY iso_volume_id = Unknown iso_release_name = iso_disk_name = [Custom] iso_version_number = MY_ISO_VERSION_NUMBER iso_file_name = MY_ISO_FILE_NAME iso_directory = MY_ISO_DIRECTORY iso_volume_id = MY_ISO_VOLUME_ID iso_release_name = MY_ISO_RELEASE_NAME iso_disk_name = MY_ISO_DISK_NAME [Status] is_success_copy = False is_success_extract = False iso_template = casper_directory = squashfs_file_name = iso_checksum = iso_checksum_file_name = [Options] update_os_release = True boot_configurations = boot/grub/grub.cfg,boot/grub/loopback.cfg,isolinux/txt.cfg compression = xz
-
You can execute the following steps on the command line or add them to your script.
-
Set the following variables.
CUBIC_VERSION=`dpkg-query --showformat='${Version}\n' --show cubic` TIME_STAMP=$(date '+%Y-%m-%d %H:%M')
-
Set the following variables with your desired values.
PROJECT_DIRECTORY='/home/pico/Documents/Linux Mint 20.3 Cinnamon Updated 2022.01.12' ORIGINAL_ISO_FILE='linuxmint-20.3-cinnamon-64bit.iso' ORIGINAL_ISO_DIRECTORY='/home/pico/Documents' MY_ISO_VERSION_NUMBER='2022.01.12' MY_ISO_FILE_NAME='linuxmint-20.3-cinnamon-64bit-updated-22.01.12.iso' MY_ISO_DIRECTORY="$PROJECT_DIRECTORY" MY_ISO_VOLUME_ID='Linux Mint 20.3 Cinnamon 64-bit' MY_ISO_RELEASE_NAME='Una - Updated 2022.01.12' MY_ISO_DISK_NAME='Linux Mint 20.3 Cinnamon 64-bit "Una - Updated 2022.01.12"' MY_ISO_RELEASE_NOTES_URL='https://www.linuxmint.com/rel_una_cinnamon.php'
-
Create an empty project directory and copy the template into it.
mkdir "$PROJECT_DIRECTORY" cp cubic.template "$PROJECT_DIRECTORY/cubic.conf"
-
Update the template with your desired values from step 3 above.
sed -i "s|CUBIC_VERSION|$CUBIC_VERSION|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|TIME_STAMP|$TIME_STAMP|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|PROJECT_DIRECTORY|$PROJECT_DIRECTORY|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|ORIGINAL_ISO_FILE|$ORIGINAL_ISO_FILE|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|ORIGINAL_ISO_DIRECTORY|$ORIGINAL_ISO_DIRECTORY|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|MY_ISO_VERSION_NUMBER|$MY_ISO_VERSION_NUMBER|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|MY_ISO_FILE_NAME|$MY_ISO_FILE_NAME|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|MY_ISO_DIRECTORY|$MY_ISO_DIRECTORY|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|MY_ISO_VOLUME_ID|$MY_ISO_VOLUME_ID|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|MY_ISO_RELEASE_NAME|$MY_ISO_RELEASE_NAME|g" "$PROJECT_DIRECTORY/cubic.conf" sed -i "s|MY_ISO_DISK_NAME|$MY_ISO_DISK_NAME|g" "$PROJECT_DIRECTORY/cubic.conf" cat "$PROJECT_DIRECTORY/cubic.conf"
-
Set the ISO release notes URL.
mkdir --parents "$PROJECT_DIRECTORY/custom-disk/.disk" echo "$MY_ISO_RELEASE_NOTES_URL" | tee "$PROJECT_DIRECTORY/custom-disk/.disk/release_notes_url"
-
Run Cubic.
Take advantage of the enhancement #13 in order to pass the project directory to Cubic as a command line argument.
cubic "$PROJECT_DIRECTORY"
from cubic.
With this approach, we are simulating an existing project. For existing projects, the original ISO information is read from the cubic.conf
file and is not extracted from the original ISO. (The reason for this is that the user may no longer have the original ISO handy when they want to update an existing project). As a result, you will notice that some of the Original ISO fields are blank or not available. Nevertheless, this will not adversely affect your customizations.
from cubic.
Thanks for this info, I've updated by new Cubic project creation script to hardcode a known compatible Cubic version!
Also, here is how I'm currently setting up a new customized Cubic project in case it's interesting to you or useful for anyone in the future:
#!/bin/bash
os_version='20.3'
os_codename='Una'
build_date="$(date '+%y.%m.%d')"
cubic_project_parent_path="${HOME}/Documents"
cubic_project_path="${cubic_project_parent_path}/Linux Mint ${os_version} Cinnamon Updated 20${build_date}"
cubic_project_disk_path="${cubic_project_path}/custom-disk"
if [[ ! -f "${cubic_project_path}/cubic.conf" ]]; then
# Create new project template based on these instructions: https://github.com/PJ-Singh-001/Cubic/issues/12#issuecomment-1013804874
mkdir -p "${cubic_project_path}"
cubic_conf_version='2022.01-69-release~202201160230~ubuntu20.04.1'
# IMPORTANT: This cubic_conf_version should be set to a version of Cubic that is known the be compatible with the following "cubic.conf" format.
# The currently installed Cubic version can be retrieved with "dpkg-query --show cubic" (or by copy-and-pasting it from a new "cubic.conf" file made by Cubic).
# If the "cubic.conf" format is ever changed in the future, having this previous Cubic version listed in the "cubic.conf" file will let Cubic know that it needs to be migrated (and will show a screen like this: https://github.com/PJ-Singh-001/Cubic/wiki/Migrate-Page).
# If this happens, and a future version of Cubic needs to migrate this "cubic.conf" format, this script should be updated with the new format and a new compatible Cubic version so that migration is not necessary for each new project.
# Reference: https://github.com/PJ-Singh-001/Cubic/issues/12#issuecomment-1015001654
current_timestamp="$(date '+%F %H:%M')"
cat << CUBIC_CONF_EOF > "${cubic_project_path}/cubic.conf"
[Project]
cubic_version = ${cubic_conf_version}
create_date = ${current_timestamp}
modify_date = ${current_timestamp}
directory = ${cubic_project_path}
[Original]
iso_file_name = linuxmint-${os_version}-cinnamon-64bit.iso
iso_directory = ${cubic_project_parent_path}
iso_volume_id = Linux Mint ${os_version} Cinnamon 64-bit
iso_release_name = ${os_codename}
iso_disk_name = Linux Mint ${os_version} "${os_codename}" - Release amd64
[Custom]
iso_version_number = 20${build_date}
iso_file_name = linuxmint-${os_version}-cinnamon-64bit-updated-${build_date}.iso
iso_directory = ${cubic_project_path}
iso_volume_id = Linux Mint ${os_version} Cinnamon 64-bit
iso_release_name = ${os_codename} - Updated 20${build_date}
iso_disk_name = Linux Mint ${os_version} Cinnamon 64-bit "${os_codename} - Updated 20${build_date}"
[Status]
is_success_copy = False
is_success_extract = False
iso_template =
casper_directory =
squashfs_file_name =
iso_checksum =
iso_checksum_file_name =
[Options]
update_os_release = False
boot_configurations = boot/grub/grub.cfg,boot/grub/loopback.cfg,isolinux/isolinux.cfg
compression = xz
CUBIC_CONF_EOF
mkdir -p "${cubic_project_disk_path}/.disk"
echo "http://www.linuxmint.com/rel_${os_codename,,}_cinnamon.php" > "${cubic_project_disk_path}/.disk/release_notes_url"
fi
nohup cubic "${cubic_project_path}" &> /dev/null & disown
from cubic.
Would you please share which fields on the Project page you need to customize/change for each βnewβ project?
from cubic.
Also, let me know which fields you have attempted to change in the cubic.conf file?
from cubic.
Ideally, I would like to be able to supply a partial cubic.conf
file for a new project like this (which would be created dynamically with a script to have all the current date and specified version etc):
[Original]
iso_file_name = linuxmint-20.3-cinnamon-64bit.iso
iso_directory = /home/pico/Documents
[Custom]
iso_version_number = 2022.01.12
iso_file_name = linuxmint-20.3-cinnamon-64bit-updated-22.01.12.iso
iso_directory = /home/pico/Documents/Linux Mint 20.3 Cinnamon Updated 2022.01.12
iso_volume_id = Linux Mint 20.3 Cinnamon 64-bit
iso_release_name = Una - Updated 2022.01.12
iso_disk_name = Linux Mint 20.3 Cinnamon 64-bit "Una - Updated 2022.01.12"
[Options]
update_os_release = False
boot_configurations = boot/grub/grub.cfg,boot/grub/loopback.cfg,isolinux/isolinux.cfg
compression = xz
Then, Cubic could fill in the rest and treat is as if I just selected that specified iso file for the first time. I didn't mention the [Original]
section in my original request, but it would be nice to be able to specify part of that section as well without needing to manually fill in the other iso_volume_id
, iso_release_name
, and iso_disk_name
keys in that section.
Trying to start a new project with this partial cubic.conf
file hit exceptions because the [Project]
sections were missing. I was able to fill more and more to be able to get to the project customization page, but then I got more exceptions because the [Status]
section was missing since I'm assuming Cubic didn't realize it needed to do that part since the cubic.conf
file already existed.
I'm envisioning that I could have a create-new-cubic-project.sh
type script that would create the /home/pico/Documents/Linux Mint 20.3 Cinnamon Updated 2022.01.12
folder and create this partial cubic.conf
file in it. Then, I would just open Cubic and select that folder and start the process without needing to fill any of those customization fields out manually.
from cubic.
This is awesome, thank you so much for this info!
Looking forward to setting up some new project automation first thing on Monday!
from cubic.
This customized new project setup is working great and makes creating new updated iso's so much smoother with Cubic! Thank you again for this info and for Cubic!
I am curious about a future-proofing consideration though...
If Cubic's configuration is ever changed again in the future, would Cubic detect if migration is necessary based on the version listed in the cubic.conf
file? Or would it be based on the other contents of the cubic.conf
file or some other indicator in the structure of the project?
Since this current setup always sets the cubic_version
attribute in the [Project]
section to the currently installed version, I'm wondering if that could cause an issue with any necessary migration in the future. Would it be safer to set the cubic_version
attribute to a current version that I know works with this cubic.conf
structure so that any necessary future migration is triggered, or would this cubic_version
attribute not matter in that case?
from cubic.
You are right, the cubic_version
attribute in the [Project]
section of the cubic.conf
file is used to determine if migration is necessary.
If there is a significant change, you would need to update the template to match the new version.
To avoid this, your idea to use a known version makes sense. (When you run Cubic, it will automatically update the cubic_version
value in cubic.conf
to the currently running version of Cubic any way. This helps keep track of which version of Cubic was last used on your project).
So go ahead and use the output of dpkg -l cubic
(i.e. 2022.01-69-release~202201...
) as a hard coded value, since you know that the cubic.template
file works with this version of Cubic.
from cubic.
Related Issues (20)
- Have problems if editing an Ubuntu noble ISO in an host Ubuntu Focal ? HOT 4
- Ubuntu 24.04 (beta) bootstrapper/installer seemingly crashes under install of live image
- Cubic reference removal from project HOT 4
- Any plans to make cubic properely support ubuntu 24.04? HOT 3
- Cubic breaks iso HOT 2
- Why can't I access the Typical and Minimal packages page? HOT 2
- Missing user after new install of Ubuntu 22.04 HOT 3
- How to customize the Plymouth Splash Screen on Ubuntu 24.04?
- Virtual environment state save HOT 1
- multi-user mode broken on 24.04 variants
- generated .iso doesn't boot once burnt to USB stick
- Cubic doesn't work together with autoinstall identity. HOT 1
- 24.04 Custom ISOs not reflecting snap removals / some installed app icons not displayed HOT 2
- Errors when install cubic on ubuntu 24.04 HOT 2
- i have error while mount Ubuntu 18.04 on cubic HOT 1
- cubic project folder selection page HOT 2
- Change Kernel version in Virtual Environment HOT 2
- Cubic can be exploited to allow an unprivileged user to elevate their privileges to root on the host system HOT 3
- How to prevent single user mode from GRUB in debian? HOT 5
- After booting created ISO it looks like broken installed OS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cubic.