Magellan Linux

Diff of /trunk/mlivecdbuild/profiles/alx-0_7_branch/prepare_custom

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3070 by niro, Fri Sep 1 09:31:56 2017 UTC revision 3071 by niro, Fri Sep 1 09:36:13 2017 UTC
# Line 142  prepare_custom_installertarball() Line 142  prepare_custom_installertarball()
142  ##  ##
143  create_install_tarball()  create_install_tarball()
144  {  {
145   install -d ${LIVECDROOT}/install-temp   install -d ${LIVECDROOT}/install-chroot
146   install -d ${CDISOROOT}/system   install -d ${CDISOROOT}/system
147    
148   # use all settings from the global config, but the basesystem   # use all settings from the global config, but the basesystem
149   # has to be the normal install basesystem not for livecds   # has to be the normal install basesystem not for livecds
150   mage-bootstrap \   mage-bootstrap \
151   --root ${LIVECDROOT}/install-temp \   --root ${LIVECDROOT}/install-chroot \
152   --profile ${MAGE_PROFILE} \   --profile ${MAGE_PROFILE} \
153   --magerc ${MAGERC} \   --magerc ${MAGERC} \
154   --toolchain ${TOOLCHAIN} \   --toolchain ${TOOLCHAIN} \
# Line 157  create_install_tarball() Line 157  create_install_tarball()
157    
158  ## DEV SERVER ##  ## DEV SERVER ##
159  # NEW_MCORE_CONTROL_SERVER="alx-control-dev.dom-aka-nt.intern"  # NEW_MCORE_CONTROL_SERVER="alx-control-dev.dom-aka-nt.intern"
160  # CONFIG="${LIVECDROOT}/install-temp/etc/mcore/mcore.conf"  # CONFIG="${LIVECDROOT}/install-chroot/etc/mcore/mcore.conf"
161  # updateconfig MCORE_CONTROL_SERVER  # updateconfig MCORE_CONTROL_SERVER
162  ###  ###
163    
164   # fix missing symlink   # fix missing symlink
165   if [ ! -L ${LIVECDROOT}/install-temp/usr/bin/X ]   if [ ! -L ${LIVECDROOT}/install-chroot/usr/bin/X ]
166   then   then
167   ln -snf Xorg ${LIVECDROOT}/install-temp/usr/bin/X   ln -snf Xorg ${LIVECDROOT}/install-chroot/usr/bin/X
168   fi   fi
169    
170   # os config   # os config
171   prepare_custom_baseconfig "${LIVECDROOT}/install-temp" "alx-${CDOSARCH}" "magellan-linux.de"   prepare_custom_baseconfig "${LIVECDROOT}/install-chroot" "alx-${CDOSARCH}" "magellan-linux.de"
172    
173   # create tarball   # create tarball
174   prepare_custom_installertarball "${LIVECDROOT}/install-temp" "alx-${CDOSARCH}" "${CDISOROOT}/system"   prepare_custom_installertarball "${LIVECDROOT}/install-chroot" "alx-${CDOSARCH}" "${CDISOROOT}/system"
175  }  }
176    
177  ##  ##
# Line 180  create_install_tarball() Line 180  create_install_tarball()
180  create_netboot_image()  create_netboot_image()
181  {  {
182   install -d ${CDISOROOT}/netboot   install -d ${CDISOROOT}/netboot
183   install -d ${LIVECDROOT}/netboot-temp   install -d ${LIVECDROOT}/netboot-chroot
184   install -d ${LIVECDROOT}/network-squashfs-temp   install -d ${LIVECDROOT}/network-squashfs-temp
185    
186   # use all settings from the global config, but use netbootsysten as basesystem   # use all settings from the global config, but use netbootsysten as basesystem
187   mage-bootstrap \   mage-bootstrap \
188   --root ${LIVECDROOT}/netboot-temp \   --root ${LIVECDROOT}/netboot-chroot \
189   --profile ${MAGE_PROFILE} \   --profile ${MAGE_PROFILE} \
190   --magerc ${MAGERC} \   --magerc ${MAGERC} \
191   --toolchain ${TOOLCHAIN} \   --toolchain ${TOOLCHAIN} \
# Line 193  create_netboot_image() Line 193  create_netboot_image()
193   --basesystem netbootsystem || die "bootstrapping target system failed!"   --basesystem netbootsystem || die "bootstrapping target system failed!"
194    
195   # os config   # os config
196   prepare_custom_baseconfig "${LIVECDROOT}/netboot-temp" "alx-${CDOSARCH}" "magellan-linux.de"   prepare_custom_baseconfig "${LIVECDROOT}/netboot-chroot" "alx-${CDOSARCH}" "magellan-linux.de"
197    
198   # creating netboot image from here on   # creating netboot image from here on
199   install -d ${LIVECDROOT}/network-squashfs-temp/{LiveOS,mnt} || die   install -d ${LIVECDROOT}/network-squashfs-temp/{LiveOS,mnt} || die
200    
201   # fix fstab, use the livecd fstab without rootfs and swap   # fix fstab, use the livecd fstab without rootfs and swap
202   install -m 0644 $(get_profile fstab) ${LIVECDROOT}/netboot-temp/etc/fstab || die   install -m 0644 $(get_profile fstab) ${LIVECDROOT}/netboot-chroot/etc/fstab || die
203    
204   # get the actual size of the chroot   # get the actual size of the chroot
205   size=$(du -s ${LIVECDROOT}/netboot-temp | sed 's:^\(.*\)[[:space:]].*:\1:')   size=$(du -s ${LIVECDROOT}/netboot-chroot | sed 's:^\(.*\)[[:space:]].*:\1:')
206    
207   # generate a ext3fs file for devicemapper   # generate a ext3fs file for devicemapper
208   dd if=/dev/zero of=${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img bs=1024 count=$(( ${size} + 20000 )) || die   dd if=/dev/zero of=${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img bs=1024 count=$(( ${size} + 20000 )) || die
# Line 226  create_netboot_image() Line 226  create_netboot_image()
226   mount ${loopdev} ${LIVECDROOT}/network-squashfs-temp/mnt || die   mount ${loopdev} ${LIVECDROOT}/network-squashfs-temp/mnt || die
227    
228   # copy everything to the image file and preserve permissions   # copy everything to the image file and preserve permissions
229   ( cd ${LIVECDROOT}/netboot-temp && tar cpf - . ) | ( cd ${LIVECDROOT}/network-squashfs-temp/mnt && tar xvpf - )   ( cd ${LIVECDROOT}/netboot-chroot && tar cpf - . ) | ( cd ${LIVECDROOT}/network-squashfs-temp/mnt && tar xvpf - )
230   sleep 3   sleep 3
231    
232   # now umount everything and create the squashfs image   # now umount everything and create the squashfs image
# Line 289  create_netboot_image() Line 289  create_netboot_image()
289   then   then
290   rm -r ${LIVECDROOT}/network-squasfs-temp || die   rm -r ${LIVECDROOT}/network-squasfs-temp || die
291   fi   fi
292   if [[ -d ${LIVECDROOT}/netboot-temp ]]   if [[ -d ${LIVECDROOT}/netboot-chroot ]]
293   then   then
294   rm -r ${LIVECDROOT}/netboot-temp   rm -r ${LIVECDROOT}/netboot-chroot
295   fi   fi
296   fi   fi
297  }  }
# Line 301  create_netboot_image() Line 301  create_netboot_image()
301  ##  ##
302  create_server_tarball()  create_server_tarball()
303  {  {
304   install -d ${LIVECDROOT}/server-temp   install -d ${LIVECDROOT}/server-chroot
305   install -d ${CDISOROOT}/server   install -d ${CDISOROOT}/server
306    
307   mage-bootstrap \   mage-bootstrap \
308   --root ${LIVECDROOT}/server-temp \   --root ${LIVECDROOT}/server-chroot \
309   --profile ${MAGE_PROFILE} \   --profile ${MAGE_PROFILE} \
310   --magerc ${MAGERC} \   --magerc ${MAGERC} \
311   --toolchain ${TOOLCHAIN} \   --toolchain ${TOOLCHAIN} \
# Line 314  create_server_tarball() Line 314  create_server_tarball()
314    
315    
316   # enable getty1   # enable getty1
317   install -d ${LIVECDROOT}/server-temp/etc/systemd/system/getty.target.wants   install -d ${LIVECDROOT}/server-chroot/etc/systemd/system/getty.target.wants
318   ln -snf /usr/lib/systemd/system/getty@.service ${LIVECDROOT}/server-temp/etc/systemd/system/getty.target.wants/getty@tty1.service   ln -snf /usr/lib/systemd/system/getty@.service ${LIVECDROOT}/server-chroot/etc/systemd/system/getty.target.wants/getty@tty1.service
319    
320   # be more verbose   # be more verbose
321   sed -i 's:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1"rd.info":' ${LIVECDROOT}/server-temp/etc/conf.d/grub   sed -i 's:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1"rd.info":' ${LIVECDROOT}/server-chroot/etc/conf.d/grub
322    
323   # remove phpmyadmin configuration directory   # remove phpmyadmin configuration directory
324   if [ -d ${LIVECDROOT}/server-temp/usr/share/phpmyadmin/config ]   if [ -d ${LIVECDROOT}/server-chroot/usr/share/phpmyadmin/config ]
325   then   then
326   rm -r ${LIVECDROOT}/server-temp/usr/share/phpmyadmin/config   rm -r ${LIVECDROOT}/server-chroot/usr/share/phpmyadmin/config
327   fi   fi
328    
329   # os config   # os config
330   prepare_custom_baseconfig "${LIVECDROOT}/server-temp" "alx-svr-${CDOSARCH}" "magellan-linux.de"   prepare_custom_baseconfig "${LIVECDROOT}/server-chroot" "alx-svr-${CDOSARCH}" "magellan-linux.de"
331    
332   # fix certificate issues with mcored (common name of cert issuer) and >php-5.4   # fix certificate issues with mcored (common name of cert issuer) and >php-5.4
333   echo "127.0.0.1 mcored" >> ${LIVECDROOT}/server-temp/etc/hosts   echo "127.0.0.1 mcored" >> ${LIVECDROOT}/server-chroot/etc/hosts
334    
335   # create tarball   # create tarball
336   prepare_custom_installertarball "${LIVECDROOT}/server-temp" "alx-svr-${CDOSARCH}" "${CDISOROOT}/server"   prepare_custom_installertarball "${LIVECDROOT}/server-chroot" "alx-svr-${CDOSARCH}" "${CDISOROOT}/server"
337  }  }
338    
339  # set an empty root password  # set an empty root password

Legend:
Removed from v.3070  
changed lines
  Added in v.3071