# HG changeset patch # User Xander Ziiryanoff # Date 1428355699 -10800 # Node ID 399204d8cc51c94ffedb9d6aa4c67113b37da245 # Parent df4af4ac205695f00b3943a4c5754cc1de167c47 Check mount cd twice. rootfs: fix boot failed with large wtmp or without it. diff -r df4af4ac2056 -r 399204d8cc51 tazlito --- a/tazlito Mon Apr 06 21:56:20 2015 +0200 +++ b/tazlito Tue Apr 07 00:28:19 2015 +0300 @@ -2328,6 +2328,8 @@ status # Clean-up files by default + mv -f /var/log/wtmp /var/log/.wtmp + touch /var/log/wtmp newline > /etc/udev/rules.d/70-persistent-net.rules newline > /etc/udev/rules.d/70-persistant-cd.rules @@ -2346,10 +2348,11 @@ [ -d $dir ] && echo $dir done >>/tmp/list - sed -i '\/var\/run\/.*pid$/d' /tmp/list + sed -i '/var\/run\/.*pid$/d' /tmp/list + sed -i '/var\/run\/utmp/d' /tmp/list for removelog in auth boot messages dmesg daemon slim .*old Xorg; do - sed -i "\/var\/log\/$removelog/d" /tmp/list + sed -i "/var\/log\/$removelog/d" /tmp/list done # Generate initramfs with specified compression and display rootfs @@ -2364,6 +2367,7 @@ sleep 1 echo -en "\\033[18G`du -sh /rootfs.gz | awk '{print $1}'` " done + mv -f /var/log/.wtmp /var/log/wtmp echo -e "\n" rm -f /tmp/rootfs @@ -2372,23 +2376,26 @@ mv -f /rootfs.gz $ROOTCD/boot # Now we need the kernel and isolinux files. - if mount /dev/cdrom /media/cdrom 2>/dev/null; then + copy_from_cd() + { cp /media/cdrom/boot/bzImage* $ROOTCD/boot cp -a /media/cdrom/boot/isolinux $ROOTCD/boot unmeta_boot $ROOTCD umount /media/cdrom - elif mount |grep /media/cdrom; then - cp /media/cdrom/boot/bzImage* $ROOTCD/boot - cp -a /media/cdrom/boot/isolinux $ROOTCD/boot - unmeta_boot $ROOTCD - umount /media/cdrom; - else + } + if mount /dev/cdrom /media/cdrom 2>/dev/null; then + copy_from_cd; + elif mount |grep /media/cdrom; then + copy_from_cd; + else + echo "Located in: $ROOTCD/boot/rootfs.gz" echo -e " When SliTaz is running in RAM the kernel and bootloader files are kept on the cdrom. Please insert a LiveCD or loop mount the slitaz.iso to /media/cdrom to let Tazlito copy the files.\n" echo -en "----\nENTER to continue..."; read i - exit 1 + [ ! -d /media/cdrom/boot/isolinux ] && exit 1 + copy_from_cd fi # Generate the iso image.