1 (edited by projectgus 2014-10-10 07:06:46)

Topic: Debian installer for Novena?

The latest (very exciting) update asked for opinions on distros/firmware. I can volunteer to help put together a customised Debian installer for Novena if people think that would be useful.

I did this once before for my GK802 "AndroidPC", another imx6 device that I use as a personal server. That time I did it pretty hacky (though still reproducable) because I was in a hurry and I didn't want to set up a package repo for custom udebs. For Novena I think there may(?) be a Debian repo planned so it could be done in a somewhat less hacky and more maintainable way.

The nice thing about an installer, rather than a rootfs image, is it allows you a lot of fine-grained control over things like filesystem choice/location, disk encryption, LVM, and initial package set. For example I run my GK802 home server on a LUKS encrypted rootfs on top of software RAID1 (dual MicroSD RAID1!) Configs like this are a pain to apply retrospectively on top of a rootfs image.

Installer can also be configured to run via a serial tty, so you can do a headless installation also.

I have a small advantage in helping out because I have a loaner Novena PVT1 (I think it's PVT1) on my desk, courtesy of a generous friend. Although to be successful I think I'd need to get some assistance from xobs/bunnie/someone to integrate properly with any official repo, and support whatever tools are required for the newer custom hardware I don't have.

Thoughts, anyone? If the general opinion is that rootfs images are easier to deal with then I'm 100% OK with that, don't want to put in effort just to make people's lives more complex.

Re: Debian installer for Novena?

I think that'd be a great idea.

I'm currently in the process of Debianizing my support packages, which definitely should go into the repo.  I set up a preseed at one point, which I documented here: http://www.kosagi.com/w/index.php?title … _installer

It's grown some cruft to be sure.  It's for Wheezy, and we're shipping Jessie.  But it was designed so you'd put it on a full-sized SD card, short out "P_EXT" on the mainboard, and install Debian that way.  The version of U-Boot I'm working with ought to even be smart enough to be able to boot from USB, but that's a thing I haven't tested yet.

Note that the U-Boot we're using will be smart enough to redirect output.  If you have an HDMI monitor or LVDS display plugged in, the console will go out to video, otherwise it'll set root=/dev/ttymxc1,115200.  So no worries there!

In short, it seems like a great idea.

Re: Debian installer for Novena?

Hi xobs,

Oh wow, I should have done some more reading before posting! I knew you were building debian packages but I hadn't seen the installer wiki page. Looks like you're a long way down this road already. Thanks for filling me in.

I'll try to have a play around with what you've got there, see whether I can help bring it over to Jessie.


Angus

Re: Debian installer for Novena?

That'd be much appreciated.

One thing I never figured out how to do was to specify a bootloader.  For Wheezy, it seems like there are about five hardcoded bootloader platforms.  I ended up just ignoring it and specifying no bootloader in the preflight script, but maybe it can be solved in the "proper" manner.

I've got about a half dozen packages.  Some (like novena-firstrun) might not be so interesting if you're running the installer, but others (such as pulseaudio-novena) bring real functionality enhancements.  I'll put together a wiki article on the install process and custom packages we're adding.

5 (edited by picmaster 2015-02-24 15:11:05)

Re: Debian installer for Novena?

Debian installer for armhf (actually originally for imx53) worked out of the box on several of my imx6 boards, so I'm pretty sure it will work also on Novena, even without Novena-specific packages there. Just load you kernel, device-tree and installer's uInitrd in memory, and then bootm your Linux. This will start the Debian installation process, and will even install as usual as long as you have a network device support and an appropriate storage to install. The only special thing is to stich the booting process together with the distro, which is usually done with hush scripts in U-Boot.

Here's a link to Debian installer (don't care that it's for effika, it works fine for generic armhf systems):
http://ftp.nl.debian.org/debian/dists/w … mx/uInitrd

Regards.

Edit: The nice thing about using the Debian installer is that it setups all the users/configuration files for you, so you don't have to do all the debootstrapping effort by yourself.

6 (edited by projectgus 2015-02-24 15:24:24)

Re: Debian installer for Novena?

Thanks picmaster. I think I used the effika image as the basis when I hacked together the GK802 installer as well.

I guess the difference is one of definition - is the installer done when it produces a valid rootfs, or is it done when it produces an immediately bootable system? The critical differences for that was boot process as you say - having a bootloader package that's correct, also the right kernel package and having a correct initrd generated by the debian update-initramfs system. Probably also for GUI stuff there's a need to choose and install the right graphics drivers.

Given for Novena these items are now all packaged, it might be almost as simple as injecting a preseed.cfg into an effika/other initrd with a secondary package repo (novena.io) and a list of additional packages - then you'd have an installer that produces an immediately bootable target.

Re: Debian installer for Novena?

Hi projectgus,

Absolutely correct, it's a question of definitions. For me it was just easy after the installation fininishes to fix all the stuff in U-Boot so the board can start booting normally. But you would be right to comment that not everyone has to do this manually, and most of the people would prefer to have nicer out-of-the-box experience.

Still, back in the day this is what I had, so just sharing the info for the other curious/impatient souls that would dare to go the same path before a more official Novena Debian installer is available. I also would be more than happy user of such installer big_smile.

Regards.

Re: Debian installer for Novena?

Just to check: am I right in thinking that there is no Debian installer image yet for Jessie, and that the recommended way to install this is via the recovery image and manually bootstrapping etc?

Re: Debian installer for Novena?

9600: That is correct.  There was an older image for Wheezy (mentioned above), but nothing so far for Jessie.

Re: Debian installer for Novena?

I had no trouble loading the armhf installer initrd for Jessie and doing a full install with it.

Chuck http://linux.citylink.co.nz/debian/dist … /initrd.gz on to the SD card boot partition as "uInitrd" and configure u-boot to boot it with a uEnv.txt like this:

initrd_addr_r=0x12800000
fh_initramfs_try=fatload \${bootsrc} \${bootdev} \${initrd_addr_r} uInitrd\${rec}
fh_initramfs_ok=echo initramfs uInitrd\${rec} loaded; setenv bootargs rootwait ro; setenv rootdev UUID=fa7f372b-d890-4a8c-877e-7e201e997682
fh_initramfs_no=echo initramfs uInitrd\${rec} not found; setenv initrd_addr_r -; setenv bootargs rootwait rw
finalhook=if run fh_initramfs_try; then run fh_initramfs_ok; else run fh_initramfs_no; fi; setenv bootargs \${bootargs} root=\${rootdev} console=\${consdev}

With thanks to russm on IRC for the uEnv recipe smile With this I was able to do a fully encrypted install, and with some tweaking to put the modules in the right place and build a new initrd, can unlock it during the boot process no trouble.

11 (edited by projectgus 2015-05-14 06:16:22)

Re: Debian installer for Novena?

Nice work ex-parrot, that's excellent news!

Did you have to preload the novena repo & its packages somewhere, or did you just do this after first boot into the new system?

12 (edited by ex-parrot 2015-05-14 14:41:57)

Re: Debian installer for Novena?

projectgus wrote:

Did you have to preload the novena repo & its packages somewhere, or did you just do this after first boot into the new system?

In order to generate an initrd you need the modules for the kernel available. I actually just grabbed these from my recovery filesystem, but you could jump out of the installer in to a shell at the end and make them available by installing the package, or bundle it in the install.

You can also boot in to recovery when you're done, chroot in to the new install and set things up from there.

Edit: Went to work halfway through posting and forgot to mention - you don't need any of the packages or modules to just boot the system and have it work. They only enable extra functionality or performance.

Re: Debian installer for Novena?

To convert the initrd.gz image to the uInitrd which is required by U-Boot, the following commands are helpful:
apt-get install u-boot-tools
mkimage -A arm -T ramdisk -C none -n uInitrd -d ./initrd.gz /boot/uInitrd

Re: Debian installer for Novena?

Looks like there's been some success with full-disk encryption on Novena. Is there a step-by-step guide for doing this under Debian Jessie? If not, I'll volunteer to put one together if I others can point me in the right direction.

Re: Debian installer for Novena?

I started a Novena Debian Installer generator project now:
https://github.com/thesourcerer8/novena … -installer

It downloads a debian installer image, adds the needed kernel modules and a preseed.cfg, and builds a proper uInitrd image, which even works fine to do an encrypted installation now.
The only thing missing is that the installed system does not boot automatically yet. Any improvements or suggestions are welcome.

16 (edited by Sourcerer 2015-08-28 07:10:50)

Re: Debian installer for Novena?

I completed the installer now, it can install both normal and LUKS-encrypted now, and it handles update-initramfs correctly, so kernel updates should work properly now:

https://github.com/thesourcerer8/novena … -installer

I am also offering a out-of-the-box MicroSD card image that can be copied to the MicroSD card, which directly boots the installer.

17 (edited by chris4795 2015-10-31 21:38:12)

Re: Debian installer for Novena?

Hello,

How were you able to get it installed? I was working on the partitioner, and it does not allow for me to use FAT16 or 32 for /boot. What does your boot partition look like?

EDIT:

Nevermind, it works!

I thought I was smarter than the installer and tried to do my own partitioning, but when I did the guided partitioning, it worked just fine.

18 (edited by chris4795 2015-12-16 22:49:39)

Re: Debian installer for Novena?

So an update for a few notes I had to do:

I used the MicroSD Card image. Just do the guided setup for encryption. it will not let you use a FAT partition for the /boot. Ironically it won't care when you modify /etc/fstab

xorg would not work for me. The only way I got it to work is my copying this from an old image to /etc/X11/xorg.conf:

Section "Device"
    Identifier "novena"
    Driver "modesetting"
    Option "kmsdev" "/dev/dri/card0"
    Option "SWcursor" "true"
    BusID "platform:sys/devices/soc0/imx-drm.20/drm/card0"
EndSection

I also installed xorg-novena, xserver-xorg-video-armada, xserver-xorg-video-armada-etanviv

I installed kosagi-repo and then removed the reference of the repo from /etc/apt/sources.list

I also had to modify /etc/fstab in the following manner:
comment out the current /boot and add:

/dev/disk/by-path/platform-2198000.usdhc-part1        /boot        vfat    defaults        2    2

This way the normal boot will be there and the novena can update the linux. Updating to a new linux does not destroy the cryptsetup, as I happily found out.
EDIT 2015/12/16: I just updated to a newer kernel, and I got a missing "dm_mod" error.

However, right now I am not confident that 2d acceleration works, and I am not sure how to make it work.
EDIT: I just checked, and 2D acceleration does work.

Re: Debian installer for Novena?

An easy way to tell if 2D acceleration is working is to use Xv.  You can try using mpv or VLC to play a video.  If you can change the size of the video, then 2D acceleration is functioning.

Re: Debian installer for Novena?

My installer currently does not mount the partition from the MicroSD card to /boot, so there is no problem with FAT16/32. What my installer does is that it installs a tool into /etc/kernel/postinst.d/zzz-novena-... which is called after the /boot is readyly populated, and it mounts the MicroSD card to /sd and copies the kernel and initramdisk over to the MicroSD card. An advantage of this is that it should also work with smaller sized partitions on the MicroSD card, since it does not need space for the intermediate files that are generated by Debian in /boot

21 (edited by chris4795 2015-12-16 23:38:29)

Re: Debian installer for Novena?

Hey sourcerer,

I just updated to the new kernel that was posted, and my laptop will not decrypt the hard drive anymore. I got the "connot initialize device-mapper. Is DM_mod kernel module installed?" Error.

EDIT: I decided to try just reinstalling, the installer does not work anymore as well. I suspect the issue is the newer repo.

Re: Debian installer for Novena?

Oh, I am sorry about that. I bought a new SSD to continue development on the installer and I want to publish a new version of the installer soon now.

Re: Debian installer for Novena?

Hey Sourcerer,

It's fine, it happens! I am wokring to get the installer to work with the new repo (as the other way is incredibly painful to try to work).

As of now, Just installing the new repo (1.3) to an image is not enough, the public keys need to be added as well. Once I figure out how to do that, I can update here.

Re: Debian installer for Novena?

Hey Sourcerer,

I made a bunch of upgrades to the installer, and make a new image for it! I made a pull request to merge it with your installer.

What would be the easiest way for me to send the image to you?

Or could we host is on the novena repo?

Re: Debian installer for Novena?

Hey Chris,

Great! Thanks a lot for your changes, I am currently reviewing them, and I am testing a image I built with your changes.
Can you upload the image somewhere and send me a link?
xobs is managing the novena repo, I don't have access there.