LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-06-2022, 02:33 PM   #1
marietto
Member
 
Registered: Aug 2010
Posts: 96

Rep: Reputation: 17
cpio: Too many arguments


Hello to everyone.

I'm trying to customize the Debian 11 iso image with cubic. The most important parameter that I should set up within cubic is the following :

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on"
I'm working on a method to add any parameter I may need now and in the future to kernel and maybe I found it,thanks to the help of some good reddit users that put me on the right path. The method is called "Automate the installation of Debian with Preseed". Basically I should create a preseed.cfg file that I should add inside the Debian ISO image so that the installer will read inside of it and it will automate some settings during the installation. At the moment this is the preseed.cfg file that I'm trying to use :


Code:
d-i debian-installer/add-kernel-opts string intel_iommu=on
d-i passwd/root-password password marietto

My doubt was : how and where to place the preseed.cfg file ? I've found part of the solution by watching this video tutorial :


https://www.youtube.com/watch?v=QdA7UX5VJjc


and this github :


https://github.com/Nidouille/Debian-...d-Installation


He says to do something like this :
  1. Ajout du fichier de pré configuration dans initrd

Code:
echo preseed.cfg | cpio -H newc -o -A -F isofiles/install.amd/initrd gzip isofiles/install.amd/initrd
I tried,but I've got an error :

Code:
gunzip initrd.gz
echo preseed.cfg | cpio -H newc -o -A -F initrd gzip debian-11-unattended/d-i/initrd
cpio: Too many arguments
you can see the attached picture if you want understand better.
Attached Thumbnails
Click image for larger version

Name:	Istantanea_2022-10-06_19-03-03.png
Views:	5
Size:	183.0 KB
ID:	39685  

Last edited by marietto; 10-06-2022 at 02:36 PM.
 
Old 10-06-2022, 04:55 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,103
Blog Entries: 6

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
I've got cpio 2.13

And the man page says
Code:
-A  (o mode only) Append to the specified archive.  (Not yet implemented.)

-F file, --file file
    Read archive from or write archive to file
After -F you have 3 arguments.

Read:
Code:
man cpio
See if you can understand it better.
 
Old 10-06-2022, 05:41 PM   #3
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
thanks. this worked :
Code:
echo preseed.cfg | cpio -H newc -o -A -F initrd
2 blocks.
And then :

Code:
gzip initrd
OK
unfortunately a problem comes with the next command :

Code:
/home/ziomario/Scrivania/PassT-Cubic# sudo genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot- load-size 4 -boot-info-table -o debian-11-unattended.iso debian-11-unattended

.....

98.82% done, estimate finish Thu Oct 6 23:11:57 2022

98.98% done, estimate finish Thu Oct 6 23:11:57 2022

99.15% done, estimate finish Thu Oct 6 23:11:57 2022

99.31% done, estimate finish Thu Oct 6 23:11:57 2022

99.47% done, estimate finish Thu Oct 6 23:11:58 2022

99.63% done, estimate finish Thu Oct 6 23:11:58 2022

99.79% done, estimate finish Thu Oct 6 23:11:58 2022

99.96% done, estimate finish Thu Oct 6 23:11:58 2022
the iso image "debian-11-unattended.iso" is not bootable.

maybe it does not boot because the different checksums of the files ?

Instructions says to do :

Code:
md5sum find -follow -type f > md5sum.txt
and I did it. So whats wrong now ?
 
1 members found this post helpful.
Old 10-07-2022, 12:27 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
Quote:
Originally Posted by marietto View Post
unfortunately a problem comes with the next command :

Code:
/home/ziomario/Scrivania/PassT-Cubic# sudo genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot- load-size 4 -boot-info-table -o debian-11-unattended.iso debian-11-unattended
This not related to the previous issue (cpio). I don't really know what did you try, where are these commands coming from?

Quote:
Originally Posted by marietto View Post
the iso image "debian-11-unattended.iso" is not bootable.

maybe it does not boot because the different checksums of the files ?
No, it is not related to the checksums, but the content of the iso.
Quote:
Originally Posted by marietto View Post
Instructions says to do :

Code:
md5sum find -follow -type f > md5sum.txt
and I did it. So whats wrong now ?
This command is invalid. And I guess the iso you created is invalid too, just I still don't know what do you want to achieve, what kind of instructions did you try to follow and what went wrong (your initial cpio command was also incorrect).
 
Old 10-07-2022, 03:52 AM   #5
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
The commands come from this site :

https://github.com/Nidouille/Debian-...d-Installation

I've mentioned it on the first post. Can you see it ? My goal is to learn how to pass some arguments to the debian 11 kernel using a preseed file while I'm customizing the ISO image with cubic.
 
Old 10-07-2022, 04:36 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Can you see the difference?
Code:
md5sum `find -follow -type f` > md5sum.txt
md5sum find -follow -type f > md5sum.txt
Those backticks aren't not just decorative elements, they are important.
Mind you, since 198x there is another syntax:
Code:
md5sum $(find -follow -type f) > md5sum.txt
 
Old 10-07-2022, 02:46 PM   #7
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
The backticks are gone at some point when I have copied and pasted the command but I've used them on my computer. Is this command mandatory ?

Last edited by marietto; 10-07-2022 at 04:18 PM.
 
Old 10-08-2022, 02:14 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
Quote:
Originally Posted by marietto View Post
The backticks are gone at some point when I have copied and pasted the command but I've used them on my computer. Is this command mandatory ?
nothing is mandatory, do what you want, but if you want to follow a guide do it without errors (and would be nice to understand what's going on).
 
Old 10-08-2022, 05:07 AM   #9
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
I created a new post,trying to explain better what I'm trying to do :

https://www.linuxquestions.org/quest...ed-4175717533/

problem is that the modifications that I'm asking to cubic are ignored.
 
Old 10-09-2022, 05:43 AM   #10
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
I'm trying to understand how to extract all the files from a (bootable) Debian ISO and then re-generate a bootable ISO image. Below you can see the commands that I've issued. For some unknown reason,the generated ISO image does not boot. Can someone help me to understand why ? thanks.

Code:
apt update && apt -y install xorriso genisoimage

wget https://cdimage.debian.org/debian-cd...64-netinst.iso

xorriso -osirrox on -indev debian-11.5.0-amd64-netinst.iso -extract / isofiles/

genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o debian-11-unattended.iso isofiles
as you can see I haven't done any modification to the files inside the ISO image,so the error should be most likely on the latest command.
 
Old 10-09-2022, 01:27 PM   #11
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,103
Blog Entries: 6

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
I have not used a debian live media for years. Does it have a checksum protection built into the squashfs like arch linux iso does? That is one way of keeping the iso from being altered.

You are going to have to look at the debian docs. And see how they recommend altering an installation iso.

https://www.debian.org/devel/debian-live/
https://live-team.pages.debian.net/l.../index.en.html
https://wiki.debian.org/DebianInstaller/Modify/CD
 
1 members found this post helpful.
  


Reply

Tags
cpio, debian


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: My Nerd Life: Too Loud, Too Funny, Too Smart, Too Fat LXer Syndicated Linux News 0 01-24-2014 05:21 AM
cpio -idcmv command hanged while extracting .cpio command ravindra.atre Linux - General 2 08-22-2011 04:10 AM
How to use cpio to extract a cpio archive? linx win Debian 4 06-17-2005 01:53 PM
logname: no login name, -bash: [: too many arguments da_kidd_er Linux - General 1 10-27-2004 02:09 PM
BASH says "too many arguments" in terminal tmitch70377 Linux - Newbie 4 12-06-2003 05:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration