mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-19 18:39:15 +00:00
Fix building EFI ISO
This commit is contained in:
@@ -16,15 +16,10 @@ In addition to the host, you will want to pre-install the following packages:
|
||||
* debootstrap
|
||||
* jq
|
||||
* git
|
||||
* xorriso
|
||||
* grub-common
|
||||
* grub-efi-amd64-bin
|
||||
* grub-pc-bin
|
||||
* mtools
|
||||
* squashfs-tools
|
||||
* unzip
|
||||
|
||||
``` % sudo apt install build-essential debootstrap jq git xorriso grub-common grub-efi-amd64-bin grub-pc-bin mtools squashfs-tools unzip```
|
||||
``` % sudo apt install build-essential debootstrap jq git squashfs-tools unzip```
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -60,9 +60,7 @@
|
||||
"firmware-netronome",
|
||||
"firmware-netxen",
|
||||
"firmware-realtek",
|
||||
"grub-pc",
|
||||
"grub-pc-bin",
|
||||
"grub-efi-amd64",
|
||||
"grub-efi-amd64-bin",
|
||||
"htop",
|
||||
"ifstat",
|
||||
|
||||
@@ -83,7 +83,7 @@ make_bootstrapdir() {
|
||||
case $1 in
|
||||
cd|CD)
|
||||
CDBUILD=1
|
||||
DEOPTS="--components=main,contrib,nonfree --variant=minbase --include=systemd-sysv,gnupg,grub-pc,grub-efi-amd64-signed"
|
||||
DEOPTS="--components=main,contrib,nonfree --variant=minbase --include=systemd-sysv,gnupg"
|
||||
CACHENAME="cdrom"
|
||||
;;
|
||||
package|packages)
|
||||
@@ -638,14 +638,14 @@ make_iso_file() {
|
||||
cp -L ${CHROOT_BASEDIR}/vmlinuz ${CD_DIR}/ || exit_err "Failed to copy vmlinuz"
|
||||
rm ${CD_DIR}/boot/initrd.img-* || exit_err "Failed to remove /boot/initrd.img-*"
|
||||
rm ${CD_DIR}/boot/vmlinuz-* || exit_err "Failed to remove /boot/vmlinuz-*"
|
||||
cp ${RELEASE_DIR}/TrueNAS-SCALE.update ${CD_DIR}/TrueNAS-SCALE.update || exit_err "Faile copy .update"
|
||||
cp ${RELEASE_DIR}/TrueNAS-SCALE.update ${CD_DIR}/TrueNAS-SCALE.update || exit_err "Failed to copy .update"
|
||||
|
||||
mkdir -p ${CHROOT_BASEDIR}/${RELEASE_DIR}
|
||||
mkdir -p ${CHROOT_BASEDIR}/${CD_DIR}
|
||||
mount --bind ${RELEASE_DIR} ${CHROOT_BASEDIR}/${RELEASE_DIR} || exit_err "Failed mount --bind ${RELEASE_DIR}"
|
||||
mount --bind ${CD_DIR} ${CHROOT_BASEDIR}/${CD_DIR} || exit_err "Failed mount --bind ${CD_DIR}"
|
||||
chroot ${CHROOT_BASEDIR} apt-get update
|
||||
chroot ${CHROOT_BASEDIR} apt-get install -y xorriso
|
||||
chroot ${CHROOT_BASEDIR} apt-get install -y grub-efi mtools xorriso
|
||||
chroot ${CHROOT_BASEDIR} grub-mkrescue -o ${RELEASE_DIR}/TrueNAS-SCALE-${VERSION}.iso ${CD_DIR} \
|
||||
|| exit_err "Failed grub-mkrescue"
|
||||
umount -f ${CHROOT_BASEDIR}/${CD_DIR}
|
||||
|
||||
@@ -293,6 +293,8 @@ def main():
|
||||
|
||||
run_command(["mount", "-t", "sysfs", "none", f"{root}/sys"])
|
||||
undo.append(["umount", f"{root}/sys"])
|
||||
|
||||
os.makedirs(f"{root}/boot/grub", exist_ok=True)
|
||||
run_command(["mount", "-t", "zfs", f"{pool_name}/grub", f"{root}/boot/grub"])
|
||||
undo.append(["umount", f"{root}/boot/grub"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user