more build script bugfixes

This commit is contained in:
ading2210 2023-12-22 19:15:24 -08:00
parent e8b2f15d7b
commit c0daaf71fa
4 changed files with 8 additions and 11 deletions

View File

@ -58,6 +58,8 @@ echo "extracting data from kernel"
initramfs_dir=/tmp/shim_initramfs
rm -rf $initramfs_dir
extract_initramfs $kernel_dir/kernel.bin $kernel_dir $initramfs_dir
umount $shim_rootfs
losetup -d $shim_loop
echo "patching initramfs"
patch_initramfs $initramfs_dir
@ -75,16 +77,9 @@ image_loop=$(create_loop ${output_path})
echo "creating partitions on the disk image"
create_partitions $image_loop "${kernel_dir}/kernel.bin"
echo "mounting the original shim rootfs"
shim_rootfs="/tmp/shim_rootfs"
make_mountable "${shim_loop}p3"
safe_mount "${shim_loop}p3" $shim_rootfs
echo "copying data into the image"
populate_partitions $image_loop $initramfs_dir $rootfs_dir
echo "cleaning up loop devices"
umount $rootfs_dir
losetup -d $shim_loop
losetup -d $image_loop
echo "done"

View File

@ -73,9 +73,8 @@ echo "extracting initramfs from kernel (this may take a while)"
extract_initramfs $kernel_dir/kernel.bin $kernel_dir $rootfs_dir
rm -rf $rootfs_dir/init
echo "mounting shim"
make_mountable "${shim_loop}p3"
safe_mount "${shim_loop}p3" $shim_rootfs
echo "removeing shim loop device"
losetup -d $shim_loop
echo "compressing old rootfs"
mksquashfs $old_dir $root_squashfs -noappend -comp gzip

View File

@ -7,7 +7,7 @@ if [ "$DEBUG" ]; then
set -x
fi
. ./build_image.sh
. ./image_utils.sh
print_help() {
echo "Usage: ./patch_rootfs.sh shim_path reco_path rootfs_dir"

View File

@ -24,6 +24,9 @@ Pin: origin ${custom_repo_domain}
Pin-Priority: 1001
END
#fix name servers
echo "nameserver 1.1.1.1" > /etc/resolv.conf
#install the patched systemd
apt-get install -y ca-certificates
apt-get update