[ User ] Login

Bug 257: OPEN

tazlito writeiso fails

Date: 2021-05-10 - Creator: hgt - Priority standard - 1 message

When SliTaz is booted in live mode from the
ISO image slitaz-rolling-core64 from 2021-05-02,
and tazlito is called to create a new ISO image:
# tazlito writeiso lzma SAR
and some other files are created, but /usr/bin/tazlito is aborted at line 516
with "arithmetic syntax error".

echo "dclust: $dclust"
is inserted to /usr/bin/tazlito immediately before line 516,
it shows variable dclust is undefined.

Affected package(s): tazlito


By: hgt on 2022-01-17 12:54

With the below modifications tazlito-533 can be made working
with the function writeiso again.

When SliTaz is booted in live mode from the ISO image
slitaz-rolling-core64 from 2022-01-09,
# mount /dev/cdrom /media/cdrom
is successful, even when there is no optical disk drive at all:
/dev/cdrom is mounted as filesystem of type configfs
and there are no files in /media/cdrom.

So at least in this case, checking this mount command for success
is no way to secure the accessibility of files required for
Checking for the existence of a directory /media/cdrom/boot as
in my modification might be a better way.
So the user can (loop-)mount an ISO image to /media/cdrom before
calling tazlito, or will be asked to mount it before tazlito
tries to copy the files required for booting.

Do not forget to copy the kernel /boot/vmlinuz\*slitaz\*!

umount /media/cdrom
is removed from copy_from_cd()
"arithmetic syntax error" no longer occurs.

It is not tested, whether these modifications have side effects
on the other functions of tazlito, or the use of tazlito in
other hardware configurations!

--- /usr/bin/tazlito
+++ tazlito
@@ -3131,14 +3131,13 @@
copy_from_cd() {
cp /media/cdrom/boot/bzImage\* /boot
cp -a /media/cdrom/boot/isolinux /boot
+ cp /media/cdrom/boot/vmlinuz\*slitaz\* /boot/
- umount /media/cdrom

- if mount /dev/cdrom /media/cdrom 2>/dev/null; then
- copy_from_cd;
- elif mount | grep /media/cdrom; then
- copy_from_cd;
+ if [ -d /media/cdrom/boot ]
+ then
+ copy_from_cd
#elif [ -f "" -a -f /boot/vmlinuz-2.6.37-slitaz 
/boot/vmlinuz-3.16.55-slitaz64 /boot/vmlinuz-3.2.98-slitaz64 ]; then
# [ -f /boot/vmlinuz-2.6.37-slitaz ] cp /boot/vmlinuz-2.6.37-slitaz 
# [ -f /boot/vmlinuz-3.16.55-slitaz64 /boot/vmlinuz-3.2.98-slitaz64 ] cp 
/boot/vmlinuz-3.16.55-slitaz64 /boot/vmlinuz-3.2.98-slitaz64