Author: alexander
Date: 2005-05-29 10:01:06 -0600 (Sun, 29 May 2005)
New Revision: 213
Added:
trunk/packages/dialog/
trunk/packages/dialog/Makefile
trunk/packages/lfs-bootscripts/clkconf
Modified:
trunk/Makefile
trunk/packages/lfs-bootscripts/Makefile
Log:
Added dialog-based timezone configurator.
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2005-05-29 14:13:03 UTC (rev 212)
+++ trunk/Makefile 2005-05-29 16:01:06 UTC (rev 213)
@@ -175,7 +175,7 @@
ch-docbook-xsl ch-html_tidy ch-LFS-BOOK ch-libpng ch-freetype
ch-fontconfig ch-Xorg ch-freefont ch-inputattach \
ch-fonts-dejavu ch-update-fontsdir ch-libjpeg ch-libtiff ch-links
ch-openssh ch-pkgconfig ch-glib2 \
ch-libungif ch-imlib2 ch-pango ch-atk ch-gtk2 ch-cvs ch-popt ch-samba
ch-libIDL ch-firefox ch-thunderbird ch-startup-notification ch-gvim \
- ch-xfce ch-lua ch-ion ch-irssi ch-xchat ch-tcpwrappers ch-portmap
ch-nfs-utils ch-traceroute \
+ ch-xfce ch-lua ch-ion ch-irssi ch-xchat ch-tcpwrappers ch-portmap
ch-nfs-utils ch-traceroute ch-dialog \
ch-ncftp ch-pciutils ch-nALFS ch-device-mapper ch-LVM2 ch-dhcpcd
ch-distcc ch-ppp ch-rp-pppoe ch-libaal \
ch-reiser4progs ch-squashfs ch-cpio ch-db ch-postfix ch-mutt ch-msmtp
ch-slrn ch-raidtools ch-linux ch-klibc ch-unionfs \
ch-initramfs ch-cdrtools ch-blfs-bootscripts ch-syslinux
@@ -781,6 +781,10 @@
make -C $(PKG)/$@ chroot
make unmount
+dialog: prep-chroot
+ make -C $(PKG)/$@ chroot
+ make unmount
+
ncftp: prep-chroot
make -C $(PKG)/$@ chroot
make unmount
@@ -1330,6 +1334,9 @@
ch-traceroute: popdev
make -C $(PKG)/traceroute stage2
+ch-dialog: popdev
+ make -C $(PKG)/dialog stage2
+
ch-ncftp: popdev
make -C $(PKG)/ncftp stage2
Added: trunk/packages/dialog/Makefile
===================================================================
--- trunk/packages/dialog/Makefile 2005-05-29 14:13:03 UTC (rev 212)
+++ trunk/packages/dialog/Makefile 2005-05-29 16:01:06 UTC (rev 213)
@@ -0,0 +1,27 @@
+# Dialog Makefile
+
+# Package versions
+NM= dialog
+VRS= 1.0-20050306
+DIR= $(NM)-$(VRS)
+FILE= $(DIR).tgz
+URL= ftp://invisible-island.net/dialog/$(FILE)
+
+#RULES
+
+.PHONY: clean chroot stage2
+
+chroot:
+ @chroot "$(MP)" $(chenv3) 'cd $(ROOT) && make ch-$(NM) $(chbash2)'
+
+stage2:
+ @echo ""
+ @echo "=====> Building $(NM) in chroot"
+ @echo ""
+ @if [ ! -f $(FILE) ] ; then $(WGET) $(URL) ; fi
+ @if [ ! -f /usr/bin/dialog ] ; then tar xzvf $(FILE) && cd $(DIR) && \
+ ./configure --prefix=/usr --enable-nls && make && make install ; fi
+ @make clean
+
+clean:
+ @-rm -rf $(DIR)
Modified: trunk/packages/lfs-bootscripts/Makefile
===================================================================
--- trunk/packages/lfs-bootscripts/Makefile 2005-05-29 14:13:03 UTC (rev
212)
+++ trunk/packages/lfs-bootscripts/Makefile 2005-05-29 16:01:06 UTC (rev
213)
@@ -29,6 +29,8 @@
ln -sf ../init.d/udev /etc/rc.d/rcsysinit.d/S10udev && \
install -m 755 ../mountfs /etc/rc.d/init.d/ && \
ln -sf ../init.d/mountfs /etc/rc.d/rcsysinit.d/S40mountfs && \
+ install -m 755 ../clkconf /etc/rc.d/init.d/ && \
+ ln -sf ../init.d/clkconf /etc/rc.d/rcsysinit.d/S59clkconf && \
rm -f /etc/rc.d/*/*mountsqfs /etc/rc.d/*/*startup ; fi
clean:
Added: trunk/packages/lfs-bootscripts/clkconf
===================================================================
--- trunk/packages/lfs-bootscripts/clkconf 2005-05-29 14:13:03 UTC (rev
212)
+++ trunk/packages/lfs-bootscripts/clkconf 2005-05-29 16:01:06 UTC (rev
213)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Get a well-defined sorting order
+export LC_ALL=C
+
+if [ ! -z "$TZ" ] ; then
+ # Assume that the system clock is already configured,
+ # e.g. from boot prompt
+ exit 0
+fi
+
+DLG_COMMAND="dialog --title \"Configure system clock\" \
+ --default-item \"Etc/GMT\" --timeout 20 \
+ --menu \"Select your timezone from the list below\" 0 0 0 \
+ `find /usr/share/zoneinfo/posix -type f -mindepth 2 | \
+ sed -e 's,/usr/share/zoneinfo/posix/,,' -e 's,$, "",' | sort`"
+TZ_SELECTED=`eval $DLG_COMMAND 3>&2 2>&1 1>&3`
+
+if [ $? -ne 0 ] ; then
+ # The user really doesn't want to configure system clock
+ exit 0
+fi
+
+echo "TZ=$TZ_SELECTED ; export TZ" >>/etc/sysconfig/rc
+echo "TZ=$TZ_SELECTED" >>/etc/environment
+
+dialog --yes-label "Localtime" --no-label "GMT" \
+ --title 'Configure system clock' \
+ --yesno "Is the system clock set to local time or to GMT?" -1 -1
+
+UTC_SELECTED=$?
+
+case "$UTC_SELECTED" in
+0|1)
+ echo "UTC=$UTC_SELECTED" >/etc/sysconfig/clock
+esac
+
+# Just to avoid useless warnings
+exit 0
--
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page