From c97cf523a83335f2c1d69e2c86a8146239ddfe3b Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 6 Oct 2011 11:52:35 +0200 Subject: [PATCH] Configure live targets for autologin as 'liveuser' instead of root --- platforms/bootusb/initramfs-include.sh | 96 ------------------------- platforms/livecd-gnome-root/post.inc.sh | 8 +-- platforms/livecd-light-root/post.inc.sh | 8 +-- platforms/livecd-root/Makefile | 6 +- platforms/livecd-root/post.inc.sh | 9 +-- platforms/livedvd-root/post.inc.sh | 11 +-- platforms/livegames-root/post.inc.sh | 10 +-- 7 files changed, 8 insertions(+), 140 deletions(-) delete mode 100644 platforms/bootusb/initramfs-include.sh diff --git a/platforms/bootusb/initramfs-include.sh b/platforms/bootusb/initramfs-include.sh deleted file mode 100644 index c0f4ac5..0000000 --- a/platforms/bootusb/initramfs-include.sh +++ /dev/null @@ -1,96 +0,0 @@ -FOUND_ISO= -#RAMSIZE=100000 -o "size=${RAMSIZE}k" - -msg ":: Creating new root ramdisk (dinamic size=${RAMSIZE}k) on /dev/shm..." -mkdir -p /flash /cdrom /squashfs /newroot - -# -# findiso(): looks for ISO9660 images stored in flash root -# -findiso(){ - msg ":: Looking for openmamba ISO cdrom images" - - # try removable devices only - for i in /flash/openmamba-*.iso; do - /bin/losetup /dev/loop0 $i - if mount -r -t iso9660 /dev/loop0 /cdrom >/dev/null 2>&1; then - if test -r /cdrom/rootfs.compressed; then - msg ":: Valid ISO image $i found..." - FOUND_ISO="$i" - return 0 - fi - umount /cdrom - fi - /bin/losetup /dev/loop0 - done - return 1 -} - -#/sbin/splash_util -c repaint ${splash_add} -t default --mesg="Looking for cdrom device" --progress="4444" - -while true; do - msg ":: root device is ${root}" - if ! mount -t ext3 ${root} /flash >/dev/null 2>&1; then - if ! mount -t ext2 ${root} /flash >/dev/null 2>&1; then - err ":: Unable to mount USB rootfs. Supported filesystems are ext2 and ext3." - fi - fi - findiso - if [ "$FOUND_ISO" ]; then -# /sbin/splash_util -c repaint ${splash_add} -t default --mesg="Mounting compressed filesystem" --progress="5555" - msg ":: Mounting compressed filesystem" - /bin/losetup /dev/loop1 /cdrom/rootfs.compressed - mount -r -t squashfs /dev/loop1 /squashfs - - if [ "${unionfs}" != "off" -a "${unionfs}" != "OFF" ]; then - - [ "${unionfs}" = "reset" ] && { - msg ":: Resetting unionfs data in rwroot" - mkdir -p /flash/old - mv /flash/rwroot /flash/old/ - } - msg ":: Mounting unionfs" - mkdir -p /flash/rwroot - mount -t unionfs -o dirs=/flash/rwroot=rw:/squashfs=ro unionfs /newroot - mkdir -p /newroot/squashfs /newroot/flash /newroot/cdrom - mount -n -o move /squashfs /newroot/squashfs - mount -n -o move /flash /newroot/flash - mount -n -o move /cdrom /newroot/cdrom - else - msg ":: Creating directories and symlinks on ramdisk..." - /bin/mount -t tmpfs /dev/shm /newroot - mkdir -p \ - /newroot/tmp /newroot/proc /newroot/sys \ - /newroot/initrd /newroot/mnt /newroot/media \ - /newroot/oldroot /newroot/squashfs /newroot/flash \ - /newroot/cdrom - mount -n -o move /squashfs /newroot/squashfs - mount -n -o move /flash /newroot/flash - mount -n -o move /cdrom /newroot/cdrom - ln -s squashfs/bin /newroot/bin - ln -s squashfs/boot /newroot/boot - ln -s squashfs/lib /newroot/lib - ln -s squashfs/opt /newroot/opt - ln -s squashfs/sbin /newroot/sbin - ln -s squashfs/srv /newroot/srv - ln -s squashfs/usr /newroot/usr - - chroot /newroot /bin/cp -a \ - /squashfs/dev /squashfs/home /squashfs/var \ - /squashfs/etc /squashfs/root / - fi - - # Create empty utmp and wtmp - #:> /newroot/var/run/utmp - #:> /newroot/var/run/wtmp - - [ "${init}" ] || init=/sbin/init - msg ":: Running init, runlevel:${runlevel}" - exec run-init /newroot ${init} ${runlevel} - msg ":: Could not run init; opening a command prompt." - /bin/sh.shared - else - msg ":: Could not find a valid ISO image; opening a command prompt." - /bin/sh.shared - fi -done diff --git a/platforms/livecd-gnome-root/post.inc.sh b/platforms/livecd-gnome-root/post.inc.sh index a43aab2..89d9cd7 100644 --- a/platforms/livecd-gnome-root/post.inc.sh +++ b/platforms/livecd-gnome-root/post.inc.sh @@ -17,7 +17,7 @@ sed -i "s|id:3\(:initdefault.*\)|id:5\1|" $MOUNTDIR/etc/inittab cat > $MOUNTDIR/etc/gdm/custom.conf << _EOF [daemon] AutomaticLoginEnable=true -AutomaticLogin=root +AutomaticLogin=liveuser _EOF ## provide a basilar gtkrc (to be improved) @@ -53,12 +53,6 @@ sed -i -e '/^halt .*/i \ sed -i -e '/^reboot .*/i \ /sbin/eject_cd.sh 2>&1 >/dev/null' $MOUNTDIR/etc/init.d/reboot -# installer icon on root desktop -# FIXME: move this somewhere else -mkdir -p $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-installer.desktop $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-bootrecover.desktop $MOUNTDIR/root/Desktop/ - # prebuild postplug sound CARDID_DB (with some ugly trick to make it work from chroot) [ -e $MOUNTDIR/lib/modules/`uname -r` ] || ln -s ${KERNEL_MAJVER}${KERNEL_EXTRAVER} $MOUNTDIR/lib/modules/`uname -r` echo "SOUND_BUILD_CARDID_DB_ONLY=1 /etc/postplug/postplug.d/sound" >> $MOUNTDIR/tmp/sounddb.sh diff --git a/platforms/livecd-light-root/post.inc.sh b/platforms/livecd-light-root/post.inc.sh index a9f3e11..bab1b21 100644 --- a/platforms/livecd-light-root/post.inc.sh +++ b/platforms/livecd-light-root/post.inc.sh @@ -14,7 +14,7 @@ sed -i "s|id:3\(:initdefault.*\)|id:5\1|" $MOUNTDIR/etc/inittab # configure LXDM for autologin # -sed -i "s|# autologin.*|autologin=root|" $MOUNTDIR/etc/lxdm/lxdm.conf +sed -i "s|# autologin.*|autologin=liveuser|" $MOUNTDIR/etc/lxdm/lxdm.conf # FIXME: ensure alternatives are correclty set chroot $MOUNTDIR update-alternatives-set-dri @@ -42,12 +42,6 @@ sed -i -e '/^halt .*/i \ sed -i -e '/^reboot .*/i \ /sbin/eject_cd.sh 2>&1 >/dev/null' $MOUNTDIR/etc/init.d/reboot -# installer icon on root desktop -# FIXME: move this somewhere else -mkdir -p $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-installer.desktop $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-bootrecover.desktop $MOUNTDIR/root/Desktop/ - # prebuild postplug sound CARDID_DB (with some ugly trick to make it work from chroot) [ -e $MOUNTDIR/lib/modules/`uname -r` ] || ln -s ${KERNEL_MAJVER}${KERNEL_EXTRAVER} $MOUNTDIR/lib/modules/`uname -r` echo "SOUND_BUILD_CARDID_DB_ONLY=1 /etc/postplug/postplug.d/sound" >> $MOUNTDIR/tmp/sounddb.sh diff --git a/platforms/livecd-root/Makefile b/platforms/livecd-root/Makefile index cf9591a..a192011 100644 --- a/platforms/livecd-root/Makefile +++ b/platforms/livecd-root/Makefile @@ -10,7 +10,6 @@ $(MAKEDIST_TARGET)-livecd-kde4: kppp4 krfb4 ksirk ark4 kcalc4 kdf4 kfloppy4 kgpg $(MAKEDIST_TARGET)-livecd-OpenOffice: libicu OpenOffice-Calc OpenOffice-Writer OpenOffice-Impress $(MAKEDIST_TARGET)-livecd-root: \ - $(MAKEDIST_TARGET)-livecd-kde4 \ postplug-xorg postplug-sound \ $(MAKEDIST_TARGET)-commontools msysklogd xorg-server \ xorg-fonts-100dpi xorg-fonts-Type1 xorg-fonts-TTF \ @@ -23,6 +22,7 @@ $(MAKEDIST_TARGET)-livecd-root: \ compizconfig-settings-manager compiz-fusion-plugins-main \ compiz-fusion-plugins-extra samba-server \ ndisgtk smart-gui cpufreqd mambatray \ + $(MAKEDIST_TARGET)-livecd-kde4 # gnome-device-manager # libopensync-plugin-syncml libopensync-plugin-google-calendar \ # libopensync-plugin-gnokii libopensync-plugin-synce \ @@ -34,9 +34,9 @@ $(MAKEDIST_TARGET)-livecd-root-en: \ kde-l10n-en_GB $(MAKEDIST_TARGET)-livecd-root-es: \ kde-l10n-es -#firefox-i18n-es-ES +# firefox-i18n-es-ES $(MAKEDIST_TARGET)-livecd-root-it: \ kde-l10n-it -#firefox-i18n-it +# firefox-i18n-it #OpenOffice-i18n-it # FIXME: add kdepim diff --git a/platforms/livecd-root/post.inc.sh b/platforms/livecd-root/post.inc.sh index 808da58..a29ed0f 100644 --- a/platforms/livecd-root/post.inc.sh +++ b/platforms/livecd-root/post.inc.sh @@ -19,9 +19,7 @@ if [ -e $MOUNTDIR/opt/kde/share/config/kdm/kdmrc ]; then $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=root|' \ - $MOUNTDIR/opt/kde/share/config/kdm/kdmrc - sed -i 's|[#]*AllowRootLogin=.*|AllowRootLogin=true|' \ + sed -i 's|[#]*AutoLoginUser=.*|AutoLoginUser=liveuser|' \ $MOUNTDIR/opt/kde/share/config/kdm/kdmrc fi @@ -51,11 +49,6 @@ sed -i -e '/^halt .*/i \ sed -i -e '/^reboot .*/i \ /sbin/eject_cd.sh 2>&1 >/dev/null' $MOUNTDIR/etc/init.d/reboot -# installer icon on root desktop -# FIXME: move this somewhere else -mkdir -p $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-installer.desktop $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-bootrecover.desktop $MOUNTDIR/root/Desktop/ # configure favorites in kde menu for f in /usr/share/applications/chromium-devel.desktop /opt/kde/share/applications/kaffeine.desktop; do diff --git a/platforms/livedvd-root/post.inc.sh b/platforms/livedvd-root/post.inc.sh index 28d5263..3a80b32 100644 --- a/platforms/livedvd-root/post.inc.sh +++ b/platforms/livedvd-root/post.inc.sh @@ -19,11 +19,8 @@ if [ -e $MOUNTDIR/opt/kde/share/config/kdm/kdmrc ]; then $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=root|' \ + sed -i 's|[#]*AutoLoginUser=.*|AutoLoginUser=liveuser|' \ $MOUNTDIR/opt/kde/share/config/kdm/kdmrc - sed -i 's|[#]*AllowRootLogin=.*|AllowRootLogin=true|' \ - $MOUNTDIR/opt/kde/share/config/kdm/kdmrc - fi # FIXME: ensure alternatives are correclty set @@ -52,12 +49,6 @@ sed -i -e '/^halt .*/i \ sed -i -e '/^reboot .*/i \ /sbin/eject_cd.sh 2>&1 >/dev/null' $MOUNTDIR/etc/init.d/reboot -# installer icon on root desktop -# FIXME: move this somewhere else -mkdir -p $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-installer.desktop $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-bootrecover.desktop $MOUNTDIR/root/Desktop/ - # configure favorites in kde menu for f in /usr/share/applications/chromium-devel.desktop \ /opt/kde/share/applications/kaffeine.desktop /opt/kde/share/applications/amarok.desktop; do diff --git a/platforms/livegames-root/post.inc.sh b/platforms/livegames-root/post.inc.sh index a4c9388..7d27432 100644 --- a/platforms/livegames-root/post.inc.sh +++ b/platforms/livegames-root/post.inc.sh @@ -19,9 +19,7 @@ if [ -e $MOUNTDIR/opt/kde/share/config/kdm/kdmrc ]; then $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=root|' \ - $MOUNTDIR/opt/kde/share/config/kdm/kdmrc - sed -i 's|[#]*AllowRootLogin=.*|AllowRootLogin=true|' \ + sed -i 's|[#]*AutoLoginUser=.*|AutoLoginUser=liveuser|' \ $MOUNTDIR/opt/kde/share/config/kdm/kdmrc fi @@ -51,12 +49,6 @@ sed -i -e '/^halt .*/i \ sed -i -e '/^reboot .*/i \ /sbin/eject_cd.sh 2>&1 >/dev/null' $MOUNTDIR/etc/init.d/reboot -# installer icon on root desktop -# FIXME: move this somewhere else -mkdir -p $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-installer.desktop $MOUNTDIR/root/Desktop/ -cp $MOUNTDIR/usr/share/applications/openmamba-bootrecover.desktop $MOUNTDIR/root/Desktop/ - # configure favorites in kde menu for f in /usr/share/applications/chromium-devel.desktop; do chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f