Tomas-M / linux-live

Linux Live Kit
http://www.linux-live.org/
1.01k stars 250 forks source link

Failed to load ldlinux.c32 #101

Closed iobreaker closed 2 years ago

iobreaker commented 4 years ago

Hi all,

Description

When booting from the generated iso, an error is issued :

ISOLINUX 6.03 ETCD Copyright (C) 1994-2014 H. Peter Anvin et Al

Failed to load ldlinux.c32
Boot failed : press a key to retry ...

Configuration Files and environment

[root@hbcs tmp]# uname -a
Linux hbcs 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@hbcs tmp]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)

Steps to Reproduce

Expected Functionality

Boot into your customized linux

Config File

[root@hbcs tmp]# cat /linux-live/config 
#!/bin/bash
# This is a config file for Linux Live Kit build script.
# You shouldn't need to change anything expect LIVEKITNAME

# Live Kit Name. Defaults to 'linux';
# This will be the name of the directory created on your CD/USB, which
# will contain everything including boot files and such.
# For example, Slax changes it to 'slax'
# Must not contain any spaces.
# If you change it, you must run ./tools/isolinux.bin.update script
# in order to update isolinux.bin for CD booting.
# If you do not need booting from CD (eg you're booting only from USB)
# then you can ignore recompiling isolinux.bin, just rename LIVEKITNAME
# and you're done.
LIVEKITNAME="mysuperiso"

# Kernel file, will be copied to your Live Kit
# Your kernel must support aufs and squashfs. Debian Jessie's kernel is ready
# out of the box.
#VMLINUZ=/vmlinuz
VMLINUZ=/boot/vmlinuz-3.10.0-1062.el7.x86_64

# Kernel version. Change it to "3.2.28" for example, if you are building
# Live Kit with a different kernel than the one you are actually running
KERNEL=$(uname -r)

# List of directories for root filesystem
# No subdirectories are allowed, no slashes,
# so You can't use /var/tmp here for example
# Exclude directories like proc sys tmp
MKMOD="bin etc home lib lib64 opt root sbin srv usr var"

# If you require network support in initrd, for example to boot over
# PXE or to load data using 'from' boot parameter from a http server,
# you will need network modules included in your initrd.
# This is disabled by default since most people won't need it.
# To enable, set to true
NETWORK=false

# Temporary directory to store livekit filesystem
LIVEKITDATA=/tmp/$LIVEKITNAME-data-$$

# Bundle extension, for example 'sb' for .sb extension
BEXT=sb

# Directory with kernel .ko modules, can be different in some distros
LMK="lib/modules/$KERNEL"

Generation Log

[root@hbcs linux-live]# ./build 
Changing current directory to /linux-live
Building intramfs image...
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /tmp/hbcs-data-8951/hbcs/01-core.sb, block size 1048576.
[============================================================================================================================================================================================================================================|           ] 24753/25822  95%
File /var/lib/NetworkManager/dhclient-8935414b-7b67-439f-b649-8ef3ef0f74a1-ens160.lease changed size while reading filesystem, attempting to re-read
[======================================================================================================================================================================================================================================================\ ] 25796/25822  99%
File /var/log/audit/audit.log changed size while reading filesystem, attempting to re-read

File /var/log/cron changed size while reading filesystem, attempting to re-read

File /var/log/messages changed size while reading filesystem, attempting to re-read
[=======================================================================================================================================================================================================================================================|] 25822/25822 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 1048576
        compressed data, compressed metadata, compressed fragments, compressed xattrs
        duplicates are removed
Filesystem size 666637.95 Kbytes (651.01 Mbytes)
        37.90% of uncompressed filesystem size (1759097.24 Kbytes)
Inode table size 273058 bytes (266.66 Kbytes)
        16.49% of uncompressed inode table size (1656329 bytes)
Directory table size 289058 bytes (282.28 Kbytes)
        37.32% of uncompressed directory table size (774461 bytes)
Xattr table size 3686 bytes (3.60 Kbytes)
        18.41% of uncompressed xattr table size (20017 bytes)
Number of duplicate files found 1923
Number of inodes 30847
Number of files 24825
Number of fragments 759
Number of symbolic links  1044
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 23
Number of directories 4955
Number of ids (unique uids + gids) 17
Number of uids 5
        root (0)
        chrony (998)
        polkitd (999)
        hbcs (1000)
        postfix (89)
Number of gids 16
        root (0)
        chrony (996)
        polkitd (998)
        ssh_keys (997)
        hbcs (1000)
        bin (1)
        slocate (21)
        nobody (99)
        tty (5)
        dbus (81)
        utmp (22)
        utempter (35)
        sys (3)
        postdrop (90)
        postfix (89)
        mail (12)
-----------------------------
Finished. Find your result in /tmp/hbcs-data-8951
To build ISO, run: /tmp/gen_hbcs_iso.sh
To build ZIP, run: /tmp/gen_hbcs_zip.sh

ISO Build Log

[root@hbcs tmp]# ./gen_hbcs_iso.sh 
genisoimage 1.1.11 (Linux)
Scanning .
Scanning ./hbcs
Scanning ./hbcs/modules
Scanning ./hbcs/changes
Scanning ./hbcs/boot
Writing:   Initial Padblock                        Start Block 0
Done with: Initial Padblock                        Block(s)    16
Writing:   Primary Volume Descriptor               Start Block 16
Done with: Primary Volume Descriptor               Block(s)    1
Writing:   Eltorito Volume Descriptor              Start Block 17
Size of boot image is 4 sectors -> No emulation
Done with: Eltorito Volume Descriptor              Block(s)    1
Writing:   Joliet Volume Descriptor                Start Block 18
Done with: Joliet Volume Descriptor                Block(s)    1
Writing:   End Volume Descriptor                   Start Block 19
Done with: End Volume Descriptor                   Block(s)    1
Writing:   Version block                           Start Block 20
Done with: Version block                           Block(s)    1
Writing:   Path table                              Start Block 21
Done with: Path table                              Block(s)    4
Writing:   Joliet path table                       Start Block 25
Done with: Joliet path table                       Block(s)    4
Writing:   Directory tree                          Start Block 29
Done with: Directory tree                          Block(s)    6
Writing:   Joliet directory tree                   Start Block 35
Done with: Joliet directory tree                   Block(s)    5
Writing:   Directory tree cleanup                  Start Block 40
Done with: Directory tree cleanup                  Block(s)    0
Writing:   Extension record                        Start Block 40
Done with: Extension record                        Block(s)    1
Writing:   The File(s)                             Start Block 41
  1.48% done, estimate finish Tue Mar  3 10:14:43 2020
  2.96% done, estimate finish Tue Mar  3 10:14:43 2020
  4.43% done, estimate finish Tue Mar  3 10:14:43 2020
  5.91% done, estimate finish Tue Mar  3 10:14:43 2020
  7.38% done, estimate finish Tue Mar  3 10:14:43 2020
  8.86% done, estimate finish Tue Mar  3 10:14:43 2020
 10.33% done, estimate finish Tue Mar  3 10:14:43 2020
 11.81% done, estimate finish Tue Mar  3 10:14:43 2020
 13.29% done, estimate finish Tue Mar  3 10:14:43 2020
 14.76% done, estimate finish Tue Mar  3 10:14:43 2020
 16.24% done, estimate finish Tue Mar  3 10:14:43 2020
 17.72% done, estimate finish Tue Mar  3 10:14:43 2020
 19.19% done, estimate finish Tue Mar  3 10:14:43 2020
 20.67% done, estimate finish Tue Mar  3 10:14:43 2020
 22.14% done, estimate finish Tue Mar  3 10:14:43 2020
 23.62% done, estimate finish Tue Mar  3 10:14:47 2020
 25.09% done, estimate finish Tue Mar  3 10:14:46 2020
 26.57% done, estimate finish Tue Mar  3 10:14:46 2020
 28.04% done, estimate finish Tue Mar  3 10:14:46 2020
 29.52% done, estimate finish Tue Mar  3 10:14:46 2020
 31.00% done, estimate finish Tue Mar  3 10:14:46 2020
 32.48% done, estimate finish Tue Mar  3 10:14:46 2020
 33.95% done, estimate finish Tue Mar  3 10:14:45 2020
 35.43% done, estimate finish Tue Mar  3 10:14:45 2020
 36.90% done, estimate finish Tue Mar  3 10:14:45 2020
 38.38% done, estimate finish Tue Mar  3 10:14:45 2020
 39.85% done, estimate finish Tue Mar  3 10:14:45 2020
 41.33% done, estimate finish Tue Mar  3 10:14:45 2020
 42.80% done, estimate finish Tue Mar  3 10:14:45 2020
 44.28% done, estimate finish Tue Mar  3 10:14:45 2020
 45.76% done, estimate finish Tue Mar  3 10:14:47 2020
 47.23% done, estimate finish Tue Mar  3 10:14:47 2020
 48.71% done, estimate finish Tue Mar  3 10:14:47 2020
 50.19% done, estimate finish Tue Mar  3 10:14:46 2020
 51.66% done, estimate finish Tue Mar  3 10:14:46 2020
 53.14% done, estimate finish Tue Mar  3 10:14:46 2020
 54.61% done, estimate finish Tue Mar  3 10:14:46 2020
 56.09% done, estimate finish Tue Mar  3 10:14:46 2020
 57.56% done, estimate finish Tue Mar  3 10:14:46 2020
 59.04% done, estimate finish Tue Mar  3 10:14:46 2020
 60.52% done, estimate finish Tue Mar  3 10:14:46 2020
 61.99% done, estimate finish Tue Mar  3 10:14:46 2020
 63.47% done, estimate finish Tue Mar  3 10:14:46 2020
 64.95% done, estimate finish Tue Mar  3 10:14:47 2020
 66.42% done, estimate finish Tue Mar  3 10:14:47 2020
 67.90% done, estimate finish Tue Mar  3 10:14:47 2020
 69.37% done, estimate finish Tue Mar  3 10:14:47 2020
 70.85% done, estimate finish Tue Mar  3 10:14:47 2020
 72.32% done, estimate finish Tue Mar  3 10:14:47 2020
 73.80% done, estimate finish Tue Mar  3 10:14:47 2020
 75.27% done, estimate finish Tue Mar  3 10:14:46 2020
 76.75% done, estimate finish Tue Mar  3 10:14:46 2020
 78.23% done, estimate finish Tue Mar  3 10:14:46 2020
 79.70% done, estimate finish Tue Mar  3 10:14:46 2020
 81.18% done, estimate finish Tue Mar  3 10:14:46 2020
 82.66% done, estimate finish Tue Mar  3 10:14:46 2020
 84.13% done, estimate finish Tue Mar  3 10:14:47 2020
 85.61% done, estimate finish Tue Mar  3 10:14:47 2020
 87.08% done, estimate finish Tue Mar  3 10:14:47 2020
 88.56% done, estimate finish Tue Mar  3 10:14:47 2020
 90.03% done, estimate finish Tue Mar  3 10:14:47 2020
 91.51% done, estimate finish Tue Mar  3 10:14:47 2020
 92.99% done, estimate finish Tue Mar  3 10:14:47 2020
 94.46% done, estimate finish Tue Mar  3 10:14:47 2020
 95.94% done, estimate finish Tue Mar  3 10:14:47 2020
 97.42% done, estimate finish Tue Mar  3 10:14:47 2020
 98.89% done, estimate finish Tue Mar  3 10:14:47 2020
Total translation table size: 2048
Total rockridge attributes bytes: 2699
Total directory bytes: 10240
Path table size(bytes): 66
Done with: The File(s)                             Block(s)    338577
Writing:   Ending Padblock                         Start Block 338618
Done with: Ending Padblock                         Block(s)    150
Max brk space used 1b000
338768 extents written (661 MB)

ISO boot directory content

/tmp/hbcs-data-8951/hbcs/boot
[root@hbcs boot]# ll
total 10532
-rwxr-xr-x. 1 root root    1175 Mar  3 09:54 bootinst.bat
-rwxr-xr-x. 1 root root    1156 Mar  3 09:54 bootinst.sh
-rw-r--r--. 1 root root    9798 Mar  3 09:54 bootlogo.png
-rwxr-xr-x. 1 root root  208480 Mar  3 09:54 extlinux.x32
-rwxr-xr-x. 1 root root  209424 Mar  3 09:54 extlinux.x64
-rw-r--r--. 1 root root 2775356 Mar  3 09:54 initrfs.img
-rw-r--r--. 1 root root   40960 Mar  3 10:14 isolinux.bin
-rw-r--r--. 1 root root  116552 Mar  3 09:54 ldlinux.c32
-rw-r--r--. 1 root root  181944 Mar  3 09:54 libcom32.c32
-rw-r--r--. 1 root root   23628 Mar  3 09:54 libutil.c32
-rw-r--r--. 1 root root     440 Mar  3 09:54 mbr.bin
-rw-r--r--. 1 root root   46909 Mar  3 09:54 pxelinux.0
-rw-r--r--. 1 root root     451 Mar  3 09:54 syslinux.cfg
-rw-r--r--. 1 root root  126511 Mar  3 09:54 syslinux.com
-rw-r--r--. 1 root root  243712 Mar  3 09:54 syslinux.exe
-rw-r--r--. 1 root root   26684 Mar  3 09:54 vesamenu.c32
-rwxr-xr-x. 1 root root 6734016 Mar  3 09:54 vmlinuz-3.10.0-1062.el7.x86_64

Kind Regards

thesoulkiller commented 4 years ago

Hello, I have the same issue as you and I'm using Debian (4.19 amd64). I guess after the step

customize config file (vmlinuz part)

you have to run the script tools/isolinux.bin.update . Maybe isolinux.bin is incompatible with your kernel version. However I've already run the script, it's failed when building the isolinux.bin . Errors were:

ld: cannot find /usr/lib/crt0,efi,ia32.o
ld: skipping incompatible /usr/lib/libgnuefi.a
ld: skipping incompatible /usr/lib/libefi.a 
theogfx commented 4 years ago

If you change the LIVEKITNAME var in config, then you should also rebuild the isolinux files (for USB or CD).

Thus when launching ./tools/isolinux.bin.update, you should specify the following-path:

/<LIVEKITNAME>/boot

Don't forget to copy the newly built files to ./bootfiles/ and voilà!

neilmunday commented 4 years ago

./tools/isolinux.bin.update does not work under CentOS as it is written for Debian. I'd be interested to know the steps required to make this work with CentOS.

mjhorvath commented 3 years ago

Don't forget to copy the newly built files to ./bootfiles/ and voilà!

What are the names of the files we are supposed to copy? I don't have a diff of the folder contents, and there is not a dedicated subfolder.

handibles commented 2 years ago

Don't forget to copy the newly built files to ./bootfiles/ and voilà! ... What are the names of the files we are supposed to copy?

Likely it was in the working directory at the time - did a search in the gnome GUI (Ctrl+F ldlinux.c32) and found the second updated copies in the base dir of linux-live-kit (several other copies from slax internal stuff e.g. debian9, debian10) - presumably I was there when I called bin.update.

Copied files with a newer, shared timestamp to linux-live-kit.x.y/bootfiles/ and currently building ...

Tomas-M commented 2 years ago

I am closing all issues to make some cleanup. Please reopen if you still need to, yet I cannot guarantee that I can help with your current issue.