Difference between revisions of "Talk:Archiso"

From ArchWiki
Jump to: navigation, search
m (Issue with mkarchroot)
m (dot slash)
 
(73 intermediate revisions by 19 users not shown)
Line 1: Line 1:
Hi thar! If you guys have any questions or trouble when following this guide, please do post it here, I will come back to you!
+
==Sourceforce error for edk2 files==
  
--[[User:Svenstaro|Svenstaro]] 19:14, 3 June 2009 (EDT)
+
build.sh contains the following two lines:
  
 +
<code>curl -o ${work_dir}/iso/EFI/shellx64_v2.efi https://svn.code.sf.net/p/edk2/code/trunk/edk2/ShellBinPkg/UefiShell/X64/Shell.efi
 +
<br/>curl -o ${work_dir}/iso/EFI/shellx64_v1.efi https://svn.code.sf.net/p/edk2/code/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi</code>
  
== Errors during build ==
+
These lines failed with the error: ''curl: (7) Failed to connect to svn.code.sf.net port 443: Connection refused''<br/>
 +
As a workaround, I used those same files from the GitHub page of the TianoCore Project:
  
During the build process, I receive a number of errors (I don't know if they are fatal):
+
<code>curl -o ${work_dir}/iso/EFI/shellx64_v2.efi https://github.com/tianocore/edk2/blob/master/EdkShellBinPkg/MinimumShell/X64/Shell.efi?raw=true<br/>
 +
curl -o ${work_dir}/iso/EFI/shellx64_v1.efi https://github.com/tianocore/edk2/blob/master/EdkShellBinPkg/FullShell/Arm/Shell_Full.efi?raw=true</code>
  
==> Starting build: 3.0-ARCH
+
Not sure if this is a temporary problem or those URLs need to be replaced permanently.
  -> Parsing hook: [base]
+
--[[User:TcShadowWalker|TcShadowWalker]] ([[User talk:TcShadowWalker|talk]]) 19:48, 16 July 2015 (UTC)
  -> Parsing hook: [udev]
 
  -> Parsing hook: [memdisk]
 
  -> Parsing hook: [archiso]
 
  -> Parsing hook: [archiso_pxe_nbd]
 
==> ERROR: file not found: `/tmp/baseline/work/root-image/usr/sbin/nbd-client'
 
==> ERROR: file not found: `/tmp/baseline/work/root-image/lib/initcpio/ipconfig'
 
==> ERROR: file not found: `/tmp/baseline/work/root-image/lib/initcpio/hooks/archiso_pxe_nbd'
 
  -> Parsing hook: [archiso_loop_mnt]
 
==> ERROR: file not found: `/tmp/baseline/work/root-image/lib/initcpio/hooks/archiso_loop_mnt'
 
...
 
These files however are within the /lib/initcpio/hooks/ directory. Are these the same ones it is looking for?
 
  
: Each hook must be present in root-image. See [http://projects.archlinux.org/archiso.git/tree/configs/releng/build.sh#n41 make_setup_mkinitcpio()]
+
==Archiso doesn't work on non stock kernel==
: Also hooks has some build requirements. See [http://projects.archlinux.org/archiso.git/tree/README#n107 For these hooks needs these packages (on target root-image)] and how this is implemented in releng [http://projects.archlinux.org/archiso.git/tree/configs/releng/build.sh#n18 make_basefs()]
 
: [[User:Djgera|Djgera]] 10:37, 23 August 2011 (EDT)
 
  
[mkarchiso] INFO: Creating ISO image...
+
I've been having on and off issues when building ISOs with archiso and the other day when I was working on one I did a pacman -Syu before working but didn't reboot. I was running on the stock kernel at that point because the linux-ck kernel had not updated yet. My ISO built fine. Later that day I rebooted and was now running on the updated linux-ck kernel and suddenly the build process would simply die without any errors, even with the -v option. Right after installing all the custom packages, a dd output appears and then a mkfs.vfat version message appears and that's where it dies. Rebooting back to the stock arch kernel fixed the issue. I'm guessing it has something to do with hardcoded names or something like that in the build scripts.
/usr/sbin/mkarchiso: line 318: mkisofs: command not found
 
  
: See [http://projects.archlinux.org/archiso.git/tree/README#n99 Build requirements] also this is present in the wiki.
+
Is this normal behaviour? I don't mind using the stock kernel on the ISOs I build but I figured I'd at least be able to build them on a different one.
: [[User:Djgera|Djgera]] 10:37, 23 August 2011 (EDT)
 
  
Also, where does one put the packages.list file? I've tried placing it within the same directory as the build script and mkinitcpio.conf file, but it does not seem to read it.
+
On that note, is it possible to use a kernel other than the stock one within the ISOs we build
 +
[[User:Biltong|Biltong]] ([[User talk:Biltong|talk]]) Sun May 6 2012, 21:47 SAST
  
: On any place where you reference inside your build.sh. If you are working with configs/baseline profile, you need to add such functionallity. See configs/releng [http://projects.archlinux.org/archiso.git/tree/configs/releng/build.sh#n21 make_packages()] for more advanced things like this. Baseline profile should be the the most basic as posible.
+
== Sidenote: ==
: [[User:Djgera|Djgera]] 10:37, 23 August 2011 (EDT)
 
  
Thank you.
+
Re-initializing pacman can be important, though I'm not sure. [[Pacman-key#Initializing_the_keyring]]
  
 +
Consider trying out -Archboot- GUI for installation: [[FAQ#Q.29_Arch_needs_an_installer._Maybe_a_GUI_installer]]
  
== NO iso file outpu ==
+
{{Unsigned|01:40, 28 March 2013‎|Ubunchu}}
My output of
 
    [root@myhost releng]# ./build.sh build single netinstall
 
is
 
  
    [mkarchiso] INFO: Configuration settings
+
== Estimating size? Starting over? ==
    [mkarchiso] INFO:                  Command:  create
 
    [mkarchiso] INFO:              Architecture:  x86_64
 
    [mkarchiso] INFO:        Working directory:  work/x86_64
 
    [mkarchiso] INFO:    Installation directory:  arch
 
    [mkarchiso] INFO:        Pacman config file:  /etc/pacman.conf
 
    [mkarchiso] INFO:                  Packages:  base
 
   
 
    [mkarchiso] INFO: Installing packages to 'work/x86_64/root-image/'...
 
  
And here is the structure of my /tmp/releng
+
How do you best estimate the size?
  
    aitab.core   build.sh     core.exclude.x86_64  mkinitcpio.conf  packages.x86_64  syslinux   work
+
How do you start over? Suppose just take `etc/`, delete the `releng/` directory recopy, put stuff back. [[User:Jasper1984|Jasper1984]] ([[User talk:Jasper1984|talk]]) 13:46, 1 July 2013 (UTC)
    aitab.netinstall  core.exclude.i686  isolinux   packages.i686    root-image     syslinux.dual
 
  
I cannot find any iso file.....Is there anyone could help me?
+
:Best way to start over is delete releng/{work,out} it keeps cached packages, and there is no need to do every step from the beginning. {{Unsigned|14:08, 5 October 2013‎|Jqvillanova}}
  
: something is wrong with your mirror. Enable verbose mode to see details [[User:Djgera|Djgera]] 12:55, 8 October 2011 (EDT)
+
== Encryption ==
  
== Issue with mkarchroot ==
 
  
Upon issuing the command to create a base chroot (mkarchroot /home/user/live base), I get the following errors for all but a few of the packages that are being installed:
+
* with «cryptsetup», encrypt the file «airootfs.sfs» built with «mkarchiso» :
  
"call to execv failed (Permission denied)"
+
# cd /path/to/buildir/
 +
# cd ./work/iso/arch/x86_64/
 +
# cryptsetup --verify-passphrase plainOpen ./airootfs.sfs encrypt
 +
# dd < ./airootfs.sfs > /dev/mapper/encrypt
 +
# sync
 +
# cryptsetup plainClose encrypt
 +
# md5sum ./airootfs.sfs > ./airootfs.md5
 +
# cd -
  
"error: command failed to execute correctly"
+
''(note that you can't decrypt the encrypted file «airootfs.sfs» in the same «dd» way, instead use {{ic|1=dd of=./airootfs.sfs conv=nocreat,notrunc < /dev/mapper/encrypt}})''
  
Once the package installation process has finished, I then get:
+
* add the hook «encrypt» in «mkinitcpio.conf» :
  
chroot: failed to run command `/usr/sbin/locale-gen': Permission denied
+
# grep HOOKS ./work/airootfs/etc/mkinitcpio.conf
 +
HOOKS="... encrypt"
  
chroot: failed to run command `/bin/findmnt': Permission denied
 
  
 +
* insert these lines in «archiso» hook :
  
Any ideas what is up? The previous versions from git seemed to work fine.
+
--- a/work/airootfs/usr/lib/initcpio/hooks/archiso
 +
+++ b/work/airootfs/usr/lib/initcpio/hooks/archiso
 +
@@ -65,6 +65,10 @@
 +
      fi
 +
      sfs_dev=$(losetup --find --show --read-only "${img}")
 +
      echo ${sfs_dev} >> /run/archiso/used_block_devices
 +
+    msg ":: Mapping encrypted squashfs..."
 +
+    local map="${sfs_dev##*/}.map"
 +
+    cryptsetup plainOpen "${sfs_dev}" "${map}"
 +
+    sfs_dev="/dev/mapper/${map}"
 +
      _mnt_dev "${sfs_dev}" "${mnt}" "-r" "defaults"
 +
  }
  
Full pastebin out is here: http://pastebin.com/wNHMkyH4
+
 
Thanks.
+
* rebuild initramfs and iso with «mkarchiso» and test :
 +
 
 +
# mkarchiso -r "mkinitcpio -p linux" run
 +
# mkarchiso iso encrypted.iso
 +
# qemu ... ./out/encrypted.iso
 +
 
 +
 
 +
[[User:Lacsap|Lacsap]] ([[User talk:Lacsap|talk]]) 21:51, 20 Feb 2016 (UTC)
 +
 
 +
== Rebuilding the iso after removing the lock files is not enough ==
 +
 
 +
The wiki states that to rebuild the iso, you have to remove lock files in the work directory
 +
 
 +
However, this is not enough, because the script stops after reaching "adduser" command with "user exists" error [[User:Hadiyazdi|Hadiyazdi]] ([[User talk:Hadiyazdi|talk]]) 13:50, 11 March 2015 (UTC)
 +
 
 +
== Copying file tha neither go in /skel/ or /etc/ ==
 +
 
 +
It is unclear whether it is possible and how to prepare folder in some other directory of the hierarchy. E.g. if one wanted to prepare a custom xinitrc file, should one run
 +
 
 +
# mkdir /etc/X11/xinit/xinitrc
 +
# cp /path/to/customxinitrc/xinitrc /etc/X11/xinit/xinitrc
 +
 
 +
or whether one should put instead a dedicated line in one of the building script.
 +
 
 +
I am not yet qualified enough to do this, but it is not a request for personal help, but rather a issue concerning a relevant (imo) point in the page.
 +
 
 +
[[User:Navi se|Navi se]] ([[User talk:Navi se|talk]]) 12:37, 6 January 2016 (UTC)
 +
 
 +
== Style|typo tag discussion for id/useradd check/command ==
 +
 
 +
The following was tagged with "{{[[Template:Style|Style]]|typo?}}":
 +
 
 +
! id arch && useradd -m -p "" -g users -G "adm,audio,floppy,log,network,rfkill,scanner,storage,optical,power,wheel" -s /usr/bin/zsh arch
 +
 
 +
I tried the command and also variations. They work, so may I remove the template/tag? Or, did it refer to something else? Or, maybe explain why {{ic|!}} and {{ic|&&}} are used? [[User:Zeniff|Zeniff]] ([[User talk:Zeniff|talk]]) 02:39, 30 October 2016 (UTC)

Latest revision as of 08:50, 14 January 2017

Sourceforce error for edk2 files

build.sh contains the following two lines:

curl -o ${work_dir}/iso/EFI/shellx64_v2.efi https://svn.code.sf.net/p/edk2/code/trunk/edk2/ShellBinPkg/UefiShell/X64/Shell.efi
curl -o ${work_dir}/iso/EFI/shellx64_v1.efi https://svn.code.sf.net/p/edk2/code/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi

These lines failed with the error: curl: (7) Failed to connect to svn.code.sf.net port 443: Connection refused
As a workaround, I used those same files from the GitHub page of the TianoCore Project:

curl -o ${work_dir}/iso/EFI/shellx64_v2.efi https://github.com/tianocore/edk2/blob/master/EdkShellBinPkg/MinimumShell/X64/Shell.efi?raw=true
curl -o ${work_dir}/iso/EFI/shellx64_v1.efi https://github.com/tianocore/edk2/blob/master/EdkShellBinPkg/FullShell/Arm/Shell_Full.efi?raw=true

Not sure if this is a temporary problem or those URLs need to be replaced permanently. --TcShadowWalker (talk) 19:48, 16 July 2015 (UTC)

Archiso doesn't work on non stock kernel

I've been having on and off issues when building ISOs with archiso and the other day when I was working on one I did a pacman -Syu before working but didn't reboot. I was running on the stock kernel at that point because the linux-ck kernel had not updated yet. My ISO built fine. Later that day I rebooted and was now running on the updated linux-ck kernel and suddenly the build process would simply die without any errors, even with the -v option. Right after installing all the custom packages, a dd output appears and then a mkfs.vfat version message appears and that's where it dies. Rebooting back to the stock arch kernel fixed the issue. I'm guessing it has something to do with hardcoded names or something like that in the build scripts.

Is this normal behaviour? I don't mind using the stock kernel on the ISOs I build but I figured I'd at least be able to build them on a different one.

On that note, is it possible to use a kernel other than the stock one within the ISOs we build? Biltong (talk) Sun May 6 2012, 21:47 SAST

Sidenote:

Re-initializing pacman can be important, though I'm not sure. Pacman-key#Initializing_the_keyring

Consider trying out -Archboot- GUI for installation: FAQ#Q.29_Arch_needs_an_installer._Maybe_a_GUI_installer

—This unsigned comment is by Ubunchu (talk) 01:40, 28 March 2013‎. Please sign your posts with ~~~~!

Estimating size? Starting over?

How do you best estimate the size?

How do you start over? Suppose just take `etc/`, delete the `releng/` directory recopy, put stuff back. Jasper1984 (talk) 13:46, 1 July 2013 (UTC)

Best way to start over is delete releng/{work,out} it keeps cached packages, and there is no need to do every step from the beginning. —This unsigned comment is by Jqvillanova (talk) 14:08, 5 October 2013‎. Please sign your posts with ~~~~!

Encryption

  • with «cryptsetup», encrypt the file «airootfs.sfs» built with «mkarchiso» :
# cd /path/to/buildir/
# cd ./work/iso/arch/x86_64/
# cryptsetup --verify-passphrase plainOpen ./airootfs.sfs encrypt
# dd < ./airootfs.sfs > /dev/mapper/encrypt
# sync
# cryptsetup plainClose encrypt
# md5sum ./airootfs.sfs > ./airootfs.md5
# cd -

(note that you can't decrypt the encrypted file «airootfs.sfs» in the same «dd» way, instead use dd of=./airootfs.sfs conv=nocreat,notrunc < /dev/mapper/encrypt)

  • add the hook «encrypt» in «mkinitcpio.conf» :
# grep HOOKS ./work/airootfs/etc/mkinitcpio.conf
HOOKS="... encrypt"


  • insert these lines in «archiso» hook :
--- a/work/airootfs/usr/lib/initcpio/hooks/archiso
+++ b/work/airootfs/usr/lib/initcpio/hooks/archiso
@@ -65,6 +65,10 @@
     fi
     sfs_dev=$(losetup --find --show --read-only "${img}")
     echo ${sfs_dev} >> /run/archiso/used_block_devices
+    msg ":: Mapping encrypted squashfs..."
+    local map="${sfs_dev##*/}.map"
+    cryptsetup plainOpen "${sfs_dev}" "${map}"
+    sfs_dev="/dev/mapper/${map}"
     _mnt_dev "${sfs_dev}" "${mnt}" "-r" "defaults"
 }


  • rebuild initramfs and iso with «mkarchiso» and test :
# mkarchiso -r "mkinitcpio -p linux" run
# mkarchiso iso encrypted.iso
# qemu ... ./out/encrypted.iso


Lacsap (talk) 21:51, 20 Feb 2016 (UTC)

Rebuilding the iso after removing the lock files is not enough

The wiki states that to rebuild the iso, you have to remove lock files in the work directory

However, this is not enough, because the script stops after reaching "adduser" command with "user exists" error Hadiyazdi (talk) 13:50, 11 March 2015 (UTC)

Copying file tha neither go in /skel/ or /etc/

It is unclear whether it is possible and how to prepare folder in some other directory of the hierarchy. E.g. if one wanted to prepare a custom xinitrc file, should one run

  1. mkdir /etc/X11/xinit/xinitrc
  2. cp /path/to/customxinitrc/xinitrc /etc/X11/xinit/xinitrc

or whether one should put instead a dedicated line in one of the building script.

I am not yet qualified enough to do this, but it is not a request for personal help, but rather a issue concerning a relevant (imo) point in the page.

Navi se (talk) 12:37, 6 January 2016 (UTC)

Style|typo tag discussion for id/useradd check/command

The following was tagged with "{{Style|typo?}}":

! id arch && useradd -m -p "" -g users -G "adm,audio,floppy,log,network,rfkill,scanner,storage,optical,power,wheel" -s /usr/bin/zsh arch

I tried the command and also variations. They work, so may I remove the template/tag? Or, did it refer to something else? Or, maybe explain why ! and && are used? Zeniff (talk) 02:39, 30 October 2016 (UTC)