From f21c448c6d0ec4a3b61c4d826eb8c1b668e10409 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 31 May 2006 12:33:06 +0000 Subject: allow building of kernel-specific stuff in package/ instead of target/linux/package/ and merge target/linux/package/base-files into package/base-files git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3855 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/ar7-2.4/etc/config/network | 27 ++++++++++++++++++++++++++ package/base-files/ar7-2.4/etc/init.d/S00adam2 | 8 ++++++++ 2 files changed, 35 insertions(+) create mode 100644 package/base-files/ar7-2.4/etc/config/network create mode 100755 package/base-files/ar7-2.4/etc/init.d/S00adam2 (limited to 'package/base-files/ar7-2.4') diff --git a/package/base-files/ar7-2.4/etc/config/network b/package/base-files/ar7-2.4/etc/config/network new file mode 100644 index 000000000..353538bf4 --- /dev/null +++ b/package/base-files/ar7-2.4/etc/config/network @@ -0,0 +1,27 @@ +# Network configuration file +# Uncomment the following statements to change the network configuration + +## LAN configuration +lan_ifname="eth0" +lan_proto="static" +lan_ipaddr="192.168.1.1" +lan_netmask="255.255.255.0" +# lan_gateway="" +# lan_dns="" + +## WAN configuration +# wan_proto=pppoe +wan_ifname=ppp0 +wan_device=nas0 +atm_vpi=8 +atm_vci=35 +# ppp_username=my_username +# ppp_passwd=my_passwd + +## WAN configuration (pppoe) +pppoe_atm=1 +ppp_mtu=1492 + +## WAN configuration (pppoa) +# ppp_mtu=1500 + diff --git a/package/base-files/ar7-2.4/etc/init.d/S00adam2 b/package/base-files/ar7-2.4/etc/init.d/S00adam2 new file mode 100755 index 000000000..0ca4c0145 --- /dev/null +++ b/package/base-files/ar7-2.4/etc/init.d/S00adam2 @@ -0,0 +1,8 @@ +#!/bin/sh +# ADAM2 patcher for Netgear DG834 and compatible +MD5="$(md5sum /dev/mtdblock/0 | awk '{print $1}')" +[ "$MD5" = "0530bfdf00ec155f4182afd70da028c1" ] && { + mtd unlock adam2 + /sbin/adam2patcher /dev/mtdblock/0 +} +rm -f /etc/init.d/S00adam2 /sbin/adam2patcher >&- 2>&- -- cgit v1.2.3 From 7885524586983ec44edf08324cfc7c63574b5388 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 15 Jun 2006 17:21:17 +0000 Subject: clean up handling of the root filesystem mount - remove broadcom specific junk from the generic base-files part git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3951 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/ar7-2.4/bin/firstboot | 89 ++++++++++++++++++++++++++++++ package/base-files/ar7-2.4/etc/preinit | 11 ++++ package/base-files/ar7-2.4/sbin/mount_root | 28 ++++++++++ 3 files changed, 128 insertions(+) create mode 100755 package/base-files/ar7-2.4/bin/firstboot create mode 100755 package/base-files/ar7-2.4/etc/preinit create mode 100755 package/base-files/ar7-2.4/sbin/mount_root (limited to 'package/base-files/ar7-2.4') diff --git a/package/base-files/ar7-2.4/bin/firstboot b/package/base-files/ar7-2.4/bin/firstboot new file mode 100755 index 000000000..955423be0 --- /dev/null +++ b/package/base-files/ar7-2.4/bin/firstboot @@ -0,0 +1,89 @@ +#!/bin/sh +# $Id$ + +rom=$(awk '/squashfs/ {print $2}' /proc/mounts) +jffs=$(awk '/jffs2/ {print $2}' /proc/mounts) + +dupe() { # + cd $1 + echo -n "creating directories... " + { + cd $2 + find . -xdev -type d + echo "./dev ./jffs ./mnt ./proc ./tmp ./sys" + # xdev skips mounted directories + cd $1 + } | xargs mkdir -p + echo "done" + + echo -n "setting up symlinks... " + for file in $(cd $2; find . -xdev -type f;); do + case "$file" in + ./rom/note) ;; #nothing + ./etc/config*|\ + ./etc/resolv.conf|\ + ./usr/lib/ipkg/info) cp -af $2/$file $file;; + *) ln -sf /rom/${file#./*} $file;; + esac + done + for file in $(cd $2; find . -xdev -type l;); do + cp -af $2/${file#./*} $file + done + echo "done" +} + +pivot() { # + mount -o move /proc $1/proc && \ + pivot_root $1 $1$2 && { + mount -o move $2/dev /dev + mount -o move $2/tmp /tmp + mount -o move $2/sys /sys + return 0 + } +} + +mountdp() { # + dev=$1; mnt=$2; shift 2; opt=$* + mount $dev $mnt $opt + dupe $mnt $rom + pivot $mnt /rom +} + +ramoverlay() { + mkdir -p /tmp/root + mountdp /tmp/root /mnt -o bind +} + +[ "${0##*/}" = "firstboot" ] && { + [ -z "$rom" ] && { + echo "You do not have a squashfs partition; aborting" + echo "(firstboot cannot be run on jffs2 based firmwares)" + exit 1 + } + + [ "$1" = "switch2jffs" ] && { + mtd erase OpenWrt + mount -o remount,ro none / # try to avoid fs changing while copying + mount -o bind / /mnt + mount /dev/mtdblock/4 /rom/jffs -t jffs2 + echo -n "copying files ... " + cp -a /mnt/* /rom/jffs + umount /mnt + echo "done" + pivot /rom /mnt + mount -o move /mnt /tmp/root + pivot /jffs /rom + exit 0 + } + + # script run manually + [ \! -z "$jffs" ] && { + echo "firstboot has already been run" + echo "jffs2 partition is mounted, only resetting files" + dupe $jffs $rom + exit 0 + } + + mtd erase OpenWrt + mountdp /dev/mtdblock/4 /jffs -t jffs2 +} diff --git a/package/base-files/ar7-2.4/etc/preinit b/package/base-files/ar7-2.4/etc/preinit new file mode 100755 index 000000000..5b676ca3a --- /dev/null +++ b/package/base-files/ar7-2.4/etc/preinit @@ -0,0 +1,11 @@ +#!/bin/sh +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +mount none /proc -t proc + +[ -f /etc/preinit.arch ] && . /etc/preinit.arch +[ -z "$FAILSAFE" ] || { + echo /bin/true > /proc/sys/kernel/hotplug + telnetd -l /bin/login <> /dev/null 2>&1 +} +mount_root ${FAILSAFE:+failsafe} +exec /sbin/init diff --git a/package/base-files/ar7-2.4/sbin/mount_root b/package/base-files/ar7-2.4/sbin/mount_root new file mode 100755 index 000000000..6b90bdc9c --- /dev/null +++ b/package/base-files/ar7-2.4/sbin/mount_root @@ -0,0 +1,28 @@ +#!/bin/sh +size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)&- + if [ $? = 0 ] ; then + if [ $(cat /proc/mtd | wc -l) = 6 ]; then + mtd erase OpenWrt + else + mount -o remount,rw /dev/root / + fi + else + . /bin/firstboot + echo "switching to jffs2" + mount /dev/mtdblock/4 /jffs -t jffs2 + pivot /jffs /rom || { + echo "jffs2 unusable; using ramdisk" + ramoverlay + } + fi +fi + +mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777 +mkdir -p /dev/pts +mount none /dev/pts -t devpts +mount -t sysfs none /sys 2>&- -- cgit v1.2.3 From ed5ef674d100ca0ffa8bc00160718f69af5515c3 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 27 Jun 2006 00:36:13 +0000 Subject: add copyright headers to base-files scripts and config files git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4090 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/ar7-2.4/bin/firstboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/ar7-2.4') diff --git a/package/base-files/ar7-2.4/bin/firstboot b/package/base-files/ar7-2.4/bin/firstboot index 955423be0..774bbc754 100755 --- a/package/base-files/ar7-2.4/bin/firstboot +++ b/package/base-files/ar7-2.4/bin/firstboot @@ -1,5 +1,5 @@ #!/bin/sh -# $Id$ +# Copyright (C) 2006 OpenWrt.org rom=$(awk '/squashfs/ {print $2}' /proc/mounts) jffs=$(awk '/jffs2/ {print $2}' /proc/mounts) -- cgit v1.2.3 From c4f3575368c5aeef4134d82125df2814d688cc2a Mon Sep 17 00:00:00 2001 From: nbd Date: Sun, 30 Jul 2006 03:09:09 +0000 Subject: rewrite of the network scripts and configuration git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4323 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/ar7-2.4/etc/config/network | 29 +++++---------------------- 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'package/base-files/ar7-2.4') diff --git a/package/base-files/ar7-2.4/etc/config/network b/package/base-files/ar7-2.4/etc/config/network index 353538bf4..19a858e16 100644 --- a/package/base-files/ar7-2.4/etc/config/network +++ b/package/base-files/ar7-2.4/etc/config/network @@ -1,27 +1,8 @@ # Network configuration file -# Uncomment the following statements to change the network configuration -## LAN configuration -lan_ifname="eth0" -lan_proto="static" -lan_ipaddr="192.168.1.1" -lan_netmask="255.255.255.0" -# lan_gateway="" -# lan_dns="" - -## WAN configuration -# wan_proto=pppoe -wan_ifname=ppp0 -wan_device=nas0 -atm_vpi=8 -atm_vci=35 -# ppp_username=my_username -# ppp_passwd=my_passwd - -## WAN configuration (pppoe) -pppoe_atm=1 -ppp_mtu=1492 - -## WAN configuration (pppoa) -# ppp_mtu=1500 +config interface lan + option ifname eth0 + option proto static + option ipaddr 192.168.1.1 + option netmask 255.255.255.0 -- cgit v1.2.3 From 465de48141a686fc4915fa816a24b976fa00a5bd Mon Sep 17 00:00:00 2001 From: mbm Date: Sun, 27 Aug 2006 11:11:55 +0000 Subject: fix minor typo & move loopback to network config git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4683 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/ar7-2.4/etc/config/network | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'package/base-files/ar7-2.4') diff --git a/package/base-files/ar7-2.4/etc/config/network b/package/base-files/ar7-2.4/etc/config/network index 19a858e16..911134bb0 100644 --- a/package/base-files/ar7-2.4/etc/config/network +++ b/package/base-files/ar7-2.4/etc/config/network @@ -1,5 +1,11 @@ # Network configuration file +config interface loopback + option ifname lo + option proto static + option ipaddr 127.0.0.1 + option netmask 255.0.0.0 + config interface lan option ifname eth0 option proto static -- cgit v1.2.3 From cf123d2a166d297712ab7b7221af999a62643f98 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 4 Oct 2006 20:05:48 +0000 Subject: add new rc.common for standardized init scripts, convert existing init scripts git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4915 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/ar7-2.4/etc/init.d/S00adam2 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'package/base-files/ar7-2.4') diff --git a/package/base-files/ar7-2.4/etc/init.d/S00adam2 b/package/base-files/ar7-2.4/etc/init.d/S00adam2 index 0ca4c0145..5f5b3504c 100755 --- a/package/base-files/ar7-2.4/etc/init.d/S00adam2 +++ b/package/base-files/ar7-2.4/etc/init.d/S00adam2 @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/sh /etc/rc.common # ADAM2 patcher for Netgear DG834 and compatible -MD5="$(md5sum /dev/mtdblock/0 | awk '{print $1}')" -[ "$MD5" = "0530bfdf00ec155f4182afd70da028c1" ] && { - mtd unlock adam2 - /sbin/adam2patcher /dev/mtdblock/0 +# Copyright (C) 2006 OpenWrt.org + +start() { + MD5="$(md5sum /dev/mtdblock/0 | awk '{print $1}')" + [ "$MD5" = "0530bfdf00ec155f4182afd70da028c1" ] && { + mtd unlock adam2 + /sbin/adam2patcher /dev/mtdblock/0 + } + rm -f /etc/init.d/S00adam2 /sbin/adam2patcher >&- 2>&- } -rm -f /etc/init.d/S00adam2 /sbin/adam2patcher >&- 2>&- -- cgit v1.2.3