Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
e74a3b7f
Commit
e74a3b7f
authored
Mar 04, 2020
by
Marcus Nordenberg
Committed by
Esteban Blanc
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pkg: fixed some issues with the pwrsev package
(cherry picked from commit 2324d74bbcc0fdb4adbd5245a806b16ccde227a9)
parent
ab1e6d83
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
214 deletions
+102
-214
src/tools/pkg/deb_x86_64/pwrsev/build.sh
src/tools/pkg/deb_x86_64/pwrsev/build.sh
+2
-0
src/tools/pkg/deb_x86_64/pwrsev/postinst
src/tools/pkg/deb_x86_64/pwrsev/postinst
+65
-117
src/tools/pkg/deb_x86_64/pwrsev/postrm
src/tools/pkg/deb_x86_64/pwrsev/postrm
+11
-0
src/tools/pkg/deb_x86_64/pwrsev/prerm
src/tools/pkg/deb_x86_64/pwrsev/prerm
+23
-96
src/tools/pkg/deb_x86_64/pwrsev/pwrp_profile
src/tools/pkg/deb_x86_64/pwrsev/pwrp_profile
+1
-1
No files found.
src/tools/pkg/deb_x86_64/pwrsev/build.sh
View file @
e74a3b7f
...
@@ -108,8 +108,10 @@ find $pkgroot -type d | xargs chmod 755
...
@@ -108,8 +108,10 @@ find $pkgroot -type d | xargs chmod 755
cp
$pkgsrc
/control
$pkgroot
/DEBIAN
cp
$pkgsrc
/control
$pkgroot
/DEBIAN
cp
$pkgsrc
/postinst
$pkgroot
/DEBIAN
cp
$pkgsrc
/postinst
$pkgroot
/DEBIAN
cp
$pkgsrc
/prerm
$pkgroot
/DEBIAN
cp
$pkgsrc
/prerm
$pkgroot
/DEBIAN
cp
$pkgsrc
/postrm
$pkgroot
/DEBIAN
chmod
755
$pkgroot
/DEBIAN/postinst
chmod
755
$pkgroot
/DEBIAN/postinst
chmod
755
$pkgroot
/DEBIAN/prerm
chmod
755
$pkgroot
/DEBIAN/prerm
chmod
755
$pkgroot
/DEBIAN/postrm
chmod
644
$pkgroot
/DEBIAN/control
chmod
644
$pkgroot
/DEBIAN/control
# copyright
# copyright
...
...
src/tools/pkg/deb_x86_64/pwrsev/postinst
View file @
e74a3b7f
...
@@ -16,158 +16,122 @@ proot="/pwrp"
...
@@ -16,158 +16,122 @@ proot="/pwrp"
aroot
=
"/usr/pwrp/adm"
aroot
=
"/usr/pwrp/adm"
# Create users...
# Create users...
new_user
=
0
echo
"-- Creating users/groups..."
if
getent group pwrp
>
/dev/null
;
then
for
grp
in
pwrp b55 b66 skiftel
;
do
echo
"-- group pwrp already exist"
if
getent group
${
grp
}
>
/dev/null
;
then
else
echo
"-- Group
${
grp
}
already exist. OK!"
if
groupadd pwrp
;
then
else
echo
"-- group pwrp added"
if
groupadd
${
grp
}
;
then
fi
echo
"-- Group
${
grp
}
added..."
fi
fi
if
getent group b55
>
/dev/null
;
then
echo
"-- group b55 already exist"
else
if
groupadd b55
;
then
echo
"-- group b55 added"
fi
fi
if
getent group b66
>
/dev/null
;
then
echo
"-- group b66 already exist"
else
if
groupadd b66
;
then
echo
"-- group b66 added"
fi
fi
fi
done
if
getent group skiftel
>
/dev/null
;
then
# Do we have a pwrp user already?
echo
"-- group skiftel already exist"
if
getent passwd pwrp
>
/dev/null
;
then
echo
"-- User pwrp already exist. OK!"
else
else
if
groupadd skiftel
;
then
if
useradd
--create-home
--shell
/bin/bash
--password
aaupl/kQs1p3U
--gid
pwrp
--groups
b55,b66,skiftel
--home-dir
/home/pwrp pwrp
;
then
echo
"--
group skiftel added
"
echo
"--
User pwrp added...
"
fi
fi
fi
# If all went well we copy proview specific startup scripts to the home folder
if
getent passwd pwrp
>
/dev/null
;
then
if
[
-e
/home/pwrp
]
;
then
echo
"-- user pwrp already exist"
else
new_user
=
1
if
useradd
-s
/bin/bash
-p
aaupl/kQs1p3U
-g
pwrp
-G
b55,b66,skiftel
-d
/home/pwrp pwrp
;
then
echo
"-- user pwrp added"
fi
if
[
!
-e
/home/pwrp
]
;
then
mkdir
/home/pwrp
cp
/usr/pwrsev/cnf/user/.bashrc /home/pwrp
cp
/usr/pwrsev/cnf/user/.bash_profile /home/pwrp
# cp /usr/pwrsev/cnf/user/.mwmrc /home/pwrp
cp
/usr/pwrsev/cnf/user/.rtt_start /home/pwrp
cp
/usr/pwrsev/cnf/user/.rtt_start /home/pwrp
chmod
a+x /home/pwrp/.rtt_start
chmod
a+x /home/pwrp/.rtt_start
cp
/usr/pwrsev/cnf/user/.xtt_start /home/pwrp
cp
/usr/pwrsev/cnf/user/.xtt_start /home/pwrp
chmod
a+x /home/pwrp/.xtt_start
chmod
a+x /home/pwrp/.xtt_start
# cp /usr/pwrsev/cnf/user/.xsession /home/pwrp
chown
-R
pwrp /home/pwrp
chgrp
-R
pwrp /home/pwrp
fi
fi
# Add to group dialout
# Add
pwrp
to group dialout
if
getent group dialout
>
/dev/null
;
then
if
getent group dialout
>
/dev/null
;
then
usermod
-a
-G
dialout pwrp
usermod
-a
-G
dialout pwrp
&&
echo
"-- User 'pwrp' added to group 'dialout'..."
||
echo
"-- Unable to add user 'pwrp' to group 'dialout'!"
fi
fi
fi
fi
if
getent passwd skiftel
>
/dev/null
;
then
if
getent passwd skiftel
>
/dev/null
;
then
echo
"--
user skiftel already exist
"
echo
"--
User skiftel already exist. OK!
"
else
else
new_user
=
1
if
useradd
--create-home
--shell
/bin/bash
--password
aa6NzxS/aBgP6
--gid
skiftel
--groups
pwrp
--home-dir
/home/skiftel skiftel
;
then
echo
"-- User skiftel added..."
if
useradd
-s
/bin/bash
-p
aa6NzxS/aBgP6
-g
skiftel
-G
pwrp
-d
/home/skiftel skiftel
;
then
echo
"-- user skiftel added"
fi
fi
if
[
!
-e
/home/skiftel
]
;
then
# If all went well we copy proview specific startup scripts to the home folder
mkdir
/home/skiftel
if
[
-e
/home/skiftel
]
;
then
cp
/usr/pwrsev/cnf/user/.bashrc /home/skiftel
cp
/usr/pwrsev/cnf/user/.bash_profile /home/skiftel
# cp /usr/pwrsev/cnf/user/.mwmrc /home/skiftel
cp
/usr/pwrsev/cnf/user/.rtt_start /home/skiftel
cp
/usr/pwrsev/cnf/user/.rtt_start /home/skiftel
chmod
a+x /home/skiftel/.rtt_start
chmod
a+x /home/skiftel/.rtt_start
cp
/usr/pwrsev/cnf/user/.xtt_start /home/skiftel
cp
/usr/pwrsev/cnf/user/.xtt_start /home/skiftel
chmod
a+x /home/skiftel/.xtt_start
chmod
a+x /home/skiftel/.xtt_start
# cp /usr/pwrsev/cnf/user/.xsession /home/skiftel
chown
-R
pwrp /home/skiftel
# And change group ownership of skiftel's home folder to pwrp
chgrp
-R
pwrp /home/skiftel
chgrp
-R
pwrp /home/skiftel
fi
fi
fi
fi
if
getent passwd b55
>
/dev/null
;
then
# Setup the operator group memberships
new_user
=
1
groups
=
"pwrp"
getent group audio
>
/dev/null
&&
groups
+
=
",audio"
# Check if group audio exist
# Add the user b55
if
getent group audio
>
/dev/null
;
then
if
getent passwd b55
>
/dev/null
;
then
groups
=
"pwrp,audio"
echo
"-- User b55 already exist. OK!"
else
else
groups
=
"pwrp"
if
useradd
--create-home
--shell
/bin/bash
--password
aaQPClsglxJP6
--gid
b55
--groups
$groups
--home-dir
/home/b55 b55
;
then
echo
"-- User b55 added..."
fi
fi
if
useradd
-s
/bin/bash
-p
aaQPClsglxJP6
-g
b55
-G
$groups
-d
/home/b55 b55
;
then
if
[
-e
/home/b55
]
;
then
echo
"-- user b55 added"
fi
if
[
!
-e
/home/b55
]
;
then
mkdir
/home/b55
cp
/usr/pwrsev/cnf/op/.bashrc /home/b55
cp
/usr/pwrsev/cnf/op/.bash_profile /home/b55
# cp /usr/pwrsev/cnf/op/.mwmrc /home/b55
cp
/usr/pwrsev/cnf/op/.rtt_start /home/b55
cp
/usr/pwrsev/cnf/op/.rtt_start /home/b55
chmod
a+x /home/b55/.rtt_start
chmod
a+x /home/b55/.rtt_start
cp
/usr/pwrsev/cnf/op/.xtt_start /home/b55
cp
/usr/pwrsev/cnf/op/.xtt_start /home/b55
chmod
a+x /home/b55/.xtt_start
chmod
a+x /home/b55/.xtt_start
# cp /usr/pwrsev/cnf/op/.xsession /home/b55
chown
-R
b55 /home/b55
chown
-R
b55 /home/b55
chgrp
-R
pwrp /home/b55
chgrp
-R
pwrp /home/b55
chmod
g+rw
x
/home/b55
chmod
g+rw
s
/home/b55
fi
fi
fi
fi
if
getent passwd b66
>
/dev/null
;
then
# Add the user b66
new_user
=
1
if
getent passwd b66
>
/dev/null
;
then
echo
"-- User b66 already exist. OK!"
# Check if group audio exist
else
if
getent group audio
>
/dev/null
;
then
if
useradd
--create-home
--shell
/bin/bash
--password
1P4JdWA5HqSMQ
--gid
b66
--groups
$groups
--home-dir
/home/b66 b66
;
then
groups
=
"pwrp,audio"
echo
"-- User b66 added..."
else
groups
=
"pwrp"
fi
fi
if
useradd
-s
/bin/bash
-p
aae.nHgHbfUpw
-g
b66
-G
$groups
-d
/home/b66 b66
;
then
if
[
-e
/home/b66
]
;
then
echo
"-- user b66 added"
fi
if
[
!
-e
/home/b66
]
;
then
mkdir
/home/b66
cp
/usr/pwrsev/cnf/op/.bashrc /home/b66
cp
/usr/pwrsev/cnf/op/.bash_profile /home/b66
# cp /usr/pwrsev/cnf/op/.mwmrc /home/b66
cp
/usr/pwrsev/cnf/op/.rtt_start /home/b66
cp
/usr/pwrsev/cnf/op/.rtt_start /home/b66
chmod
a+x /home/b
66
/.rtt_start
chmod
a+x /home/b
55
/.rtt_start
cp
/usr/pwrsev/cnf/op/.xtt_start /home/b66
cp
/usr/pwrsev/cnf/op/.xtt_start /home/b66
chmod
a+x /home/b66/.xtt_start
chmod
a+x /home/b55/.xtt_start
# cp /usr/pwrsev/cnf/op/.xsession /home/b66
chown
-R
b66 /home/b66
chown
-R
b66 /home/b66
chgrp
-R
pwrp /home/b66
chgrp
-R
pwrp /home/b66
chmod
g+rw
x
/home/b66
chmod
g+rw
s
/home/b66
fi
fi
fi
fi
chown
-R
pwrp /usr/pwrsev
chown
-R
pwrp /usr/pwrsev
chgrp
-R
pwrp /usr/pwrsev
chgrp
-R
pwrp /usr/pwrsev
chmod
u+s /usr/pwrsev/exe/sev_ini
setcap cap_net_admin,cap_net_raw,cap_net_broadcast+eip /usr/pwrsev/exe/sev_ini
# Source pwrp_profile in login shells
if
[
!
-e
/etc/profile/pwrp_profile.sh
]
;
then
# profile.d should always exist on a modern debian system. BUT if it doesn't we create it :)
if
[
!
-e
/etc/profile.d
]
;
then
mkdir
/etc/profile.d
;
fi
echo
"[[ -e /etc/pwrp_profile ]] && . /etc/pwrp_profile"
>
/etc/profile.d/pwrp_profile.sh
fi
# Source pwrp_profile from both profile and bash.bashrc
# for cnf_file in /etc/profile /etc/bash.bashrc; do
# if ! grep -q "/etc/pwrp_profile\b" ${cnf_file}; then
# cat >> ${cnf_file} <<-EOF
# [[ -e /etc/pwrp_profile ]] && . /etc/pwrp_profile
# EOF
# fi
# done
# Copy configuration files
# Copy configuration files
new_cnf
=
0
new_cnf
=
0
...
@@ -176,15 +140,6 @@ if [ ! -e /etc/proview.cnf ]; then
...
@@ -176,15 +140,6 @@ if [ ! -e /etc/proview.cnf ]; then
new_cnf
=
1
new_cnf
=
1
fi
fi
# Add pwrp_profile to profile
if
!
grep
-q
"/etc/pwrp_profile
\b
"
/etc/profile
;
then
cat
>>
/etc/profile
<<-
EOF
if [ -e /etc/pwrp_profile ]; then
source /etc/pwrp_profile
fi
EOF
fi
# Create startup link
# Create startup link
set
+e
set
+e
checklink
=
`
eval ls
/etc/rc2.d/S90pwrsev 2>/dev/null
`
checklink
=
`
eval ls
/etc/rc2.d/S90pwrsev 2>/dev/null
`
...
@@ -226,16 +181,13 @@ fi
...
@@ -226,16 +181,13 @@ fi
#
#
changes
=
0
changes
=
0
if
[
$new_user
-eq
1
]
;
then
if
[
$new_cnf
-eq
1
]
;
then
changes
=
1
elif
[
$new_cnf
-eq
1
]
;
then
changes
=
1
changes
=
1
elif
[
$new_project
-eq
1
]
;
then
elif
[
$new_project
-eq
1
]
;
then
changes
=
1
changes
=
1
fi
fi
if
[
$changes
-ne
0
]
;
then
if
[
$changes
-ne
0
]
;
then
echo
""
echo
""
echo
""
echo
"***********************************************************"
echo
"***********************************************************"
echo
" Don't forget to do this :"
echo
" Don't forget to do this :"
...
@@ -246,10 +198,6 @@ if [ $new_cnf -eq 1 ]; then
...
@@ -246,10 +198,6 @@ if [ $new_cnf -eq 1 ]; then
echo
"-- Enter QcomBusId in /etc/proview.cnf"
echo
"-- Enter QcomBusId in /etc/proview.cnf"
fi
fi
#if [ $new_user -eq 1 ]; then
# echo "-- Enter OpPlace object as argument to rt_xtt in /home/b55/.xtt_start"
#fi
if
[
$new_project
-eq
1
]
;
then
if
[
$new_project
-eq
1
]
;
then
nodename
=
`
eval uname
-n
`
nodename
=
`
eval uname
-n
`
echo
"-- Distribute project to
$nodename
"
echo
"-- Distribute project to
$nodename
"
...
...
src/tools/pkg/deb_x86_64/pwrsev/postrm
0 → 100755
View file @
e74a3b7f
#!/bin/sh
set
-e
# Remove proview.cnf if we are purging
if
[
"
$1
"
=
"purge"
-a
-e
/etc/proview.cnf
]
;
then
rm
/etc/proview.cnf
echo
"-- Purged /etc/proview.cnf"
fi
if
[
-e
/etc/profile.d/pwrp_profile.sh
]
;
then
rm
/etc/profile.d/pwrp_profile.sh
;
fi
src/tools/pkg/deb_x86_64/pwrsev/prerm
View file @
e74a3b7f
...
@@ -8,102 +8,29 @@ fi
...
@@ -8,102 +8,29 @@ fi
# End automatically added section
# End automatically added section
proot
=
"/pwrp"
proot
=
"/pwrp"
aroot
=
"/usr/pwrp/adm"
aroot
=
"/usr/pwrp"
echo
""
if
[
!
"
$1
"
=
"upgrade"
]
;
then
echo
-n
"Do you wan't to remove project and users (y/n) [n] "
echo
""
read
remove_all
echo
-n
"Do you want to remove project and users (y/n) [n] "
read
remove_all
if
[
"
$remove_all
"
=
"y"
]
;
then
if
[
"
$remove_all
"
=
"y"
]
;
then
# Check that any user that is to be remoted isn't logged in
for
user
in
pwrp skiftel b55 b66
;
do
set
+e
getent passwd
${
user
}
>
/dev/null 2>&1
&&
userdel
-rf
${
user
}
2>/dev/null
user_found
=
0
echo
"-- Removed user
${
user
}
"
currentusers
=
`
eval users
`
done
userstr
=
""
for
grp
in
pwrp skiftel b55 b66
;
do
checkuser
=
`
eval echo
$currentusers
|
grep
"
\b
b55
\b
"
`
getent group
${
grp
}
>
/dev/null 2>&1
&&
groupdel
${
grp
}
if
[
"
$checkuser
"
!=
""
]
;
then
echo
"-- Removed group
${
grp
}
"
user_found
=
1
done
userstr
=
$userstr
" b55"
echo
"-- Removing projects..."
fi
if
[
-e
$proot
]
;
then
checkuser
=
`
eval echo
$currentusers
|
grep
"
\b
b66
\b
"
`
rm
-r
$proot
&&
echo
"-- Removed project
$proot
"
if
[
"
$checkuser
"
!=
""
]
;
then
fi
user_found
=
1
if
[
-e
$aroot
]
;
then
userstr
=
$userstr
" b66"
rm
-r
$aroot
&&
echo
"-- Removed admin directory
$aroot
"
fi
fi
checkuser
=
`
eval echo
$currentusers
|
grep
"
\b
pwrp
\b
"
`
if
[
"
$checkuser
"
!=
""
]
;
then
user_found
=
1
userstr
=
$userstr
" pwrp"
fi
checkuser
=
`
eval echo
$currentusers
|
grep
"
\b
skiftel
\b
"
`
if
[
"
$checkuser
"
!=
""
]
;
then
user_found
=
1
userstr
=
$userstr
" skiftel"
fi
if
[
$user_found
-eq
1
]
;
then
echo
"-- Current users:
$currentusers
"
echo
"** Remove user will fail. Logout user
$userstr
first."
exit
-1
;
fi
set
-e
echo
"-- Remove user b55"
if
grep
-q
"
\b
b55:"
/etc/passwd
;
then
userdel b55
fi
if
[
-e
/home/b55
]
;
then
rm
-r
/home/b55
fi
echo
"-- Remove user b66"
if
grep
-q
"
\b
b66:"
/etc/passwd
;
then
userdel b66
fi
if
[
-e
/home/b66
]
;
then
rm
-r
/home/b66
fi
echo
"-- Remove user pwrp"
if
grep
-q
"
\b
pwrp:"
/etc/passwd
;
then
userdel pwrp
fi
if
[
-e
/home/pwrp
]
;
then
rm
-r
/home/pwrp
fi
echo
"-- Remove user skiftel"
if
grep
-q
"
\b
skiftel:"
/etc/passwd
;
then
userdel skiftel
fi
if
[
-e
/home/skiftel
]
;
then
rm
-r
/home/skiftel
fi
if
grep
-q
"
\b
b55:"
/etc/group
;
then
groupdel b55
fi
if
grep
-q
"
\b
b66:"
/etc/group
;
then
groupdel b66
fi
if
grep
-q
"
\b
pwrp:"
/etc/group
;
then
groupdel pwrp
fi
if
grep
-q
"
\b
skiftel:"
/etc/group
;
then
groupdel skiftel
fi
echo
"-- Remove project
$proot
"
if
[
-e
$proot
]
;
then
rm
-r
$proot
fi
if
[
-e
$aroot
]
;
then
rm
-r
$aroot
fi
fi
fi
fi
...
...
src/tools/pkg/deb_x86_64/pwrsev/pwrp_profile
View file @
e74a3b7f
...
@@ -63,7 +63,7 @@ fi
...
@@ -63,7 +63,7 @@ fi
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrs
ve
stop'
alias pwr_stop='/etc/init.d/pwrs
ev
stop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
alias pwr_start="/etc/init.d/pwrsev start"
alias pwr_start="/etc/init.d/pwrsev start"
alias pwrsev="/etc/init.d/pwrsev"
alias pwrsev="/etc/init.d/pwrsev"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment