Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • 66-service/arch/boot-user
  • 66-service/debian/66-service-boot-user
2 results
Show changes
[Main]
Type = oneshot
Version = %%version%%
Description = "Mount /run/user directory of user @I"
User = ( root )
[Start]
Execute =
(
if { 66-yeller -p mount-run@@I starts... }
if -nt {
execl-subuidgid -o @I
execl-toc -X -m /run/user/${UID} -o noatime,nodev,nosuid,gid=${GID},uid=${UID},mode=0700,size=64M -t tmpfs -d user
}
66-yeller -fp mount-run@@I crashed!
)
package=boot-user
version=0.8.0
package_macro_dir=66
configure 0755
.xsession 0755
.xinitrc 0755
seed 0644
\ No newline at end of file
SCRIPT_TARGET := \
module/configure/configure \
module/configure/.xinitrc \
module/configure/.xsession
MODULE_TARGET := $(shell find module/ -type f)
SEED_TARGET := module/configure/session
#!/usr/bin/bash
# Copyright (c) 2015-2019 Eric Vidal <eric@obarun.org>
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
PROG="66-mods.sh"
service_system="${service_system:-/usr/lib/66/service}"
module_system="${module_system:-/usr/lib/66/module}"
force=0
out() {
msg="${1}"
66-echo -- $PROG: $msg
}
die() {
out "${1}"
exit 111
}
usage () {
cat <<EOF
$PROG [ -h ] [ -H ] [ -f ] module@instance
$PROG <options> modules@instance
options :
-h: print this help
-H: print module help
-f: force to overwrite an existing module
EOF
exit 0
}
for arg ; do
case "$arg" in
-h|--help) usage ;;
-H|--help-module) hm=1 ;;
-f|--force) force=1 ;;
-*) die "fatal: unknown option $arg" ;;
*) target+=( $arg ) ;;
esac
done
if [[ "${target[0]}" != *"@"* ]];then
die "fatal: invalid argument -- not a module name"
fi
mod="${target[0]}"
mod="${mod%%@*}"
mod_name="${mod}"
mod="${mod%%@*}@"
insta="${target[0]}"
insta="${insta##*@}"
mod_name="${mod_name}${insta}"
if [[ ! -d ${module_system}/${mod} ]]; then
die "fatal: module ${mod} doesn't exist"
fi
if (( ${hm} )); then
if [[ -e ${module_system}/${mod}/.configure/help ]]; then
h=$(<${module_system}/${mod}/.configure/help)
66-echo -- "${h}"
else
out "warning: no help found for ${mod}"
fi
exit 0
fi
if [[ -z "${insta}" ]];then
die "fatal: instance for ${mod} is not set"
fi
if [[ -d ${service_system}/${mod_name} ]]; then
if (( !$force )) ; then
die "fatal: ${service_system}/${mod_name} already exist"
else
rm -rf ${service_system}/${mod_name} || die "fatal: unable to remove ${service_system}/${mod_name}"
fi
fi
cp -rT ${module_system}/${mod} ${service_system}/${mod_name} || die "fatal: unable to cp ${module_system}/${mod} to ${service_system}/${mod_name}"
## @MOD@ in file
for i in $(find ${service_system}/${mod_name} -mindepth 1 -type f);do
sed -i "s:@MOD@:${insta}:g" $i || die "fatal: unable to sed ${i}"
done
## change directory name
for i in $(find ${service_system}/${mod_name} -mindepth 1 -type d|grep -v "configure");do
mv $i $(66-echo -- ${i}|sed "s:@MOD@:${insta}:g") || die "fatal: unable to move ${i} to $(echo ${i}|sed "s:@MOD@:${insta}:g")"
done
## change file name
for i in $(find ${service_system}/${mod_name} -mindepth 1 -type f|grep -v "configure");do
mv $i $(66-echo -- ${i}|sed "s:@MOD@:${insta}:g") || die "fatal: unable to move ${i} to $(echo ${i}|sed "s:@MOD@:${insta}:g")"
done
## run .configure scripts
if [[ -x ${service_system}/${mod_name}/.configure/configure ]]; then
cd ${service_system}/${mod_name}/.configure/
${service_system}/${mod_name}/.configure/configure ${insta} || die "fatal: unable to configure ${service_system}/${mod_name}"
rm -rf ${service_system}/${mod_name}/.configure || die "fatal: unable to remove ${service_system}/${mod_name}/.configure"
fi
#!/bin/sh
usage() {
echo "usage: $0 [-D] [-l] [-m mode] src dst" 1>&2
exit 1
}
mkdirp=false
symlink=false
mode=0755
while getopts Dlm: name ; do
case "$name" in
D) mkdirp=true ;;
l) symlink=true ;;
m) mode=$OPTARG ;;
?) usage ;;
esac
done
shift $(($OPTIND - 1))
test "$#" -eq 2 || usage
src=$1
dst=$2
tmp="$dst.tmp.$$"
case "$dst" in
*/) echo "$0: $dst ends in /" 1>&2 ; exit 1 ;;
esac
set -C
set -e
if $mkdirp ; then
umask 022
case "$2" in
*/*) mkdir -p "${dst%/*}" ;;
esac
fi
trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
umask 077
if $symlink ; then
ln -s "$src" "$tmp"
else
cat < "$1" > "$tmp"
chmod "$mode" "$tmp"
fi
mv -f "$tmp" "$dst"
if test -d "$dst" ; then
rm -f "$dst/$(basename $tmp)"
if $symlink ; then
mkdir "$tmp"
ln -s "$src" "$tmp/$(basename $dst)"
mv -f "$tmp/$(basename $dst)" "${dst%/*}"
rmdir "$tmp"
else
echo "$0: $dst is a directory" 1>&2
exit 1
fi
fi