diff options
Diffstat (limited to 'package/base-files')
-rw-r--r-- | package/base-files/Makefile | 80 | ||||
-rw-r--r-- | package/base-files/src/etc/group | 2 | ||||
-rw-r--r-- | package/base-files/src/etc/hosts | 2 | ||||
-rw-r--r-- | package/base-files/src/etc/mdev.conf | 2 | ||||
-rwxr-xr-x | package/base-files/src/init | 4 | ||||
-rwxr-xr-x | package/base-files/src/sbin/adkupdate | 8 |
6 files changed, 92 insertions, 6 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index a1cf05491..fa1fecd86 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 45 +PKG_RELEASE:= 48 PKG_SECTION:= base PKG_DESCR:= basic files and scripts @@ -64,10 +64,15 @@ endif cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \ cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab +ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILE),y) + $(SED) 's#ttyS#ttyAMA#g' $(IDIR_BASE_FILES)/etc/inittab +endif $(SED) 's#@SPEED@#$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)#' $(IDIR_BASE_FILES)/etc/inittab test -z $(ADK_RUNTIME_HOSTNAME) || \ echo $(ADK_RUNTIME_HOSTNAME) > $(IDIR_BASE_FILES)/etc/hostname; \ - echo "127.0.0.1 $(ADK_RUNTIME_HOSTNAME)" >> $(IDIR_BASE_FILES)/etc/hosts + echo "127.0.0.1 localhost" > $(IDIR_BASE_FILES)/etc/hosts + echo "::1 localhost" >> $(IDIR_BASE_FILES)/etc/hosts + echo "127.0.1.1 $(ADK_RUNTIME_HOSTNAME)" >> $(IDIR_BASE_FILES)/etc/hosts test -z $(ADK_RUNTIME_PASSWORD) || \ $(SED) 's,\*NP\*,'"$$(${TOPDIR}/bin/tools/mkcrypt \ ${ADK_RUNTIME_PASSWORD}),g" $(IDIR_BASE_FILES)/etc/shadow @@ -81,4 +86,75 @@ ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},) chmod 600 $(IDIR_BASE_FILES)/etc/adkconfig.gz endif + + +# simple network configuration +ifneq (${ADK_SIMPLE_NETWORK_CONFIG},) + ${INSTALL_DIR} ${IDIR_BASE_FILES}/etc/network + + # network config local + echo -e "auto lo\niface lo inet loopback" > ${IDIR_BASE_FILES}/etc/network/interfaces + + # network config eth0 + # configure nic with manual ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_NIC},y) + echo -e "\nauto eth0\niface eth0 inet dhcp" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure nic with dhcp +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_NIC_MANUAL},y) + echo -e "\nauto eth0\niface eth0 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH0_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH0_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH0_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " gateway ${SIMPLE_NETWORK_CONFIG_ETH0_GW}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure bridge +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_BRIDGE},y) + echo -e "\nauto br0\niface br0 inet manual" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH0_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + #configure bridge with ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_BRIDGE_IP},y) + echo -e "\nauto br0\niface br0 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH0_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH0_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH0_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH0_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + + # network config eth1 + # configure nic with manual ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_NIC},y) + echo -e "\nauto eth1\niface eth1 inet dhcp" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure nic with dhcp +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_NIC_MANUAL},y) + echo -e "\nauto eth1\niface eth1 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH1_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH1_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH1_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " gateway ${SIMPLE_NETWORK_CONFIG_ETH1_GW}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure bridge +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_BRIDGE},y) + echo -e "\nauto br0\niface br1 inet manual" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH1_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + #configure bridge with ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_BRIDGE_IP},y) + echo -e "\nauto br0\niface br1 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH1_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH1_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH1_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH1_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + + # newline at the end of interfaces file + echo -en "\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + + # resolver config + echo -e "nameserver ${SIMPLE_NETWORK_CONFIG_RESOLV}" > ${IDIR_BASE_FILES}/etc/resolv.conf +endif + + include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/base-files/src/etc/group b/package/base-files/src/etc/group index c4e77f316..bbf6c0603 100644 --- a/package/base-files/src/etc/group +++ b/package/base-files/src/etc/group @@ -1,2 +1,4 @@ root:x:0: +video:x:1: +audio:x:2: nogroup:x:65534: diff --git a/package/base-files/src/etc/hosts b/package/base-files/src/etc/hosts deleted file mode 100644 index 085363292..000000000 --- a/package/base-files/src/etc/hosts +++ /dev/null @@ -1,2 +0,0 @@ -::1 localhost -127.0.0.1 localhost diff --git a/package/base-files/src/etc/mdev.conf b/package/base-files/src/etc/mdev.conf index 173a851f3..4cc06251a 100644 --- a/package/base-files/src/etc/mdev.conf +++ b/package/base-files/src/etc/mdev.conf @@ -9,7 +9,7 @@ ttyS* 0:0 640 rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc device-mapper 0:0 660 @test -d /dev/mapper || mkdir /dev/mapper tun 0:0 660 >net/tun -fb? root:video 660 +fb0 root:video 660 audio root:audio 660 >snd/audio dsp root:audio 660 >snd/dsp timer root:audio 660 >snd/timer diff --git a/package/base-files/src/init b/package/base-files/src/init index a3232cb9c..c57149fe3 100755 --- a/package/base-files/src/init +++ b/package/base-files/src/init @@ -1,7 +1,7 @@ #!/bin/sh echo "System initialization ..." export PATH=/bin:/sbin:/usr/bin:/usr/sbin -mount -t devtmpfs devtmpfs /dev > /dev/null 2>&1 +mount -t devtmpfs devtmpfs /dev >/dev/null 2>&1 mount -nt proc proc /proc mount -o nosuid,nodev,noexec -t sysfs sysfs /sys [ ! -f /etc/notmpfs ] && { @@ -12,12 +12,14 @@ mount -o nosuid,nodev,noexec -t sysfs sysfs /sys mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev [ -d /dev/pts ] || mkdir /dev/pts [ -d /dev/shm ] || mkdir /dev/shm +mount -o nosuid,noexec -t tmpfs tmpfs /dev/shm mount -o nosuid,noexec -t devpts devpts /dev/pts exec 0<>/dev/console >&0 2>&0 echo >/dev/mdev.seq echo "/sbin/mdev" >/proc/sys/kernel/hotplug mdev -s cat /etc/.rnd >/dev/urandom 2>&1 +[ -x /kexecinit ] && { /kexecinit; } [ -x /cryptinit ] && { /cryptinit; exec switch_root /mnt "/init";} [ -x /sbin/cfgfs ] && { cfgfs setup; mount -o remount,ro /;} || mount -o remount,rw / [ -f /etc/fstab ] && { fsck -p >/dev/null; mount -a;} diff --git a/package/base-files/src/sbin/adkupdate b/package/base-files/src/sbin/adkupdate index 619faf04f..b5477412f 100755 --- a/package/base-files/src/sbin/adkupdate +++ b/package/base-files/src/sbin/adkupdate @@ -89,6 +89,14 @@ case $1 in ;; esac +# fix permissions +if [ -f /usr/bin/sudo ];then + chmod 4755 /usr/bin/sudo +fi +if [ -f /usr/bin/Xorg ];then + chmod 4755 /usr/bin/Xorg +fi + sync if [ -x /sbin/cfgfs ];then umount /etc |