Fix OMARCHY_USER when archinstall fails (#12)
Get username from JSON config instead of /mnt/home to ensure error recovery works even when archinstall completely fails.
This commit is contained in:
1 parent
b9f5ec0284
commit
a0dd0127d5
1 file changed
+3
-2
@@ -21,13 +21,14 @@ trap catch_errors ERR
|
|||||||
if [[ $(tty) == "/dev/tty1" ]]; then
|
if [[ $(tty) == "/dev/tty1" ]]; then
|
||||||
NETWORK_NEEDED=1 ./installer
|
NETWORK_NEEDED=1 ./installer
|
||||||
|
|
||||||
|
# Get username from installer config for reliable error recovery
|
||||||
|
OMARCHY_USER="$(jq -r '.users[0].username' user_credentials.json)"
|
||||||
|
|
||||||
archinstall \
|
archinstall \
|
||||||
--config user_configuration.json \
|
--config user_configuration.json \
|
||||||
--creds user_credentials.json \
|
--creds user_credentials.json \
|
||||||
--silent
|
--silent
|
||||||
|
|
||||||
OMARCHY_USER="$(ls -1 /mnt/home | head -n1)"
|
|
||||||
|
|
||||||
# No need to ask for sudo during the installation (omarchy itself responsible for removing after install)
|
# No need to ask for sudo during the installation (omarchy itself responsible for removing after install)
|
||||||
mkdir -p /mnt/etc/sudoers.d
|
mkdir -p /mnt/etc/sudoers.d
|
||||||
echo "root ALL=(ALL:ALL) NOPASSWD: ALL\n%wheel ALL=(ALL:ALL) NOPASSWD: ALL\n$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL" >/mnt/etc/sudoers.d/99-omarchy-installer
|
echo "root ALL=(ALL:ALL) NOPASSWD: ALL\n%wheel ALL=(ALL:ALL) NOPASSWD: ALL\n$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL" >/mnt/etc/sudoers.d/99-omarchy-installer
|
||||||
|
|||||||
Reference in new issue
Block a user