Fix pacman wrapper location
This commit is contained in:
parent
00685e9d87
commit
d9a2c1d788
6 changed files with 93 additions and 84 deletions
|
@ -1,28 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [[ ! $EUID -eq 0 ]]; then
|
|
||||||
printf 'You have to be root to perform this action.\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the disk is ro'ed using subvolume properties
|
|
||||||
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
|
||||||
cat <<- END
|
|
||||||
The root partition is currently in read-only mode, to run pacman it will have to be switched over to read-write mode.
|
|
||||||
|
|
||||||
Note that any changes made to the system will not carry over to future OS image updates.
|
|
||||||
|
|
||||||
END
|
|
||||||
read -p 'Do you want to unlock the root partition? (y/N) ' ans
|
|
||||||
|
|
||||||
if [[ $ans =~ ^(y|Y|yes|YES)$ ]]; then
|
|
||||||
btrfs property set / ro false
|
|
||||||
else
|
|
||||||
printf 'Quitting... no changes have been made to the system.\n'
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# No exit statement here, we return pacman's exit code
|
|
||||||
/usr/bin/pacman $@
|
|
||||||
|
|
31
arkdep-build.d/arkanelinux/overlay/post_install/usr/local/bin/pacman
Executable file
31
arkdep-build.d/arkanelinux/overlay/post_install/usr/local/bin/pacman
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ ! $EUID -eq 0 ]]; then
|
||||||
|
printf 'You have to be root to perform this action.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If -r is defined do not check, we may be running pacstrap
|
||||||
|
if [[ ! $@ =~ '-r' ]]; then
|
||||||
|
# Check if the disk is ro'ed using subvolume properties
|
||||||
|
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
||||||
|
cat <<- END
|
||||||
|
The root partition is currently in read-only mode, to run pacman it will have to be switched over to read-write mode.
|
||||||
|
|
||||||
|
Note that any changes made to the system will not carry over to future OS image updates.
|
||||||
|
|
||||||
|
END
|
||||||
|
read -p 'Do you want to unlock the root partition? (y/N) ' ans
|
||||||
|
|
||||||
|
if [[ $ans =~ ^(y|Y|yes|YES)$ ]]; then
|
||||||
|
btrfs property set / ro false
|
||||||
|
else
|
||||||
|
printf 'Quitting... no changes have been made to the system.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# No exit statement here, we return pacman's exit code
|
||||||
|
/usr/bin/pacman $@
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [[ ! $EUID -eq 0 ]]; then
|
|
||||||
printf 'You have to be root to perform this action.\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the disk is ro'ed using subvolume properties
|
|
||||||
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
|
||||||
cat <<- END
|
|
||||||
The root partition is currently in read-only mode, to run pacman it will have to be switched over to read-write mode.
|
|
||||||
|
|
||||||
Note that any changes made to the system will not carry over to future OS image updates.
|
|
||||||
|
|
||||||
END
|
|
||||||
read -p 'Do you want to unlock the root partition? (y/N) ' ans
|
|
||||||
|
|
||||||
if [[ $ans =~ ^(y|Y|yes|YES)$ ]]; then
|
|
||||||
btrfs property set / ro false
|
|
||||||
else
|
|
||||||
printf 'Quitting... no changes have been made to the system.\n'
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# No exit statement here, we return pacman's exit code
|
|
||||||
/usr/bin/pacman $@
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ ! $EUID -eq 0 ]]; then
|
||||||
|
printf 'You have to be root to perform this action.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If -r is defined do not check, we may be running pacstrap
|
||||||
|
if [[ ! $@ =~ '-r' ]]; then
|
||||||
|
# Check if the disk is ro'ed using subvolume properties
|
||||||
|
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
||||||
|
cat <<- END
|
||||||
|
The root partition is currently in read-only mode, to run pacman it will have to be switched over to read-write mode.
|
||||||
|
|
||||||
|
Note that any changes made to the system will not carry over to future OS image updates.
|
||||||
|
|
||||||
|
END
|
||||||
|
read -p 'Do you want to unlock the root partition? (y/N) ' ans
|
||||||
|
|
||||||
|
if [[ $ans =~ ^(y|Y|yes|YES)$ ]]; then
|
||||||
|
btrfs property set / ro false
|
||||||
|
else
|
||||||
|
printf 'Quitting... no changes have been made to the system.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# No exit statement here, we return pacman's exit code
|
||||||
|
/usr/bin/pacman $@
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [[ ! $EUID -eq 0 ]]; then
|
|
||||||
printf 'You have to be root to perform this action.\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the disk is ro'ed using subvolume properties
|
|
||||||
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
|
||||||
cat <<- END
|
|
||||||
The root partition is currently in read-only mode, to run pacman it will have to be switched over to read-write mode.
|
|
||||||
|
|
||||||
Note that any changes made to the system will not carry over to future OS image updates.
|
|
||||||
|
|
||||||
END
|
|
||||||
read -p 'Do you want to unlock the root partition? (y/N) ' ans
|
|
||||||
|
|
||||||
if [[ $ans =~ ^(y|Y|yes|YES)$ ]]; then
|
|
||||||
btrfs property set / ro false
|
|
||||||
else
|
|
||||||
printf 'Quitting... no changes have been made to the system.\n'
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# No exit statement here, we return pacman's exit code
|
|
||||||
/usr/bin/pacman $@
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ ! $EUID -eq 0 ]]; then
|
||||||
|
printf 'You have to be root to perform this action.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If -r is defined do not check, we may be running pacstrap
|
||||||
|
if [[ ! $@ =~ '-r' ]]; then
|
||||||
|
# Check if the disk is ro'ed using subvolume properties
|
||||||
|
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
||||||
|
cat <<- END
|
||||||
|
The root partition is currently in read-only mode, to run pacman it will have to be switched over to read-write mode.
|
||||||
|
|
||||||
|
Note that any changes made to the system will not carry over to future OS image updates.
|
||||||
|
|
||||||
|
END
|
||||||
|
read -p 'Do you want to unlock the root partition? (y/N) ' ans
|
||||||
|
|
||||||
|
if [[ $ans =~ ^(y|Y|yes|YES)$ ]]; then
|
||||||
|
btrfs property set / ro false
|
||||||
|
else
|
||||||
|
printf 'Quitting... no changes have been made to the system.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# No exit statement here, we return pacman's exit code
|
||||||
|
/usr/bin/pacman $@
|
||||||
|
|
Loading…
Add table
Reference in a new issue