You are not logged in.
I'm attempting to install arch using a bash script.
Problem is, when i run:
"arch-chroot /mnt $HOME/HussarInstaller/scripts/sysconf.sh",
or any script with arch-chroot, it returns:
"chroot: failed to run command ‘/root/HussarInstaller/scripts/sysconf.sh’: Permission denied".
I've consulted the wiki and followed its instruction remount with the execute permission, so i ran the following but retried to no avail:
"mount -o remount,exec /mnt"
Further searching online showed up nothing.
Wiki Page im refrencing:
https://wiki.archlinux.org/title/Chroot#Using_chroot
Full Script:
https://github.com/ThePolishHussar/HussarInstaller
Thanks in advance for any help!
Last edited by TheWingedHussar (2022-05-19 18:01:12)
Offline
What does `ls -l /mnt/root/HussarInstaller/scripts/` give you?
Last edited by Scimmia (2022-05-19 02:21:44)
Offline
Just do something like
cp sysconf.sh /mnt
arch-chroot /mnt
./sysconf.shJust remember that the script will be run as root, so $HOME will be mapped to /root.
The first line of the script (the sourcing part) will not work unless you copy that to /mnt/root/HussarInstaller/install.conf
I'd also strongly recommend bringing this up with the author of the script on github.
Offline
They *are* the author, and sourcing other files is not an issue. If they were trying to use someone else's script, that would be off topic here.
Last edited by Scimmia (2022-05-19 02:16:53)
Offline
"What does `ls -a /mnt/root/HussarInstaller/scripts/` give you?":
at the time the scripts are refrenced:
customize.sh install.sh packages.sh partions.sh sysconf.sh system_services.sh
"cp sysconf.sh /mnt
arch-chroot /mnt
./sysconf.sh"
arch-chroot will just chroot and ask for manual input, wont work
"Just remember that the script will be run as root, so $HOME will be mapped to /root.
The first line of the script (the sourcing part) will not work unless you copy that to /mnt/root/HussarInstaller/install.conf
I'd also strongly recommend bringing this up with the author of the script on github."
Ive taken this into account, any scripts run using arch-chroot sources the config file using:
"source $HOME/HussarInstaller/install.conf"
Offline
My apologies, I realized I typoed and corrected it as you were replying. I as actually looking for ls -l, not ls -a.
Offline
They *are* the author
Oh. I also didn't notice that they copied the whole folder into the chroot. My bad
Offline
"My apologies, I realized I typoed and corrected it as you were replying. I as actually looking for ls -l, not ls -a."
Source (normal root):
-rwxrwxrwx 1 root root 160 May 18 21:06 customize.sh
-rwxrwxrwx 1 root root 417 May 18 21:06 install.sh
-rwxrwxrwx 1 root root 1136 May 18 21:06 packages.sh
-rwxrwxrwx 1 root root 1222 May 18 21:06 partions.sh
-rwxrwxrwx 1 root root 1614 May 18 21:06 sysconf.sh
-rwxrwxrwx 1 root root 302 May 18 21:06 system_services.sh
Coppied (/mnt/root/):
-rw-r--r-- 1 root root 160 May 18 22:11 customize.sh
-rw-r--r-- 1 root root 417 May 18 22:11 install.sh
-rw-r--r-- 1 root root 1136 May 18 22:11 packages.sh
-rw-r--r-- 1 root root 1222 May 18 22:11 partions.sh
-rw-r--r-- 1 root root 1614 May 18 22:11 sysconf.sh
-rw-r--r-- 1 root root 302 May 18 22:11 system_services.sh
I assume i need to add some flag to the cp command to keep these permissions in the copy. Which would that be?
Offline
Try --preserve=mode.
If that does not work for you try the install command with the -m flag instead of cp (look into the man page to see how install works).
Offline
Please use code tags, https://bbs.archlinux.org/help.php#bbcode
Then try
arch-chroot /mnt /bin/sh -c 'echo snafu'Offline
Try --preserve=mode.
Didn't work.
If that does not work for you try the install command with the -m flag instead of cp (look into the man page to see how install works).
Then try
arch-chroot /mnt /bin/sh -c 'echo snafu
Didn't try either, opted to use
chmod a+rwx /mnt/root/HussarInstaller/scripts*Offline
So you simply lacked permissions on the scripts directory?
Offline
So you simply lacked permissions on the scripts directory?
after i coppied them into the mounted system that was the case.
Offline
"cp -a" will preserve attributes
Is this the original situation or an effort to solve it following post #3 ?
Offline