http://www.salixos.org/forum/viewtopic. ... 368#p24368
As requested by Shador there, here is the output of
Code: Select all
#bash -x install-on-usb.sh 2>&1 | tee log
Code: Select all
++ dirname install-on-USB.sh
+ cd .
+ VER=1.7
+ AUTHOR='Pontvieux Cyrille - jrd@enialis.net'
+ LICENCE='GPL v3+'
++ basename install-on-USB.sh
+ SCRIPT=install-on-USB.sh
++ readlink -f install-on-USB.sh
+ SCRIPT=/media/disk/boot/install-on-USB.sh
+ '[' '!' -t 0 ']'
+ '[' '' = --version ']'
+ '[' '' = -v ']'
+ '[' '' = --help ']'
+ '[' '' = -h ']'
++ id -ru
+ '[' 0 -ne 0 ']'
++ get_mnt_dir
++ OIFS='
'
++ IFS='
'
+++ mount
+++ sed -e 's/^.* on \(.*\) type.*$/\1/'
+++ sort -dur
++ mounts='/sys
/proc
/media/disk
/home/one/.gvfs
/'
++ startdir=/media/disk/boot
++ unset mntdir
++ '[' /media/disk/boot '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /media/disk ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /home/one/.gvfs ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = / ']'
++ cd ..
++ '[' /media/disk '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk = /media/disk ']'
++ echo /media/disk
++ cd /media/disk/boot
++ return
+ MNTDIR=/media/disk
+ RES=0
+ '[' 0 -ne 0 ']'
+ '[' '!' -f /media/disk/salix-mate-13.37-32.live ']'
++ cd ..
++ echo /media/disk
++ sed -e s:/media/disk:: -e 's:^/::'
+ BASEDIR=
+ '[' -n '' ']'
++ get_dev_part /media/disk
++ MNTDIR=/media/disk
+++ mount
+++ grep 'on /media/disk '
+++ cut '-d ' -f1
+++ head -n 1
++ DEVPART=/dev/sdb1
++ '[' -z /dev/sdb1 ']'
+++ echo /dev/sdb1
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb1 ']'
++ '[' '!' -b /dev/sdb1 ']'
++ echo /dev/sdb1
+ DEVPART=/dev/sdb1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_partition_num /dev/sdb1
++ DEVPART=/dev/sdb1
++ echo /dev/sdb1
++ sed 's/^.*[^0-9]\([0-9]*\)$/\1/'
+ PARTNUM=1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_dev_root /dev/sdb1 1
++ DEVPART=/dev/sdb1
++ PARTNUM=1
+++ echo /dev/sdb1
+++ sed 's/1$//'
++ DEVROOT=/dev/sdb
+++ echo /dev/sdb
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb ']'
++ '[' '!' -b /dev/sdb ']'
++ echo /dev/sdb
+ DEVROOT=/dev/sdb
+ RES=0
+ '[' 0 -ne 0 ']'
+ install_syslinux /media/disk /dev/sdb /dev/sdb1 1 ''
+ DIR=/media/disk
+ DEVICE=/dev/sdb
+ DEVPART=/dev/sdb1
+ PARTNUM=1
+ BASEDIR=
+ USELILO=true
+ img=/media/disk/boot/g2l.img
+ relimg=boot/g2l.img
+ '[' -f /media/disk/boot/g2l.img ']'
+ which syslinux
+ '[' 0 -ne 0 ']'
+ which parted
+ '[' 0 -ne 0 ']'
+ which lilo
+ '[' 0 -ne 0 ']'
+ echo 'Warning: syslinux+grub2 is about to be installed in /dev/sdb'
Warning: syslinux+grub2 is about to be installed in /dev/sdb
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'on partition /dev/sdb1'
on partition /dev/sdb1
+ printf 'Do you want to continue? [y/N] '
Do you want to continue? [y/N] + read R
+ '[' y = y ']'
+ set -e
++ dd if=/dev/sdb bs=1 count=2 skip=510
++ od -t x1
++ tr '\n' ' '
+ signature='0000000 55 aa 0000002 '
+ '[' '0000000 55 aa 0000002 ' '!=' '0000000 55 aa 0000002 ' ']'
++ echo /dev/sdb
++ tr / _
++ date +%Y%m%d%H%M
+ bakfile=/media/disk/boot/_dev_sdb.mbr.201207111943
+ echo 'Backing up mbr of /dev/sdb to '\''/media/disk/boot/_dev_sdb.mbr.201207111943'\''...'
Backing up mbr of /dev/sdb to '/media/disk/boot/_dev_sdb.mbr.201207111943'...
+ dd if=/dev/sdb of=/media/disk/boot/_dev_sdb.mbr.201207111943 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.0156e-05 s, 17.0 MB/s
+ echo 'Installing syslinux...'
Installing syslinux...
+ syslinux /dev/sdb1
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'Do you want to overwrite the MBR loader (first 440 bytes)'
Do you want to overwrite the MBR loader (first 440 bytes)
+ echo 'of the disk? Recommended unless you know the code in there'
of the disk? Recommended unless you know the code in there
+ printf 'already does what you want. [y/N] '
already does what you want. [y/N] + read R
+ '[' y = y ']'
+ '[' true = true ']'
+ lilo -M /dev/sdb mbr -s /media/disk/boot/_dev_sdb.mbr.201207111943
Backup copy of /dev/sdb in /media/disk/boot/_dev_sdb.mbr.201207111943.0810
The Master Boot Record of /dev/sdb has been updated.
+ echo 'Setting bootable flag of /dev/sdb1...'
Setting bootable flag of /dev/sdb1...
+ parted /dev/sdb set 1 boot on
[?1034h
Information: You may need to update /etc/fstab.
+ sync
+ cat
+ set +e
+ exit 0
++ dirname install-on-USB.sh
+ cd .
+ VER=1.7
+ AUTHOR='Pontvieux Cyrille - jrd@enialis.net'
+ LICENCE='GPL v3+'
++ basename install-on-USB.sh
+ SCRIPT=install-on-USB.sh
++ readlink -f install-on-USB.sh
+ SCRIPT=/media/disk/boot/install-on-USB.sh
+ '[' '!' -t 0 ']'
+ '[' '' = --version ']'
+ '[' '' = -v ']'
+ '[' '' = --help ']'
+ '[' '' = -h ']'
++ id -ru
+ '[' 0 -ne 0 ']'
++ get_mnt_dir
++ OIFS='
'
++ IFS='
'
+++ mount
+++ sed -e 's/^.* on \(.*\) type.*$/\1/'
+++ sort -dur
++ mounts='/sys
/proc
/media/disk
/home/one/.gvfs
/'
++ startdir=/media/disk/boot
++ unset mntdir
++ '[' /media/disk/boot '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /media/disk ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /home/one/.gvfs ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = / ']'
++ cd ..
++ '[' /media/disk '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk = /media/disk ']'
++ echo /media/disk
++ cd /media/disk/boot
++ return
+ MNTDIR=/media/disk
+ RES=0
+ '[' 0 -ne 0 ']'
+ '[' '!' -f /media/disk/salix-mate-13.37-32.live ']'
++ cd ..
++ echo /media/disk
++ sed -e s:/media/disk:: -e 's:^/::'
+ BASEDIR=
+ '[' -n '' ']'
++ get_dev_part /media/disk
++ MNTDIR=/media/disk
+++ mount
+++ grep 'on /media/disk '
+++ cut '-d ' -f1
+++ head -n 1
++ DEVPART=/dev/sdb1
++ '[' -z /dev/sdb1 ']'
+++ echo /dev/sdb1
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb1 ']'
++ '[' '!' -b /dev/sdb1 ']'
++ echo /dev/sdb1
+ DEVPART=/dev/sdb1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_partition_num /dev/sdb1
++ DEVPART=/dev/sdb1
++ echo /dev/sdb1
++ sed 's/^.*[^0-9]\([0-9]*\)$/\1/'
+ PARTNUM=1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_dev_root /dev/sdb1 1
++ DEVPART=/dev/sdb1
++ PARTNUM=1
+++ echo /dev/sdb1
+++ sed 's/1$//'
++ DEVROOT=/dev/sdb
+++ echo /dev/sdb
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb ']'
++ '[' '!' -b /dev/sdb ']'
++ echo /dev/sdb
+ DEVROOT=/dev/sdb
+ RES=0
+ '[' 0 -ne 0 ']'
+ install_syslinux /media/disk /dev/sdb /dev/sdb1 1 ''
+ DIR=/media/disk
+ DEVICE=/dev/sdb
+ DEVPART=/dev/sdb1
+ PARTNUM=1
+ BASEDIR=
+ USELILO=true
+ img=/media/disk/boot/g2l.img
+ relimg=boot/g2l.img
+ '[' -f /media/disk/boot/g2l.img ']'
+ which syslinux
+ '[' 0 -ne 0 ']'
+ which parted
+ '[' 0 -ne 0 ']'
+ which lilo
+ '[' 0 -ne 0 ']'
+ echo 'Warning: syslinux+grub2 is about to be installed in /dev/sdb'
Warning: syslinux+grub2 is about to be installed in /dev/sdb
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'on partition /dev/sdb1'
on partition /dev/sdb1
+ printf 'Do you want to continue? [y/N] '
Do you want to continue? [y/N] + read R
+ '[' y = y ']'
+ set -e
++ dd if=/dev/sdb bs=1 count=2 skip=510
++ od -t x1
++ tr '\n' ' '
+ signature='0000000 55 aa 0000002 '
+ '[' '0000000 55 aa 0000002 ' '!=' '0000000 55 aa 0000002 ' ']'
++ echo /dev/sdb
++ tr / _
++ date +%Y%m%d%H%M
+ bakfile=/media/disk/boot/_dev_sdb.mbr.201207111943
+ echo 'Backing up mbr of /dev/sdb to '\''/media/disk/boot/_dev_sdb.mbr.201207111943'\''...'
Backing up mbr of /dev/sdb to '/media/disk/boot/_dev_sdb.mbr.201207111943'...
+ dd if=/dev/sdb of=/media/disk/boot/_dev_sdb.mbr.201207111943 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.0156e-05 s, 17.0 MB/s
+ echo 'Installing syslinux...'
Installing syslinux...
+ syslinux /dev/sdb1
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'Do you want to overwrite the MBR loader (first 440 bytes)'
Do you want to overwrite the MBR loader (first 440 bytes)
+ echo 'of the disk? Recommended unless you know the code in there'
of the disk? Recommended unless you know the code in there
+ printf 'already does what you want. [y/N] '
already does what you want. [y/N] + read R
+ '[' y = y ']'
+ '[' true = true ']'
+ lilo -M /dev/sdb mbr -s /media/disk/boot/_dev_sdb.mbr.201207111943
Backup copy of /dev/sdb in /media/disk/boot/_dev_sdb.mbr.201207111943.0810
The Master Boot Record of /dev/sdb has been updated.
+ echo 'Setting bootable flag of /dev/sdb1...'
Setting bootable flag of /dev/sdb1...
+ parted /dev/sdb set 1 boot on
[?1034h
Information: You may need to update /etc/fstab.
+ sync
+ cat
+ set +e
+ exit 0