Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mkinitcpio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
obcore
mkinitcpio
Commits
c524d5ad
Commit
c524d5ad
authored
3 years ago
by
jean-michel
Browse files
Options
Downloads
Patches
Plain Diff
restore/update mkinitcpio 30-4
parent
df363a57
No related branches found
No related tags found
No related merge requests found
Pipeline
#806
passed
3 years ago
Stage: build
Stage: commit
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
trunk/PKGBUILD
+61
-54
61 additions, 54 deletions
trunk/PKGBUILD
trunk/add_udev_rule_function.patch
+50
-0
50 additions, 0 deletions
trunk/add_udev_rule_function.patch
with
111 additions
and
54 deletions
trunk/PKGBUILD
+
61
−
54
View file @
c524d5ad
# Obarun : 66 init/supervisor
# Maintainer : Eric Vidal <eric@obarun.org>
# Maintainer : Jean-Michel T.Dydak <jean-michel@obarun.org>
# Obarun PkgSrc :
url="
https://git.obarun.org/pkg/obcore/mkinitcpio
"
# Obarun PkgSrc : https://git.obarun.org/pkg/obcore/mkinitcpio
#----------------
# Maintainer :
# Contributor :
# Arch PkgSrc : url="https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/mkinitcpio/"
#----------------
# Website : https://
#----------------------------------------------------------------------------
#--DESCRIPTION---------------------------------------------------------------
#--------------------------------------------------------------
# DESCRIPTION ]
pkgname
=
mkinitcpio
pkgdesc
=
"Modular initramfs image creation utility"
pkgver
=
30
pkgrel
=
3
pkgrel
=
4
pkgdesc
=
'Modular initramfs image creation utility'
url
=
'https://github.com/archlinux/mkinitcpio'
source
=(
"https://sources.archlinux.org/other/
${
pkgname
}
/
${
pkgname
}
-
$pkgver
.tar.gz"
'001-remove-systemd-and-kept-gzip-as-default.patch'
)
#--BUILD CONFIGURATION-------------------------------------------------------
makedepends
=(
'asciidoc'
'git'
'sed'
)
#--BUILD PREPARATION---------------------------------------------------------
prepare
()
{
cd
"
$pkgname
-
$pkgver
"
# Apply 0003-remove-systemd.patch
patch
-Np1
<
$srcdir
/001-remove-systemd-and-kept-gzip-as-default.patch
}
#--BUILD---------------------------------------------------------------------
#--CHECK---------------------------------------------------------------------
check
()
{
make
-C
"
$pkgname
-
$pkgver
"
check
}
source
=(
"https://sources.archlinux.org/other/
$pkgname
/
$pkgname
-
$pkgver
.tar.gz"
'001-remove-systemd-and-kept-gzip-as-default.patch'
'add_udev_rule_function.patch'
)
#--PACKAGE-------------------------------------------------------------------
#----------------------
# BUILD CONFIGURATION ]
package
()
{
make
-C
"
${
pkgname
}
-
$pkgver
"
DESTDIR
=
"
$pkgdir
"
install
}
makedepends
=(
'asciidoc'
'git'
'sed'
)
#--INSTALL CONFIGURATION-----------------------------------------------------
#------------------------
# INSTALL CONFIGURATION ]
arch
=(
x86_64
)
install
=
mkinitcpio.install
backup
=(
'etc/mkinitcpio.conf'
)
depends
=(
'mkinitcpio-busybox>=1.19.4-2'
'kmod'
...
...
@@ -76,7 +48,8 @@ depends=(
'filesystem>=2011.10-1'
'gzip'
'lz4'
'sed'
)
'sed'
)
optdepends
=(
'xz: Use lzma or xz compression for the initramfs image'
...
...
@@ -84,13 +57,47 @@ optdepends=(
'lzop: Use lzo compression for the initramfs image'
'lz4: Use lz4 compression for the initramfs image'
'zstd: Use zstd compression for the initramfs image'
'mkinitcpio-nfs-utils: Support for root filesystem on NFS'
)
'mkinitcpio-nfs-utils: Support for root filesystem on NFS'
)
backup
=(
'etc/mkinitcpio.conf'
)
provides
=(
"mkinitcpio=
$pkgver
-
$pkgrel
"
'initramfs'
)
#----------------
# BUILD PREPARE ]
prepare
()
{
cd
$pkgname
-
$pkgver
## Apply 0003-remove-systemd.patch
patch
-Np1
<
$srcdir
/001-remove-systemd-and-kept-gzip-as-default.patch
patch
-Np1
<
$srcdir
/add_udev_rule_function.patch
provides
=(
"mkinitcpio=
${
pkgver
}
-
${
pkgrel
}
"
"initramfs"
)
}
#--------
# CHECK ]
check
()
{
make
-C
$pkgname
-
$pkgver
check
}
#----------
# PACKAGE ]
package
()
{
make
-C
$pkgname
-
$pkgver
DESTDIR
=
"
$pkgdir
"
install
}
#--SECURITY AND LICENCE------------------------------------------------------
#-------------------------
# LICENCE AND VALIDATION ]
license
=(
'
GPL
'
)
license
=(
GPL
)
sha256sums
=(
'c7725035a06d2ab6ef6e97601b69859d6061aec95c4551e2a1ad2e27d307258f'
'a7dcad6ec0a3ea32896f2ca218ea4ba1550feaed25d58ed609bfbb7f9fd03619'
)
sha512sums
=(
' '
)
This diff is collapsed.
Click to expand it.
trunk/add_udev_rule_function.patch
0 → 100644
+
50
−
0
View file @
c524d5ad
diff -Nuar -uar --color a/functions b/functions
--- a/functions 2021-02-17 13:37:31.000000000 +1100
+++ b/functions 2021-11-03 10:35:49.773891914 +1100
@@ -625,6 +625,46 @@
return 0
}
+add_udev_rule() {
+ # Add an udev rules file to the initcpio image. Dependencies on binaries
+ # will be discovered and added.
+ # $1: path to rules file (or name of rules file)
+
+ local rules="$1" rule= key= value= binary=
+
+ if [[ ${rules:0:1} != '/' ]]; then
+ rules=$(PATH=/usr/lib/udev/rules.d:/lib/udev/rules.d type -P "$1")
+ fi
+ if [[ -z $rules ]]; then
+ # complain about not found rules
+ return 1
+ fi
+
+ add_file "$rules" /usr/lib/udev/rules.d/"${rules##*/}"
+
+ while IFS=, read -ra rule; do
+ # skip empty lines, comments
+ [[ -z $rule || $rule = @(+([[:space:]])|#*) ]] && continue
+
+ for pair in "${rule[@]}"; do
+ IFS=' =' read -r key value <<< "$pair"
+ case $key in
+ RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD})
+ # strip quotes
+ binary=${value//[\"\']/}
+ # just take the first word as the binary name
+ binary=${binary%% *}
+ [[ ${binary:0:1} == '$' ]] && continue
+ if [[ ${binary:0:1} != '/' ]]; then
+ binary=$(PATH=/usr/lib/udev:/lib/udev type -P "$binary")
+ fi
+ add_binary "$binary"
+ ;;
+ esac
+ done
+ done <"$rules"
+}
+
parse_config() {
# parse key global variables set by the config file.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment