From c0daaf71fa7b7b8018856083892bae863a3886ef Mon Sep 17 00:00:00 2001 From: ading2210 Date: Fri, 22 Dec 2023 19:15:24 -0800 Subject: [PATCH] more build script bugfixes --- build.sh | 9 ++------- build_squashfs.sh | 5 ++--- patch_rootfs.sh | 2 +- rootfs/opt/setup_rootfs.sh | 3 +++ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index 842ffe4..10ec5ca 100755 --- a/build.sh +++ b/build.sh @@ -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" \ No newline at end of file diff --git a/build_squashfs.sh b/build_squashfs.sh index edd3d36..e3a7d6b 100755 --- a/build_squashfs.sh +++ b/build_squashfs.sh @@ -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 diff --git a/patch_rootfs.sh b/patch_rootfs.sh index 8e85ca9..1aca979 100755 --- a/patch_rootfs.sh +++ b/patch_rootfs.sh @@ -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" diff --git a/rootfs/opt/setup_rootfs.sh b/rootfs/opt/setup_rootfs.sh index 6fda0a7..6e69f41 100755 --- a/rootfs/opt/setup_rootfs.sh +++ b/rootfs/opt/setup_rootfs.sh @@ -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