-git: checkout: +--ignore-other-worktrees
authorJan Kratochvil <jan@jankratochvil.net>
Fri, 9 Sep 2022 13:39:04 +0000 (15:39 +0200)
committerJan Kratochvil <jan@jankratochvil.net>
Fri, 9 Sep 2022 13:39:04 +0000 (15:39 +0200)
 - It corrupts other worktrees.

13 files changed:
.bashrc
.gdbinit
.mailcap [new file with mode: 0644]
.muttrc
.muttrc-gpg.rc
.screenrc
bin/engine-di.fm
bin/exx
bin/kernel/kernelkkfix
bin/taillog
public_html/cgi-bin/idnes-foto
src/OOo-LiveCD.ks
src/OOo-LiveCD.sh

diff --git a/.bashrc b/.bashrc
index 2bd97fb..0a78130 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -394,7 +394,6 @@ function rpmsrclist
 }
 function yumupdate {(ulimit -v unlimited;yum makecache;yum -y --skip-broken update "$@";);}
 function gitcommit { git commit -a --allow-empty-message -m '' "$@"; }
-function git {(unset git;if [ "$1" = "checkout" ];then shift;git checkout --ignore-other-worktrees "$@";else git "$@";fi)}
 function gpg {(unset gpg; http_proxy= all_proxy= HTTP_PROXY= ALL_PROXY= gpg "$@"; );}
 function swap() {( set -ex;local TMPFILE=tmp.$$;[ $# = 2 ] && mv "$1" $TMPFILE && mv "$2" "$1" && mv $TMPFILE "$2" && echo done )}
 alias gthumb='rm -rf ~/.cache/thumbnails/fail/;gthumb'
index 613d134..6d168c4 100644 (file)
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,3 +1,13 @@
+add-auto-load-safe-path ~/src/stock
+add-auto-load-safe-path ~/src/interview/.gdbinit
+add-auto-load-safe-path ~/src/interview/asan/*-gdb.gdb
+add-auto-load-safe-path ~/src/toptal.com-codility.com/.gdbinit
+add-auto-load-safe-path ~/src/toptal.com-codility.com/asan/*-gdb.gdb
+define bt
+       disable frame-filter all
+       backtrace
+end
+
 set break pending on
 set style enabled off
 # See .bashrc: export GDBHISTFILE="$HOME/.gdb_history"
diff --git a/.mailcap b/.mailcap
new file mode 100644 (file)
index 0000000..ad4dd1d
--- /dev/null
+++ b/.mailcap
@@ -0,0 +1,4 @@
+# https://unix.stackexchange.com/a/42714/296319
+#text/html; (cp -p '%s' /tmp/$$.html\;chromium-freeworld /tmp/$$.html 2>/dev/null\;rm /tmp/$$.html)&; test=test -n "$DISPLAY"; needsterminal;
+text/html; chromium-freeworld '%s' 2>/dev/null &; test=test -n "$DISPLAY"; nametemplate=%s.html; needsterminal;
+text/html; lynx -dump $(: -width=$COLUMNS ) %s; nametemplate=%s.html; copiousoutput;
diff --git a/.muttrc b/.muttrc
index 09b4501..74da566 100644 (file)
--- a/.muttrc
+++ b/.muttrc
@@ -17,3 +17,4 @@ alias archer archer@sourceware.org
 alias binutils binutils@sourceware.org
 alias gccpat gcc-patches@gcc.gnu.org
 alias steph Marie Stephanie Kratochvilova <istephielicious@gmail.com>
+alias jacob Thomas Jacob <thomas.jacobjacob@web.de>
index aee3df2..e69de29 100644 (file)
@@ -1,73 +0,0 @@
-# -*-muttrc-*-
-#
-# Command formats for gpg.
-# 
-# This version uses gpg-2comp from 
-#   http://muppet.faveve.uni-stuttgart.de/~gero/gpg-2comp.tar.gz
-#
-# $Id$
-#
-# %p    The empty string when no passphrase is needed,
-#       the string "PGPPASSFD=0" if one is needed.
-#
-#       This is mostly used in conditional % sequences.
-#
-# %f    Most PGP commands operate on a single file or a file
-#       containing a message.  %f expands to this file's name.
-#
-# %s    When verifying signatures, there is another temporary file
-#       containing the detached signature.  %s expands to this
-#       file's name.
-#
-# %a    In "signing" contexts, this expands to the value of the
-#       configuration variable $pgp_sign_as.  You probably need to
-#       use this within a conditional % sequence.
-#
-# %r    In many contexts, mutt passes key IDs to pgp.  %r expands to
-#       a list of key IDs.
-
-# decode application/pgp
-set pgp_decode_command="gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
-
-# verify a pgp/mime signature
-set pgp_verify_command="gpg --no-verbose --batch --output - --verify %s %f"
-
-# decrypt a pgp/mime attachment
-set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
-
-# create a pgp/mime signed attachment
-# set pgp_sign_command="gpg-2comp --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
-set pgp_sign_command="gpg --no-verbose --compress-algo 1 --cipher-algo cast5 --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
-
-# create a application/pgp signed (old-style) message
-# set pgp_clearsign_command="gpg-2comp --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
-set pgp_clearsign_command="gpg --no-verbose --compress-algo 1 --cipher-algo cast5 --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
-
-# create a pgp/mime encrypted attachment
-# set pgp_encrypt_only_command="pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
-set pgp_encrypt_only_command="pgpewrap gpg -v --compress-algo 1 --cipher-algo cast5 --batch --output - --encrypt --textmode --armor -- -r %r -- %f"
-# --always-trust
-
-# create a pgp/mime encrypted and signed attachment
-# set pgp_encrypt_sign_command="pgpewrap gpg-2comp --passphrase-fd 0 -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
-set pgp_encrypt_sign_command="pgpewrap gpg --passphrase-fd 0 -v --compress-algo 1 --cipher-algo cast5 --batch --textmode --output - --encrypt --sign %?a?-u %a? --armor -- -r %r -- %f"
-# --always-trust
-
-# import a key into the public key ring
-set pgp_import_command="gpg --no-verbose --import -v %f"
-
-# export a key from the public key ring
-set pgp_export_command="gpg --no-verbose --export --armor %r"
-
-# verify a key
-set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r"
-
-# read in the public key ring
-set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r" 
-
-# read in the secret key ring
-set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r" 
-
-# receive key from keyserver:
-#set pgp_getkeys_command="wrap.sh -g %r"
-set pgp_getkeys_command=""
index a2a56d1..359a9a5 100644 (file)
--- a/.screenrc
+++ b/.screenrc
@@ -150,3 +150,29 @@ bindkey -d -k kb stuff \010
 # bind + resize +1
 # bind - resize -1
 # bind _ resize max
+
+# jankratochvil:
+bindkey -t \033OP select 1
+bindkey -t \033OQ select 2
+bindkey -t \033OR select 3
+bindkey -t \033OS select 4
+bindkey -t \033[15~ select 5
+bindkey -t \033[17~ select 6
+bindkey -t \033[18~ select 7
+bindkey -t \033[19~ select 8
+bindkey -t \033[20~ select 9
+bindkey -t \033[21~ select 10
+bindkey -t \033[23~ select 11
+bindkey -t \033[24~ select 12
+bindkey -t \033O2P select 13
+bindkey -t \033O2Q select 14
+bindkey -t \033O2R select 15
+bindkey -t \033O2S select 16
+bindkey -t \033[15;2~ select 17
+bindkey -t \033[17;2~ select 18
+bindkey -t \033[18;2~ select 19
+bindkey -t \033[19;2~ select 20
+bindkey -t \033[20;2~ select 21
+bindkey -t \033[21;2~ select 22
+bindkey -t \033[23;2~ select 23
+bindkey -t \033[24;2~ select 24
index 45a9968..8cefb64 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 #
-# $Id$
+# $Id: engine-di.fm,v 1.7 2008/05/08 09:08:23 lace Exp $
 
 use strict;
 use warnings;
@@ -84,14 +84,15 @@ if ("build" eq ($ARGV[0]||"")) {
                my($site,$page)=@_;
 
                my @newdashed;
-               while ($page=~m{"((?:http://www.'$site')?([^":]*(?<!_low)[.](?:pls|asx)))"}g) {
+               while ($page=~m{"(?:http://listen.$site)?([^":]*(?<!_low)[.](?:pls|asx)(?:[?]\w+)?)"}g) {
                        local $_=$1;
                        next if m{^/aacplus/};
                        next if m{/(?:32|56|64|128)k[.]};
                        tr{/}{-};
+                       tr{?}{%};
                        push @newdashed,$_;
                }
-               @newdashed or die "No URLs found";
+               @newdashed or die $page."\nNo URLs found";
                for (@symlink) {
                        unlink or die "unlink \"$_\": $!";
                }
@@ -117,6 +118,7 @@ if ("build" eq ($ARGV[0]||"")) {
 my $pathslashed=$0;
 $pathslashed=~s{^.*/}{};
 $pathslashed=~tr{-}{/};
+$pathslashed=~tr{%}{?};
 my $streamlisturl="http://$pathslashed";
 my $tried;
 do {
@@ -162,14 +164,13 @@ do {
                }
                my $mplayer="mplayer";
                my @list=($mplayer);
-               if ($pathslashed=~m{/(\d+)k}) {
-                       push @list,"-cache",60*$1/8,"-cache-min",45;
-               }
+               push @list,qw(-volume 40);
+               push @list,"-cache",30*192/8,"-cache-min",45;
                push @list,@ARGV;
                push @list,$stream;
                warn Dumper(\@list);
                #system $mplayer @list;
-               do { die "[$&] <$_>" if m{[^-a-zA-Z 0-9/:.@=]}; } for @list;
+               do { die "[$&] <$_>" if m{[^-a-zA-Z 0-9/:.@=_?]}; } for @list;
                system {"bash"} "bash","-c",join(" ",@list);
                exit 0 if $?;
        }
diff --git a/bin/exx b/bin/exx
index 97f021b..8994599 100755 (executable)
--- a/bin/exx
+++ b/bin/exx
@@ -14,6 +14,8 @@ use constant FORMATS=>{
        "rpm"    =>'rpm2cpio $pathname|cpio -id --quiet',       #-v #FIXME: --sparse doesn't work, why?
        "zip"    =>'unzip -Lq $pathname',
        "jar"    =>'unzip -Lq $pathname',
+       "xpi"    =>'unzip -Lq $pathname',
+       "crx"    =>'unzip -Lq $pathname',
        "a"      =>'ar x $pathname',
        "deb"    =>'ar x $pathname;'
                   .'for i in *.tar.gz;do j=`basename $i .tar.gz`;mkdir -p $j;cd $j;tar xzf ../$i;cd ..;rm -f $i;done',
index 1bf168a..e6d03c2 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/bash
 #
-# $Id$
+# $Id: kernelkkfix,v 1.2 2005/05/12 10:21:26 short Exp $
 #
-# Subst $Id$ -> $Id$ (as in cvs ... -kk) in all the subdirectories.
+# Subst $Id: kernelkkfix,v 1.2 2005/05/12 10:21:26 short Exp $ -> $Id: kernelkkfix,v 1.2 2005/05/12 10:21:26 short Exp $ (as in cvs ... -kk) in all the subdirectories.
 # Required for proper diffing of CVSed Linux kernel sourcetrees.
 
 
index b58d0e0..f6a48e6 100755 (executable)
@@ -1,2 +1,2 @@
 #! /bin/bash
-tail -fn0 `(file $(find /var/log -name ntpstats -prune -o -type f -print)|grep -v 'data$'|sed 's/:.*//'|grep -v '^\(/var/log/squid/store.log\|/var/log/acpid\|/var/log/btmp\|/var/log/maillog\)$';echo "$*"|tr ' ' '\n')|sort -u` # |grep -v ': bio too big device md3 (248 > 240)$'
+tail -fn0 $(file $(find /var/log $(cat ~/.taillog.addon 2>/dev/null) -name ntpstats -prune -o -type f -print)|grep -v 'data$'|sed 's/:.*//'|grep -v '^/var/log/squid/store.log$\|/.tmp$\|[.]gz$') "$@"
index 2cd8e73..6ead9ce 100755 (executable)
@@ -41,7 +41,30 @@ print <<"EOH";
        <input type="submit">
 </form>
 EOH
-$BASE=~m{^http://\w+\Q.idnes.cz/foto.asp?\E(?:r=[-_\w]+&c=[-_\w]+|c=[-_\w]+&r=[-_\w]+)$} or $BASE="";
+$BASE=~m{^http://\w+\Q.idnes.cz/foto.asp\Ex?[?](?:r=[-_\w]+&c=[-_\w]+|c=[-_\w]+&r=[-_\w]+)$} or $BASE="";
+
+my $ua=LWP::UserAgent->new();
+$ua->env_proxy();
+$ua->requests_redirectable([]);
+
+#sub webget($)
+#{
+#  my($url)=@_;
+#
+#  my $resp=$ua->get($url);
+#  if ($resp->is_redirect()) {
+#    my $relurl=$resp->header("Location");
+#    $relurl=~m{^foto.*[?]} or die;
+#    $url=~s{[^/]*$}{};
+#    $url.=$relurl;
+#    warn "Redirect to: $url\n";
+#    $resp=$ua->get($url);
+#  }
+#  $resp->is_success() or die $url;
+#  return $resp->decoded_content();
+#}
+
 if ($BASE) {
        my $pageno=1;
        my %seen;
@@ -50,7 +73,43 @@ PAGES:       for (;;) {
                my $pageurl=$BASE.'&strana='.$pageno;
                my $page=LWP::Simple::get($pageurl) or die $pageurl;
                my $did=0;
-               while ($page=~m{<img src="http://(?:\Qi.idnes.cz\E/\d{2}/\d{3}|\Qimgs.idnes.cz\E/\w+)(?:/\w+)?/([-.\w]+.jpg)" }gi) {
+               my $aspx=0;
+               while ($page=~m{<a href="([?]c=[^<>"]*&amp;foto=[^<>"&]*(?:&amp;inframe=1)?)"(?: target="foto-iframe")?>}gi) {
+                       my $relurl=$1;
+                       $relurl=~s{&amp;}{&}g;
+                       my $frameurl=$BASE;
+                       $frameurl=~s{[?].*}{};
+                       $frameurl.=$relurl;
+                       my $frame=LWP::Simple::get($frameurl) or die $frameurl;
+                       if ($frame=~m{<iframe name="foto-iframe" id="foto-iframe" [^<>]* src="([?]c=[^<>"]*&amp;inframe=1&amp;[^<>"]*foto=[^<>"]*)">}) {
+                               $relurl=$1;
+                               $relurl=~s{&amp;}{&}g;
+                               $frameurl=~s{[?].*}{};
+                               $frameurl.=$relurl;
+                               $frame=LWP::Simple::get($frameurl) or die $frameurl;
+                       }
+                       if ($frame!~m{<img\s+id="fotka"\s+alt="([^"]*)"\s+src="(http://\w+\Q.idnes.cz/\E[\d/]+)/(?:gal|cl6h|cl6)/([^<>"]+)" }is) {
+die $frame;
+                               last if !$did;
+                               die "No aspx image found: $frameurl";
+                       }
+                       $did=1;
+                       $aspx=1;
+                       my $text=$1;
+                       my $img_src="$2/org/$3";
+                       if (!LWP::Simple::head($img_src)) {
+                               $img_src="$2/maxi/$3";
+                               die $img_src if !LWP::Simple::head($img_src);
+                       }
+                       print <<"EOH";
+<hr>
+<img src="$img_src" border="0">
+EOH
+                       print <<"EOH" if !$seen_p_text{$text}++;
+<p>$text</p>
+EOH
+               }
+               while (!$aspx && $page=~m{<img src="http://(?:\Qi.idnes.cz\E/\d{2}/\d{3}|\Qimgs.idnes.cz\E/\w+)(?:/\w+)?/([-.\w]+.jpg)" }gi) {
                        $did=1;
                        my($base)=($1);
                        last PAGES if $seen{$base}++;
@@ -81,6 +140,7 @@ EOH
                        warn "No text found: $infourl" if !$hit;
                        }
                die $pageurl if !$did;
+               last if $aspx;
                $pageno++;
                }
        }
index c64b21d..6055416 100644 (file)
@@ -1,7 +1,7 @@
-# $Id$
+# $Id: OOo-LiveCD.ks,v 1.1 2010/03/24 14:50:06 lace Exp $
 
-#include /usr/share/spin-kickstarts/fedora-livecd-desktop.ks
-%include /usr/share/rpmfusion-nonfree-remix-kickstarts/rpmfusion-nonfree-livecd-desktop.ks
+%include /usr/share/spin-kickstarts/fedora-livecd-desktop.ks
+#%include /usr/share/rpmfusion-nonfree-remix-kickstarts/rpmfusion-nonfree-livecd-desktop.ks
 
 timezone Europe/Prague
 selinux --disabled
@@ -18,90 +18,12 @@ selinux --disabled
 
 # office
 evince
-openoffice.org-*
--openoffice.org-devel
--openoffice.org-bsh
--openoffice.org-emailmerge
--openoffice.org-ogltrans
--openoffice.org-ooolatex
--openoffice.org-pdfimport
--openoffice.org-headless
--openoffice.org-pyuno
--openoffice.org-report-builder
--openoffice.org-rhino
--openoffice.org-sdk*
--openoffice.org-testtools
--openoffice.org-voikko
--openoffice.org-wiki-publisher
--openoffice.org-writer2latex
--openoffice.org-writer2xhtml
--openoffice.org-xsltfilter
--openoffice.org-langpack-af_ZA
--openoffice.org-langpack-ar
--openoffice.org-langpack-as_IN
--openoffice.org-langpack-bg_BG
--openoffice.org-langpack-bn
--openoffice.org-langpack-ca_ES
-#openoffice.org-langpack-cs_CZ
--openoffice.org-langpack-cy_GB
--openoffice.org-langpack-da_DK
--openoffice.org-langpack-de
--openoffice.org-langpack-dz
--openoffice.org-langpack-el_GR
-#openoffice.org-langpack-en
--openoffice.org-langpack-es
--openoffice.org-langpack-et_EE
--openoffice.org-langpack-eu_ES
--openoffice.org-langpack-fi_FI
--openoffice.org-langpack-fr
--openoffice.org-langpack-ga_IE
--openoffice.org-langpack-gl_ES
--openoffice.org-langpack-gu_IN
--openoffice.org-langpack-he_IL
--openoffice.org-langpack-hi_IN
--openoffice.org-langpack-hr_HR
--openoffice.org-langpack-hu_HU
--openoffice.org-langpack-it
--openoffice.org-langpack-ja_JP
--openoffice.org-langpack-kn_IN
--openoffice.org-langpack-ko_KR
--openoffice.org-langpack-lt_LT
--openoffice.org-langpack-mai_IN
--openoffice.org-langpack-ml_IN
--openoffice.org-langpack-mr_IN
--openoffice.org-langpack-ms_MY
--openoffice.org-langpack-nb_NO
--openoffice.org-langpack-nl
--openoffice.org-langpack-nn_NO
--openoffice.org-langpack-nr_ZA
--openoffice.org-langpack-nso_ZA
--openoffice.org-langpack-or_IN
--openoffice.org-langpack-pa
--openoffice.org-langpack-pl_PL
--openoffice.org-langpack-pt_BR
--openoffice.org-langpack-pt_PT
--openoffice.org-langpack-ro
--openoffice.org-langpack-ru
--openoffice.org-langpack-si
--openoffice.org-langpack-sk_SK
--openoffice.org-langpack-sl_SI
--openoffice.org-langpack-sr
--openoffice.org-langpack-ss_ZA
--openoffice.org-langpack-st_ZA
--openoffice.org-langpack-sv
--openoffice.org-langpack-ta_IN
--openoffice.org-langpack-te_IN
--openoffice.org-langpack-th_TH
--openoffice.org-langpack-tn_ZA
--openoffice.org-langpack-tr_TR
--openoffice.org-langpack-ts_ZA
--openoffice.org-langpack-uk
--openoffice.org-langpack-ur
--openoffice.org-langpack-ve_ZA
--openoffice.org-langpack-xh_ZA
--openoffice.org-langpack-zh_CN
--openoffice.org-langpack-zh_TW
--openoffice.org-langpack-zu_ZA
+openoffice.org-base
+openoffice.org-calc
+openoffice.org-impress
+openoffice.org-math
+openoffice.org-writer
+openoffice.org-extendedPDF
 -abiword
 
 # graphics
@@ -121,31 +43,14 @@ thunderbird
 qemu-img
 qemu-kvm
 qemu-system-x86
-libvpx-utils
-sunbird
--abrt*
-cvs
-git
--empathy
--eog
-gthumb
-gnash
-java-*-openjdk-plugin
 
 # non-free
-mplayer
-#FIXME:gstreamer-plugins-bad-nonfree
-ffmpeg2theora
-#FIXME:lha
-#FIXME:unrar
+#mplayer
 
 %end
 
 %post
 
-rpm -i http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
-rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
-
 cat >> /etc/rc.d/init.d/livesys << EOF
 
 # set up timed auto-login for after 60 seconds
index dd707cc..72c0a1d 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/bash
-# $Id$
+# $Id: OOo-LiveCD.sh,v 1.2 2010/03/24 15:03:15 lace Exp $
 
 set -ex
 SIZE=2021654528
-BASE=f14-live
+BASE=OOo-LiveCD
 BIN=$BASE.bin
 ISO64=$BASE-x86_64.iso
 ISO32=$BASE-i686.iso
@@ -12,7 +12,11 @@ KS=$BASE.ks
 SELF=$BASE.sh
 # $PWD: rpm: arguments to --root (-r) must begin with a /
 MNT=$PWD/$BASE.mnt
-LOOPDEV=
+# Cheat livecd-iso-to-disk getdisk():
+LOOPDEV=/dev/loop-$BASE.dev
+LOOPDEVMK="mknod $LOOPDEV b 7 0"
+LOOPDEV1=/dev/loop-$BASE.dev1
+LOOPDEV1MK="mknod $LOOPDEV1 b 7 1"
 
 set -o pipefail
 renice +19 -p $$
@@ -20,6 +24,8 @@ ionice -c3 -p $$
 test "`uname -m`" = "x86_64"
 test ! -e $BIN
 test ! -e $ISO
+test ! -e $LOOPDEV
+test ! -e $LOOPDEV1
 test ! -e $MNT
 test -e $SELF
 
@@ -36,47 +42,85 @@ if [ ! -e $ISO32 ];then
   mv -f $ISO $ISO32
 fi
 
-trap 'set +e; rm -f $BIN; (umount $MNT/{c,b,a,}; rmdir $MNT/{c,b,a,}; losetup -d $LOOPDEV) 2>/dev/null' EXIT
+$LOOPDEVMK
+test "`losetup $LOOPDEV 2>&1|tee /proc/self/fd/2`" = "loop: can't get info on device $LOOPDEV: No such device or address"
+$LOOPDEV1MK
+test "`losetup $LOOPDEV1 2>&1|tee /proc/self/fd/2`" = "loop: can't get info on device $LOOPDEV1: No such device or address"
+
 dd if=/dev/zero of=$BIN bs=1 seek=$[SIZE-1] count=1
-/sbin/parted --script $BIN mklabel msdos
-dd bs=1 if=/usr/share/syslinux/mbr.bin of=$BIN conv=notrunc
-# 17408=34*512
-/sbin/parted --script $BIN unit b mkpart primary fat32 17408 $[$(find $BIN -printf %s)-17408] set 1 boot on
-LOOPDEV=`losetup -o 17408 -v -f $BIN | sed 's/^Loop device is //'`
-[ -n "$LOOPDEV" -a "${LOOPDEV#/dev/loop[0-9]}" != "$LOOPDEV" ]
-/sbin/mkdosfs -n LIVE $LOOPDEV
-UUID="$(dd skip=$[0x43] bs=1 count=4 if=$LOOPDEV|od -An -txI|tr a-z A-Z|sed 's/^ \(....\)\(....\)$/\1-\2/')"
+losetup $LOOPDEV $BIN
+losetup -o $[34*512] $LOOPDEV1 $LOOPDEV
 # --overlay-size-mb 100 --home-size-mb 100
-echo | livecd-iso-to-disk --unencrypted-home --livedir $BASE-i686 $ISO32 $LOOPDEV
+echo | livecd-iso-to-disk --unencrypted-home --livedir $BASE-i686 --format --reset-mbr $ISO32 $LOOPDEV
 mkdir $MNT
-mount $LOOPDEV $MNT
-CFG="`cat $MNT/syslinux/syslinux.cfg | sed 's/\( root=live:UUID=\)....-.... /\1'"$UUID /"`"
+mount $LOOPDEV1 $MNT
+UUID1="$(sed <$MNT/syslinux/syslinux.cfg -n 's/^.* root=live:UUID=\([0-9A-Z]*-[0-9A-Z]*\) .*$/\1/p'|uniq)"
+test -n "$UUID1"
 mv $MNT/syslinux/initrd0.img $MNT/syslinux/initrd1.img
 mv $MNT/syslinux/vmlinuz0 $MNT/syslinux/vmlinuz1
 umount $MNT
-livecd-iso-to-disk --unencrypted-home --livedir $BASE-x86_64 $ISO64 $LOOPDEV
-mount $LOOPDEV $MNT
+rmdir $MNT
+livecd-iso-to-disk --unencrypted-home --livedir $BASE-x86_64 $ISO64 $LOOPDEV1
+mkdir $MNT
+mount $LOOPDEV1 $MNT
+UUID0="$(sed <$MNT/syslinux/syslinux.cfg -n 's/^.* root=live:UUID=\([0-9A-Z]*-[0-9A-Z]*\) .*$/\1/p'|uniq)"
+test -n "$UUID0"
 cp -p /usr/share/syslinux/ifcpu64.c32 $MNT/syslinux/
-(
-  echo "$CFG" | sed -n '1,/^menu hiddenrow/p'
-  cat <<EOH
+cat >$MNT/syslinux/syslinux.cfg <<EOH
+
+default vesamenu.c32
+timeout 100
+
+menu background splash.jpg
+menu title Welcome to $BASE!
+menu color border 0 #ffffffff #00000000
+menu color sel 7 #ffffffff #ff000000
+menu color title 0 #ffffffff #00000000
+menu color tabmsg 0 #ffffffff #00000000
+menu color unsel 0 #ffffffff #00000000
+menu color hotsel 0 #ff000000 #ffffffff
+menu color hotkey 7 #ffffffff #ff000000
+menu color timeout_msg 0 #ffffffff #00000000
+menu color timeout 0 #ffffffff #00000000
+menu color cmdline 0 #ffffffff #00000000
+menu hidden
+menu hiddenrow 5
 label detect
   menu label Autoselect x86_64 / i686 Boot
   kernel ifcpu64.c32
   append linux0 -- linux1
-  menu default
+menu default
+label linux0
+  menu label Boot x86_64
+  kernel vmlinuz0
+  append initrd=initrd0.img root=live:UUID=$UUID0 rootfstype=vfat ro liveimg live_dir=$BASE-x86_64 quiet  rhgb rd_NO_LUKS rd_NO_MD noiswmd 
+label check0
+  menu label Verify and Boot x86_64
+  kernel vmlinuz0
+  append initrd=initrd0.img root=live:UUID=$UUID0 rootfstype=vfat ro liveimg live_dir=$BASE-x86_64 quiet  rhgb check
+label linux1
+  menu label Boot i686
+  kernel vmlinuz1
+  append initrd=initrd1.img root=live:UUID=$UUID1 rootfstype=vfat ro liveimg live_dir=$BASE-i686 quiet  rhgb rd_NO_LUKS rd_NO_MD noiswmd 
+label check1
+  menu label Verify and Boot i686
+  kernel vmlinuz1
+  append initrd=initrd1.img root=live:UUID=$UUID1 rootfstype=vfat ro liveimg live_dir=$BASE-i686 quiet  rhgb check
+label memtest
+  menu label Memory Test
+  kernel memtest
+label local
+  menu label Boot from local drive
+  localboot 0xffff
 EOH
-  echo "$CFG" | sed -n -e "s/$BASE-i686/$BASE-x86_64/g"                             -e 's/^  menu label .*$/& x86_64/' -e '/^label.*0$/,/^  append/p'
-  echo "$CFG" | sed -n -e 's/^\(label.*\)0$/\11/' -e 's/\(vmlinuz\|initrd\)0/\11/g' -e 's/^  menu label .*$/& i686/'   -e '/^label.*1$/,/^  append/p'
-  echo "$CFG" | sed -n '/^label mem/,$p'
-) >$MNT/syslinux/syslinux.cfg
 cp -p $SELF $MNT/
 if [ -e "$KS" ];then
   cp -p $KS $MNT/
 fi
 umount $MNT
+
 mkdir $MNT/{a,b,c}
-mount $LOOPDEV $MNT/a
+mount    -o loop $LOOPDEV1 $MNT/a
 mount -r -o loop $MNT/a/$BASE-x86_64/squashfs.img $MNT/b
 mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
 rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-x86_64/rpm-qa
@@ -84,6 +128,16 @@ umount $MNT/{c,b}
 mount -r -o loop $MNT/a/$BASE-i686/squashfs.img $MNT/b
 mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
 rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-i686/rpm-qa
-diff -u <(sed 's/\.x86_64$//' <$MNT/a/$BASE-x86_64/rpm-qa) <(sed 's/\.i.86$//' <$MNT/a/$BASE-i686/rpm-qa) || :
-BIN=
+umount $MNT/{c,b}
+diff -u <(sed 's/\.x86_64$//' <$MNT/a/$BASE-x86_64/rpm-qa) <(sed 's/\.i686$//' <$MNT/a/$BASE-i686/rpm-qa) || :
+umount $MNT/a
+rmdir $MNT/{c,b,a}
+
+rmdir $MNT
+losetup -d $LOOPDEV1
+rm -f $LOOPDEV1
+losetup -d $LOOPDEV
+rm -f $LOOPDEV
+# livecd-iso-to-disk resetMBR does not work due to /dev/loop*.
+dd bs=1 if=/usr/share/syslinux/mbr.bin of=$BIN conv=notrunc
 echo OK