"No such file" can mean "/sbin/init does not exist", but it can also mean "a library /sbin/init depends on does not exist",Aza-Industries wrote:Hey if enyone knows what could be causing this on my Archlinux install let me know!
Let's take a look at the Arm Linux image.
Code: Select all
max@lynx:/tmp$ sudo kpartx -av archlinux-hf-2012-09-18.img
add map loop0p1 (252:4): 0 192512 linear /dev/loop0 2048
add map loop0p2 (252:5): 0 3667968 linear /dev/loop0 194560
max@lynx:/tmp$ sudo mount /dev/mapper/loop0p2 /mnt
max@lynx:/tmp$ cd /mnt
max@lynx:/mnt$ ls -l
total 84
drwxr-xr-x 2 root root 4096 Sep 5 11:31 bin
drwxr-xr-x 2 root root 4096 Sep 18 12:25 boot
drwxr-xr-x 2 root root 4096 Jan 1 1970 dev
drwxr-xr-x 40 root root 4096 Sep 18 12:40 etc
drwxr-xr-x 2 root root 4096 Sep 14 09:52 home
lrwxrwxrwx 1 root root 7 Sep 15 00:13 lib -> usr/lib
drwx------ 2 root root 16384 Sep 18 12:18 lost+found
drwxr-xr-x 2 root root 4096 Sep 14 09:52 media
drwxr-xr-x 2 root root 4096 Sep 14 09:52 mnt
drwxr-xr-x 3 root root 4096 Sep 18 12:32 opt
dr-xr-xr-x 2 root root 4096 Jul 30 05:59 proc
drwxr-x--- 2 root root 4096 Sep 18 12:47 root
drwxr-xr-x 3 root root 4096 Jan 1 1970 run
drwxr-xr-x 2 root root 4096 Sep 18 12:32 sbin
drwxr-xr-x 4 root root 4096 Sep 14 09:52 srv
dr-xr-xr-x 2 root root 4096 Jul 30 05:59 sys
drwxrwxrwt 7 root root 4096 Jan 1 1970 tmp
drwxr-xr-x 9 root root 4096 Sep 14 19:48 usr
drwxr-xr-x 12 root root 4096 Sep 14 19:48 var
Libraries necessary to boot the system MUST be in /lib.
For some reason they want to have a single library directory, and point /lib to /usr/lib.
Lets reverse that, move all libraries to /lib, and make /usr/lib point to /lib instead
Code: Select all
max@lynx:/mnt$ sudo rm lib
max@lynx:/mnt$ sudo mv usr/lib lib
max@lynx:/mnt$ cd usr
max@lynx:/mnt/usr$ sudo ln -s ../lib lib
Code: Select all
max@lynx:/mnt$ cd /tmp
max@lynx:/tmp$ sudo mksquashfs /mnt Arch_Linux.img240 -comp lzo -e lib/modules
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on Arch_Linux.img240, block size 131072.
[======================================================================================================/] 24562/24562 100%
Exportable Squashfs 4.0 filesystem, lzo compressed, data block size 131072
compressed data, compressed metadata, compressed fragments, compressed xattrs
duplicates are removed
Filesystem size 136414.51 Kbytes (133.22 Mbytes)
46.77% of uncompressed filesystem size (291664.73 Kbytes)
Inode table size 373145 bytes (364.40 Kbytes)
35.02% of uncompressed inode table size (1065622 bytes)
Directory table size 369763 bytes (361.10 Kbytes)
54.08% of uncompressed directory table size (683732 bytes)
Number of duplicate files found 2588
Number of inodes 31219
Number of files 25285
Number of fragments 1228
Number of symbolic links 2772
Number of device nodes 3
Number of fifo nodes 1
Number of socket nodes 0
Number of directories 3158
Number of ids (unique uids + gids) 6
Number of uids 2
root (0)
unknown (87)
Number of gids 6
root (0)
unknown (81)
unknown (11)
tty (5)
staff (50)
unknown (87)
max@lynx:/tmp$ sudo umount /mnt
max@lynx:/tmp$ sudo kpartx -d archlinux-hf-2012-09-18.img
loop deleted : /dev/loop0