forked from Bitmessage/sysdeploy
fix: missing files and permissions
This commit is contained in:
parent
b17988134b
commit
83b34cff5d
43
install.inc
Normal file
43
install.inc
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. maas-images.inc
|
||||||
|
. syslinux-menu.inc
|
||||||
|
|
||||||
|
function download_version()
|
||||||
|
{
|
||||||
|
local release_version="$1"
|
||||||
|
local drive="$2"
|
||||||
|
local target
|
||||||
|
|
||||||
|
find_unused "$drive"
|
||||||
|
target="$unused"
|
||||||
|
if [ -z "$unused" ]; then
|
||||||
|
find_oldest "$drive"
|
||||||
|
target="$unused"
|
||||||
|
fi
|
||||||
|
if [ -z "$target" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
downloads="$(mktemp -d)"
|
||||||
|
pushd "$downloads"
|
||||||
|
|
||||||
|
download_and_verify "$release_version" boot-initrd
|
||||||
|
download_and_verify "$release_version" boot-kernel
|
||||||
|
download_and_verify "$release_version" squashfs
|
||||||
|
|
||||||
|
mount_efi "$drive"
|
||||||
|
mv boot-init "$mnt"/boot-initrd."$release_version"
|
||||||
|
mv boot-kernel "$mnt"/boot-kernel."$release_version"
|
||||||
|
umount_efi
|
||||||
|
|
||||||
|
dev_from_partnum "$drive" "$target"
|
||||||
|
dd if=squashfs of="$partition" bs=1M
|
||||||
|
rename_partition "$drive" "$target" root_"$release_version"
|
||||||
|
rm -f squashfs
|
||||||
|
popd
|
||||||
|
rmdir "$downloads"
|
||||||
|
update_syslinux_menu "$drive"
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim: set ft=sh:
|
0
install.sh
Normal file → Executable file
0
install.sh
Normal file → Executable file
Loading…
Reference in New Issue
Block a user