From d2eb7124a78c27dce44f0a45947751d038aa4614 Mon Sep 17 00:00:00 2001 From: Albert Hopkins Date: Sun, 16 Dec 2012 15:49:21 +0000 Subject: [PATCH] Use busybox for dhcp and acpi. --- Makefile | 22 ++++++++++++---------- acpi.start | 10 ++++++++++ airport/world | 1 - drupal/world | 1 - mongodb/world | 1 - owncloud/world | 1 - teamplayer/world | 1 - x/world | 1 - xfce/world | 1 - 9 files changed, 22 insertions(+), 17 deletions(-) create mode 100755 acpi.start diff --git a/Makefile b/Makefile index f7d9298..dc2592a 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ ifdef stage4-exists else mkdir -p $(DOWNLOAD_DIR) rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/latest-stage3.txt $(DOWNLOAD_DIR) - rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/`tail -n 1 $(DOWNLOAD_DIR)/latest-stage3.txt` $(DOWNLOAD_DIR)/stage3-$(ARCH)-latest.tar.bz2 + rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/`grep $(ARCH) $(DOWNLOAD_DIR)/latest-stage3.txt|grep -v multilib` $(DOWNLOAD_DIR)/stage3-$(ARCH)-latest.tar.bz2 @./echo Using stage3 tarball tar xjpf $(DOWNLOAD_DIR)/stage3-$(ARCH)-latest.tar.bz2 -C $(CHROOT) endif @@ -189,7 +189,7 @@ $(CHROOT)/etc/fstab: fstab preproot $(CHROOT)/etc/conf.d/hostname: preproot echo hostname=\"$(HOSTNAME)\" > $(CHROOT)/etc/conf.d/hostname -sysconfig: preproot $(SWAP_FILE) $(CHROOT)/etc/fstab $(CHROOT)/etc/conf.d/hostname +sysconfig: preproot acpi.start $(SWAP_FILE) $(CHROOT)/etc/fstab $(CHROOT)/etc/conf.d/hostname @echo $(VIRTIO) ifeq ($(VIRTIO),YES) sed -i 's/sda/vda/' $(CHROOT)/etc/fstab @@ -204,25 +204,23 @@ ifeq ($(HEADLESS),YES) rm -f $(CHROOT)/etc/runlevels/boot/keymaps endif echo 'modules="dhclient"' > $(CHROOT)/etc/conf.d/net - echo 'config_eth0="dhcp"' >> $(CHROOT)/etc/conf.d/net + echo 'config_eth0="udhcpc"' >> $(CHROOT)/etc/conf.d/net echo 'dhcp_eth0="release"' >> $(CHROOT)/etc/conf.d/net $(inroot) ln -nsf net.lo /etc/init.d/net.eth0 $(inroot) ln -nsf /etc/init.d/net.eth0 /etc/runlevels/default/net.eth0 $(inroot) rm -f /etc/runlevels/boot/consolefont + cp -a acpi.start $(CHROOT)/etc/local.d touch sysconfig systools: sysconfig compile_options @./echo Installing standard system tools $(inroot) $(EMERGE) -n $(USEPKG) app-admin/metalog $(inroot) /sbin/rc-update add metalog default - $(inroot) $(EMERGE) -n $(USEPKG) sys-power/acpid - $(inroot) /sbin/rc-update add acpid default - $(inroot) $(EMERGE) -n $(USEPKG) net-misc/dhcp ifeq ($(DASH),YES) - if ! test -e "$(STAGE4_TARBALL)"; \ + if ! test -e "$(STAGE4_TARBALL)"; \ then $(inroot) $(EMERGE) -n $(USEPKG) app-shells/dash; \ echo /bin/dash >> $(CHROOT)/etc/shells; \ - $(inroot) chsh -s /bin/dash root; \ + $(inroot) chsh -s /bin/sh root; \ fi $(inroot) ln -sf dash /bin/sh endif @@ -251,7 +249,11 @@ build-software: systools issue etc-update.conf $(CRITICAL) $(WORLD) # the stage3 so may not be installed yet #$(inroot) $(EMERGE) -1n $(USEPKG) app-arch/xz-utils - $(inroot) $(EMERGE) $(USEPKG) --update --newuse --deep `cat $(WORLD)` $(EXTRA_WORLD) + if test `cat $(WORLD)` ; then \ + $(inroot) $(EMERGE) $(USEPKG) --update --newuse --deep `cat $(WORLD)` $(EXTRA_WORLD); \ + else \ + true; \ + fi $(gcc_config) @./echo Running revdep-rebuild @@ -273,7 +275,7 @@ endif ifeq ($(PRUNE_CRITICAL),YES) $(inroot) $(EMERGE) -C `cat $(CRITICAL)` ifeq ($(DASH),YES) - $(inroot) $(EMERGE) -C app-shells/bash + $(inroot) $(EMERGE) -c app-shells/bash endif endif diff --git a/acpi.start b/acpi.start new file mode 100755 index 0000000..b6d345b --- /dev/null +++ b/acpi.start @@ -0,0 +1,10 @@ +#!/bin/sh + +script="/etc/acpi/PWRF/00000080" +if [ ! -f $script ] ; then + mkdir -p `dirname $script` + echo '#!/bin/sh\n/sbin/halt\n' > $script + chmod +x $script +fi + +busybox acpid diff --git a/airport/world b/airport/world index b941718..9b13158 100644 --- a/airport/world +++ b/airport/world @@ -1,5 +1,4 @@ dev-db/postgresql-server:9.2 -net-misc/dhcp www-apache/mod_wsgi dev-python/django dev-python/psycopg diff --git a/drupal/world b/drupal/world index ad84ee5..9123e75 100644 --- a/drupal/world +++ b/drupal/world @@ -1,5 +1,4 @@ dev-db/postgresql-server:9.2 dev-php/pecl-uploadprogress mail-mta/ssmtp -net-misc/dhcp www-apps/drupal diff --git a/mongodb/world b/mongodb/world index 4f08995..ec1ff80 100644 --- a/mongodb/world +++ b/mongodb/world @@ -1,2 +1 @@ -net-misc/dhcp dev-db/mongodb diff --git a/owncloud/world b/owncloud/world index 3dd435a..cbc6f25 100644 --- a/owncloud/world +++ b/owncloud/world @@ -1,3 +1,2 @@ -net-misc/dhcp www-apps/owncloud www-servers/apache diff --git a/teamplayer/world b/teamplayer/world index 16ef6c2..ef4c7bc 100644 --- a/teamplayer/world +++ b/teamplayer/world @@ -3,6 +3,5 @@ dev-python/flup dev-python/python-mpd media-libs/mutagen media-sound/mpd -net-misc/dhcp net-misc/ntp www-servers/lighttpd diff --git a/x/world b/x/world index 32dfb7d..3aa5b2e 100644 --- a/x/world +++ b/x/world @@ -1,4 +1,3 @@ -net-misc/dhcp x11-apps/xcalc x11-apps/xdm x11-apps/xedit diff --git a/xfce/world b/xfce/world index 0d09046..a55080c 100644 --- a/xfce/world +++ b/xfce/world @@ -1,6 +1,5 @@ app-editors/leafpad app-office/orage -net-misc/dhcp www-client/firefox x11-apps/xdm x11-apps/xrandr