Creating a custom Arch Linux live USB

Creative Commons License

Outcome: To create a custom, bootable version of the Arch Linux operating system that will allow you to carry your OS,
pre-installed with all your needed programs, on a USB stick.

Last Update: 6th February 2014.
Minor update to reflect the changes Arch Linux has brought about.
Uploaded fresh copy of customize_root_image.sh script.

Update: 1st December 2013:
Arch Linux has recently switched from SysVinit to systemd
The post has been updated to reflect the changes.

Update: 5th April 2012:
Recent changes with mkarchiso now means a chroot is no longer necessary

Introduction

I’ve been tinkering around lately with archiso, which is a set of bash scripts that, to put it briefly, allow you to create a fully customised version of the OS, squash it into an ISO file, and then stick it on a USB stick or CD ready to be booted from pretty much any computer. This allows me to have my beloved OS with me at all times, which is great if I’m at a friend’s house, internet cafe, University, or wherever, and not feeling to pleased with their choice of OS.
I’ve also pre-filled it with many maintenance and data recovery tools saving me the need to carry around a bunch of CDs.

I will try to explain, as simply as possible, on how to achieve this so you can have your own release up and booted in no time.

Setup

Depending on your experience, the steps below may look daunting, but many of them will only have to be done once to get everything set up, once it is the process of redefining and customising the OS in the future becomes a doddle.

To begin with, we need to install the dependencies for the ‘archiso’ packge.
So open up a terminal and execute:

(root): pacman -S make  squashfs-tools  libisoburn  dosfstools  patch  lynx devtools git

Next we need to obtain archoiso which is a set of scripts that carry out the beef of the work for us. I recommend getting them from git, there is a package in the repositories, however, at this time of writing, it will not work with the instructions below.
So, grab the most recent version from git and install it:

(user): git clone git://projects.archlinux.org/archiso.git && cd archiso
(root): make install && cd .. && rm -rf archiso

Now we need to create a directory to work in, essentially a place where the live system will live while we work on it.
Within this tutorial I will be using ~/livecd.
Note, that this directory will quickly fill up in space depending on how many packages you install and what files you decide to copy over, so you will need a fair bit of space. I recommend at least 4GB.

At this point, it is best to open a root shell (sudo su), as everything we do within this ‘livecd’ directory must be root owned.

Copy over the newly installed archiso scripts (which now live in /usr/share/archiso/configs/releng/) into this newly created directory:

(root): cp -r /usr/share/archiso/configs/releng/* ~/livecd && cd ~/livecd

Essentially, that is it.
If you were to execute the build command, after some time you will be presented with a bare minimum ISO file you can boot from. But where is the fun in that? You could’ve just downloaded the Arch Linux install medium.
Now to move on to customising the system.

Customising the Live System

-Packages

Inside the ~/livecd/ directory there are a number of files, most of which can be ignored; however, what is of importance to us are the packages.x86_64, packages.i686, packages.both files; and the root-image directory.

When you finally build the system, it will create a dual architecture system (32bit & 64bit both inside one ISO), and so inside the respective packages.* file you can list, line by line, the packages you want each system to have installed.
I’ve not had much luck in creating a single architecture system, so I recommend you list all the files you want inside the packages.both file, and leave the other two alone.
You will notice there are a few packages listed in there by default, it’s probably best you keep them in there (unless you know you don’t need them) and add your own to the end.

More than likely you will want to be able to boot into X so you can have a pretty GUI and all, for this you will need to list the relevant Xorg packages (xorg-server, xorg-xinit, xorg-server-utils); a desktop environment, or window manager (such as i3, gnome, or openbox); you may also want to include all the xf86-video drivers so you can boot the USB on any computer regardless of what video chipset is in use.
Don’t forgot about sound (alsa-utils, if that’s you preference), networking (wicd), fonts, a file manager,  a terminal emulator, and sudo.

To give you some ideas, you can get a full list of what you currently have installed on your host machine, by executing the following and picking out what you need.

    (root): pacman -Qqe

I wouldn’t recommend copying everything from there into your packages file, as this may result in a huge ISO file that may not fit onto your USB, just select sparingly the main programs you want.

Make sure you do not make a spelling mistake with any of the package names and make that they all exist in the official repositories. A single spelling mistake will make the build process fail without any indication of the error.

-Files & Configs

To customize your system further you place any files/configurations you want your image to contain inside the root-image directory: ~/livecd/root-image.

This directory is the root ‘/’ file system of the live system, and it will act as an overlay; anything within here will automatically be copied over to the live system.
Again, I will state that all the files within the whole ~livecd/ directory must be root owned, don’t chown them to a different user (we’ll sort out permissions soon).

If you look in this directory you will see there are already a few files as a starting point.
There’s an etc where you can place system files and a root folder (which is the root users home folder, do not delete this, it contains an important file).

You can simply copy over files from your host system to here, for e.g., I want my iptables scripts, so I create the directory ‘iptables’ within ~/livecd/root-image/etc/ and copy the file from my host to this directory, ie:

(root): mkdir ~/livecd/root-image/etc/iptables
(root): cp /etc/iptables/iptables.rules ~/livecd/root-image/etc/iptables/

I also want my live system to have a copy of all the fonts I’ve been collecting over the years, which live in /usr/share/fonts, so I create the relevant directory structure and copy the fonts over:

(root): mkdir -p ~/livecd/root-image/usr/share/fonts
(root): cp -r /usr/share/fonts/* ~/livecd/root-image/usr/share/fonts/

 

-Adding Users

To add a user to the system, first create the directory “home” within “root-image”, and within “home” create another directory with the same name as the new user.
E.g. I want to add the user “jak”, so I execute (as root remember):
(root): mkdir -p ~/livecd/root-image/home/jak

Populate the user’s home directory using the same process as above.
For example, I want to have my GTK configuration files and themes copied over, so I execute:
(root): cp /home/jak/.gtkrc-2.0 ~/livecd/root-image/home/jak/
(root): cp -r /home/jak/.themes ~/livecd/root-image/home/jak/

Now to move on to actually adding the user account:
The easiest way I’ve found to do this is by copying over /etc/passwd, /etc/shadow, and /etc/group from your host system to ~/livecd/root-image/etc.
(root): cp /etc/{shadow,passwd,group} ~/livecd/root-image/etc/

Once copied over, the new live system will then have the same user accounts and associated passwords that your host system does; if you’d prefer to use a different password (or username), change it first on your host system, copy the files over as described above, and then change your password back.
Make sure, however, that the username within those three files matches up with the new user’s home folder you just created in the previous step.

-Final customisations

Inside root’s home folder (~/livecd/root-image/root), there is a simple shell script called customize_root_image.sh.
Whilst your system is being built, this script will be executed. We can use it to our advantage to make further changes to the system, such as; setting the live system to auto log and start X server, starting specific services, and sorting out proper permissions on the files we have been copying over.

Here is my customize_root_image.sh, I’d recommend using this one instead of the one provided.
I’ve added the necessary commands to set the correct permissions on home files, and start services.
Make sure you edit this file to change the username value to the user you have been setting up.

Take a look at it, and modify it to your needs.

Building the ISO

That should be it. Now you move on to actually building the ISO file and copying it to a USB.

Within the ~/livecd directory there is a bash script which will take care of everything for you.
Simply make it executable (chmod +x build.sh), and run it:

(root): ./build.sh -v

The build process can be slow depending on how many packages you’ve installed (it takes 20 minutes on my solid state, Intel i5 with 6GB RAM laptop).
This will output an ISO file in the ~/livecd/out directory which you can then simply dd onto your USB.

(root): dd if=~/livecd/out/N.iso  of=/dev/sdX

Where N is the name of the ISO, and sdX is your USB.

Be careful with this command if you care for the precious data you hold on your hard disk! sdX must refer to your USB stick.
Also, do not specify a partition number on your USB, for example use sdb not sdb1

If you get any errors during the build process, or you ever want to update the live system with any changes/updates, simply remove the “work” folder (~/livecd/work), and re-run the build command.

Optional

It is possible to have the Arch Linux operating system load entirely into RAM, meaning that once system has booted you are able to remove the USB stick and carry on using the system.

This is great if, for some reason, you’d like to boot the live system onto multiple computers but don’t have a handful of flash drives to hand, or, if  like me, you value your security/privacy: booting into RAM will mean nothing is ever cached (great for SSD drive life too), and any malware that makes it on to your live system will only live for the current boot. A reboot will restore the system to the same static state.

To accomplish this: when you are presented with the boot loader (grub/EFI shell), press ‘e’ and append the following parameter
copytoram=y
to the kernel line.

Part Two

As there is some confusion regarding how to recreate a live system without building from scratch, and also how to have the system boot to a graphical environment, I have posted a second part to this tutorial detailing the instructions.

Bitcoin: 1An5GQ8atkzUxJMFXU42Dfcq1RzSvNHK6A
Litecoin: LSERj49g1ywBTCFcNhxrsPPcHBcehSN8EB
DOGE: DP9gA9xkSz1ZR6Wh9UjN1WcLaoDuFJhgfg
BTC stats

102 thoughts on “Creating a custom Arch Linux live USB

  1. xandout says:

    Thanks so much. I used poison-livecd-creator in the AUR for a long time but it is out of order for now. Just fired up my VBox a few minutes ago. Will post a link on facebook.com/turnerdistributed with my own distro called Parch

  2. bernie says:

    Thanks for this writeup! It’s much more clear than the one on the Arch site. The default setup works perfectly. But, I’m having problems when I add to the packages.i686 file. I’m trying to duplicate a working setup, which has about 300 packages. I’m not worried about iso size, since I’m using a very large USB stick.

    When I add my 300+ files to the packages.i686 file, the build.sh fails. No error messages. It just returns to the root prompt. Has anyone else seen this before?

    • Hey,
      Without any logs, I can’t be too sure as to why.
      If you could paste everthing your doing, and the results you get to http://codepad.org/ I’ll try my best to work out why.

      One thing, are you executing:
      “mknod /dev/loop0 b 7 0″ everytime you enter the chroot?

  3. thanks a bunch for the step by step guid. i have not used it yet but i hope to.
    so i have a question for you. when i have made this can i boot into kde or gnome or dose it get rid of all that and just give me a terminal instead. excuse the spelling if somthing was wrong. my e-mail is nickmarkham397@hotmail.com if you want to reply to me. thanks

  4. kainosnous says:

    Thank you for the article. I had been using an older version a while ago that worked very differently. This looks like it will be better.

    However, when attempting the instructions, both yours and the ones from the wiki, I came across a problem running build.sh. The script exits with an error suggesting that mount could not find any loop device. The loop device exists, and is a block special device. I tried the suggestion from mount: modprobe loop, but that didn’t work.

    I’m not sure if I’m doing something wrong, or if it’s just that archiso is still being developed. Has anybody seen this before? Any help would be appreciated.

    • The only time I’ve had this error was when I forgot to execute:
      mknod /dev/loop0 b 7 0
      from within the chroot; maybe try changing the ’7′ to another number.

      Other than that, I’m not sure. If you post the question on the Arch Wiki discussion page, you should get a quick response from djgera, who knows more about this than me.

  5. Mr Green says:

    Followed guide to the letter [including loop] when I try to create an iso after a minute it just stops there is no /out folder or iso I can see…

    Am trying to create a base x86_64 iso just to test scripts….

    • Mr Green says:

      Second run worked fine, it did grab an extra package [noticed there is only one mirror in mirrorlist [easy fix]

      Off to test

      Great article and a big help

      Thanks again

  6. When you run the ./build.sh script enable versbose mode, with “-v”.

    It may be that you have made a spelling mistake in your packages.lst file, so the program is erroring out because if can’t find a package.

  7. Max says:

    How can I rebuild the whole image after I modify something in root-image dir? Now if I change root-image/etc/rc.conf and run ./build.sh build single netinstall it tells that everything is up to date and doesn’t rebuild the image. I could do ./build.sh purge before rebuilding – this works but it is a very long to wait maybe there are another way of rebuilding?

    • NewEvolution says:

      Going to hop on this as well. The only changes I need to make are in the root-image overlay, and it seems fairly ridiculous to have to pull down and reinstall all the packages to the image in order to remake the ISO.

  8. biltong says:

    Do you know of any way to install packages with the baseline config? I’m trying to set up a very small arch ISO and using the releng config just about doubles the ISO size, so I want to have only the very basics needed to run Arch and then about 3 packages + their dependencies. The only way I can see that happening right now is putting the packages in the root-image directory somewhere and then writing scripts to install those packages after initial installation.

      • biltong says:

        Okay I went ahead and copied that over to the baseline’s build.sh and I also had to include the line to call the function at the bottom of the file (make_packages under make_basefs). Just a note, by default the baseline config only includes sata modules in the initramfs, so you have to add pata and usb to mkinitcpio.conf in the hooks section before filesystems if you want to boot from cd/usb and have a working system.

        After having done that, I built the image and my image is now ~150mb smaller (was 500mb, now ~350 (:D)) and now it boots up to arch just like any arch system would if it were installed on the machine. EXCEPT: You can’t log in, and it doesn’t log in by default. Using root as the username just gives me incorrect login (like it does on the real arch install medium) and trying arch with no password gave me incorrect login too. I’ll post back if I find out anything in that regard.

        • Nice findings.

          Maybe you could a few lines to the rc.local to change the passwords on boot, or create the relavent /etc/passwd and /etc/shadow entries.

          • biltong says:

            Actually I just copied over the make_customize_root_image over from the releng build.sh to the baseline build.sh and commented out the chmod lines in it (otherwise it throws errors if the files aren’t there) and copied inittab, rc.d, and archiso from the root-image/etc folder in releng to the root-image in my baseline config, as well as root-image/usr and arch. The inittab is what logs in as root automatically for you on tty1 and it took me a while to find that :D.

            Thanks for the guide by the way, I certainly would not have got this far without it. The one on the wiki is rather confusing.

          • That’s pretty interesting, cheers for reporting back.

            Can I just ask, what will you using it for? Why do you want such a minimalistic version, when the official install image offers the same functionality?
            s

  9. bernie says:

    Btw, this procedure is still awesome! My earlier problems were user error on my part; I had forgotten to run the mknod step. I’ve been making liveCD’s all weekend with no problems; I’m just customizing which takes time. I like using Archiso since it appears not to be affected by the recent removal of aufs.

  10. biltong says:

    Just an update on my progress: it is possible to have your own packages on the ISO to install from. I had to edit build.sh to read packages from a file and include them in the core repo .that gets put on the ISO. The easiest way to install the packages you want on your host machine is to run pactree -lu and put those in the file you edited build.sh to read. Easy :). For those who don’t want to have to rebuild the whole image for minor changes, you could try deleting one of the squashfs files and see if your changes show up in the iso – if they don’t you deleted the wrong file :P.

  11. dS says:

    this is exactely what I was looking for ;)
    but I have some troubles to generate the iso…
    everything seemd to work fine, but the last output I get is “[mkarchiso] INFO: Installing packages to ‘work/i686/root-image/’…”
    the problem is that the “out” folder isnt created and hence there is no iso..
    what went wrong?
    All in all I want to create an archlive system that has a preinstalled gnome desktop, how can I achive that?

  12. jsteel says:

    Great instructions. Worked perfectly for me in November but just came back to create an updated one and it stops and I get no “out” folder. I added the -v switch as suggested above and the error is:

    error: failed to commit transaction (unexpected error)
    Errors occurred, no packages were upgraded
    ==> ERROR: Failed to install all packages

    Any idea? Thanks.

    • jsteel says:

      Found the issue! A package that was in community had been moved to the AUR so it couldn’t find it. It would have been nice if it said it couldn’t find that particular package rather than the useless error above, but that’s not your fault :)

      Cheers

  13. i want to instal this on my computer but i dont see how. the way you are discribing is to make a live disc but i want one that has the option to instal it to. any idias

    sorry for grammer ans spelling

  14. John says:

    Hi – great article

    When I get to

    ./build.sh build single netinstall

    The script runs but it doesn’t output an iso file. It seems to create a work/x86_64 folder with some files in there – but no iso or out folder.

    I have not added any custom packages – just seeing if I can get a basic version running first.

    any ideas what i might be doing wrong?

    My host system is Arch64

    thanks in advance

    • I’ve not used archiso in a few weeks so I’m not sure if any thing has changed; try adding the -v flag when running the build script to get a verbose output.

      Normally, if the out folder, and respective iso file, are not present then a build error has occured; the verbose flag should give you an indication as to what

  15. I’ve followed the Wiki and this page, and I must say that yours is more clear than the Wiki. Good job. However, I still have the same problem when booting from the generated ISO. I keep getting the following error at boot time:

    ::Mounting ‘/dev/disk/by-label/’ to ‘/run/archiso/bootmnt’
    Waiting 30 seconds for device /dev/disk/by-label/ …
    ERROR: ‘/dev/disk/by-label’ device did not show up after 30 seconds…

    I tried Google for any solutions, but I have found none. Any ideas?

    • I believe it is because archiso doesn’t use device nodes (like /dev/sdb1/) when booting, it uses file system labels, so you need to make sure when you format the USB stick, you use ext3/4 and set the appropiate label on it (I can’t recall what it is off by heart).

      Try googling: Archiso usb label

      • Raymond says:

        Hey Jak,

        I found my problem. The generated ISO ran flawlessly in virtual machine, which suggests the problem must on my end of things. Next, I used DD to my USB key as stated in your documentation and that one worked out too. When reading my USB, the label was changed to ARCH_201203, which is the date (year and month) at which the ISO was generated.

        The part that gave me the error (that I also forgot to mention) was when I want to include this ISO into a multi-boot USB key using SARDU ( http://www.sarducd.it ). I had to extract the generated ISO and write the SARDU configuration file and point the LABEL correctly, which will overwrite the LABEL that was generated with the ISO. Anyway, it was my bad, and not yours~

        But again, thanks for this doc, it helped me and my friends.

      • Glad to hear you got it working, and thanks for mentioning about sarducd; I’ve never heard of that before but it looks really interesting.

  16. I have to agree, this is better than what’s in the Wiki. Have you considered doing this to build the ISO from an installed system instead of a chroot? I’ve heard it’s possible to use Archiso to make a bootable media from the currently installed system. Have you done this before? Care to shed some light on it? We are trying to add an Arch alternative (right now all our releases have been Debian-based) but building the bootable media is holding us up. I was hoping there would be something like remastersys to basically clone the installed system and build and ISO, but no such luck.

  17. rickster says:

    First, TY for the instructions here.
    I have used this to successfully make a basic Netinstall image, unfortunately
    why does “aif” fail ???
    ie: /arch/setup -> which is just a script “aif -p interactive”, or if trying to use “aif -p automatic -c scripts/mystuff”
    I get these errors:
    “ERROR: ask_checklist makes only sense if you specify at least 1 thing (tag,item and ON/OFF switch)”
    and,
    “FATAL: Module aes-586 not found…” ?

    I also tried the the latest “http://releng.archlinux.org/isos/” and “aif” still fails same as above.
    I’m just simply noting this, as checking on the arch forums shows that the devs are hopefully looking into this.
    Otherwise I will have to continue using the official Archlinux-netinstall-2011-08…, for AIF installations, atleast until this is fixed.

    regards.

  18. edro says:

    Great article. I spend a lot of time playing with other OS’s. I have yet to load one that will recognize any other OS’s on the hardrive for multi-booting. I want use grub2. I added the line ‘grub’ to the core.exclude.x86_64 file. I added ‘grub2-common’ and grub2-bios on successive lines of packages.x86_64. When I build the iso, it exits with:

    :: grub2-common and grub are in conflict. Remove grub? [y/N]
    error: unresolvable package conflicts detected
    error: failed to prepare transaction (conflicting dependencies)
    :: grub2-common and grub are in conflict

    What can I do? On a live system I have to load grub2 interactively.

    • biltong says:

      You can’ install grub and grub2 at the same time. Install grub2 on it’s own, and then look on the AUR for a package called os-probe which will detect any other supported OS installed on any drive in the system when you update grub2′s config file.

  19. JDM says:

    Hi,
    It’s possible use a live overlay ?

    Let’s say using one pen USB change for example the network configuration and make the
    new configuration persistent.

    • biltong says:

      I found this – https://bbs.archlinux.org/viewtopic.php?id=129418

      I’ve only ever used persistent storage on Ubuntu, and I’ve had unetbootin create the storage for me. You could try using that.

      Basically, build your ISO as you would normally, then on your host machine install unetbootin and use that to create a USB flash drive with persistent storage, with your ISO installed.

      • JDM says:

        Thanks for your help

        I’m sorry, but i’m a newbie,
        were can i define the options “cow_label= cow_persistent=” ???

        Thanks

        • jsteel says:

          In your bootloader config. I use SYSLINUX and edit the system’s /boot/syslinux/syslinux.cfg

          So basically I create an ext4 partition on the rest of the drive and add a label at the same time with “mkfs.ext4 /dev/sdx2 -L myLabel” then just add “cow-label=myLabel” to the APPEND line of the syslinux.cfg file.

          Hope that helps.

  20. m33b0 here again, thanks for posting about the updated archiso. Updated my copy from git and everything is a breeze now (although I still can’t use archiso against my currently installed system – but that’s no worry now). Just wondering if you knew of a way to add things such as Perl modules from CPAN and Ruby Gems to the ISO. I haven’t found any other info online regarding this.

    • I’ve never used Perl, and so have no idea about the module installation process. But from a quick search it seems that to install them to your system you just issue a simple make && make install, which after compilation copies the modules to /usr/lib/perl5/*/*.

      So, you could just recreate this directory structure within the root-image folder, copy the modules over and they will be available in the ISO, well in theory.

      • Thanks, this was the only idea I had – to copy them over from the installed system. But I wasn’t sure if that was the right procedure or if there was an actual right way to do it. Again much thanks.

        P.S.: diggin’ the new theme. =P

  21. biltong says:

    I have an issue trying to use the updated archiso scripts on a chroot made by the older version – I keep getting this error:
    [mkarchiso] INFO: Installing packages to ‘work/x86_64/root-image/’…
    mount: mount point work/x86_64/root-image/dev does not exist

    Making that directory keep throwing more missing mount points, once I made all of those I got an error saying the alpm library couldn’t be loaded.

    I’ve now given up on that chroot and started a fresh one with the new archiso scripts, which seems to be going well.

    A quick question: somehow I managed to change the label of my old ISOs from the old chroot, but I can’t remember in the slightest how I did it. Does anyone else know?

    • Not too sure on the first error. Have you tried a full system update, if not something else may have changed with the archiso scripts, I’ll take a look later.

      To change the label edit the build.sh script. There is a variable at the time $iso_label. I’ve never tried changing the label myself, but I’ve heard of few people running into issues when trying to boot the system because the label had changed. Give it a try, I’d say it should work.

      • The build script gives an option to change the label. I would recommend this instead of manually editing the build script.
        “./build -N name -V version -L label build single core”

  22. biltong says:

    Hey, just to let you know your new theme seems to break the mobile version of your blog. I can’t see any text except for the code boxes and the comments, everything else is white. At least on dolphin hd and opera mini on a galaxy S2 that is.

  23. biltong says:

    So I’ve been making more ISOs (now I’m working on one for my friends at college) and I’ve found that if I use the standard ARCH linux kernel, everything builds fine, but if I boot to linux-ck (Con Koliva’s patched kernel with BFS) every build I do simply dies right after installing all the packages. If you use the -v option, a dd prompt prints and then a mkfs.vfat version message prints and the script dies. Only realised because I built an ISO yesterday and there was a linux-ck update today. I’m not sure who to report this to.

  24. Brittany says:

    I just did “./build.sh build single netinstall” and it ran for less than 3 minutes and i checked the filesystem and there is no OUT directory. I have the following in /tmp/releng:

    releng]# ls
    aitab.core core.exclude.x86_64 packages.i686 syslinux.dual
    aitab.netinstall efiboot packages.x86_64 work
    build.sh isolinux root-image
    core.exclude.i686 mkinitcpio.conf syslinux

    • biltong says:

      Try running ./build.sh -v build single netinstall. Odds are it can’t find a package you specified, probably a spelling error or you’re trying to include AUR packages.

      • Brittany says:

        Ok thanks :) I found out that i had quite a few packages that weren’t able to be installed. One by one I got through them all. :P Thanks!!

      • biltong says:

        We can’t help you if you dont give us anything… post your output on pastebin or something and post the link so we can figure out what’s wrong.

    • biltong says:

      Not exactly as it is. The packages you put in it won’t be put in the local pacman repo unless you edit build.sh, and then you need to find all your packages in a massive list when you do install. You’ll have to copy any configuration you’ve done after the install too. I also have no idea how to make it work with a netinstall, I’ve only ever worked with core images.

  25. peter says:

    You can easily find what you have installed on your host machine but not in chroot:
    $ diff <(pacman -Qq) <(pacman -Qq –root ~/livecd)

  26. Hi again Jak,
    I was wondering if you’ve ever used AIF in conjunction with archiso (for more than a basic Arch Linux install)? We’ve managed to get our own LiveISO up and functioning – but what about using AIF to then install the ISO? Have you (or anyone else reading here) figured a way to use AIF to install the custom packages from AUR?

    • biltong says:

      You have to edit build.sh to include your custom packages and all dependencies in [core]. You can use pactree -lu for this. I’ve put all the output of pactree into a file called deps.txt and then added a line in build.sh to grep that file and add all the packages to the _pkgs variable. It handles the rest by itself. The only problem with this is that when you install you have to go through loads of packages and check thrm all individually. In my case I had over 500 packages in that list. It’d be much easier if you could add all the packages to base or something like that to select them all automatically.

      • Thanks for the input, I’ll see if I can add the AUR packages in the “build.sh” file. I was under the impression you MUST do it with AIF.

        As per the second part of your post, you CAN have all the packages selected for installation automatically – but this requires modifying AIF manually – and I’m not sure that you can do it if you use the “build.sh” file for adding custom packages to the installation instead of AIF.

  27. I mean the only way I’ve heard of doing it before is by using the AIF and modifying it (AIF) to include the custom packages from the AUR. And I know you can modify AIF to automatically install those packages (i.e. instead of [ ] package_1 it would be [x] package_1 by default).

  28. But the posts I was reading which told me to use AIF to include custom packages when installing the LiveISO – well, they were less than descriptive on the process procedure.

  29. fabio says:

    Hi, thanks for the great tutorial! I’m just stuck at the end of the process, without having been able to create an iso image. The build.sh scripts returns me with the following:

    locating group tables: done
    Writing inode tables: done
    Writing superblocks and filesystem accounting information: done

    [mkarchiso] INFO: Done!
    [mkarchiso] INFO: Mounting ‘work/i686/root-image.fs’ on ‘work/i686/mnt/root-image’
    mount: you must specify the filesystem type
    [mkarchiso] INFO: Total: 1291305 MiB (100%) | Used: 143328 MiB (12%) | Avail: 1083345 MiB (88%)
    [mkarchiso] INFO: Unmounting ‘work/i686/root-image.fs’
    umount: work/i686/root-image.fs: not mounted

    I was not been able to find any solution, could you please help me?

    Thanks

    Fabio

  30. Thank you Jak for your work.
    I`m dealing now with generating a couple of archimages for different purposes, and looking now for speed up tricks.
    I want to make the script to use my local pacman cache. I think it`s too much to make an (always actual) local mirror, and I usually have 90% of needed packages already in my cache.

    I`ve lost in all those build.sh and arch-install-scripts.
    I wonder If you could recommend me how to do that with minimal effort.

  31. Thank your for the update Jak. I was wondering how the changes from SysVinit to systemd would affect the build process for live ISOs. Much appreciated.

  32. Just one question:
    I can`t make usb stick to load the default choice automatically
    I`ve put the line “TIMEOUT 60″ to any of .conf file I`ve found in livecd, but nothing happens…

  33. Hey, it’s me again. I’m glad that you’ve updated this page because I was a bit lost. I just want to point out that you forgot to include “git” in the “pacman” command before issuing the “git clone” command to retrieve “archiso.git”. Everything else is perfect.

    Cheers~

  34. Jeff Hodd says:

    I have a question about booting into a graphical environment. I’ve followed every set of instructions I can find and am now officially stumped. My distro properly boots up to the console login (after a painstaking week of research into how cowspace works – something that desperately needs better documentation) as the new user I defined. I can run startx and the UI comes up without issue with all the configuration that I set up. So booting and the DE are both working correctly. As far as I can tell, the only thing I should have to do is create the display-manager.service symlink in /etc/systemd/system to /usr/lib/systemd/system/kdm.service and it should boot right into KDE… but it’s just not happening and I can’t figure out why. Can anyone provide me with some insight into this, please?

    Thanks.

    • I don’t have access to my system with my ArchIso configurations, so I’m going off the top of my head, but inside the “customize_root_image.sh” script you need to change “default.target” to “graphical.target”.
      It should read “systemctl enable graphical.target (…other services to start…)”

      You may need to add the “kdm.service” in there aswell, or replace “graphical.target” with it. I’m not too sure.
      I have my system boot into SLim login manager with OpenBox and i3wm, and using “graphical.target” works.

      Other than that, when you’ve created the ISO, you can copy the squashed filesystem out of it, and chroot into the new system and making the changes there.
      Have a look at https://wiki.archlinux.org/index.php/Remastering_the_Install_ISO just don’t follow any thing within the “Creating the new iso” section, when you’ve made your changes just copy the remade squashed filesystem back.

      • Jeff Hodd says:

        Thanks very much, Jak. I’m guessing maybe just adding graphical.target might do the trick – my customize_root_image.sh doesn’t enable default.target although the default.target symlink does exist in etc/systemd/system (I have “systemctl enable multi-user.target pacmn-init.service autologin@.service dhcpd.service”). I had added kdm.service to that list at one point but it made no difference. Maybe what I also need to do is point default.target to /usr/lib/systemd/system/graphical.target (would I be correct in guessing that’s what enabling graphical.target does?) instead of multi-user.target. It could be, too, that all I have to do is remove the default.target symlink and enable kdm.service. Once my image is settled, I’ll see what makes it work.

        I did manage to figure out a way to boot directly into kde without the using kdm, though. For the sake of whatever readers may come this way, I’ll run it down quickly….

        I started by plundering ArchBang’s root-image file system to figure out how it boots directly to openbox without enabling any systemd services, and discovered that it uses .bash_profile to call startx – yes, the piece I needed. In any case, after a couple more image builds without success, I finally figured out that the customize_root_image.sh that comes with archiso was assigning zsh as the default shell instead of bash, thus my failure to run .bash_profile (duh). I fixed that and am now booting directly into kde without the login manager, which is fine since I plan to turn this image into more of an installation platform anyway.

        Also, thanks for the link. there are a couple of useful bits in there – especially how to use genisoimage; that’s useful. Btw, I noticed that your link to your customize_root_image.sh no longer works – just thought you might want to know – maybe you could just list it in a comment if you get a chance.

        I do have one more question for you, and it might be slightly off-topic, so you’re free not to answer if you don’t want to. I don’t want to waste your time. However, I’m wondering how to get the Leave/Logout function to include shutdown and reboot. I did notice that the /etc/systemd/system/graphical.target.wants directory includes a symlink to upower – so, I guess the actual question is, if I were to enable graphical.target (or change the default.target symlink to point to graphical.target), would the “wants” upower symlink provide this functionality? Or do I need to do something else. I couldn’t find any obvious answer to this in my exploration of archbang’s root-fs image, even though its live openbox implementation does in fact provide reboot and shutdown on exit.

        Thanks again.

      • jghodd says:

        Hi again, Jak. Thought I’d leave a final note that I managed to get everything working. Ultimately both graphical.target and kdm.service needed to be enabled, and autologin disabled.

        Part of the issue I was having came down to using an abridged passwd file in root-image/etc – probably the one that came with archiso to begin with. Once I ensured that I had the correct system and software users defined (including the most important kdm user), the kdm login manager came up and all of the power options were available.

        i now have both the 32-bit and 64-bit versions working perfectly.

        Thanks again.

  35. Christian says:

    Hi,

    your Link to your customize_root_image.sh have been expired. Can you post it again please?

    Thanks, Christian

  36. Wilfredo Krukiel says:

    The most common “data recovery” scenario involves an operating system (OS) failure (typically on a single-disk, single-partition, single-OS system), in which case the goal is simply to copy all wanted files to another disk. This can be easily accomplished using a Live CD, many of which provide a means to mount the system drive and backup disks or removable media, and to move the files from the system disk to the backup media with a file manager or optical disc authoring software. Such cases can often be mitigated by disk partitioning and consistently storing valuable data files (or copies of them) on a different partition from the replaceable OS system files.:,

    Very latest write-up coming from our online site
    <http://www.healthmedicinentral.com

  37. Ashraf says:

    Unfortunately, after the action ended script, I did not find a folder named out or ISO file

    I’ve followed the step-by-step instructions until the installation is completed ..I do not know what the is wrong

  38. Gerard Aalders says:

    As I really would like to know how to do this, I am asking is there anyone else who has that script? Could someone please post it somewhere?

  39. I’ve tried this and added only the packages I wanted for x86_64. This worked well, but my home directory was not added to the iso even though I added it to the root-image/etc/home directory.

    Just as Gerald Aalders asked, please post your configuration on this site or provide a new copy we can use.

  40. Jack says:

    Hey Guys, I want to make my live system persistent, so I try to use cow_label=mylabel in syslinux. I also need the partition “mylabel”, how can I create this in my .iso?

    Thanks (:

  41. KairiTech says:

    Assuming you already know how to configure your apps, create users and automatically start the desktop when the user logs in, you just need to add those commands to the end of the customize_root_image.sh script. It’s run in the fully functional ISO image environment so all of your your configurations and users will be added to the ISO image.

  42. Jak says:

    Sorry for the delay.

    The post has been updated to reflect recent changes and a working copy of customize_root_image.sh has been uploaded.

  43. debasish says:

    Thanks jak,
    I have been able to install softwares that I need and boot into X from arch live iso, but I am facing a major problem. I can’t see my synaptics mouse after booting even though I have installed the xf86-input-synaptics package. I checked and figured that the psmouse module was also missing in the live cd. I can boot into X, but neither my keyboard nor the mouse works. I am stuck there.

    Another problem is when I am trying to add software by unsquashing the rootfs and chrooting into it. It gives me no more space problem. I figured out that it has something to do with aitab, but didn’t understand clearly about it.

    Thanks if u could help me in this :)

    • Jak says:

      Hi,

      Have you remastered the original install ISO, or followed this guide?
      If the latter, as long as you’ve included ‘xorg’ in the package list, it should grab everything that is needed to pick up any form of mouse/keyboard (xf86-input-keyboard, xf86-input-mouse) so I’m not sure why it’s not working.

      I’ve had this issue once a long time ago when I tried remastering the install ISO, and IIRC, it was fixed by installing ‘xf86-input-evdev’ followed by a reboot.

      You could also try generate an xorg.conf if you haven’t already with:
      Xorg -configure

      If not, can you pastebin the logs of the current boot:
      ‘journalctl -b -0′

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>