Skip to content

Commit 61ca760

Browse files
committed
feat: enable secureboot
1 parent c9709f6 commit 61ca760

File tree

3 files changed

+40
-35
lines changed

3 files changed

+40
-35
lines changed

README.md

+29-21
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ Install packages we need in the `build system` required by our scripts.
3434

3535
```shell
3636
sudo apt-get install \
37-
binutils \
38-
debootstrap \
39-
squashfs-tools \
40-
xorriso
37+
debootstrap \
38+
squashfs-tools \
39+
xorriso
4140
```
4241

4342
```shell
@@ -799,6 +798,7 @@ After everything has been installed and preconfigured in the **chrooted** enviro
799798
800799
```shell
801800
cd $HOME/live-ubuntu-from-scratch/image
801+
```
802802
803803
2. Create iso from the image directory using the command-line
804804
@@ -807,25 +807,26 @@ After everything has been installed and preconfigured in the **chrooted** enviro
807807
-as mkisofs \
808808
-iso-level 3 \
809809
-full-iso9660-filenames \
810+
-J -J -joliet-long \
810811
-volid "Ubuntu from scratch" \
811812
-output "../ubuntu-from-scratch.iso" \
812-
-eltorito-boot boot/grub/bios.img \
813-
-no-emul-boot \
814-
-boot-load-size 4 \
815-
-boot-info-table \
816-
--eltorito-catalog boot/grub/boot.cat \
817-
--grub2-boot-info \
818-
--grub2-mbr ../chroot/usr/lib/grub/i386-pc/boot_hybrid.img \
819-
-eltorito-alt-boot \
820-
-e EFI/efiboot.img \
821-
-no-emul-boot \
813+
-eltorito-boot boot/grub/bios.img \
814+
-no-emul-boot \
815+
-boot-load-size 4 \
816+
-boot-info-table \
817+
--eltorito-catalog boot/grub/boot.cat \
818+
--grub2-boot-info \
819+
--grub2-mbr ../chroot/usr/lib/grub/i386-pc/boot_hybrid.img \
820+
-eltorito-alt-boot \
821+
-e EFI/efiboot.img \
822+
-no-emul-boot \
822823
-append_partition 2 0xef isolinux/efiboot.img \
823824
-m "isolinux/efiboot.img" \
824825
-m "isolinux/bios.img" \
825-
-graft-points \
826-
"/EFI/efiboot.img=isolinux/efiboot.img" \
827-
"/boot/grub/bios.img=isolinux/bios.img" \
828-
"."
826+
-graft-points \
827+
"/EFI/efiboot.img=isolinux/efiboot.img" \
828+
"/boot/grub/bios.img=isolinux/bios.img" \
829+
"."
829830
```
830831
831832
## Alternative way, if previous one fails, create an Hybrid ISO
@@ -868,17 +869,24 @@ After everything has been installed and preconfigured in the **chrooted** enviro
868869
869870
```shell
870871
apt install -y syslinux-common && \
871-
cp /usr/lib/ISOLINUX/isolinux.bin isolinux/ && \
872-
cp /usr/lib/syslinux/modules/bios/* isolinux/
872+
cp /usr/lib/ISOLINUX/isolinux.bin image/isolinux/ && \
873+
cp /usr/lib/syslinux/modules/bios/* image/isolinux/
874+
```
875+
876+
3. Access build directory
877+
878+
```shell
879+
cd $HOME/live-ubuntu-from-scratch/image
873880
```
874881
875-
3. Create iso from the image directory
882+
4. Create iso from the image directory
876883
877884
```shell
878885
sudo xorriso \
879886
-as mkisofs \
880887
-iso-level 3 \
881888
-full-iso9660-filenames \
889+
-J -J -joliet-long \
882890
-volid "Ubuntu from scratch" \
883891
-output "../ubuntu-from-scratch.iso" \
884892
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \

scripts/build.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
set -e # exit on error
44
set -o pipefail # exit on pipeline error
55
set -u # treat unset variable as error
6-
#set -x
76

87
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
98

@@ -99,7 +98,7 @@ function check_config() {
9998
function setup_host() {
10099
echo "=====> running setup_host ..."
101100
sudo apt update
102-
sudo apt install -y binutils debootstrap squashfs-tools xorriso dosfstools unzip
101+
sudo apt install -y debootstrap squashfs-tools xorriso
103102
sudo mkdir -p chroot
104103
}
105104

@@ -160,25 +159,26 @@ function build_iso() {
160159
-as mkisofs \
161160
-iso-level 3 \
162161
-full-iso9660-filenames \
162+
-J -J -joliet-long \
163163
-volid "$TARGET_NAME" \
164-
-eltorito-boot boot/grub/bios.img \
164+
-output "$SCRIPT_DIR/$TARGET_NAME.iso" \
165+
-eltorito-boot boot/grub/bios.img \
165166
-no-emul-boot \
166167
-boot-load-size 4 \
167168
-boot-info-table \
168169
--eltorito-catalog boot/grub/boot.cat \
169170
--grub2-boot-info \
170171
--grub2-mbr ../chroot/usr/lib/grub/i386-pc/boot_hybrid.img \
171-
-eltorito-alt-boot \
172+
-eltorito-alt-boot \
172173
-e EFI/efiboot.img \
173174
-no-emul-boot \
174175
-append_partition 2 0xef isolinux/efiboot.img \
175-
-output "$SCRIPT_DIR/$TARGET_NAME.iso" \
176176
-m "isolinux/efiboot.img" \
177177
-m "isolinux/bios.img" \
178-
-graft-points \
179-
"/EFI/efiboot.img=isolinux/efiboot.img" \
180-
"/boot/grub/bios.img=isolinux/bios.img" \
181-
"."
178+
-graft-points \
179+
"/EFI/efiboot.img=isolinux/efiboot.img" \
180+
"/boot/grub/bios.img=isolinux/bios.img" \
181+
"."
182182

183183
popd
184184
}

scripts/chroot_build.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
set -e # exit on error
44
set -o pipefail # exit on pipeline error
55
set -u # treat unset variable as error
6-
#set -x
76

87
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
98

@@ -107,7 +106,6 @@ function install_pkg() {
107106
laptop-detect \
108107
os-prober \
109108
network-manager \
110-
resolvconf \
111109
net-tools \
112110
wireless-tools \
113111
wpagui \
@@ -150,14 +148,13 @@ function install_pkg() {
150148

151149
# final touch
152150
dpkg-reconfigure locales
153-
dpkg-reconfigure resolvconf
154151

155152
# network manager
156153
cat <<EOF > /etc/NetworkManager/NetworkManager.conf
157154
[main]
158-
rc-manager=resolvconf
155+
rc-manager=none
159156
plugins=ifupdown,keyfile
160-
dns=dnsmasq
157+
dns=systemd-resolved
161158
162159
[ifupdown]
163160
managed=false

0 commit comments

Comments
 (0)