Create a script for copying the repo
This commit is contained in:
parent
b1dc0b2009
commit
eef2a1edc6
3 changed files with 17 additions and 11 deletions
|
@ -10,13 +10,7 @@ profileDir="/mnt/archiso-valhalla";
|
|||
projectDir="$rootHome/PortValhalla";
|
||||
nixDir="$profileDir/$root/nix/var/nix/profiles/per-user/root/channels/nixpkgs";
|
||||
mkdir -p "$rootHome";
|
||||
git clone .. "$projectDir";
|
||||
git -C .. diff HEAD | git -C "$projectDir" apply --allow-empty;
|
||||
|
||||
git -C .. ls-files --exclude-standard --others | \
|
||||
while read file; do
|
||||
cp "../$file" "$projectDir/$file";
|
||||
done;
|
||||
"${BASH_SOURCE%/*}/../../scripts/copy-repo.sh" "$projectDir";
|
||||
|
||||
if [ ! -d "$nixCache" ]; then
|
||||
mkdir -p "$nixCache"
|
||||
|
|
|
@ -18,7 +18,7 @@ USER_GROUPS="${USER_GROUPS}";
|
|||
projectRoot="$(realpath ../../..)";
|
||||
projectName="$(basename "$projectRoot")";
|
||||
relativeDir="$(realpath --relative-to "$projectRoot" "$(pwd)")";
|
||||
tempRoot="/root/$(basename "$projectName")";
|
||||
tempRoot="/opt/$(basename "$projectName")";
|
||||
tempDir="$tempRoot/$relativeDir";
|
||||
|
||||
loadkeys "$ARCH_KEYMAP";
|
||||
|
@ -39,7 +39,7 @@ pacstrap -K "$ARCH_MOUNT_ROOT" \
|
|||
texinfo \
|
||||
;
|
||||
|
||||
cp -r "$projectRoot" "${ARCH_MOUNT_ROOT}$tempRoot";
|
||||
../../copy-repo.sh "${ARCH_MOUNT_ROOT}$tempRoot";
|
||||
genfstab -U "$ARCH_MOUNT_ROOT" >> "$ARCH_MOUNT_ROOT/etc/fstab";
|
||||
|
||||
arch-chroot "$ARCH_MOUNT_ROOT" systemctl enable NetworkManager;
|
||||
|
@ -78,6 +78,4 @@ systemd-nspawn -bD "$ARCH_MOUNT_ROOT" -E "ARCH_X11_KEYMAP=${ARCH_X11_KEYMAP}";
|
|||
systemd-nspawn -D "$ARCH_MOUNT_ROOT" systemctl disable set-keymap;
|
||||
rm "$ARCH_MOUNT_ROOT/etc/systemd/system/set-keymap.service";
|
||||
|
||||
arch-chroot "$ARCH_MOUNT_ROOT" rm -rf "$tempRoot";
|
||||
|
||||
popd > /dev/null;
|
||||
|
|
14
scripts/copy-repo.sh
Executable file
14
scripts/copy-repo.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
function copyRepo() {
|
||||
local dir="${BASH_SOURCE%/*}/..";
|
||||
local target="$1";
|
||||
git clone "$dir" "$target";
|
||||
git -C "$dir" diff HEAD | git -C "$target" apply --allow-empty;
|
||||
|
||||
git -C "$dir" ls-files --exclude-standard --others | \
|
||||
while read file; do
|
||||
cp "$dir/$file" "$target/$file";
|
||||
done;
|
||||
}
|
||||
|
||||
copyRepo "$@";
|
Loading…
Reference in a new issue