aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fripost-partman-udeb/base.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/fripost-partman-udeb/base.sh b/src/fripost-partman-udeb/base.sh
index 6ca8ddc..e6a3bf9 100644
--- a/src/fripost-partman-udeb/base.sh
+++ b/src/fripost-partman-udeb/base.sh
@@ -484,7 +484,7 @@ fripost_fstab_addentry() {
if ! [ -h /dev/disk/by-uuid/"$uuid" ]; then
device=$(/bin/mapdevfs "$device")
log "Adding a symlink UUID $uuid -> $device"
- ln -s ../../"${device#/dev/}" /dev/disk/by-uuid/"$uuid"
+ ln -fs ../../"${device#/dev/}" /dev/disk/by-uuid/"$uuid"
fi
fi
}
@@ -517,9 +517,8 @@ fripost_mount_partitions() {
done
# Post-installation scripts may use the install CD as a local mirror
- # for APT packages. TODO: What if it was a USB stick? A netboot?
- cdrom=$( sed -rn 's#^(\S+) /cdrom.*#\1#p' /proc/mounts \
- | grep -m1 -Ev '^/dev/(loop|sd[a-z])' )
+ # for APT packages.
+ cdrom=$( sed -rn 's#^(\S+) /cdrom\s.*#\1#p' /proc/mounts | head -1 )
[ "$cdrom" ] || fatal "Error: Is /cdrom a mountpoint?"
fripost_fstab_addentry "$cdrom" /media/cdrom0 udf,iso9660 user,noauto 0 0
mkdir -p /target/media/cdrom0
@@ -532,8 +531,11 @@ fripost_mount_partitions() {
}
getIPv4() {
- local if=$( /bin/ip -4 route show to default scope global \
+ local ip=/sbin/ip
+ [ -x $ip ] || ip=/bin/ip
+ [ -x $ip ] || fatal "Error: couldn't find ip(8)"
+ local if=$( $ip -4 route show to default scope global \
| sed -nr '/^default via \S+ dev (\S+).*/ {s//\1/p;q}' )
- /bin/ip -4 address show dev "$if" scope global \
+ $ip -4 address show dev "$if" scope global \
| sed -nr '/^\s+inet\s([[:xdigit:].:]{3,39}).*/ {s//\1/p;q}'
}