Browse Source

Do not use deprecated egrep/fgrep

master
Ville Skyttä 8 years ago
parent
commit
9430ae301e
  1. 8
      dracut-init.sh
  2. 2
      install/dracut-install.c
  3. 10
      modules.d/00systemd/module-setup.sh
  4. 8
      modules.d/02systemd-networkd/module-setup.sh
  5. 2
      modules.d/95debug/module-setup.sh
  6. 8
      modules.d/95nfs/module-setup.sh
  7. 4
      modules.d/95udev-rules/module-setup.sh
  8. 4
      modules.d/99base/module-setup.sh
  9. 2
      test/TEST-04-FULL-SYSTEMD/test.sh

8
dracut-init.sh

@ -328,15 +328,15 @@ inst_rule_group_owner() { @@ -328,15 +328,15 @@ inst_rule_group_owner() {

if grep -qE 'OWNER=?"[^ "]+' "$1"; then
for i in $(grep -E 'OWNER=?"[^ "]+' "$1" | sed -r 's/.*OWNER=?"([^ "]+).*/\1/'); do
if ! egrep -q "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
egrep "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
fi
done
fi
if grep -qE 'GROUP=?"[^ "]+' "$1"; then
for i in $(grep -E 'GROUP=?"[^ "]+' "$1" | sed -r 's/.*GROUP=?"([^ "]+).*/\1/'); do
if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
egrep "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
fi
done
fi

2
install/dracut-install.c

@ -287,7 +287,7 @@ static int library_install(const char *src, const char *lib) @@ -287,7 +287,7 @@ static int library_install(const char *src, const char *lib)

/* Also try to install the same library from one directory above.
This fixes the case, where only the HWCAP lib would be installed
# ldconfig -p|fgrep libc.so
# ldconfig -p|grep -F libc.so
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6

10
modules.d/00systemd/module-setup.sh

@ -179,11 +179,11 @@ install() { @@ -179,11 +179,11 @@ install() {

# install adm user/group for journald
inst_multiple nologin
egrep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
egrep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
egrep '^wheel:' /etc/group >> "$initdir/etc/group"
egrep '^adm:' /etc/group >> "$initdir/etc/group"
grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
grep '^wheel:' /etc/group >> "$initdir/etc/group"
grep '^adm:' /etc/group >> "$initdir/etc/group"

ln_r $systemdutildir/systemd "/init"
ln_r $systemdutildir/systemd "/sbin/init"

8
modules.d/02systemd-networkd/module-setup.sh

@ -48,10 +48,10 @@ install() { @@ -48,10 +48,10 @@ install() {

# inst_dir /var/lib/systemd/clock

egrep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
egrep '^systemd-network:' /etc/group >> "$initdir/etc/group"
# egrep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
# egrep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
# grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
# grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"

_arch=$(uname -m)
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \

2
modules.d/95debug/module-setup.sh

@ -18,6 +18,6 @@ install() { @@ -18,6 +18,6 @@ install() {
tcpdump cp less hostname mkdir \
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck

egrep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
}


8
modules.d/95nfs/module-setup.sh

@ -105,14 +105,14 @@ install() { @@ -105,14 +105,14 @@ install() {

# Rather than copy the passwd file in, just set a user for rpcbind
# We'll save the state and restart the daemon from the root anyway
egrep '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
egrep '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"
grep -E '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
grep -E '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"

# rpc user needs to be able to write to this directory to save the warmstart
# file
chmod 770 "$initdir/var/lib/rpcbind"
egrep -q '^rpc:' /etc/passwd \
&& egrep -q '^rpc:' /etc/group \
grep -q '^rpc:' /etc/passwd \
&& grep -q '^rpc:' /etc/group \
&& chown rpc.rpc "$initdir/var/lib/rpcbind"
dracut_need_initqueue
}

4
modules.d/95udev-rules/module-setup.sh

@ -63,8 +63,8 @@ install() { @@ -63,8 +63,8 @@ install() {

{
for i in cdrom tape dialout floppy; do
if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
if ! egrep "^$i:" /etc/group 2>/dev/null; then
if ! grep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
if ! grep "^$i:" /etc/group 2>/dev/null; then
case $i in
cdrom) echo "$i:x:11:";;
dialout) echo "$i:x:18:";;

4
modules.d/99base/module-setup.sh

@ -27,8 +27,8 @@ install() { @@ -27,8 +27,8 @@ install() {
fi

#add common users in /etc/passwd, it will be used by nfs/ssh currently
egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
grep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
grep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"

# install our scripts and hooks
inst_script "$moddir/init.sh" "/init"

2
test/TEST-04-FULL-SYSTEMD/test.sh

@ -197,7 +197,7 @@ EOF @@ -197,7 +197,7 @@ EOF
ln -fs /proc/self/mounts $initdir/etc/mtab

# install any Execs from the service files
egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
grep -Eho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
| while read i || [ -n "$i" ]; do
i=${i##Exec*=}; i=${i##-}
inst_multiple -o $i

Loading…
Cancel
Save