--- trunk/mlivecdbuild/mlivecdbuild2.sh 2011/07/29 11:14:07 1446 +++ trunk/mlivecdbuild/mlivecdbuild2.sh 2011/11/04 11:34:30 1531 @@ -77,6 +77,13 @@ case ${cmd} in add) chroot ${CDCHROOTDIR} systemctl enable ${i} ;; del) chroot ${CDCHROOTDIR} systemctl disable ${i} ;; + default) + # convert targets + case ${i} in + 2|3) service="multi-user.target" ;; + 5) service="graphical.target" ;; + esac + chroot ${CDCHROOTDIR} systemctl enable ${i} ;; esac fi # busybox and sysvinit @@ -173,13 +180,32 @@ then install -m 0644 $(get_profile inittab) ${CDCHROOTDIR}/etc/inittab || die fi - # check lock group on systemd systems if [[ -x ${CDCHROOTDIR}/bin/systemctl ]] then + # check lock group on systemd systems if [[ -z $(chroot ${CDCHROOTDIR} getent group lock) ]] then + echo "adding missing group 'lock'" chroot ${CDCHROOTDIR} groupadd -g 54 lock fi + # dbus plugdev group + if [[ -z $(chroot ${CDCHROOTDIR} getent group plugdev) ]] + then + echo "adding missing group 'plugdev'" + chroot ${CDCHROOTDIR} groupadd -g 302 plugdev + fi + # dbus messagebus group + if [[ -z $(chroot ${CDCHROOTDIR} getent group messagebus) ]] + then + echo "adding missing group 'messagebus'" + chroot ${CDCHROOTDIR} groupadd -g 300 messagebus + fi + # dbus messagebus user + if [[ -z $(chroot ${CDCHROOTDIR} getent passwd messagebus) ]] + then + echo "adding missing user 'messagebus'" + chroot ${CDCHROOTDIR} useradd -u 300 -g messagebus -d /dev/null -s /bin/false messagebus + fi fi install -m 0644 $(get_profile fstab) ${CDCHROOTDIR}/etc/fstab || die install -m 0644 $(get_profile motd) ${CDCHROOTDIR}/etc/motd || die @@ -189,6 +215,25 @@ echo Setting up services ... + # install systemd default services + if [[ -x ${CDCHROOTDIR}/bin/systemctl ]] + then + # install tmpfs /tmp and /var/tmp + install -m 0644 $(get_profile tmp.mount) ${CDCHROOTDIR}/lib/systemd/system/ || die + install -m 0644 $(get_profile var-tmp.mount) ${CDCHROOTDIR}/lib/systemd/system/ || die + # enable them + ln -snf ../tmp.mount ${CDCHROOTDIR}/lib/systemd/system/local-fs.target.wants/tmp.mount || die + ln -snf ../var-tmp.mount ${CDCHROOTDIR}/lib/systemd/system/local-fs.target.wants/var-tmp.mount || die + + install -m 0644 $(get_profile getty) ${CDCHROOTDIR}/etc/conf.d/getty || die + + custom_services add getty@.service + custom_services add remote-fs.target + # disable readahead + custom_services del systemd-readahead-replay.service + custom_services del systemd-readahead-collect.service + fi + # # add hardware detection # if [[ -x ${CDCHROOTDIR}/sbin/rc-config ]] # then @@ -259,7 +304,7 @@ install -d ${LIVECDROOT}/loop/{LiveOS,mnt} || die # get the actual size of the chroot - size=$(du -s chroot | sed 's:^\(.*\)[[:space:]].*:\1:') + size=$(du -s ${LIVECDROOT}/chroot | sed 's:^\(.*\)[[:space:]].*:\1:') # generate a ext3fs file for devicemapper dd if=/dev/zero of=${LIVECDROOT}/loop/LiveOS/ext3fs.img bs=1024 count=$(( ${size} + 10 )) || die @@ -327,6 +372,15 @@ install -m 0644 $(get_profile boot.lss) ${CDISOROOT}/isolinux || die install -m 0644 $(get_profile boot.msg) ${CDISOROOT}/isolinux || die install -m 0644 $(get_profile help.msg) ${CDISOROOT}/isolinux || die + # support the new layout too + if [[ -f $(get_profile index.msg) ]] + then + install -m 0644 $(get_profile index.msg) ${CDISOROOT}/isolinux || die + fi + if [[ -f $(get_profile debug.msg) ]] + then + install -m 0644 $(get_profile debug.msg) ${CDISOROOT}/isolinux || die + fi return 0 }