diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-08-05 13:33:49 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-08-05 13:40:56 +0200 |
commit | ca63414b7bdc515e1de49c0269d9b4c91cc2bf00 (patch) | |
tree | 4ee5d5e03ea2954ec04f020556b6c56dcfe61f70 /main/alpine-baselayout | |
parent | 3029cb16752db39b71626f026a394da40ac1f8b7 (diff) | |
download | aports-ca63414b7bdc515e1de49c0269d9b4c91cc2bf00.zip |
main/{alpine-baselayout,openrc}: move mkmntdirs to openrc
The mkmntdirs binary is only used by openrc's localmount, whickh ensures
that all directories in /etc/fstab is created before mounting. This is
needed in tmpfs installs.
This has nothing to do with the alpine-baselayout so move it to where it
belongs.
Diffstat (limited to 'main/alpine-baselayout')
-rw-r--r-- | main/alpine-baselayout/APKBUILD | 14 | ||||
-rw-r--r-- | main/alpine-baselayout/mkmntdirs.c | 67 |
2 files changed, 4 insertions, 77 deletions
diff --git a/main/alpine-baselayout/APKBUILD b/main/alpine-baselayout/APKBUILD index a31f17c3808..58434ab806e 100644 --- a/main/alpine-baselayout/APKBUILD +++ b/main/alpine-baselayout/APKBUILD @@ -1,11 +1,11 @@ # Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=alpine-baselayout -pkgver=3.2.0 -pkgrel=23 +pkgver=3.3.0 +pkgrel=0 pkgdesc="Alpine base dir structure and init scripts" url="https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout" -arch="all" +arch="noarch" license="GPL-2.0-only" pkggroups="shadow" options="!fhs !check" @@ -14,8 +14,7 @@ subpackages="$pkgname-data" install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.post-install" _nbver=6.2 -source="mkmntdirs.c - crontab +source="crontab color_prompt.sh.disabled locale.sh @@ -41,9 +40,6 @@ prepare() { } build() { - ${CC:-${CROSS_COMPILE}gcc} $CPPFLAGS $CFLAGS $LDFLAGS \ - "$srcdir"/mkmntdirs.c -o "$builddir"/mkmntdirs - # generate shadow awk -F: '{ pw = ":!:" @@ -138,7 +134,6 @@ package() { install -d -m 0555 var/empty install -d -m 0700 "$pkgdir"/root install -d -m 1777 "$pkgdir"/tmp "$pkgdir"/var/tmp - install -m755 "$builddir"/mkmntdirs "$pkgdir"/sbin/mkmntdirs install -m600 "$srcdir"/crontab "$pkgdir"/etc/crontabs/root install -m644 \ @@ -255,7 +250,6 @@ package() { } sha512sums=" -199a34716b1f029407b08679fed4fda58384a1ccefbbec9abe1c64f4a3f7ad2a89bc7c02fc19a7f791f7c6bb87f9f0c708cb3f18c027cb7f54f25976eba4b839 mkmntdirs.c 6e169c0975a1ad1ad871a863e8ee83f053de9ad0b58d94952efa4c28a8c221445d9e9732ad8b52832a50919c2f39aa965a929b3d5b3f9e62f169e2b2e0813d82 crontab 558071efdce2fe92afe4277006235b1a6368b070337c7567e5632a1a3fe531f87ca692eb36f3dda498d4d29d1f834fc8f7139f2985669ae3400b6d103d6f4c5e color_prompt.sh.disabled b2fc9b72846a43a45ba9a8749e581cef34d1915836833b51b7919dfbf4e275b7d55fec4dea7b23df3796380910971a41331e53e8cf0d304834e3da02cc135e5a locale.sh diff --git a/main/alpine-baselayout/mkmntdirs.c b/main/alpine-baselayout/mkmntdirs.c deleted file mode 100644 index eaeae7321ef..00000000000 --- a/main/alpine-baselayout/mkmntdirs.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Create mount directories in fstab - * - * Copyright(c) 2008 Natanael Copa <natanael.copa@gmail.com> - * May be distributed under the terms of GPL-2 - * - * usage: mkmntdirs [fstab] - * - */ - -#include <sys/stat.h> -#include <sys/types.h> - -#include <err.h> -#include <mntent.h> -#include <stdio.h> -#include <string.h> - - -#ifdef DEBUG -#define mkdir_recursive(p) puts((p)) -#else -static void mkdir_recursive(char *path) -{ - char *s = path; - while (1) { - int c = '\0'; - while (*s) { - if (*s == '/') { - do { - ++s; - } while (*s == '/'); - c = *s; /* Save the current char */ - *s = '\0'; /* and replace it with nul. */ - break; - } - ++s; - } - mkdir(path, 0755); - if (c == '\0') - return; - *s = c; - } -} -#endif - -int main(int argc, const char *argv[]) -{ - const char *filename = "/etc/fstab"; - FILE *f; - struct mntent *ent; - if (argc == 2) - filename = argv[1]; - - f = setmntent(filename, "r"); - if (f == NULL) - err(1, "%s", filename); - - while ((ent = getmntent(f)) != NULL) { - if (strcmp(ent->mnt_dir, "none") != 0) - mkdir_recursive(ent->mnt_dir); - } - - endmntent(f); - return 0; -} - |