diff options
Diffstat (limited to 'remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions')
-rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions | 18 |
1 files changed, 10 insertions, 8 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 bd80890b..b18a97d5 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 @@ -58,7 +58,7 @@ diskfm () { ;; esac echo "formatting ${target} with $fs..." - mkfs.$fs ${fopt} "${target}" 2> /dev/null + mkfs.$fs ${fopt} "${target}" > /dev/null 2>&1 fi [ -n "$found" ] && break fi @@ -74,7 +74,7 @@ mount_temp () { mount $@ /tmp || return 1 chmod a+rwxt /tmp # Move stuff from working directory, which is old /tmp, to new /tmp just mounted - mv ./* ./.[!.]* ./..?* /tmp/ 2> /dev/null + mv ./* ./.[!.]* ./..?* /tmp/ > /dev/null 2>&1 local OLD=$(LANG=C ls -alh | grep -v -E ' \.\.?$' | grep -v '^total') [ -n "$OLD" ] && echo -- "Leftovers:" && echo -- "$OLD" cd "$PRE" @@ -82,7 +82,7 @@ mount_temp () { mount_temp_fallback () { mkdir -p /tmptmp - mv /tmp/* /tmp/.* /tmptmp/ 2> /dev/null + mv /tmp/* /tmp/.* /tmptmp/ > /dev/null 2>&1 mount $@ /tmp || return 1 chmod a+rwxt /tmp mv /tmptmp/* /tmptmp/.* /tmp/ @@ -95,7 +95,7 @@ mount_partition () { local partition="$2" mkdir -p "$mountpoint" - if ! blkid -s TYPE | grep "${partition}" ; then + if ! blkid -s TYPE | grep "${partition}" ; then echo "No fs found for ${partition}, formating..." diskfm "$partition" "jfs xfs ext3" || return $? mount -t auto -o noexec "$partition" "$mountpoint" || return $? @@ -130,6 +130,7 @@ read_partitions () { echo "Partitions:" cat "/etc/disk.partition" + echo "------------------------------------------------------" } # default partitions, if not specifies in config (note: size is irrelevant for setup_partitions) @@ -185,9 +186,9 @@ for PARTITION in $SLX_PARTITION_TABLE; do # Check for standard swap partitions and make them available to the system HAVE_SWAP=no for swppart in $(grep -e "82$\|0657FD6D-A4AB-43C4-84E5-0933C84B4F4F$" /etc/disk.partition | cut -d ' ' -f1); do - echo "$swppart\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab" - swapon "$swppart" -p 10 && HAVE_SWAP=yes # low priority, in case we have zram swap, prefer that) - echo "swap partition found and activated" + echo -e "$swppart\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab" + mkswap "$swppart" && swapon "$swppart" -p 10 && HAVE_SWAP=yes # low priority, in case we have zram swap, prefer that) + [ $HAVE_SWAP = "yes" ] && echo "swap partition found and activated" done ;; *) @@ -203,7 +204,7 @@ for PARTITION in $SLX_PARTITION_TABLE; do done ;; esac - + echo "------------------------------------------------------" done #Put detected linux partitions (83) into /etc/fstab with "noauto" @@ -212,6 +213,7 @@ for linuxpart in $(grep -e "83$\|0FC63DAF-8483-4772-8E79-3D69D8477DE4$" /etc/dis mkdir -p "${mountpoint}/${linuxpart#/dev/*}" echo "${linuxpart}\t${mountpoint}/${linuxpart#/dev/*}\tauto\t\tnoauto,noexec\t 0 0" >> "/etc/fstab" echo "linux partition ${linuxpart} mounted on ${mountpoint}/${linuxpart#/dev/*}" + echo "------------------------------------------------------" done mount -a |