From 18f9ecc0f416ceb820889d49d7b9262375b9ac8c Mon Sep 17 00:00:00 2001 From: Benjamin Schieder Date: Mon, 9 Oct 2006 17:53:14 +0000 Subject: [PATCH] Benjamin Schieder: forcefully extract a rocknet packgae from the sysfiles package This is in preparation of /etc/net integration [2006092710562627885] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@7942 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- .../{sysfiles => rocknet}/etc_networks.txt | 0 package/base/{sysfiles => rocknet}/ifup.sh | 0 .../base/{sysfiles => rocknet}/network.init | 7 +++ package/base/rocknet/rocknet.conf | 60 +++++++++++++++++++ package/base/rocknet/rocknet.desc | 39 ++++++++++++ package/base/{sysfiles => rocknet}/rocknet.sh | 0 .../base/{sysfiles => rocknet}/rocknet_README | 0 .../base/{sysfiles => rocknet}/rocknet_config | 0 .../{sysfiles => rocknet}/rocknet_getprofile | 0 .../rocknet_modules_base.sh | 0 .../rocknet_modules_dns.sh | 0 .../rocknet_modules_script.sh | 0 .../rocknet_modules_sysctl.sh | 0 .../stone_mod_network.sh | 0 package/base/sysfiles/sysfiles.conf | 18 ------ package/base/sysfiles/system.init | 6 -- 16 files changed, 106 insertions(+), 24 deletions(-) rename package/base/{sysfiles => rocknet}/etc_networks.txt (100%) rename package/base/{sysfiles => rocknet}/ifup.sh (100%) rename package/base/{sysfiles => rocknet}/network.init (94%) create mode 100644 package/base/rocknet/rocknet.conf create mode 100644 package/base/rocknet/rocknet.desc rename package/base/{sysfiles => rocknet}/rocknet.sh (100%) mode change 100755 => 100644 rename package/base/{sysfiles => rocknet}/rocknet_README (100%) rename package/base/{sysfiles => rocknet}/rocknet_config (100%) rename package/base/{sysfiles => rocknet}/rocknet_getprofile (100%) rename package/base/{sysfiles => rocknet}/rocknet_modules_base.sh (100%) rename package/base/{sysfiles => rocknet}/rocknet_modules_dns.sh (100%) rename package/base/{sysfiles => rocknet}/rocknet_modules_script.sh (100%) rename package/base/{sysfiles => rocknet}/rocknet_modules_sysctl.sh (100%) rename package/base/{sysfiles => rocknet}/stone_mod_network.sh (100%) diff --git a/package/base/sysfiles/etc_networks.txt b/package/base/rocknet/etc_networks.txt similarity index 100% rename from package/base/sysfiles/etc_networks.txt rename to package/base/rocknet/etc_networks.txt diff --git a/package/base/sysfiles/ifup.sh b/package/base/rocknet/ifup.sh similarity index 100% rename from package/base/sysfiles/ifup.sh rename to package/base/rocknet/ifup.sh diff --git a/package/base/sysfiles/network.init b/package/base/rocknet/network.init similarity index 94% rename from package/base/sysfiles/network.init rename to package/base/rocknet/network.init index 5aa515543..8c5b8f263 100644 --- a/package/base/sysfiles/network.init +++ b/package/base/rocknet/network.init @@ -29,6 +29,13 @@ main_begin block_begin(start, `Setting up network devices.') + block_split(`Renaming network interfaces') + if [ -e /etc/iftab ] ; then + check(`ifrename') + else + true + fi + oldprof="$(cat /etc/network/profile 2>/dev/null)" oldprof=${oldprof:-default} if [ -n "$2" ]; then diff --git a/package/base/rocknet/rocknet.conf b/package/base/rocknet/rocknet.conf new file mode 100644 index 000000000..3005c45bd --- /dev/null +++ b/package/base/rocknet/rocknet.conf @@ -0,0 +1,60 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/package/base/sysfiles/sysfiles.conf +# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +main_rn() { + cd $root/ + + echo "Creating various etc/* files ..." + for x in $( cd $confdir ; echo etc_*.txt ) ; do + y="${x%.txt}" ; z="/" + if [ -f "${y//_/$z}" ] + then + echo "Found old ${y//_/$z} (don't overwrite)." + touch "${y//_/$z}" + else + cp -v "$confdir/$x" "${y//_/$z}" + fi + done + [ -f etc/HOSTNAME ] || echo localhost > etc/HOSTNAME + + echo "Installing the rock-net tool ..." + cp -v $confdir/rocknet.sh etc/network/rocknet + if [ ! -f etc/network/config ]; then + cp -vf $confdir/rocknet_config etc/network/config + fi + chmod +x etc/network/rocknet + for x in $( cd $confdir; echo rocknet_{*.sh,README,getprofile}; ); do + dst="${x#rocknet_}"; z="/"; dst="${dst//_/$z}" + cp -vf $confdir/$x etc/network/$dst + done + cp -vf $confdir/ifup.sh sbin/ifup + chmod +x etc/network/getprofile sbin/ifup + ln -sf ifup sbin/ifdown + + echo "Installing 'network' init script ..." + install_init network $confdir/network.init +} + +custmain="main_rn" +autoextract=0 +check_usrlocal=0 + diff --git a/package/base/rocknet/rocknet.desc b/package/base/rocknet/rocknet.desc new file mode 100644 index 000000000..98c0cc166 --- /dev/null +++ b/package/base/rocknet/rocknet.desc @@ -0,0 +1,39 @@ + +[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- +[COPY] +[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. +[COPY] Please add additional copyright information _after_ the line containing +[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +[COPY] +[COPY] ROCK Linux: rock-src/package/base/rocknet/rocknet.desc +[COPY] ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf +[COPY] +[COPY] This program is free software; you can redistribute it and/or modify +[COPY] it under the terms of the GNU General Public License as published by +[COPY] the Free Software Foundation; either version 2 of the License, or +[COPY] (at your option) any later version. A copy of the GNU General Public +[COPY] License can be found at Documentation/COPYING. +[COPY] +[COPY] Many people helped and are helping developing ROCK Linux. Please +[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM +[COPY] file for details. +[COPY] +[COPY] --- ROCK-COPYRIGHT-NOTE-END --- + +[I] ROCK Network system + +[T] This package contains the ROCK Net network configuration system + +[A] Clifford Wolf +[M] The ROCK Linux Project + +[C] base/system + +[L] GPL +[S] Stable +[V] 0000 0 +[P] X -1-3---7-9 204.200 + +[CV-URL] none + diff --git a/package/base/sysfiles/rocknet.sh b/package/base/rocknet/rocknet.sh old mode 100755 new mode 100644 similarity index 100% rename from package/base/sysfiles/rocknet.sh rename to package/base/rocknet/rocknet.sh diff --git a/package/base/sysfiles/rocknet_README b/package/base/rocknet/rocknet_README similarity index 100% rename from package/base/sysfiles/rocknet_README rename to package/base/rocknet/rocknet_README diff --git a/package/base/sysfiles/rocknet_config b/package/base/rocknet/rocknet_config similarity index 100% rename from package/base/sysfiles/rocknet_config rename to package/base/rocknet/rocknet_config diff --git a/package/base/sysfiles/rocknet_getprofile b/package/base/rocknet/rocknet_getprofile similarity index 100% rename from package/base/sysfiles/rocknet_getprofile rename to package/base/rocknet/rocknet_getprofile diff --git a/package/base/sysfiles/rocknet_modules_base.sh b/package/base/rocknet/rocknet_modules_base.sh similarity index 100% rename from package/base/sysfiles/rocknet_modules_base.sh rename to package/base/rocknet/rocknet_modules_base.sh diff --git a/package/base/sysfiles/rocknet_modules_dns.sh b/package/base/rocknet/rocknet_modules_dns.sh similarity index 100% rename from package/base/sysfiles/rocknet_modules_dns.sh rename to package/base/rocknet/rocknet_modules_dns.sh diff --git a/package/base/sysfiles/rocknet_modules_script.sh b/package/base/rocknet/rocknet_modules_script.sh similarity index 100% rename from package/base/sysfiles/rocknet_modules_script.sh rename to package/base/rocknet/rocknet_modules_script.sh diff --git a/package/base/sysfiles/rocknet_modules_sysctl.sh b/package/base/rocknet/rocknet_modules_sysctl.sh similarity index 100% rename from package/base/sysfiles/rocknet_modules_sysctl.sh rename to package/base/rocknet/rocknet_modules_sysctl.sh diff --git a/package/base/sysfiles/stone_mod_network.sh b/package/base/rocknet/stone_mod_network.sh similarity index 100% rename from package/base/sysfiles/stone_mod_network.sh rename to package/base/rocknet/stone_mod_network.sh diff --git a/package/base/sysfiles/sysfiles.conf b/package/base/sysfiles/sysfiles.conf index 38b543482..16614bfed 100644 --- a/package/base/sysfiles/sysfiles.conf +++ b/package/base/sysfiles/sysfiles.conf @@ -35,7 +35,6 @@ main_sf() { cp -v "$confdir/$x" "${y//_/$z}" fi done - [ -f etc/HOSTNAME ] || echo localhost > etc/HOSTNAME chmod +x etc/initscript etc/rc.d/rc echo "Add missing entries to etc/services .." @@ -64,20 +63,6 @@ EOT cp -v $confdir/$x etc/stone.d/${x#stone_} done - echo "Installing the rock-net tool ..." - cp -v $confdir/rocknet.sh etc/network/rocknet - if [ ! -f etc/network/config ]; then - cp -vf $confdir/rocknet_config etc/network/config - fi - chmod +x etc/network/rocknet - for x in $( cd $confdir; echo rocknet_{*.sh,README,getprofile}; ); do - dst="${x#rocknet_}"; z="/"; dst="${dst//_/$z}" - cp -vf $confdir/$x etc/network/$dst - done - cp -vf $confdir/ifup.sh sbin/ifup - chmod +x etc/network/getprofile sbin/ifup - ln -sf ifup sbin/ifdown - echo "Create /etc/issue, /etc/issue.ansi and /etc/issue.net ... " rocktxt="ROCK Linux $rockver $arch" . $confdir/issue-std.sh @@ -128,9 +113,6 @@ EOT echo "Installing 'system' init script ..." install_init system $confdir/system.init - echo "Installing 'network' init script ..." - install_init network $confdir/network.init - echo "Exporting LINGUAS environment variable ..." if [ "$ROCKCFG_LINGUAS" == "all" ] ; then echo "# export LINGUAS=" > $root/etc/profile.d/linguas diff --git a/package/base/sysfiles/system.init b/package/base/sysfiles/system.init index a92a0b34e..0bfe47e18 100644 --- a/package/base/sysfiles/system.init +++ b/package/base/sysfiles/system.init @@ -157,12 +157,6 @@ dnl check(`cat /var/state/random-seed >/dev/urandom') fi - block_split(`Renaming network interfaces') - if [ -e /etc/iftab ] ; then - check(`ifrename') - fi - block_end - block_begin(stop, `Saving /var/log/init.msg and /var/log/boot.msg.') check(`echo -n >> /var/log/init.msg') check(`echo -n >> /var/log/boot.msg')