Changed user id from $USER ro user since $USER was root

pull/1/head
Jason Mehring 10 years ago
parent 4e2a9158a8
commit 12d3808282

@ -36,19 +36,27 @@ else
fi
INSTALLDIR="$(readlink -m mnt)"
umount_kill "$INSTALLDIR" || :
# ------------------------------------------------------------------------------
# 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
warn "Copying $PREPARED_IMG to $IMG"
mount -o loop "$PREPARED_IMG" "$INSTALLDIR" || exit 1
copy_snapshot() {
warn "Copying $1 to $IMG"
umount_kill "$INSTALLDIR" || :
mount -o loop "$1" "$INSTALLDIR" || exit 1
rm -f "$INSTALLDIR/tmp/.prepared_groups"
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

@ -33,7 +33,6 @@ if [ "$SNAPSHOT" == "1" ]; then
fi
fi
# ------------------------------------------------------------------------------
# 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"
{
su $USER -c "git submodule update --init --recursive"
su user -c "git submodule update --init --recursive"
}
popd
@ -187,23 +186,23 @@ if ! [ -f "$INSTALLDIR/tmp/.prepared_whonix" ]; then
pushd "$WHONIX_DIR"
{
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
pushd "$WHONIX_DIR/packages/anon-meta-packages/debian"
{
sed -i 's/ grub-pc,//g' control || :;
su $USER -c "dpkg-source --commit" || :;
su $USER -c "git commit -am 'removed grub-pc depend'" || :;
su user -c "dpkg-source --commit" || :;
su user -c "git commit -am 'removed grub-pc depend'" || :;
}
popd
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 || :;
su $USER -c "dpkg-source --commit" || :;
su $USER -c "git commit -am 'removed grub-pc depend'" || :;
su user -c "dpkg-source --commit" || :;
su user -c "git commit -am 'removed grub-pc depend'" || :;
}
popd

Loading…
Cancel
Save