Comments (5)
Thanks @piexil , I will certainly take a look at this for the next regolith ISO release
from live-custom-ubuntu-from-scratch.
After blindly copy/pasting got the following error (regolith ISO generation):
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.
Drive current: -outdev 'stdio:/home/runner/work/regolith-ubuntu-iso-builder/regolith-ubuntu-iso-builder/scripts/Regolith.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 29.6g free
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
Added to ISO image: directory '/'='/home/runner/work/regolith-ubuntu-iso-builder/regolith-ubuntu-iso-builder/scripts/image'
xorriso : UPDATE : 19 files added in 1 seconds
libisofs: FAILURE : Cannot find directory for El Torito boot catalog in ISO image: '/boot/grub'
libisofs: FAILURE : A requested node does not exist
xorriso : FAILURE : Could not attach El-Torito boot image to ISO 9660 image
xorriso : UPDATE : 19 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
from live-custom-ubuntu-from-scratch.
@kgilmer
I think it's because the classic bios boot files need to be generated. The given parameter's are how most similar to how modern (>21.10) ubuntu builds their hybrid image.
As I said my project is different so this won't be exact copy-paste to this one, but here's the aprt of my scripts that generates the grub images and makes an ISO.
# # generate grub images
working_dir="$(pwd)"
cd "$iso_rw"
#grub uefi
grub-mkstandalone \
--format=x86_64-efi \
--output=isolinux/bootx64.efi \
--modules="part_gpt part_msdos" \
--locales="" \
--fonts="" \
"boot/grub/grub.cfg=isolinux/grub.cfg"
#fat16 uefi disk image containing bootloader
(
cd isolinux &&
dd if=/dev/zero of=efiboot.img bs=1M count=10 &&
sudo mkfs.vfat efiboot.img &&
LC_CTYPE=C mmd -i efiboot.img EFI EFI/BOOT &&
LC_CTYPE=C mcopy -i efiboot.img ./bootx64.efi ::EFI/BOOT/
)
#grub bios images
grub-mkstandalone \
--format=i386-pc \
--output=isolinux/core.img \
--install-modules="linux16 linux normal iso9660 biosdisk memdisk search tar ls" \
--modules="linux16 linux normal iso9660 biosdisk search" \
--locales="" \
--fonts="" \
"boot/grub/grub.cfg=isolinux/grub.cfg"
#combine
cat /usr/lib/grub/i386-pc/cdboot.img isolinux/core.img >isolinux/bios.img
# some broken UEFIs wont boot unless I do this
cp isolinux/efiboot.img EFI/BOOT/efiboot.img
cp isolinux/bios.img boot/grub/bios.img
cp isolinux/bootx64.efi EFI/BOOT/BOOTx64.EFI
cd "$working_dir"
LC_CTYPE=C mcopy -i ${iso_rw}/isolinux/efiboot.img -s ::EFI/ ${iso_rw}/EFI
# set seed files
cp installer/ubiquity/preseed/* "${iso_rw}/preseed/" || true
# this file will tell grub to look here
touch ${iso_rw}/$OS_NAME
# Regenerate the md5sum over the ISO contents.
working_dir="$(pwd)"
cd "$iso_rw"
rm md5sum.txt || true
/bin/bash -c "(find . -type f -print0 | xargs -0 md5sum | grep -v -e 'md5sum.txt' -e 'bios.img' -e 'efiboot.img' > md5sum.txt)"
cd "$working_dir"
working_dir="$(pwd)"
cd "$iso_rw"
# Create the ISO.
xorriso -as mkisofs -r \
-volid "${image_name}" \
-full-iso9660-filenames \
-J -J -joliet-long \
-output "../$output_name" \
--grub2-mbr /usr/lib/grub/i386-pc/boot_hybrid.img \
-partition_offset 16 \
--mbr-force-bootable \
-append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b isolinux/efiboot.img \
-appended_part_as_gpt \
-iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
-eltorito-boot isolinux/bios.img \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
--eltorito-catalog boot/grub/boot.cat \
--grub2-boot-info \
-eltorito-alt-boot \
-e '--interval:appended_partition_2:::' \
-no-emul-boot \
"../${iso_rw}"
cd "$working_dir"
from live-custom-ubuntu-from-scratch.
Thanks for the additional details @piexil . I am unable to determine what the following paths are set to in your setup as they don't exist in the mvallim
repo:
working_dir
iso_rw
I looked for a fork of yours to see the diff but didn't see one listed on the github forks page. LMK if I missed it. TIA
from live-custom-ubuntu-from-scratch.
@kgilmer, I was able to following closely notes from piexil
without much effort and I'm now able to use only Grub
for both BIOS/Legacy
and UEFI
boot modes (in my own project, unrelated to this one and for a Debian-based Live CD).
Answers to your questions
working_dir
is just the parent directory from where all the commands get executed- You might have noticed that there are few "cd" commands implying a certain folder structure ("isolinux" folder, etc.)
- In my own project, I try to always use absolute paths, unless a relative path is required by programs (
xorriso
)
iso_rw
would be the directory containing all the files that will end up on the Live CD in layman terms
Other notes
- For the part "this file will tell grub to look here", you can just use labels in your
grub.cfg
and skip that part- The label needs to match the volume ID specified in the
xorriso
command "-volid" (i.e.-volid REGOLITH_LIVECD
) - The label in question would be in the
grub.cfg
file (i.e.search --set=root --label REGOLITH_LIVECD
)
- The label needs to match the volume ID specified in the
- For the part "some broken UEFIs wont boot unless I do this", I personally don't think that it's absolutely required
- My approach is just to capitalize
EFI
related files and folders - I believe is what most UEFI implementations assume capitalized files and folders names.
- My approach is just to capitalize
Example
This is not meant for a "blind copy paste", but to better understand what you might need for "regolith" specifically.
Scripted step resulting in the ISO image creation for my application called Entrusted
from live-custom-ubuntu-from-scratch.
Related Issues (20)
- Conflicting licensing statements HOT 1
- Could this be used to create a bootable docker host/node live system? HOT 2
- When I run the script for create the iso .It give some erre HOT 1
- Ubuntu 21.10 and 22.04(RC) Desktop Live (Ubuntu default) not using isolinux anymore HOT 1
- Just a question
- Activate sshd service + add default PW for root
- Packages seem unavailable on Jammy HOT 3
- set -e # exit on error during chroot processes leaves host OS disfunctional HOT 2
- This is more of a question then an issue but is there a way to make an ISO with this method that is strictly based on Debian?
- Support creating secure-boot enabled images
- Ubuntu Server Dcoumentation HOT 1
- After initiale build
- Stuck problem when iso booting HOT 2
- Support installing on both UEFI and BIOS systems HOT 1
- problem after create iso
- Secure Boot and Nvidia Drivers Installations
- [Request] Please Make Tutorial Custom Ubuntu Server HOT 3
- Persistant Storage for the USB Device using this manual
- Anyone know if this guide still works for noble? HOT 3
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 live-custom-ubuntu-from-scratch.