You are not logged in.
Pages: 1
I'm running a fully updated copy of Arch, using systemd, with Xfce as DE. Just hit an odd problem.
I needed a recent copy of SMS (Slackware-based server) on a flash drive. Its easy enough to prepare - explode the ISO to the flash drive, then run a script to make the flash drive bootable. Only trouble is, under Arch/Xfce it doesn't work - the script can't be executed.
I've done a bit of research, and it seems likely that udisks and polkit control this behaviour. While I can understand the extra security involved in setting things up this way, its annoying, and I would like to change it. However, so far my research hasn't helped much - I have no idea where or how to set things up the way I want.
The behaviour is more than a little inconsistent - I have no problem with scripts executed from a USB hard drive, just from flash drives.
Can anyone tell me what is needed to set the defaults to suit my use? In this instance, I was able to boot to Debian to run the script, but I don't expect to be able to do that for much longer.....
Paul.
Offline
What are you using to mount them? https://wiki.archlinux.org/index.php/Xf … le_Devices?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Study the install script. Maybe you can work around it. Or maybe there's another, simpler way to write it to the USB stick (e.g. using dd).
I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).
Offline
Or mount it as you would a USB hdd? (I am guessing these are getting mounted by root under /mnt with more privileges than the flash drives?)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
What are you using to mount them? https://wiki.archlinux.org/index.php/Xf … le_Devices?
Sorry to be slow - bad couple of days.
Yes, I'm following pretty much that route. The strange thing is that the problem does no appear on USB hard drives, but does on flash drives. So I think its got to be something in polkit that is setting it up that way. I just have no idea where to look to fix it.
Paul.
Offline
Study the install script. Maybe you can work around it. Or maybe there's another, simpler way to write it to the USB stick (e.g. using dd).
Well, I worked around it by running another distro. As to a workaround with Arch, I can't see one. dd isn't an option in this instance - I'm not writing the iso to the flash drive, I'm writing the contents. That istn't a problem in itself, the problem is that I have to run the script to set the flash drive as bootable.
The script is as below:
#!/bin/bash
set -e
TARGET=""
MBR=""
# Find out which partition or disk are we using
MYMNT=$(cd -P $(dirname $0) ; pwd)
while [ "$MYMNT" != "" -a "$MYMNT" != "." -a "$MYMNT" != "/" ]; do
TARGET=$(egrep "[^[:space:]]+[[:space:]]+$MYMNT[[:space:]]+" /proc/mounts | tail -n 1 | cut -d " " -f 1)
if [ "$TARGET" != "" ]; then break; fi
MYMNT=$(dirname "$MYMNT")
done
if [ "$TARGET" = "" ]; then
echo "Can't find device to install to."
echo "Make sure you run this script from a mounted device."
exit 1
fi
if [ "$(cat /proc/mounts | grep "^$TARGET" | grep noexec)" ]; then
echo "The disk $TARGET is mounted with noexec parameter, trying to remount..."
mount -o remount,exec "$TARGET"
fi
MBR=$(echo "$TARGET" | sed -r "s/[0-9]+\$//g")
NUM=${TARGET:${#MBR}}
cd "$MYMNT"
clear
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo " Welcome to sms boot installer "
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo
echo "This installer will setup disk $TARGET to boot only SMS Installer."
if [ "$MBR" != "$TARGET" ]; then
echo
echo "Warning! Master boot record (MBR) of $MBR will be overwritten."
echo "If you use $MBR to boot any existing operating system, it will not work"
echo "anymore. Only sms will boot from this device. Be careful!"
fi
echo
echo "Press any key to continue, or Ctrl+C to abort..."
read junk
clear
echo "Flushing filesystem buffers, this may take a while..."
sync
# setup MBR if the device is not in superfloppy format
if [ "$MBR" != "$TARGET" ]; then
echo "Setting up MBR on $MBR..."
./syslinux/lilo -S /dev/null -M $MBR ext # this must be here to support -A for extended partitions
echo "Activating partition $TARGET..."
./syslinux/lilo -S /dev/null -A $MBR $NUM
echo "Updating MBR on $MBR..." # this must be here because LILO mbr is bad. mbr.bin is from syslinux
cat ./syslinux/mbr.bin > $MBR
fi
echo "Setting up boot record for $TARGET..."
./syslinux/syslinux -d syslinux $TARGET
echo "Disk $TARGET should be bootable now. Installation finished."
echo
echo "Read the information above and then press any key to exit..."
read junk
Apart from the immediate problem, I really don't like having that sort of control taken away from me - I find it much too reminiscent of Windows. So for future reference, I would really like to know how to set things up to suit my usage, not someone else's idea of what my usage should be....
Paul.
Offline
The script appears to just be a bunch of sanity checks and then it installs syslinux (and lilo somehow?). I think you should just do this manually. SMS is just a normal Linux fielsystem that is preloaded with stuffs, yeah? I see no reason why doing a traditional bootloader installation would not work.
Offline
Only trouble is, under Arch/Xfce it doesn't work - the script can't be executed.
"Doesn't work" isn't very descriptive. Does it say anything?
Maybe you need to run "sync" at the end, or copy a large-ish file (~100 MB) and then delete the file.
$ syncI have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).
Offline
I'm not writing the iso to the flash drive, I'm writing the contents.
Why don't you write the ISO to your USB? The SMS ISO is bootable and runs as a LiveCD, nah?
Offline
The script appears to just be a bunch of sanity checks and then it installs syslinux (and lilo somehow?). I think you should just do this manually. SMS is just a normal Linux fielsystem that is preloaded with stuffs, yeah? I see no reason why doing a traditional bootloader installation would not work.
I may try that the next time it comes up. The odd thing is that the flash drive is running a standard Vfat file system, but when checked, it shows the Windows install batch file as executable, but does not show the install.sh as executable. And I cannot make install.sh executable, nor can I run it using:
bash ./install.shThat option fails with an error regarding file permissions. So somewhere in the mix of udisk/polkit, a policy is saying that I cannot execute files on the flash drive. Which I find more than just a bit annoying....
Paul.
Offline
toothandnail wrote:Only trouble is, under Arch/Xfce it doesn't work - the script can't be executed.
"Doesn't work" isn't very descriptive. Does it say anything?
Maybe you need to run "sync" at the end, or copy a large-ish file (~100 MB) and then delete the file.
$ sync
Sorry. As you say, doesn't work isn't very descriptive. To be more precise, the install script is not listed as executable (which is pretty strange on a Vfat file system). Looking at the files concerned, with is the attributes that they have:
fang@sirius:/var/run/media/fang/9FD5-3C9F$ ls -l usb*
-rwxr-xr-x 1 fang users 1685 Apr 8 2012 usbboot.bat
-rw-r--r-- 1 fang users 2239 Apr 8 2012 usbboot.shSince this is a vfat file system, all files would normally be showing as executable. However, the DOS batch file is, the Linux script isn't. Which means that something is manipulating the normal file system attributes. While this in no longer a problem (I booted to a Debian-based distro and ran the script from there), I want to know how to adjust the attributes that are presented in future.
Paul.
Offline
Pages: 1