more build script bugfixes
This commit is contained in:
parent
e8b2f15d7b
commit
c0daaf71fa
9
build.sh
9
build.sh
|
@ -58,6 +58,8 @@ echo "extracting data from kernel"
|
||||||
initramfs_dir=/tmp/shim_initramfs
|
initramfs_dir=/tmp/shim_initramfs
|
||||||
rm -rf $initramfs_dir
|
rm -rf $initramfs_dir
|
||||||
extract_initramfs $kernel_dir/kernel.bin $kernel_dir $initramfs_dir
|
extract_initramfs $kernel_dir/kernel.bin $kernel_dir $initramfs_dir
|
||||||
|
umount $shim_rootfs
|
||||||
|
losetup -d $shim_loop
|
||||||
|
|
||||||
echo "patching initramfs"
|
echo "patching initramfs"
|
||||||
patch_initramfs $initramfs_dir
|
patch_initramfs $initramfs_dir
|
||||||
|
@ -75,16 +77,9 @@ image_loop=$(create_loop ${output_path})
|
||||||
echo "creating partitions on the disk image"
|
echo "creating partitions on the disk image"
|
||||||
create_partitions $image_loop "${kernel_dir}/kernel.bin"
|
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"
|
echo "copying data into the image"
|
||||||
populate_partitions $image_loop $initramfs_dir $rootfs_dir
|
populate_partitions $image_loop $initramfs_dir $rootfs_dir
|
||||||
|
|
||||||
echo "cleaning up loop devices"
|
echo "cleaning up loop devices"
|
||||||
umount $rootfs_dir
|
|
||||||
losetup -d $shim_loop
|
|
||||||
losetup -d $image_loop
|
losetup -d $image_loop
|
||||||
echo "done"
|
echo "done"
|
|
@ -73,9 +73,8 @@ echo "extracting initramfs from kernel (this may take a while)"
|
||||||
extract_initramfs $kernel_dir/kernel.bin $kernel_dir $rootfs_dir
|
extract_initramfs $kernel_dir/kernel.bin $kernel_dir $rootfs_dir
|
||||||
rm -rf $rootfs_dir/init
|
rm -rf $rootfs_dir/init
|
||||||
|
|
||||||
echo "mounting shim"
|
echo "removeing shim loop device"
|
||||||
make_mountable "${shim_loop}p3"
|
losetup -d $shim_loop
|
||||||
safe_mount "${shim_loop}p3" $shim_rootfs
|
|
||||||
|
|
||||||
echo "compressing old rootfs"
|
echo "compressing old rootfs"
|
||||||
mksquashfs $old_dir $root_squashfs -noappend -comp gzip
|
mksquashfs $old_dir $root_squashfs -noappend -comp gzip
|
||||||
|
|
|
@ -7,7 +7,7 @@ if [ "$DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. ./build_image.sh
|
. ./image_utils.sh
|
||||||
|
|
||||||
print_help() {
|
print_help() {
|
||||||
echo "Usage: ./patch_rootfs.sh shim_path reco_path rootfs_dir"
|
echo "Usage: ./patch_rootfs.sh shim_path reco_path rootfs_dir"
|
||||||
|
|
|
@ -24,6 +24,9 @@ Pin: origin ${custom_repo_domain}
|
||||||
Pin-Priority: 1001
|
Pin-Priority: 1001
|
||||||
END
|
END
|
||||||
|
|
||||||
|
#fix name servers
|
||||||
|
echo "nameserver 1.1.1.1" > /etc/resolv.conf
|
||||||
|
|
||||||
#install the patched systemd
|
#install the patched systemd
|
||||||
apt-get install -y ca-certificates
|
apt-get install -y ca-certificates
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
Loading…
Reference in New Issue