From e7a9ee665841889957fc89ca6e4e9226698400e2 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 7 Mar 2012 01:46:24 +0100 Subject: [PATCH] New multiarch 'rootfs' target with i586 and arm support Make general Makefile and Makefile.defs multi-arch for kernel and X drivers selection Some minor change to platform to support KDE 4.7 --- Makefile | 4 +- Makefile.defs | 17 ++- platforms/bootusb-test/Makefile | 2 +- platforms/bootusb/Makefile | 2 +- platforms/livecd-root/Makefile | 4 +- platforms/livecd/Makefile | 2 +- platforms/livedvd/Makefile | 2 +- platforms/rootfs/Makefile | 43 +++++++ platforms/rootfs/Makefile.defs | 24 ++++ platforms/rootfs/post.inc.sh | 131 ++++++++++++++++++++++ platforms/rootfs/root/etc/dhcpd.conf | 30 +++++ platforms/rootfs/root/etc/sysconfig/dhcpd | 3 + platforms/rootfs/settings.inc | 22 ++++ platforms/testcd/Makefile | 2 +- 14 files changed, 278 insertions(+), 10 deletions(-) create mode 100644 platforms/rootfs/Makefile create mode 100644 platforms/rootfs/Makefile.defs create mode 100644 platforms/rootfs/post.inc.sh create mode 100644 platforms/rootfs/root/etc/dhcpd.conf create mode 100644 platforms/rootfs/root/etc/sysconfig/dhcpd create mode 100644 platforms/rootfs/settings.inc diff --git a/Makefile b/Makefile index 675331e..7699928 100644 --- a/Makefile +++ b/Makefile @@ -32,12 +32,12 @@ ifdef PLATFORM include $(TARGETSDIR)/$(TARGET)/platforms/$(PLATFORM)/Makefile endif -kdelibs: +kdelibs3: @[ `echo " $$INSTALLED " | grep -c " $@ "` -eq 0 ] && \ { echo -n "$@ "; \ [ ! "$(LANGUAGE)" = "" ] && [ ! "$(LANGUAGE)" = "en" ] && echo -n "kde-i18n-$(LANGUAGE) "; } || \ : -kdelibs4: +kdelibs: @[ `echo " $$INSTALLED " | grep -c " $@ "` -eq 0 ] && \ { echo -n "$@ "; \ [ ! "$(LANGUAGE)" = "" ] && [ ! "$(LANGUAGE)" = "en" ] && echo -n "kde-l10n-$(LANGUAGE) "; } || \ diff --git a/Makefile.defs b/Makefile.defs index cd506f9..ed894fa 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -3,6 +3,7 @@ # libc libpthread.so.0 = glibc +ifeq ($(ARCH),i586) # kernel kernelnvidia = kernel-$(KERNEL_EXTRAVER)-nongpl-nvidia # kernel-$(KERNEL_EXTRAVER)-nongpl-nvidia_71xx kernel-$(KERNEL_EXTRAVER)-nongpl-nvidia_96xx @@ -40,7 +41,16 @@ kernelndiswrapper += kernel-$(KERNEL_MORE_EXTRAVER)-ndiswrapper kernellirc += kernel-$(KERNEL_MORE_EXTRAVER)-lirc kernelvboxvideo += kernel-$(KERNEL_MORE_EXTRAVER)-vboxvideo endif +endif +ifeq ($(ARCH),arm) +# xorg +xorglibGL = libGL-Mesa-dri +xorglibglx = xorg-ext-libglx +xorgdrvvideo = xorg-drv-video-fbdev xorg-drv-video-tegra +endif + +ifeq ($(ARCH),i586) # xorg xorglibGL = libGL-Mesa-dri libGL-fglrx-X11 libGL-nvidia-X11 # libGL-nvidia_71xx-X11 libGL-nvidia_96xx-X11 libGL-nvidia_173xx-X11 @@ -49,9 +59,10 @@ xorglibglx = xorg-ext-libglx xorg-ext-libglx-nvidia libGLcore.so.1 = xorg-drv-video-nvidia # xorg-drv-video-nvidia_71xx xorg-drv-video-nvidia_96xx xorg-drv-video-nvidia_173xx libnvidia-tls.so.1 = xorg-drv-video-nvidia -# xorg-drv-video-nvidia_71xx xorg-drv-video-nvidia_96xx xorg-drv-video-nvidia_173xx xorgdrvvideo = xorg-drv-video-base xorg-drv-video-fglrx xorg-drv-video-nvidia xorg-drv-video-nouveau # xorg-drv-video-nvidia_71xx xorg-drv-video-nvidia_96xx xorg-drv-video-nvidia_173xx xorg-drv-video-vboxvideo +endif + xorgdrvinput = xorg-drv-input-void xorg-drv-input-synaptics xorg-drv-input-evdev # xorg-drv-input-mouse xorg-drv-input-keyboard xorg-drv-input-joystick xorg-drv-input-evtouch xorg-drv-input-vboxmouse libGL.so.1 = libGL-Mesa-dri @@ -59,7 +70,11 @@ libGLU.so.1 = libGL-Mesa-dri splashtheme = splash-theme-openmamba + +ifeq ($(ARCH),i586) bootloader = syslinux +endif + alsaplayer_output = alsaplayer-output-alsa #libscanpci.so = xorg-server libgtkpeer.so = libgcj4 diff --git a/platforms/bootusb-test/Makefile b/platforms/bootusb-test/Makefile index cdaef74..32f28fc 100644 --- a/platforms/bootusb-test/Makefile +++ b/platforms/bootusb-test/Makefile @@ -1,4 +1,4 @@ -$(MAKEDIST_TARGET)-bootusb-test: openmamba-release syslinux memtest86+ $(MAKEDIST_TARGET)-firmwares +$(MAKEDIST_TARGET)-bootusb-test: openmamba-release syslinux memtest86+ $(MAKEDIST_TARGET)-firmwares macbook-tools # Localization targets $(MAKEDIST_TARGET)-bootusb-test-en: $(MAKEDIST_TARGET)-bootusb-test-it: diff --git a/platforms/bootusb/Makefile b/platforms/bootusb/Makefile index 57faa7f..b3728b5 100644 --- a/platforms/bootusb/Makefile +++ b/platforms/bootusb/Makefile @@ -1,4 +1,4 @@ -$(MAKEDIST_TARGET)-bootusb: openmamba-release syslinux memtest86+ $(MAKEDIST_TARGET)-firmwares +$(MAKEDIST_TARGET)-bootusb: openmamba-release syslinux memtest86+ $(MAKEDIST_TARGET)-firmwares macbook-tools # Localization targets $(MAKEDIST_TARGET)-bootusb-en: $(MAKEDIST_TARGET)-bootusb-it: diff --git a/platforms/livecd-root/Makefile b/platforms/livecd-root/Makefile index 849c8df..6268e4f 100644 --- a/platforms/livecd-root/Makefile +++ b/platforms/livecd-root/Makefile @@ -1,8 +1,8 @@ $(MAKEDIST_TARGET)-livecd-kde3: kdebase kmix \ - kppp krfb ksirc ark kcalc kdf kfloppy kgpg klaptop ksnapshot desktop-base-openmamba \ + kppp krfb ark kcalc kdf kfloppy kgpg klaptop ksnapshot desktop-base-openmamba \ kpdf kontact kmail akregator kitchensync knetworkconf kopete kdebluetooth smb4k knemo \ amarok kaffeine -$(MAKEDIST_TARGET)-livecd-kde4: kppp4 krfb4 ksirk ark4 kcalc4 kdf4 kfloppy4 kgpg4 desktop-base-kde4 \ +$(MAKEDIST_TARGET)-livecd-kde4: kppp4 krfb4 ark4 kcalc4 kdf4 kfloppy4 kgpg4 desktop-base-kde4 \ ksnapshot okular desktop-base-kde4 kmix4 \ kopete4 kdebluetooth4 smb4k juk4 lisa4 kwalletmanager4 \ kaffeine libqt4-sqlite kate diff --git a/platforms/livecd/Makefile b/platforms/livecd/Makefile index 3abea4d..f96b596 100644 --- a/platforms/livecd/Makefile +++ b/platforms/livecd/Makefile @@ -1,4 +1,4 @@ -$(MAKEDIST_TARGET)-livecd: openmamba-release memtest86+ syslinux +$(MAKEDIST_TARGET)-livecd: openmamba-release memtest86+ syslinux macbook-tools # Localized targets $(MAKEDIST_TARGET)-livecd-en: $(MAKEDIST_TARGET)-livecd-it: diff --git a/platforms/livedvd/Makefile b/platforms/livedvd/Makefile index 8146048..041eca2 100644 --- a/platforms/livedvd/Makefile +++ b/platforms/livedvd/Makefile @@ -1,4 +1,4 @@ -$(MAKEDIST_TARGET)-livedvd: openmamba-release memtest86+ syslinux +$(MAKEDIST_TARGET)-livedvd: openmamba-release memtest86+ syslinux macbook-tools # Localized targets $(MAKEDIST_TARGET)-livedvd-en: $(MAKEDIST_TARGET)-livedvd-it: diff --git a/platforms/rootfs/Makefile b/platforms/rootfs/Makefile new file mode 100644 index 0000000..0597346 --- /dev/null +++ b/platforms/rootfs/Makefile @@ -0,0 +1,43 @@ +$(MAKEDIST_TARGET)-$(PLATFORM)-kde4: \ + kppp4 desktop-base-kde4 \ + ksnapshot okular desktop-base-kde4 kmix4 \ + kopete4 kdebluetooth4 smb4k juk4 lisa4 kwalletmanager4 \ + libqt4-sqlite kate ark4 kcalc4 kdf4 kfloppy4 kgpg4 \ + kaffeine kamoso + +$(MAKEDIST_TARGET)-$(PLATFORM)-arm: \ + kernel-iconia kernel-iconia-modules kernel-hannspad kernel-hannspad-modules \ + brcm_patchram + +$(MAKEDIST_TARGET)-$(PLATFORM)-i586: \ + kernel-mamba kernel-mamba-sound kernel-mamba-wireless \ + kernel-mamba-64GB kernel-mamba-64GB-sound kernel-mamba-64GB-wireless + +$(MAKEDIST_TARGET)-$(PLATFORM): \ + $(MAKEDIST_TARGET)-$(PLATFORM)-kde4 openssh-server usbutils wireless_tools \ + parted iputils file rootfiles ppp minicom xinetd chrony locales mc \ + man-db curl zip unzip iptables iproute wpa_supplicant mtd-utils nfs-utils \ + openssh-clients binutils telnet ftp debianutils diffutils bluez traceroute \ + openmamba-devel timezone sudo syslog-ng sysvinit kmod \ + liblame expect prelink NetworkManager ModemManager procps \ + xorg-server x11vnc xkeyboard-config \ + xorg-drv-input-tslib xcursor-transparent-theme rpm smart xdg-utils \ + dhcp-server rfkill plymouth livecd-tools chromium \ + postplug-xorg postplug-sound gparted tar net-tools chrony mambatray kvkbd + +# startactive +# tightvnc-server lxde network-manager-applet matchbox-keyboard midori Mesa-tools alsa-utils +# embedded-devel embedded-debug \ +#mkfontscale vsftpd +#webmin +# FIXME: expext is a webmin prereq +# libACE: customer request +# NetworkManager strace gpsd + +# Localization targets +$(MAKEDIST_TARGET)-$(PLATFORM)-en: \ + kde-l10n-en_GB +$(MAKEDIST_TARGET)-$(PLATFORM)-es: \ + kde-l10n-es +$(MAKEDIST_TARGET)-$(PLATFORM)-it: \ + kde-l10n-it diff --git a/platforms/rootfs/Makefile.defs b/platforms/rootfs/Makefile.defs new file mode 100644 index 0000000..4b305b0 --- /dev/null +++ b/platforms/rootfs/Makefile.defs @@ -0,0 +1,24 @@ +# Fake requirement as no arm bootloader is present +#bootloader = bash +# xorg +#xorglibGL = libGL-Mesa-dri +# libGL-fglrx-X11 libGL-nvidia-X11 libGL-nvidia_71xx-X11 libGL-nvidia_96xx-X11 libGL-nvidia_173xx-X11 +#xorglibglx = xorg-ext-libglx +# xorg-ext-libglx-nvidia xorg-ext-libglx-nvidia_71xx xorg-ext-libglx-nvidia_96xx xorg-ext-libglx-nvidia_173xx +#libGLcore.so.1 = xorg-drv-video-nvidia xorg-drv-video-nvidia_71xx xorg-drv-video-nvidia_96xx xorg-drv-video-nvidia_173xx +#libnvidia-tls.so.1 = xorg-drv-video-nvidia xorg-drv-video-nvidia_71xx xorg-drv-video-nvidia_96xx xorg-drv-video-nvidia_173xx +#ifeq ($(ARCH),arm) +#xorgdrvvideo = xorg-drv-video-fbdev xorg-drv-video-tegra +#endif + +## ffmpeg / libav +#libpostproc.so.51 = libpostproc-ffmpeg +#libpostproc.so.51[LIBPOSTPROC_51] = libpostproc-ffmpeg +#ffmpegpresets := ffmpeg-presets + +## kde +#sopranobackend = soprano-backend-virtuoso +#libphonon.so.4 = libphonon +#phonon_backend = phonon-backend-gstreamer +# +#networkmanagergui = plasma-applet-networkmanagement diff --git a/platforms/rootfs/post.inc.sh b/platforms/rootfs/post.inc.sh new file mode 100644 index 0000000..c3d6dda --- /dev/null +++ b/platforms/rootfs/post.inc.sh @@ -0,0 +1,131 @@ +## disable tty virtual consoles +#sed -i "s|\(.:2345:respawn.*\)|#\1|" $MOUNTDIR/etc/inittab + +# configure for serial console login +#echo "s0:2345:respawn:/sbin/agetty -L -f /etc/issue 115200 tcc-uart0 vt100" >> $MOUNTDIR/etc/inittab + +# configure default root password +echo "openmamba" | chroot $MOUNTDIR passwd root --stdin + +# add fstab entries +#cat >> $MOUNTDIR/etc/fstab << _EOF +#/dev/mmcblk0p1 /mnt/sd0 auto defaults,noauto 0 0 +#_EOF +#mkdir $MOUNTDIR/mnt/{ndda1,ndda2,sd0,sda1,sda2} + +# disable nfs +#chroot $MOUNTDIR chkconfig --del nfslock +#chroot $MOUNTDIR chkconfig --del portmap +#chroot $MOUNTDIR chkconfig --del ts-calibrate + +## disable random +#chroot $MOUNTDIR chkconfig --del random + +## enable ftp server +#sed -i "s|\(.*disable[[:space:]]*= \)yes|\1no|" $MOUNTDIR/etc/xinetd.d/vsftpd +#sed -i "s|#local_enable|local_enable|" $NOUNTDIR/etc/vsftpd.conf +#sed -i "s|#write_enable|write_enable|" $NOUNTDIR/etc/vsftpd.conf +#sed -i "/root/d" $MOUNTDIR/etc/vsftpd/user_list +#sed -i "/root/d" $MOUNTDIR/etc/vsftpd/chroot-list + +## remove alsa configuration for now +#rm $MOUNTDIR/etc/asound.conf + +# remove some services +#rm -f $MOUNTDIR/etc/rc?.d/???{iptables,acpid} + +## generate RPM scripts first time execution +#make_rpm_first_time_script "\ +#chkconfig --del acpid +#chkconfig --del alsa +#chkconfig --del iptables +#chkconfig --del nfslock +#chkconfig --del portmap +#" + +## use system default language +#> $MOUNTDIR/etc/sysconfig/i18n + +# set localtime (default to Europe/Berlin) +case $LANGUAGE in + it) timezone=Europe/Rome ;; + es) timezone=Europe/Madrid ;; + *) timezone=Europe/Berlin ;; +esac +echo $timezone > $MOUNTDIR/etc/timezone +cp /usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime + +if [ ! "$KERNEL_IGNORE" ]; then + # run depmod + chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}-${KERNEL_EXTRAVER} +fi + +# disable automatic depmod and ldconfig execution on boot (also due to clock error) +cat >> $MOUNTDIR/etc/sysconfig/rc << _EOF +no_auto_depmod=1 +no_auto_ldconfig=1 +_EOF + +# configure touchscreen +cat > $MOUNTDIR/etc/ts-calibrate.conf << _EOF +TSLIB_CONFFILE=/etc/ts.conf +TSLIB_CONSOLEDEVICE=none +TSLIB_FBDEVICE=/dev/fb0 +TSLIB_TSDEVICE=/dev/input/event0 +TSLIB_CALIBFILE=/etc/pointercal +HOME=/root +_EOF + +# change inittab so it opens tty root shells instead of asking for login +# +echo "Forcing \`inittab' to open tty root shells with no login..." +#sed -i 's,^1:.*,1:2345:respawn:/sbin/mingetty --autologin root --noclear tty1,' $MOUNTDIR/etc/inittab +sed -i 's,^1:.*,1:234:respawn:/sbin/agetty tty1 9600,' $MOUNTDIR/etc/inittab +sed -i 's,^2:.*,2:2345:respawn:/sbin/agetty tty2 9600,' $MOUNTDIR/etc/inittab +sed -i 's,^3:.*,3:2345:respawn:/sbin/agetty ttyS0 9600,' $MOUNTDIR/etc/inittab +sed -i 's,^4:.*,4:2345:respawn:/sbin/agetty ttyGS0 9600,' $MOUNTDIR/etc/inittab +sed -i 's,^5:.*,5:2345:respawn:/sbin/agetty ttyAMA0 9600,' $MOUNTDIR/etc/inittab +sed -i '/^[5-6]:.*/d' $MOUNTDIR/etc/inittab + +# configure for runlevel 5 boot +sed -i "s|id:3\(:initdefault.*\)|id:5\1|" $MOUNTDIR/etc/inittab + +# configure KDM for autologin +# +if [ -e $MOUNTDIR/opt/kde/share/config/kdm/kdmrc ]; then + sed -i 's|[#]*AutoLoginEnable=.*|AutoLoginEnable=true|' \ + $MOUNTDIR/opt/kde/share/config/kdm/kdmrc + sed -i 's|[#]*AutoReLogin=.*|AutoReLogin=true|' \ + $MOUNTDIR/opt/kde/share/config/kdm/kdmrc + sed -i 's|[#]*AutoLoginUser=.*|AutoLoginUser=liveuser|' \ + $MOUNTDIR/opt/kde/share/config/kdm/kdmrc +fi + +# set timezone according to LANGUAGE (default is UTC) +# +case $LANGUAGE in + it) timezone=Europe/Rome ;; + es) timezone=Europe/Madrid ;; + *) timezone=UTC ;; +esac +echo $timezone > $MOUNTDIR/etc/timezone +cp $MOUNTDIR/usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime + +# configure favorites in kde menu +for f in /usr/share/applications/chromium-devel.desktop /opt/kde/share/applications/kaffeine.desktop; do + chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f +done + +# remove some documentation to save space +for f in ChangeLog Changelog CHANGES TODO NEWS README README.txt; do + find $MOUNTDIR/usr/share/doc -name $f -exec rm -f {} \; +done + +# FIXME: this should be done by postplug only when touchscreen is detected +mkdir -p $MOUNTDIR/home/liveuser/.icons/default +cat > $MOUNTDIR/home/liveuser/.icons/default/index.theme << _EOF +[Icon Theme] +Inherits=xcursor-transparent +_EOF + +prelink diff --git a/platforms/rootfs/root/etc/dhcpd.conf b/platforms/rootfs/root/etc/dhcpd.conf new file mode 100644 index 0000000..6bfe540 --- /dev/null +++ b/platforms/rootfs/root/etc/dhcpd.conf @@ -0,0 +1,30 @@ +#ddns-update-style ad-hoc; +ignore client-updates; + +subnet 10.99.99.0 netmask 255.255.255.0 { +# --- default gateway +# option routers 192.168.0.254; +# option subnet-mask 255.255.255.0; +# +# option nis-domain "domain.it"; +# option domain-name "domain.it"; +# option domain-name-servers 192.168.0.254; +# +# option time-offset -18000; # Eastern Standard Time +# option ntp-servers 192.168.0.1; +# option netbios-name-servers 192.168.0.1; +# --- Selects point-to-point node (default is hybrid). Don't change this unless +# -- you understand Netbios very well +# option netbios-node-type 2; +# + range dynamic-bootp 10.99.99.100 10.99.99.199; + default-lease-time 21600; + max-lease-time 43200; +# +# # we want the nameserver to appear at a fixed address +# host ns { +# next-server dns.domain.it; +# hardware ethernet 01:23:45:67:89:AB; +# fixed-address 1.2.3.4; +# } +} diff --git a/platforms/rootfs/root/etc/sysconfig/dhcpd b/platforms/rootfs/root/etc/sysconfig/dhcpd new file mode 100644 index 0000000..92a5b74 --- /dev/null +++ b/platforms/rootfs/root/etc/sysconfig/dhcpd @@ -0,0 +1,3 @@ +# Command line options here +DHCPDIFS="usb0" +DHCPDARGS= diff --git a/platforms/rootfs/settings.inc b/platforms/rootfs/settings.inc new file mode 100644 index 0000000..fdd2332 --- /dev/null +++ b/platforms/rootfs/settings.inc @@ -0,0 +1,22 @@ +if [ "$ARCH" = "arm" ]; then + KERNEL_EXTRAVER= + #KERNEL_PLATFORM="" + KERNEL_ADDITIONAL="" + KERNEL_IGNORE=true +elif [ "$ARCH" = "i586" ]; then + KERNEL_EXTRAVER=mamba + KERNEL_PLATFORM="" + #KERNEL_ADDITIONAL="extramodules sound" + KERNEL_MORE_EXTRAVER=mamba-64GB +fi +APPLICATION_TARGET="" +MEDIA=archive_xz +#ARCH=arm +#INSTALL_PACKAGES="bash" +BUILD_MISSING=true +TARGET_HOSTNAME=openmamba-rootfs +#rpmextraargs="--noscripts" +#DEBUG=1 +#DEVEL=1 +KEEP_RPM=1 +#RPM=rpm diff --git a/platforms/testcd/Makefile b/platforms/testcd/Makefile index 299d20f..26e27f2 100644 --- a/platforms/testcd/Makefile +++ b/platforms/testcd/Makefile @@ -1,4 +1,4 @@ -$(MAKEDIST_TARGET)-testcd: openmamba-release memtest86+ syslinux $(MAKEDIST_TARGET)-firmwares +$(MAKEDIST_TARGET)-testcd: openmamba-release memtest86+ syslinux $(MAKEDIST_TARGET)-firmwares macbook-tools # Localized targets $(MAKEDIST_TARGET)-testcd-en: $(MAKEDIST_TARGET)-testcd-it: