Skip to content

Commit 6ab0ae8

Browse files
Adapt stage2.sh for structure changes
1 parent 7b1a2ec commit 6ab0ae8

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

stage2.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,40 @@ if [ $EUID -ne 0 ]; then
88
exit 1
99
fi
1010
# Setup the environment.
11-
export MASSOS=$PWD/massos-rootfs
11+
export MASSOS="$PWD"/massos-rootfs
1212
# Ensure stage1 has been run first.
13-
if [ ! -d $MASSOS ]; then
13+
if [ ! -d "$MASSOS" ]; then
1414
echo "Error: You must run stage1.sh first!" >&2
1515
exit 1
1616
fi
1717
# Ensure the MassOS environment is owned by root.
18-
chown -R root:root $MASSOS
18+
chown -R root:root "$MASSOS"
1919
# Create pseudo-filesystem mount directories.
20-
mkdir -p $MASSOS/{dev,proc,sys,run}
20+
mkdir -p "$MASSOS"/{dev,proc,sys,run}
2121
# Initialise /dev/console and /dev/null.
22-
mknod -m 600 $MASSOS/dev/console c 5 1
23-
mknod -m 666 $MASSOS/dev/null c 1 3
22+
mknod -m 600 "$MASSOS"/dev/console c 5 1
23+
mknod -m 666 "$MASSOS"/dev/null c 1 3
2424
# Chroot into the MassOS environment and continue the build.
25-
utils/mass-chroot massos-rootfs /sources/build-system.sh
25+
utils/programs/mass-chroot "$MASSOS" /sources/build-system.sh
2626
# Strip executables and libraries to free up space.
2727
printf "Stripping binaries... "
28-
find $MASSOS/usr/{bin,libexec,sbin} -type f -exec strip --strip-all {} ';' &> /dev/null || true
28+
find "$MASSOS"/usr/{bin,libexec,sbin} -type f -exec strip --strip-all {} ';' &> /dev/null || true
2929
echo "Done!"
3030
printf "Stripping libraries... "
31-
find $MASSOS/usr/lib -type f -name \*.a -exec strip --strip-debug {} ';' &> /dev/null || true
32-
find $MASSOS/usr/lib -type f -name \*.so\* -exec strip --strip-unneeded {} ';' &> /dev/null || true
31+
find "$MASSOS"/usr/lib -type f -name \*.a -exec strip --strip-debug {} ';' &> /dev/null || true
32+
find "$MASSOS"/usr/lib -type f -name \*.so\* -exec strip --strip-unneeded {} ';' &> /dev/null || true
3333
echo "Done!"
3434
# Finish the MassOS system.
3535
outfile="massos-$(cat utils/massos-release)-rootfs-x86_64.tar"
3636
printf "Creating $outfile... "
37-
cd $MASSOS
38-
tar -cpf ../$outfile *
37+
cd "$MASSOS"
38+
tar -cpf ../"$outfile" *
3939
cd ..
4040
echo "Done!"
4141
echo "Compressing $outfile with XZ (using $(nproc) threads)..."
42-
xz -v --threads=$(nproc) $outfile
42+
xz -v --threads=$(nproc) "$outfile"
4343
echo "Successfully created $outfile.xz."
44-
printf "SHA256: "
44+
printf "SHA256 checksum: "
4545
sha256sum $outfile.xz | sed "s/ $outfile.xz//"
4646
# Clean up.
4747
rm -rf $MASSOS

0 commit comments

Comments
 (0)