Changed user id from $USER ro user since $USER was root
This commit is contained in:
parent
4e2a9158a8
commit
12d3808282
@ -36,19 +36,27 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
INSTALLDIR="$(readlink -m mnt)"
|
INSTALLDIR="$(readlink -m mnt)"
|
||||||
umount_kill "$INSTALLDIR" || :
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Use a snapshot of the debootstraped debian image to install Whonix (for DEBUGGING)
|
# Use a snapshot of the debootstraped debian image to install Whonix (for DEBUGGING)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
splitPath "$IMG" path_parts
|
|
||||||
PREPARED_IMG="${path_parts[dir]}${path_parts[base]}-debootstrap${path_parts[dotext]}"
|
|
||||||
|
|
||||||
if [ -f "$PREPARED_IMG" ]; then
|
copy_snapshot() {
|
||||||
warn "Copying $PREPARED_IMG to $IMG"
|
warn "Copying $1 to $IMG"
|
||||||
mount -o loop "$PREPARED_IMG" "$INSTALLDIR" || exit 1
|
umount_kill "$INSTALLDIR" || :
|
||||||
|
mount -o loop "$1" "$INSTALLDIR" || exit 1
|
||||||
rm -f "$INSTALLDIR/tmp/.prepared_groups"
|
rm -f "$INSTALLDIR/tmp/.prepared_groups"
|
||||||
umount_kill "$INSTALLDIR" || :
|
umount_kill "$INSTALLDIR" || :
|
||||||
cp -f "$PREPARED_IMG" "$IMG"
|
cp -f "$1" "$IMG"
|
||||||
|
}
|
||||||
|
|
||||||
|
splitPath "$IMG" path_parts
|
||||||
|
debootstrap_snapshot="${path_parts[dir]}${path_parts[base]}-debootstrap${path_parts[dotext]}"
|
||||||
|
updated_snapshot="${path_parts[dir]}${path_parts[base]}-updated${path_parts[dotext]}"
|
||||||
|
|
||||||
|
if [ -f "$updated_snapshot" ]; then
|
||||||
|
copy_snapshot "$updated_snapshot"
|
||||||
|
elif [ -f "$debootstrap_snapshot" ]; then
|
||||||
|
copy_snapshot "$debootstrap_snapshot"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ if [ "$SNAPSHOT" == "1" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# chroot Whonix build script (Make sure set -e is not set)
|
# chroot Whonix build script (Make sure set -e is not set)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@ -174,7 +173,7 @@ if ! [ -f "$INSTALLDIR/tmp/.prepared_whonix" ]; then
|
|||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
pushd "$WHONIX_DIR"
|
pushd "$WHONIX_DIR"
|
||||||
{
|
{
|
||||||
su $USER -c "git submodule update --init --recursive"
|
su user -c "git submodule update --init --recursive"
|
||||||
}
|
}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@ -187,23 +186,23 @@ if ! [ -f "$INSTALLDIR/tmp/.prepared_whonix" ]; then
|
|||||||
pushd "$WHONIX_DIR"
|
pushd "$WHONIX_DIR"
|
||||||
{
|
{
|
||||||
sed -i 's/grub-pc//g' grml_packages || :;
|
sed -i 's/grub-pc//g' grml_packages || :;
|
||||||
su $USER -c "git commit -am 'removed grub-pc depend'" || :;
|
su user -c "git commit -am 'removed grub-pc depend'" || :;
|
||||||
}
|
}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd "$WHONIX_DIR/packages/anon-meta-packages/debian"
|
pushd "$WHONIX_DIR/packages/anon-meta-packages/debian"
|
||||||
{
|
{
|
||||||
sed -i 's/ grub-pc,//g' control || :;
|
sed -i 's/ grub-pc,//g' control || :;
|
||||||
su $USER -c "dpkg-source --commit" || :;
|
su user -c "dpkg-source --commit" || :;
|
||||||
su $USER -c "git commit -am 'removed grub-pc depend'" || :;
|
su user -c "git commit -am 'removed grub-pc depend'" || :;
|
||||||
}
|
}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd "$WHONIX_DIR/packages/anon-shared-build-fix-grub/usr/lib/anon-dist/chroot-scripts-post.d"
|
pushd "$WHONIX_DIR/packages/anon-shared-build-fix-grub/usr/lib/anon-dist/chroot-scripts-post.d"
|
||||||
{
|
{
|
||||||
sed -i 's/update-grub/:/g' 85_update_grub || :;
|
sed -i 's/update-grub/:/g' 85_update_grub || :;
|
||||||
su $USER -c "dpkg-source --commit" || :;
|
su user -c "dpkg-source --commit" || :;
|
||||||
su $USER -c "git commit -am 'removed grub-pc depend'" || :;
|
su user -c "git commit -am 'removed grub-pc depend'" || :;
|
||||||
}
|
}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user