aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-29 23:45:35 +0300
committerCem Keylan <cem@ckyln.com>2020-05-29 23:45:35 +0300
commit2530a97b3c5863c8e8e002dcd489f4404c319cbd (patch)
tree65d23f31b01ea4c3e6e1237c8442c529ec97404e
parentb4c73dae057e9d688f258eb353810434f7d64365 (diff)
downloadrepository-2530a97b3c5863c8e8e002dcd489f4404c319cbd.tar.gz
baselayout: merge i686 and drop the usage of 'install'
-rwxr-xr-xcore/baselayout/build59
-rwxr-xr-xi686/baselayout/build58
l---------i686/baselayout/checksums1
l---------i686/baselayout/depends1
l---------i686/baselayout/files1
l---------i686/baselayout/sources1
l---------i686/baselayout/version1
7 files changed, 36 insertions, 86 deletions
diff --git a/core/baselayout/build b/core/baselayout/build
index 91aff2ca..b94b05be 100755
--- a/core/baselayout/build
+++ b/core/baselayout/build
@@ -1,23 +1,34 @@
#!/bin/sh -e
+# All directories are created sequentially, so we can ignore 'mkdir -pm' here.
+# shellcheck disable=2174
+
+# The fallback is for backwards compatibility, this will be dropped later.
+sys_arch=${3:-$(uname -m)}
+
+kinstall_t() {
+ mod=$1 dir=$2; mkdir -p "$2"
+ shift 2
+ for file do cp "$file" "$dir"; chmod "$mod" "$file"; done
+}
# Setup base directories.
for d in boot dev etc home mnt usr var opt run; do
- install -dm 755 "$1/$d"
+ mkdir -pm 755 "$1/$d"
done
-install -dm 555 "$1/proc"
-install -dm 555 "$1/sys"
-install -dm 0750 "$1/root"
-install -dm 1777 "$1/tmp"
+mkdir -pm 555 "$1/proc"
+mkdir -pm 555 "$1/sys"
+mkdir -pm 0750 "$1/root"
+mkdir -pm 1777 "$1/tmp"
# Setup /usr hierarchy.
-for d in bin include lib lib32 share src; do
- install -d -m755 "$1"/usr/"$d"
+for d in bin include lib lib32 local share share/man src; do
+ mkdir -pm 755 "$1/usr/$d"
done
# Setup manpages directories.
for d in 1 2 3 4 5 6 7 8; do
- install -dm 755 "$1/usr/share/man/man$d"
+ mkdir -pm 755 "$1/usr/share/man/man$d"
done
# Add symlinks.
@@ -25,16 +36,23 @@ ln -s usr/bin "$1/bin"
ln -s usr/bin "$1/sbin"
ln -s bin "$1/usr/sbin"
ln -s usr/lib "$1/lib"
-ln -s usr/lib "$1/lib64"
-ln -s lib "$1/usr/lib64"
+
+# Unless we are on i*86, create lib64 symlinks. Obviously, i*86
+# is not the only 32-bit architecture, but it is currently the
+# only supported one.
+[ "${sys_arch#i?86}" ] && {
+ ln -s usr/lib "$1/lib64"
+ ln -s lib "$1/usr/lib64"
+}
# Setup /var.
-for d in cache local opt log/old lib/misc empty service; do
- install -dm 755 "$1/var/$d"
+for d in cache local opt log log/old lib lib/misc empty service; do
+ mkdir -pm 755 "$1/var/$d"
done
-install -dm 1777 "$1/var/tmp"
-install -dm 1777 "$1/var/spool/mail"
+for d in tmp spool spool/mail; do
+ mkdir -pm 1777 "$1/var/$d"
+done
ln -s spool/mail "$1/var/mail"
ln -s ../run "$1/var/run"
@@ -42,19 +60,14 @@ ln -s ../run/lock "$1/var/lock"
# Setup /usr/local (usually for any programs installed outside package manager).
for d in bin etc games include lib man sbin share src; do
- install -dm 755 "$1/usr/local/$d"
+ mkdir -pm 755 "$1/usr/local/$d"
done
ln -s ../man "$1/usr/local/share/man"
# /etc skeleton files.
-for f in fstab group host.conf hosts issue keymap os-release \
- passwd profile securetty shells mime.types; do
- install -m 644 "$f" "$1/etc"
-done
-
-for f in crypttab shadow; do
- install -m 600 "$f" "$1/etc"
-done
+kinstall_t 644 "$1/etc" fstab group host.conf hosts issue keymap os-release \
+ passwd profile securetty shells mime.types
+kinstall_t 600 "$1/etc" crypttab shadow
ln -s /proc/self/mounts "$1/etc/mtab"
diff --git a/i686/baselayout/build b/i686/baselayout/build
deleted file mode 100755
index d55fcefa..00000000
--- a/i686/baselayout/build
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh -e
-
-# Setup base directories.
-for d in boot dev etc home mnt usr var opt run; do
- install -dm 755 "$1/$d"
-done
-
-install -dm 555 "$1/proc"
-install -dm 555 "$1/sys"
-install -dm 0750 "$1/root"
-install -dm 1777 "$1/tmp"
-
-# Setup /usr hierarchy.
-for d in bin include lib lib32 share src; do
- install -d -m755 "$1"/usr/"$d"
-done
-
-# Setup manpages directories.
-for d in 1 2 3 4 5 6 7 8; do
- install -dm 755 "$1/usr/share/man/man$d"
-done
-
-# Add symlinks.
-ln -s usr/bin "$1/bin"
-ln -s usr/bin "$1/sbin"
-ln -s bin "$1/usr/sbin"
-ln -s usr/lib "$1/lib"
-
-# Setup /var.
-for d in cache local opt log/old lib/misc empty service; do
- install -dm 755 "$1/var/$d"
-done
-
-install -dm 1777 "$1/var/tmp"
-install -dm 1777 "$1/var/spool/mail"
-
-ln -s spool/mail "$1/var/mail"
-ln -s ../run "$1/var/run"
-ln -s ../run/lock "$1/var/lock"
-
-# Setup /usr/local (usually for any programs installed outside package manager).
-for d in bin etc games include lib man sbin share src; do
- install -dm 755 "$1/usr/local/$d"
-done
-
-ln -s ../man "$1/usr/local/share/man"
-
-# /etc skeleton files.
-for f in fstab group host.conf hosts issue keymap os-release \
- passwd profile securetty shells mime.types; do
- install -m 644 "$f" "$1/etc"
-done
-
-for f in crypttab shadow; do
- install -m 600 "$f" "$1/etc"
-done
-
-ln -s /proc/self/mounts "$1/etc/mtab"
diff --git a/i686/baselayout/checksums b/i686/baselayout/checksums
deleted file mode 120000
index 3eb1cec0..00000000
--- a/i686/baselayout/checksums
+++ /dev/null
@@ -1 +0,0 @@
-../../core/baselayout/checksums \ No newline at end of file
diff --git a/i686/baselayout/depends b/i686/baselayout/depends
deleted file mode 120000
index 043fe746..00000000
--- a/i686/baselayout/depends
+++ /dev/null
@@ -1 +0,0 @@
-../../core/baselayout/depends \ No newline at end of file
diff --git a/i686/baselayout/files b/i686/baselayout/files
deleted file mode 120000
index d86c4847..00000000
--- a/i686/baselayout/files
+++ /dev/null
@@ -1 +0,0 @@
-../../core/baselayout/files \ No newline at end of file
diff --git a/i686/baselayout/sources b/i686/baselayout/sources
deleted file mode 120000
index fec74193..00000000
--- a/i686/baselayout/sources
+++ /dev/null
@@ -1 +0,0 @@
-../../core/baselayout/sources \ No newline at end of file
diff --git a/i686/baselayout/version b/i686/baselayout/version
deleted file mode 120000
index e5ba997a..00000000
--- a/i686/baselayout/version
+++ /dev/null
@@ -1 +0,0 @@
-../../core/baselayout/version \ No newline at end of file