summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Affonso Xavier de Morais2014-09-04 16:52:18 +0200
committerMichael Pereira Neves2014-10-28 14:14:50 +0100
commit4bd3e981b74296b2108f20be4a3592291e07a047 (patch)
treee035f675d44577dbd9ad4cbf371e9b505b48f4e1
parent[partitioner] changed the way GPT partitions are created. (diff)
downloadtm-scripts-4bd3e981b74296b2108f20be4a3592291e07a047.tar.gz
tm-scripts-4bd3e981b74296b2108f20be4a3592291e07a047.tar.xz
tm-scripts-4bd3e981b74296b2108f20be4a3592291e07a047.zip
[partitioner] minor fixes.
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions26
-rwxr-xr-xserver/modules/partitioner/opt/openslx/scripts/partitioner2
2 files changed, 19 insertions, 9 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
index b282a486..236bb157 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
@@ -15,7 +15,9 @@
#############################################################################
# read global OpenSLX config
-. /opt/openslx/config || { echo "Could not source config!"; exit 23; }
+. config || { echo "Could not source config!"; exit 23; }
+
+set -xv
# General formatter for the /tmp partition on a local harddisk
diskfm () {
@@ -89,7 +91,7 @@ mount_temp_fallback () {
return 0
}
-mount_partition() {
+mount_partition () {
local mountpoint="$1"
local partition="$2"
local options="$3"
@@ -108,7 +110,7 @@ mount_partition() {
echo -e "${partition}\t${mountpoint}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab"
}
-read_partitions() {
+read_partitions () {
# create the /etc/disk.partition file with all the partitions and respective id's (MSDOS and GPT)
echo "PARTITION - ID" > "/etc/disk.partition"
for hd in $(cat /proc/partitions | tr -s ' ' | cut -d ' ' -f5 | grep -o -e "[a-z]*$"); do
@@ -138,13 +140,19 @@ if [ -z "${SLX_PARTITION_TABLE}" ]; then
45,10G,/var/scratch,persistent'
fi
+read_partitions
+
for PARTITION in $SLX_PARTITION_TABLE; do
IFS=,
set $PARTITION
- id=$1; shift
- size=$1; shift
- [ -e $1 ] && mountpoint="$1"; shift
- [ $# -gt 0 ] && options="$*"
+ id=$1
+ shift
+ size=$1
+ shift
+ mountpoint="$1"
+ shift
+ options="$*"
+ unset IFS
case $id in
44)
@@ -180,7 +188,7 @@ for PARTITION in $SLX_PARTITION_TABLE; do
;;
*)
for hdpartnr in $(grep -e "${id}$\|${id}000000-0000-0000-0000-000000000000$" /etc/disk.partition | cut -d ' ' -f1); do
- mount_part "${mountpoint}" $hdpartnr $options
+ mount_partition "${mountpoint}" $hdpartnr $options
if [ $? -ne 0 ]; then
echo "Mount of partition $hdpartnr on ${mountpoint} failed with exit code: $?"
[ -d "${mountpoint}" ] && rm -r "${mountpoint}"
@@ -210,4 +218,6 @@ if [ "$HAVE_SWAP" = "no" ]; then
slxlog "partition-swap" "Have no (formatted) swap partition, using zram swap only!" "/etc/disk.partition"
fi
+set +xv
+
exit 0
diff --git a/server/modules/partitioner/opt/openslx/scripts/partitioner b/server/modules/partitioner/opt/openslx/scripts/partitioner
index 23e90b18..03e089c4 100755
--- a/server/modules/partitioner/opt/openslx/scripts/partitioner
+++ b/server/modules/partitioner/opt/openslx/scripts/partitioner
@@ -93,7 +93,7 @@ for PARTITION in $SLX_PARTITION_TABLE; do
if [ -n $3 ]; then
PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/mountpoint"]=$3
fi
- if [ -n "$4" ]; then
+ if [ "$4" = "bootable" ]; then
PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/bootable"]=1
else
PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/bootable"]=0